Salome HOME
Merge from V6_main_20120808 08Aug12
authorvsr <vsr@opencascade.com>
Thu, 9 Aug 2012 05:17:32 +0000 (05:17 +0000)
committervsr <vsr@opencascade.com>
Thu, 9 Aug 2012 05:17:32 +0000 (05:17 +0000)
1032 files changed:
GUI_version.h.in
Makefile.am
SUIT.pro [deleted file]
adm_local/Makefile.am
adm_local/cmake_files/FindCAS.cmake
adm_local/cmake_files/FindGUI.cmake
adm_local/cmake_files/FindOPENGL.cmake
adm_local/cmake_files/FindQT4.cmake
adm_local/cmake_files/FindQWT.cmake
adm_local/cmake_files/FindSIPPYQT.cmake
adm_local/cmake_files/FindVTK.cmake
adm_local/cmake_files/Makefile.am
adm_local/unix/Makefile.am
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/check_GLViewer.m4
adm_local/unix/config_files/check_GUI.m4
adm_local/unix/config_files/check_OCCViewer.m4
adm_local/unix/config_files/check_Plot2dViewer.m4
adm_local/unix/config_files/check_PyConsole.m4
adm_local/unix/config_files/check_QxGraphViewer.m4
adm_local/unix/config_files/check_SalomeObject.m4
adm_local/unix/config_files/check_SupervGraphViewer.m4
adm_local/unix/config_files/check_TestRecorder.m4
adm_local/unix/config_files/check_VTKViewer.m4
adm_local/unix/config_files/check_corba_in_GUI.m4 [deleted file]
adm_local/unix/config_files/check_disable_Corba.m4
adm_local/unix/config_files/check_msg2qm.m4
adm_local/unix/config_files/check_opengl.m4
adm_local/unix/config_files/check_pyqt.m4
adm_local/unix/config_files/check_qt.m4
adm_local/unix/config_files/check_qwt.m4
adm_local/unix/config_files/check_sip.m4
adm_local/unix/config_files/check_vtk.m4 [deleted file]
adm_local/unix/make_common_starter.am
adm_local/unix/make_conclude.in [deleted file]
bin/Makefile.am
bin/VERSION.in
bin/runLightSalome.csh
bin/runLightSalome.sh
build_cmake
build_cmake.bat
build_configure
clean_configure
configure.ac
doc/Makefile.am
doc/salome/Makefile.am
doc/salome/gui/Makefile.am
doc/salome/gui/doxyfile.in
doc/salome/gui/images/batchmode.png [deleted file]
doc/salome/gui/images/choicepage.png [deleted file]
doc/salome/gui/images/directorypage.png [deleted file]
doc/salome/gui/images/featureedgesprops.png [deleted file]
doc/salome/gui/images/geomview-alt.png
doc/salome/gui/images/icon_about.png
doc/salome/gui/images/image100.gif [deleted file]
doc/salome/gui/images/image100.png [deleted file]
doc/salome/gui/images/image102.gif [deleted file]
doc/salome/gui/images/image103.gif [deleted file]
doc/salome/gui/images/image103.png [deleted file]
doc/salome/gui/images/image105.gif [deleted file]
doc/salome/gui/images/image106.gif [deleted file]
doc/salome/gui/images/image106.png [deleted file]
doc/salome/gui/images/image108.gif [deleted file]
doc/salome/gui/images/image108.png [deleted file]
doc/salome/gui/images/image109.gif [deleted file]
doc/salome/gui/images/image157.gif [deleted file]
doc/salome/gui/images/image54.jpg [deleted file]
doc/salome/gui/images/image65.gif [deleted file]
doc/salome/gui/images/image67.gif [deleted file]
doc/salome/gui/images/image69.gif [deleted file]
doc/salome/gui/images/image70.gif [deleted file]
doc/salome/gui/images/image72.gif [deleted file]
doc/salome/gui/images/image73.gif [deleted file]
doc/salome/gui/images/image75.gif [deleted file]
doc/salome/gui/images/image77.gif [deleted file]
doc/salome/gui/images/image86.gif [deleted file]
doc/salome/gui/images/image86.png [deleted file]
doc/salome/gui/images/image88.gif [deleted file]
doc/salome/gui/images/image89.gif [deleted file]
doc/salome/gui/images/image89.png [deleted file]
doc/salome/gui/images/image91.gif [deleted file]
doc/salome/gui/images/image91.png [deleted file]
doc/salome/gui/images/image94.gif [deleted file]
doc/salome/gui/images/image95.gif [deleted file]
doc/salome/gui/images/image96.gif [deleted file]
doc/salome/gui/images/image96.png [deleted file]
doc/salome/gui/images/image97.gif [deleted file]
doc/salome/gui/images/image97.png [deleted file]
doc/salome/gui/images/image98.gif [deleted file]
doc/salome/gui/images/image98.png [deleted file]
doc/salome/gui/images/image99.gif [deleted file]
doc/salome/gui/images/image99.png [deleted file]
doc/salome/gui/images/import.png
doc/salome/gui/images/installtypepage.png [deleted file]
doc/salome/gui/images/intropage.png [deleted file]
doc/salome/gui/images/note1.gif [deleted file]
doc/salome/gui/images/occviewer_axialscale.png [deleted file]
doc/salome/gui/images/occviewer_toolbar.png
doc/salome/gui/images/platformpage.png [deleted file]
doc/salome/gui/images/plot2d_clone.gif [deleted file]
doc/salome/gui/images/plot2d_clone.png [deleted file]
doc/salome/gui/images/plot2d_legend.gif [deleted file]
doc/salome/gui/images/plot2d_legend.png [deleted file]
doc/salome/gui/images/plot2d_lines.gif [deleted file]
doc/salome/gui/images/plot2d_lines.png [deleted file]
doc/salome/gui/images/plot2d_logarithmic_horizontal.gif [deleted file]
doc/salome/gui/images/plot2d_logarithmic_horizontal.png [deleted file]
doc/salome/gui/images/plot2d_logarithmic_vertical.gif [deleted file]
doc/salome/gui/images/plot2d_logarithmic_vertical.png [deleted file]
doc/salome/gui/images/plot2d_points.gif [deleted file]
doc/salome/gui/images/plot2d_points.png [deleted file]
doc/salome/gui/images/plot2d_settings.gif [deleted file]
doc/salome/gui/images/plot2d_settings.png [deleted file]
doc/salome/gui/images/plot2d_splines.gif [deleted file]
doc/salome/gui/images/plot2d_splines.png [deleted file]
doc/salome/gui/images/plot2d_view_settings.png
doc/salome/gui/images/ppref1.png [deleted file]
doc/salome/gui/images/ppref2.png [deleted file]
doc/salome/gui/images/ppref3.png [deleted file]
doc/salome/gui/images/pref11.png [deleted file]
doc/salome/gui/images/pref12.png [deleted file]
doc/salome/gui/images/pref13.png [deleted file]
doc/salome/gui/images/pref14.png [deleted file]
doc/salome/gui/images/pref15.png [deleted file]
doc/salome/gui/images/pref21.png [deleted file]
doc/salome/gui/images/pref22.png [deleted file]
doc/salome/gui/images/pref23.png [deleted file]
doc/salome/gui/images/pref24.png [deleted file]
doc/salome/gui/images/pref31.png [deleted file]
doc/salome/gui/images/pref33.png [deleted file]
doc/salome/gui/images/pref34.png [deleted file]
doc/salome/gui/images/pref37.png [deleted file]
doc/salome/gui/images/productpage1.png [deleted file]
doc/salome/gui/images/productpage2.png [deleted file]
doc/salome/gui/images/productpage3.png [deleted file]
doc/salome/gui/images/productpage4.png [deleted file]
doc/salome/gui/images/progresspage1.png [deleted file]
doc/salome/gui/images/progresspage2.png [deleted file]
doc/salome/gui/images/readmepage.png [deleted file]
doc/salome/gui/images/save.jpg [deleted file]
doc/salome/gui/images/studymanagement.png
doc/salome/gui/images/studyproperties.png
doc/salome/gui/images/urbutton.png [deleted file]
doc/salome/gui/images/view_rotation_point.png [deleted file]
doc/salome/gui/input/geometry_preferences.doc [deleted file]
doc/salome/gui/input/index.doc
doc/salome/gui/input/installing_salome.doc [deleted file]
doc/salome/gui/input/introduction_to_gui.doc
doc/salome/gui/input/mesh_preferences.doc [deleted file]
doc/salome/gui/input/occ_3d_viewer.doc
doc/salome/gui/input/plot2d_viewer.doc
doc/salome/gui/input/postpro_preferences.doc [deleted file]
doc/salome/gui/input/salome_architecture.doc
doc/salome/gui/input/salome_desktop.doc
doc/salome/gui/input/salome_preferences.doc [deleted file]
doc/salome/gui/input/select_color_and_font.doc
doc/salome/gui/input/setting_preferences.doc
doc/salome/gui/input/study_management_chapter.doc
doc/salome/gui/input/text_user_interface.doc
doc/salome/gui/input/themes.doc
doc/salome/gui/input/using_notebook.doc
doc/salome/gui/input/using_object_browser.doc
doc/salome/gui/input/viewers_chapter.doc
doc/salome/gui/input/vtk_3d_viewer.doc
doc/salome/gui/static/footer.html
doc/salome/gui/static/header.html [deleted file]
doc/salome/tui/Makefile.am
doc/salome/tui/doxyfile.in
doc/salome/tui/images/Application-About.png [deleted file]
doc/salome/tui/images/application.gif [deleted file]
doc/salome/tui/images/html_comments.gif [deleted file]
doc/salome/tui/images/logocorp.gif [deleted file]
doc/salome/tui/static/doxygen.css
doc/salome/tui/static/footer.html
doc/salome/tui/static/myheader.html [deleted file]
idl/Makefile.am
idl/SalomeApp_Engine.idl
resources/Makefile.am
src/CAF/CAF.h
src/CAF/CAF.pro [deleted file]
src/CAF/CAF_Application.cxx
src/CAF/CAF_Application.h
src/CAF/CAF_Operation.cxx
src/CAF/CAF_Operation.h
src/CAF/CAF_Study.cxx
src/CAF/CAF_Study.h
src/CAF/CAF_Tools.cxx
src/CAF/CAF_Tools.h
src/CAF/Makefile.am
src/CAF/resources/CAF_images.po [deleted file]
src/CAF/resources/CAF_msg_en.po [deleted file]
src/CAF/resources/CAF_msg_en.ts
src/CAM/CAM.h
src/CAM/CAM.pro [deleted file]
src/CAM/CAM_Application.cxx
src/CAM/CAM_Application.h
src/CAM/CAM_DataModel.cxx
src/CAM/CAM_DataModel.h
src/CAM/CAM_DataObject.cxx
src/CAM/CAM_DataObject.h
src/CAM/CAM_Module.cxx
src/CAM/CAM_Module.h
src/CAM/CAM_Study.cxx
src/CAM/CAM_Study.h
src/CAM/Makefile.am
src/CAM/resources/CAM_msg_en.po [deleted file]
src/CAM/resources/CAM_msg_en.ts
src/CASCatch/CASCatch.hxx
src/CASCatch/CASCatch_CatchSignals.cxx
src/CASCatch/CASCatch_CatchSignals.hxx
src/CASCatch/CASCatch_ErrorHandler.cxx
src/CASCatch/CASCatch_ErrorHandler.hxx
src/CASCatch/CASCatch_Failure.cxx
src/CASCatch/CASCatch_Failure.hxx
src/CASCatch/Makefile.am
src/DDS/DDS.h
src/DDS/DDS.pro [deleted file]
src/DDS/DDS_DicGroup.cxx
src/DDS/DDS_DicGroup.h
src/DDS/DDS_DicItem.cxx
src/DDS/DDS_DicItem.h
src/DDS/DDS_Dictionary.cxx
src/DDS/DDS_Dictionary.h
src/DDS/DDS_KeyWords.cxx
src/DDS/DDS_KeyWords.h
src/DDS/Makefile.am
src/Event/Event.h
src/Event/Event.pro [deleted file]
src/Event/Makefile.am
src/Event/SALOME_Event.cxx
src/Event/SALOME_Event.h
src/Event/SALOME_EventFilter.cxx
src/Event/SALOME_EventFilter.h
src/GLViewer/GLViewer.h
src/GLViewer/GLViewer.pro [deleted file]
src/GLViewer/GLViewer_AspectLine.cxx
src/GLViewer/GLViewer_AspectLine.h
src/GLViewer/GLViewer_BaseDrawers.cxx
src/GLViewer/GLViewer_BaseDrawers.h
src/GLViewer/GLViewer_BaseObjects.cxx
src/GLViewer/GLViewer_BaseObjects.h
src/GLViewer/GLViewer_Compass.cxx
src/GLViewer/GLViewer_Compass.h
src/GLViewer/GLViewer_Context.cxx
src/GLViewer/GLViewer_Context.h
src/GLViewer/GLViewer_CoordSystem.cxx
src/GLViewer/GLViewer_CoordSystem.h
src/GLViewer/GLViewer_Defs.h
src/GLViewer/GLViewer_Drawer.cxx
src/GLViewer/GLViewer_Drawer.h
src/GLViewer/GLViewer_Geom.cxx
src/GLViewer/GLViewer_Geom.h
src/GLViewer/GLViewer_Grid.cxx
src/GLViewer/GLViewer_Grid.h
src/GLViewer/GLViewer_Group.cxx
src/GLViewer/GLViewer_Group.h
src/GLViewer/GLViewer_MimeData.cxx
src/GLViewer/GLViewer_MimeData.h
src/GLViewer/GLViewer_Object.cxx
src/GLViewer/GLViewer_Object.h
src/GLViewer/GLViewer_Selector.cxx
src/GLViewer/GLViewer_Selector.h
src/GLViewer/GLViewer_Selector2d.cxx
src/GLViewer/GLViewer_Selector2d.h
src/GLViewer/GLViewer_Text.cxx
src/GLViewer/GLViewer_Text.h
src/GLViewer/GLViewer_ToolTip.cxx
src/GLViewer/GLViewer_ToolTip.h
src/GLViewer/GLViewer_Tools.cxx
src/GLViewer/GLViewer_Tools.h
src/GLViewer/GLViewer_ViewFrame.cxx
src/GLViewer/GLViewer_ViewFrame.h
src/GLViewer/GLViewer_ViewManager.cxx
src/GLViewer/GLViewer_ViewManager.h
src/GLViewer/GLViewer_ViewPort.cxx
src/GLViewer/GLViewer_ViewPort.h
src/GLViewer/GLViewer_ViewPort2d.cxx
src/GLViewer/GLViewer_ViewPort2d.h
src/GLViewer/GLViewer_Viewer.cxx
src/GLViewer/GLViewer_Viewer.h
src/GLViewer/GLViewer_Viewer2d.cxx
src/GLViewer/GLViewer_Viewer2d.h
src/GLViewer/GLViewer_Widget.cxx
src/GLViewer/GLViewer_Widget.h
src/GLViewer/Makefile.am
src/GLViewer/resources/GLViewer_images.po [deleted file]
src/GLViewer/resources/GLViewer_images.ts
src/GLViewer/resources/GLViewer_msg_en.po [deleted file]
src/GLViewer/resources/GLViewer_msg_en.ts
src/LightApp/LightApp.h
src/LightApp/LightApp.pro [deleted file]
src/LightApp/LightApp_AboutDlg.cxx
src/LightApp/LightApp_AboutDlg.h
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_DataModel.cxx
src/LightApp/LightApp_DataModel.h
src/LightApp/LightApp_DataObject.cxx
src/LightApp/LightApp_DataObject.h
src/LightApp/LightApp_DataOwner.cxx
src/LightApp/LightApp_DataOwner.h
src/LightApp/LightApp_DataSubOwner.cxx
src/LightApp/LightApp_DataSubOwner.h
src/LightApp/LightApp_Dialog.cxx
src/LightApp/LightApp_Dialog.h
src/LightApp/LightApp_Displayer.cxx
src/LightApp/LightApp_Displayer.h
src/LightApp/LightApp_Driver.cxx
src/LightApp/LightApp_Driver.h
src/LightApp/LightApp_EventFilter.cxx
src/LightApp/LightApp_EventFilter.h
src/LightApp/LightApp_GLSelector.cxx
src/LightApp/LightApp_GLSelector.h
src/LightApp/LightApp_HDFDriver.cxx
src/LightApp/LightApp_HDFDriver.h
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_Module.h
src/LightApp/LightApp_ModuleAction.cxx
src/LightApp/LightApp_ModuleAction.h
src/LightApp/LightApp_ModuleDlg.cxx
src/LightApp/LightApp_ModuleDlg.h
src/LightApp/LightApp_NameDlg.cxx
src/LightApp/LightApp_NameDlg.h
src/LightApp/LightApp_OBFilter.cxx
src/LightApp/LightApp_OBFilter.h
src/LightApp/LightApp_OBSelector.cxx
src/LightApp/LightApp_OBSelector.h
src/LightApp/LightApp_OCCSelector.cxx
src/LightApp/LightApp_OCCSelector.h
src/LightApp/LightApp_Operation.cxx
src/LightApp/LightApp_Operation.h
src/LightApp/LightApp_Plot2dSelector.cxx
src/LightApp/LightApp_Plot2dSelector.h
src/LightApp/LightApp_Preferences.cxx
src/LightApp/LightApp_Preferences.h
src/LightApp/LightApp_PreferencesDlg.cxx
src/LightApp/LightApp_PreferencesDlg.h
src/LightApp/LightApp_Selection.cxx
src/LightApp/LightApp_Selection.h
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_SelectionMgr.h
src/LightApp/LightApp_ShowHideOp.cxx
src/LightApp/LightApp_ShowHideOp.h
src/LightApp/LightApp_Study.cxx
src/LightApp/LightApp_Study.h
src/LightApp/LightApp_SwitchOp.cxx
src/LightApp/LightApp_SwitchOp.h
src/LightApp/LightApp_UpdateFlags.h
src/LightApp/LightApp_VTKSelector.cxx
src/LightApp/LightApp_VTKSelector.h
src/LightApp/Makefile.am
src/LightApp/resources/LightApp.ini
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_images.po [deleted file]
src/LightApp/resources/LightApp_images.ts
src/LightApp/resources/LightApp_msg_en.po [deleted file]
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/icon_about.png
src/LightApp/resources/icon_applogo.png
src/LogWindow/LogWindow.cxx
src/LogWindow/LogWindow.h
src/LogWindow/LogWindow.pro [deleted file]
src/LogWindow/Makefile.am
src/LogWindow/resources/LogWindow_msg_en.ts
src/Makefile.am
src/OBJECT/Handle_SALOME_AISObject.hxx
src/OBJECT/Handle_SALOME_AISShape.hxx
src/OBJECT/Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/Handle_SALOME_Filter.hxx
src/OBJECT/Handle_SALOME_InteractiveObject.hxx
src/OBJECT/Handle_SALOME_ListNodeOfListIO.hxx
src/OBJECT/Handle_SALOME_TypeFilter.hxx
src/OBJECT/Makefile.am
src/OBJECT/OBJECT.pro [deleted file]
src/OBJECT/SALOME_AISObject.cxx
src/OBJECT/SALOME_AISObject.hxx
src/OBJECT/SALOME_AISObject.ixx
src/OBJECT/SALOME_AISObject.jxx
src/OBJECT/SALOME_AISShape.cxx
src/OBJECT/SALOME_AISShape.hxx
src/OBJECT/SALOME_AISShape.ixx
src/OBJECT/SALOME_AISShape.jxx
src/OBJECT/SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_DataMapOfIOMapOfInteger.hxx
src/OBJECT/SALOME_DataMapOfIOMapOfInteger_0.cxx
src/OBJECT/SALOME_Filter.cxx
src/OBJECT/SALOME_Filter.hxx
src/OBJECT/SALOME_Filter.ixx
src/OBJECT/SALOME_Filter.jxx
src/OBJECT/SALOME_InteractiveObject.cxx
src/OBJECT/SALOME_InteractiveObject.hxx
src/OBJECT/SALOME_InteractiveObject.ixx
src/OBJECT/SALOME_InteractiveObject.jxx
src/OBJECT/SALOME_ListIO.hxx
src/OBJECT/SALOME_ListIO_0.cxx
src/OBJECT/SALOME_ListIteratorOfListIO.hxx
src/OBJECT/SALOME_ListIteratorOfListIO_0.cxx
src/OBJECT/SALOME_ListNodeOfListIO.hxx
src/OBJECT/SALOME_ListNodeOfListIO_0.cxx
src/OBJECT/SALOME_Selection.h
src/OBJECT/SALOME_TypeFilter.cxx
src/OBJECT/SALOME_TypeFilter.hxx
src/OBJECT/SALOME_TypeFilter.ixx
src/OBJECT/SALOME_TypeFilter.jxx
src/OCCViewer/Makefile.am
src/OCCViewer/OCCViewer.h
src/OCCViewer/OCCViewer.pro [deleted file]
src/OCCViewer/OCCViewer_AISSelector.cxx
src/OCCViewer/OCCViewer_AISSelector.h
src/OCCViewer/OCCViewer_AxialScaleDlg.cxx
src/OCCViewer/OCCViewer_AxialScaleDlg.h
src/OCCViewer/OCCViewer_ClippingDlg.cxx
src/OCCViewer/OCCViewer_ClippingDlg.h
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h
src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx
src/OCCViewer/OCCViewer_SetRotationPointDlg.h
src/OCCViewer/OCCViewer_ToolTip.cxx
src/OCCViewer/OCCViewer_ToolTip.h
src/OCCViewer/OCCViewer_Trihedron.cxx
src/OCCViewer/OCCViewer_Trihedron.h
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_VService.h
src/OCCViewer/OCCViewer_ViewManager.cxx
src/OCCViewer/OCCViewer_ViewManager.h
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewPort.cxx
src/OCCViewer/OCCViewer_ViewPort.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewSketcher.cxx
src/OCCViewer/OCCViewer_ViewSketcher.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h
src/OCCViewer/resources/OCCViewer_images.po [deleted file]
src/OCCViewer/resources/OCCViewer_images.ts
src/OCCViewer/resources/OCCViewer_msg_en.po [deleted file]
src/OCCViewer/resources/OCCViewer_msg_en.ts
src/ObjBrowser/Makefile.am
src/ObjBrowser/OB.h
src/ObjBrowser/OB_Browser.cxx
src/ObjBrowser/OB_Browser.h
src/ObjBrowser/OB_Filter.cxx
src/ObjBrowser/OB_Filter.h
src/ObjBrowser/resources/OB_msg_en.po [deleted file]
src/ObjBrowser/resources/OB_msg_en.ts
src/Plot2d/Makefile.am
src/Plot2d/Plot2d.cxx
src/Plot2d/Plot2d.h
src/Plot2d/Plot2d.pro [deleted file]
src/Plot2d/Plot2d_Curve.cxx
src/Plot2d/Plot2d_Curve.h
src/Plot2d/Plot2d_FitDataDlg.cxx
src/Plot2d/Plot2d_FitDataDlg.h
src/Plot2d/Plot2d_Prs.cxx
src/Plot2d/Plot2d_Prs.h
src/Plot2d/Plot2d_SetupCurveDlg.cxx
src/Plot2d/Plot2d_SetupCurveDlg.h
src/Plot2d/Plot2d_SetupViewDlg.cxx
src/Plot2d/Plot2d_SetupViewDlg.h
src/Plot2d/Plot2d_ToolTip.cxx
src/Plot2d/Plot2d_ToolTip.h
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewFrame.h
src/Plot2d/Plot2d_ViewManager.cxx
src/Plot2d/Plot2d_ViewManager.h
src/Plot2d/Plot2d_ViewModel.cxx
src/Plot2d/Plot2d_ViewModel.h
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.h
src/Plot2d/resources/Plot2d_images.po [deleted file]
src/Plot2d/resources/Plot2d_images.ts
src/Plot2d/resources/Plot2d_msg_en.po [deleted file]
src/Plot2d/resources/Plot2d_msg_en.ts
src/Prs/Makefile.am
src/Prs/Prs.pro [deleted file]
src/Prs/SALOME_Prs.cxx
src/Prs/SALOME_Prs.h
src/PyConsole/Makefile.am
src/PyConsole/PyConsole.h
src/PyConsole/PyConsole.pro [deleted file]
src/PyConsole/PyConsole_Console.cxx
src/PyConsole/PyConsole_Console.h
src/PyConsole/PyConsole_Editor.cxx
src/PyConsole/PyConsole_Editor.h
src/PyConsole/PyConsole_Interp.cxx
src/PyConsole/PyConsole_Interp.h
src/PyConsole/resources/PyConsole_msg_en.ts
src/PyInterp/Makefile.am
src/PyInterp/PyInterp.h
src/PyInterp/PyInterp.pro [deleted file]
src/PyInterp/PyInterp_Dispatcher.cxx
src/PyInterp/PyInterp_Dispatcher.h
src/PyInterp/PyInterp_Interp.cxx
src/PyInterp/PyInterp_Interp.h
src/PyInterp/PyInterp_Watcher.h
src/QDS/Makefile.am
src/QDS/QDS.cxx
src/QDS/QDS.h
src/QDS/QDS.pro [deleted file]
src/QDS/QDS_CheckBox.cxx
src/QDS/QDS_CheckBox.h
src/QDS/QDS_ComboBox.cxx
src/QDS/QDS_ComboBox.h
src/QDS/QDS_Datum.cxx
src/QDS/QDS_Datum.h
src/QDS/QDS_LineEdit.cxx
src/QDS/QDS_LineEdit.h
src/QDS/QDS_RadioBox.cxx
src/QDS/QDS_RadioBox.h
src/QDS/QDS_SpinBox.cxx
src/QDS/QDS_SpinBox.h
src/QDS/QDS_SpinBoxDbl.cxx
src/QDS/QDS_SpinBoxDbl.h
src/QDS/QDS_Table.cxx
src/QDS/QDS_Table.h
src/QDS/QDS_TextEdit.cxx
src/QDS/QDS_TextEdit.h
src/QDS/QDS_Validator.cxx
src/QDS/QDS_Validator.h
src/QDS/resources/QDS_msg_en.po [deleted file]
src/QDS/resources/QDS_msg_en.ts
src/Qtx/Makefile.am
src/Qtx/Qtx.cxx
src/Qtx/Qtx.h
src/Qtx/Qtx.pro [deleted file]
src/Qtx/QtxAction.cxx
src/Qtx/QtxAction.h
src/Qtx/QtxActionGroup.cxx
src/Qtx/QtxActionGroup.h
src/Qtx/QtxActionMenuMgr.cxx
src/Qtx/QtxActionMenuMgr.h
src/Qtx/QtxActionMgr.cxx
src/Qtx/QtxActionMgr.h
src/Qtx/QtxActionSet.cxx
src/Qtx/QtxActionSet.h
src/Qtx/QtxActionToolMgr.cxx
src/Qtx/QtxActionToolMgr.h
src/Qtx/QtxColorButton.cxx
src/Qtx/QtxColorButton.h
src/Qtx/QtxColorScale.cxx
src/Qtx/QtxColorScale.h
src/Qtx/QtxComboBox.cxx
src/Qtx/QtxComboBox.h
src/Qtx/QtxDialog.cxx
src/Qtx/QtxDialog.h
src/Qtx/QtxDockAction.cxx
src/Qtx/QtxDockAction.h
src/Qtx/QtxDockWidget.cxx
src/Qtx/QtxDockWidget.h
src/Qtx/QtxDoubleSpinBox.cxx
src/Qtx/QtxDoubleSpinBox.h
src/Qtx/QtxEvalExpr.cxx
src/Qtx/QtxEvalExpr.h
src/Qtx/QtxFontEdit.cxx
src/Qtx/QtxFontEdit.h
src/Qtx/QtxGridBox.cxx
src/Qtx/QtxGridBox.h
src/Qtx/QtxGroupBox.cxx
src/Qtx/QtxGroupBox.h
src/Qtx/QtxIntSpinBox.cxx
src/Qtx/QtxIntSpinBox.h
src/Qtx/QtxListAction.cxx
src/Qtx/QtxListAction.h
src/Qtx/QtxListBox.cxx
src/Qtx/QtxListBox.h
src/Qtx/QtxLogoMgr.cxx
src/Qtx/QtxLogoMgr.h
src/Qtx/QtxMRUAction.cxx
src/Qtx/QtxMRUAction.h
src/Qtx/QtxMainWindow.cxx
src/Qtx/QtxMainWindow.h
src/Qtx/QtxMap.h
src/Qtx/QtxMenu.cxx
src/Qtx/QtxMenu.h
src/Qtx/QtxMultiAction.cxx
src/Qtx/QtxMultiAction.h
src/Qtx/QtxPagePrefMgr.cxx
src/Qtx/QtxPagePrefMgr.h
src/Qtx/QtxPathDialog.cxx
src/Qtx/QtxPathDialog.h
src/Qtx/QtxPathEdit.cxx
src/Qtx/QtxPathEdit.h
src/Qtx/QtxPathListEdit.cxx
src/Qtx/QtxPathListEdit.h
src/Qtx/QtxPopupMgr.cxx
src/Qtx/QtxPopupMgr.h
src/Qtx/QtxPreferenceMgr.cxx
src/Qtx/QtxPreferenceMgr.h
src/Qtx/QtxResourceMgr.cxx
src/Qtx/QtxResourceMgr.h
src/Qtx/QtxRubberBand.cxx
src/Qtx/QtxRubberBand.h
src/Qtx/QtxSearchTool.cxx
src/Qtx/QtxSearchTool.h
src/Qtx/QtxSplash.cxx
src/Qtx/QtxSplash.h
src/Qtx/QtxTable.cxx
src/Qtx/QtxTable.h
src/Qtx/QtxToolBar.cxx
src/Qtx/QtxToolBar.h
src/Qtx/QtxToolTip.cxx
src/Qtx/QtxToolTip.h
src/Qtx/QtxTranslator.cxx
src/Qtx/QtxTranslator.h
src/Qtx/QtxTreeView.cxx
src/Qtx/QtxTreeView.h
src/Qtx/QtxValidator.cxx
src/Qtx/QtxValidator.h
src/Qtx/QtxWorkspace.cxx
src/Qtx/QtxWorkspace.h
src/Qtx/QtxWorkspaceAction.cxx
src/Qtx/QtxWorkspaceAction.h
src/Qtx/QtxWorkstack.cxx
src/Qtx/QtxWorkstack.h
src/Qtx/QtxWorkstackAction.cxx
src/Qtx/QtxWorkstackAction.h
src/QxGraph/Makefile.am
src/QxGraph/QxGraph.h
src/QxGraph/QxGraph.pro [deleted file]
src/QxGraph/QxGraph_ActiveItem.h
src/QxGraph/QxGraph_Canvas.cxx
src/QxGraph/QxGraph_Canvas.h
src/QxGraph/QxGraph_CanvasView.cxx
src/QxGraph/QxGraph_CanvasView.h
src/QxGraph/QxGraph_Def.h
src/QxGraph/QxGraph_Prs.cxx
src/QxGraph/QxGraph_Prs.h
src/QxGraph/QxGraph_ViewManager.cxx
src/QxGraph/QxGraph_ViewManager.h
src/QxGraph/QxGraph_ViewModel.cxx
src/QxGraph/QxGraph_ViewModel.h
src/QxGraph/QxGraph_ViewWindow.cxx
src/QxGraph/QxGraph_ViewWindow.h
src/QxGraph/resources/QxGraph_images.po [deleted file]
src/QxGraph/resources/QxGraph_images.ts
src/QxGraph/resources/QxGraph_msg_en.po [deleted file]
src/QxGraph/resources/QxGraph_msg_en.ts
src/QxScene/DebTrace.hxx
src/QxScene/Makefile.am
src/QxScene/QxScene.h
src/QxScene/QxScene_Def.h
src/QxScene/QxScene_ViewManager.cxx
src/QxScene/QxScene_ViewManager.h
src/QxScene/QxScene_ViewModel.cxx
src/QxScene/QxScene_ViewModel.h
src/QxScene/QxScene_ViewWindow.cxx
src/QxScene/QxScene_ViewWindow.h
src/QxScene/resources/QxSceneViewer_images.ts
src/QxScene/resources/QxSceneViewer_msg_en.ts
src/QxScene/resources/QxScene_images.po [deleted file]
src/QxScene/resources/QxScene_msg_en.po [deleted file]
src/ResExporter/Makefile.am
src/ResExporter/ResExporter.pro [deleted file]
src/ResExporter/ResourceExporter.cxx
src/SALOME_PY/Makefile.am
src/SALOME_PY/SalomePy.cxx
src/SALOME_PYQT/Makefile.am
src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.am
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.sip [deleted file]
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx [deleted file]
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h [deleted file]
src/SALOME_PYQT/SalomePyQt/Makefile.am
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip
src/SALOME_SWIG/Help.py [deleted file]
src/SALOME_SWIG/Makefile.am
src/SALOME_SWIG/PyInterp.py [deleted file]
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SALOME_SWIG/SALOMEGUI_Swig.hxx
src/SALOME_SWIG/SALOMEGUI_Swig.i
src/SALOME_SWIG/SALOMEGUI_shared_modules.py
src/SALOME_SWIG/examplevtk1.py
src/SALOME_SWIG/libSALOME_Swig.i
src/SALOME_SWIG/salome.py [deleted file]
src/SALOME_SWIG/supervisionexample.py.in
src/SALOME_SWIG/supervisiongeomexample.py.in
src/SALOME_SWIG/test_big_table.py
src/SALOME_SWIG/test_many_objects.py
src/SALOME_SWIG/test_remove_ref.py
src/SALOME_SWIG/test_table.py
src/SOCC/Makefile.am
src/SOCC/SOCC.h
src/SOCC/SOCC.pro [deleted file]
src/SOCC/SOCC_Prs.cxx
src/SOCC/SOCC_Prs.h
src/SOCC/SOCC_ViewModel.cxx
src/SOCC/SOCC_ViewModel.h
src/SOCC/SOCC_ViewWindow.cxx
src/SOCC/SOCC_ViewWindow.h
src/SPlot2d/Makefile.am
src/SPlot2d/SPlot2d.h
src/SPlot2d/SPlot2d.pro [deleted file]
src/SPlot2d/SPlot2d_Curve.cxx
src/SPlot2d/SPlot2d_Curve.h
src/SPlot2d/SPlot2d_Prs.cxx
src/SPlot2d/SPlot2d_Prs.h
src/SPlot2d/SPlot2d_ViewModel.cxx
src/SPlot2d/SPlot2d_ViewModel.h
src/SPlot2d/SPlot2d_ViewWindow.cxx
src/SPlot2d/SPlot2d_ViewWindow.h
src/SPlot2d/resources/SPlot2d_msg_en.po [deleted file]
src/STD/Makefile.am
src/STD/STD.h
src/STD/STD.pro [deleted file]
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/STD/STD_MDIDesktop.cxx
src/STD/STD_MDIDesktop.h
src/STD/STD_SDIDesktop.cxx
src/STD/STD_SDIDesktop.h
src/STD/STD_TabDesktop.cxx
src/STD/STD_TabDesktop.h
src/STD/resources/STD_images.po [deleted file]
src/STD/resources/STD_images.ts
src/STD/resources/STD_msg_en.po [deleted file]
src/STD/resources/STD_msg_en.ts
src/SUIT/Makefile.am
src/SUIT/SUIT.h
src/SUIT/SUIT.pro [deleted file]
src/SUIT/SUIT_Accel.cxx
src/SUIT/SUIT_Accel.h
src/SUIT/SUIT_ActionOperation.cxx
src/SUIT/SUIT_ActionOperation.h
src/SUIT/SUIT_Application.cxx
src/SUIT/SUIT_Application.h
src/SUIT/SUIT_DataBrowser.cxx
src/SUIT/SUIT_DataBrowser.h
src/SUIT/SUIT_DataObject.cxx
src/SUIT/SUIT_DataObject.h
src/SUIT/SUIT_DataObjectIterator.cxx
src/SUIT/SUIT_DataObjectIterator.h
src/SUIT/SUIT_DataObjectKey.cxx
src/SUIT/SUIT_DataObjectKey.h
src/SUIT/SUIT_DataOwner.cxx
src/SUIT/SUIT_DataOwner.h
src/SUIT/SUIT_Desktop.cxx
src/SUIT/SUIT_Desktop.h
src/SUIT/SUIT_ExceptionHandler.cxx
src/SUIT/SUIT_ExceptionHandler.h
src/SUIT/SUIT_FileDlg.cxx
src/SUIT/SUIT_FileDlg.h
src/SUIT/SUIT_FileValidator.cxx
src/SUIT/SUIT_FileValidator.h
src/SUIT/SUIT_LicenseDlg.cxx
src/SUIT/SUIT_LicenseDlg.h
src/SUIT/SUIT_MessageBox.cxx
src/SUIT/SUIT_MessageBox.h
src/SUIT/SUIT_Operation.cxx
src/SUIT/SUIT_Operation.h
src/SUIT/SUIT_OverrideCursor.cxx
src/SUIT/SUIT_OverrideCursor.h
src/SUIT/SUIT_PopupClient.cxx
src/SUIT/SUIT_PopupClient.h
src/SUIT/SUIT_PreferenceMgr.cxx
src/SUIT/SUIT_PreferenceMgr.h
src/SUIT/SUIT_ResourceMgr.cxx
src/SUIT/SUIT_ResourceMgr.h
src/SUIT/SUIT_SelectionFilter.cxx
src/SUIT/SUIT_SelectionFilter.h
src/SUIT/SUIT_SelectionMgr.cxx
src/SUIT/SUIT_SelectionMgr.h
src/SUIT/SUIT_Selector.cxx
src/SUIT/SUIT_Selector.h
src/SUIT/SUIT_Session.cxx
src/SUIT/SUIT_Session.h
src/SUIT/SUIT_SmartPtr.h
src/SUIT/SUIT_Study.cxx
src/SUIT/SUIT_Study.h
src/SUIT/SUIT_Tools.cxx
src/SUIT/SUIT_Tools.h
src/SUIT/SUIT_TreeModel.cxx
src/SUIT/SUIT_TreeModel.h
src/SUIT/SUIT_TreeSync.h
src/SUIT/SUIT_ViewManager.cxx
src/SUIT/SUIT_ViewManager.h
src/SUIT/SUIT_ViewModel.cxx
src/SUIT/SUIT_ViewModel.h
src/SUIT/SUIT_ViewWindow.cxx
src/SUIT/SUIT_ViewWindow.h
src/SUIT/resources/SUIT_images.po [deleted file]
src/SUIT/resources/SUIT_msg_en.po [deleted file]
src/SUIT/resources/SUIT_msg_en.ts
src/SUITApp/Makefile.am
src/SUITApp/SUITApp.cxx
src/SUITApp/SUITApp.pro [deleted file]
src/SUITApp/SUITApp_Application.cxx
src/SUITApp/SUITApp_Application.h
src/SUITApp/resources/SUITApp_msg_en.po [deleted file]
src/SUITApp/resources/SUITApp_msg_en.ts
src/SUPERVGraph/Makefile.am
src/SUPERVGraph/SUPERVGraph.cxx
src/SUPERVGraph/SUPERVGraph.h
src/SUPERVGraph/SUPERVGraph.pro [deleted file]
src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx
src/SUPERVGraph/SUPERVGraph_ViewFrame.h
src/SUPERVGraph/SUPERVGraph_ViewManager.cxx
src/SUPERVGraph/SUPERVGraph_ViewManager.h
src/SUPERVGraph/SUPERVGraph_ViewModel.cxx
src/SUPERVGraph/SUPERVGraph_ViewModel.h
src/SUPERVGraph/resources/SUPERVGraph_images.po [deleted file]
src/SUPERVGraph/resources/SUPERVGraph_images.ts
src/SUPERVGraph/resources/SUPERVGraph_msg_en.po [deleted file]
src/SUPERVGraph/resources/SUPERVGraph_msg_en.ts
src/SVTK/Makefile.am
src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK.cxx
src/SVTK/SVTK.h
src/SVTK/SVTK.pro [deleted file]
src/SVTK/SVTK_Actor.cxx
src/SVTK/SVTK_Actor.h
src/SVTK/SVTK_ComboAction.cxx
src/SVTK/SVTK_ComboAction.h
src/SVTK/SVTK_CubeAxesActor2D.cxx
src/SVTK/SVTK_CubeAxesActor2D.h
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_CubeAxesDlg.h
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/SVTK/SVTK_DialogBase.cxx [deleted file]
src/SVTK/SVTK_DialogBase.h [deleted file]
src/SVTK/SVTK_Event.h
src/SVTK/SVTK_Extension.cxx [deleted file]
src/SVTK/SVTK_Extension.h [deleted file]
src/SVTK/SVTK_FontWidget.cxx
src/SVTK/SVTK_FontWidget.h
src/SVTK/SVTK_Functor.h
src/SVTK/SVTK_GenericRenderWindowInteractor.cxx
src/SVTK/SVTK_GenericRenderWindowInteractor.h
src/SVTK/SVTK_ImageWriter.cxx
src/SVTK/SVTK_ImageWriter.h
src/SVTK/SVTK_ImageWriterMgr.cxx
src/SVTK/SVTK_ImageWriterMgr.h
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/SVTK_KeyFreeInteractorStyle.cxx
src/SVTK/SVTK_KeyFreeInteractorStyle.h
src/SVTK/SVTK_NonIsometricDlg.cxx
src/SVTK/SVTK_NonIsometricDlg.h
src/SVTK/SVTK_Prs.cxx
src/SVTK/SVTK_Prs.h
src/SVTK/SVTK_Recorder.cxx
src/SVTK/SVTK_Recorder.h
src/SVTK/SVTK_RecorderDlg.cxx
src/SVTK/SVTK_RecorderDlg.h
src/SVTK/SVTK_RectPicker.cxx
src/SVTK/SVTK_RectPicker.h
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_RenderWindowInteractor.h
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_Selection.h
src/SVTK/SVTK_SelectionEvent.h
src/SVTK/SVTK_Selector.cxx
src/SVTK/SVTK_Selector.h
src/SVTK/SVTK_SelectorDef.h
src/SVTK/SVTK_SetRotationPointDlg.cxx
src/SVTK/SVTK_SetRotationPointDlg.h
src/SVTK/SVTK_SpaceMouse.cxx
src/SVTK/SVTK_SpaceMouse.h
src/SVTK/SVTK_Trihedron.cxx
src/SVTK/SVTK_Trihedron.h
src/SVTK/SVTK_UpdateRateDlg.cxx
src/SVTK/SVTK_UpdateRateDlg.h
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_View.h
src/SVTK/SVTK_ViewManager.cxx
src/SVTK/SVTK_ViewManager.h
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewModelBase.h
src/SVTK/SVTK_ViewParameterDlg.cxx
src/SVTK/SVTK_ViewParameterDlg.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/resources/SVTK_images.po [deleted file]
src/SVTK/resources/SVTK_images.ts
src/SVTK/resources/SVTK_msg_en.po [deleted file]
src/SVTK/resources/SVTK_msg_en.ts
src/SalomeApp/Makefile.am
src/SalomeApp/SalomeApp.h
src/SalomeApp/SalomeApp.pro [deleted file]
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_CheckFileDlg.cxx
src/SalomeApp/SalomeApp_CheckFileDlg.h
src/SalomeApp/SalomeApp_DataModel.cxx
src/SalomeApp/SalomeApp_DataModel.h
src/SalomeApp/SalomeApp_DataObject.cxx
src/SalomeApp/SalomeApp_DataObject.h
src/SalomeApp/SalomeApp_DoubleSpinBox.cxx
src/SalomeApp/SalomeApp_DoubleSpinBox.h
src/SalomeApp/SalomeApp_ExceptionHandler.cxx
src/SalomeApp/SalomeApp_ExceptionHandler.h
src/SalomeApp/SalomeApp_ExitDlg.cxx
src/SalomeApp/SalomeApp_ExitDlg.h
src/SalomeApp/SalomeApp_Filter.cxx
src/SalomeApp/SalomeApp_Filter.h
src/SalomeApp/SalomeApp_ImportOperation.cxx
src/SalomeApp/SalomeApp_ImportOperation.h
src/SalomeApp/SalomeApp_IntSpinBox.cxx
src/SalomeApp/SalomeApp_IntSpinBox.h
src/SalomeApp/SalomeApp_ListView.cxx
src/SalomeApp/SalomeApp_ListView.h
src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx
src/SalomeApp/SalomeApp_LoadStudiesDlg.h
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_Module.h
src/SalomeApp/SalomeApp_NoteBookDlg.cxx
src/SalomeApp/SalomeApp_NoteBookDlg.h
src/SalomeApp/SalomeApp_PyInterp.cxx
src/SalomeApp/SalomeApp_PyInterp.h
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/SalomeApp_Study.h
src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx
src/SalomeApp/SalomeApp_StudyPropertiesDlg.h
src/SalomeApp/SalomeApp_Tools.cxx
src/SalomeApp/SalomeApp_Tools.h
src/SalomeApp/SalomeApp_TypeFilter.cxx
src/SalomeApp/SalomeApp_TypeFilter.h
src/SalomeApp/SalomeApp_VisualState.cxx
src/SalomeApp/SalomeApp_VisualState.h
src/SalomeApp/Test/Makefile.am
src/SalomeApp/Test/SalomeAppTest.cxx
src/SalomeApp/Test/SalomeAppTest.hxx
src/SalomeApp/Test/TestSalomeApp.cxx
src/SalomeApp/Test/TestSalomeApp.py
src/SalomeApp/resources/SalomeApp.ini
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_images.po [deleted file]
src/SalomeApp/resources/SalomeApp_images.ts
src/SalomeApp/resources/SalomeApp_msg_en.po [deleted file]
src/SalomeApp/resources/SalomeApp_msg_en.ts
src/Session/Makefile.am
src/Session/SALOME_Session.hxx
src/Session/SALOME_Session_Server.cxx
src/Session/SalomeApp_Engine_i.cxx
src/Session/SalomeApp_Engine_i.hxx
src/Session/Session.pro [deleted file]
src/Session/Session_ServerCheck.cxx
src/Session/Session_ServerCheck.hxx
src/Session/Session_ServerLauncher.cxx
src/Session/Session_ServerLauncher.hxx
src/Session/Session_ServerThread.cxx
src/Session/Session_ServerThread.hxx
src/Session/Session_Session_i.cxx
src/Session/Session_Session_i.hxx
src/Style/Makefile.am
src/Style/Style.h
src/Style/Style.qrc
src/Style/Style_Model.cxx
src/Style/Style_Model.h
src/Style/Style_PrefDlg.cxx
src/Style/Style_PrefDlg.h
src/Style/Style_ResourceMgr.cxx
src/Style/Style_ResourceMgr.h
src/Style/Style_Salome.cxx
src/Style/Style_Salome.h
src/Style/Style_Tools.cxx
src/Style/Style_Tools.h
src/Style/resources/SalomeStyle.xml
src/TOOLSGUI/Makefile.am
src/TOOLSGUI/TOOLSGUI.pro [deleted file]
src/TOOLSGUI/ToolsGUI.cxx
src/TOOLSGUI/ToolsGUI.h
src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx
src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h
src/TOOLSGUI/ToolsGUI_RegWidget.cxx
src/TOOLSGUI/ToolsGUI_RegWidget.h
src/TOOLSGUI/resources/ToolsGUI_icons.po [deleted file]
src/TOOLSGUI/resources/ToolsGUI_msg_en.po [deleted file]
src/TOOLSGUI/resources/ToolsGUI_msg_en.ts
src/VTKViewer/Makefile.am
src/VTKViewer/VTKViewer.cxx
src/VTKViewer/VTKViewer.h
src/VTKViewer/VTKViewer.pro [deleted file]
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_Algorithm.h
src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_AppendFilter.h
src/VTKViewer/VTKViewer_CellLocationsArray.cxx
src/VTKViewer/VTKViewer_CellLocationsArray.h
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ConvexTool.h
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_Filter.cxx
src/VTKViewer/VTKViewer_Filter.h
src/VTKViewer/VTKViewer_Functor.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_GeometryFilter.h
src/VTKViewer/VTKViewer_InteractorStyle.cxx
src/VTKViewer/VTKViewer_InteractorStyle.h
src/VTKViewer/VTKViewer_PassThroughFilter.cxx [deleted file]
src/VTKViewer/VTKViewer_PassThroughFilter.h [deleted file]
src/VTKViewer/VTKViewer_RenderWindow.cxx
src/VTKViewer/VTKViewer_RenderWindow.h
src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx
src/VTKViewer/VTKViewer_RenderWindowInteractor.h
src/VTKViewer/VTKViewer_ShrinkFilter.cxx
src/VTKViewer/VTKViewer_ShrinkFilter.h
src/VTKViewer/VTKViewer_Transform.cxx
src/VTKViewer/VTKViewer_Transform.h
src/VTKViewer/VTKViewer_TransformFilter.cxx
src/VTKViewer/VTKViewer_TransformFilter.h
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Trihedron.h
src/VTKViewer/VTKViewer_Utilities.cxx
src/VTKViewer/VTKViewer_Utilities.h
src/VTKViewer/VTKViewer_VectorText.cxx [deleted file]
src/VTKViewer/VTKViewer_VectorText.h [deleted file]
src/VTKViewer/VTKViewer_ViewManager.cxx
src/VTKViewer/VTKViewer_ViewManager.h
src/VTKViewer/VTKViewer_ViewModel.cxx
src/VTKViewer/VTKViewer_ViewModel.h
src/VTKViewer/VTKViewer_ViewWindow.cxx
src/VTKViewer/VTKViewer_ViewWindow.h
src/VTKViewer/resources/VTKViewer_images.po [deleted file]
src/VTKViewer/resources/VTKViewer_images.ts
src/VTKViewer/resources/VTKViewer_msg_en.po [deleted file]
src/VTKViewer/resources/VTKViewer_msg_en.ts
src/src.pro [deleted file]

index 9669a71af4b69ffdf30653bc74c7b49e66a449a6..f01d60122bfdb1fa45a3a7ddbf7a83b25deadaef 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : GUI_version.h
 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -31,5 +32,6 @@
 
 #define GUI_VERSION_STR "@VERSION@"
 #define GUI_VERSION     @XVERSION@
+#define GUI_DEVELOPMENT @VERSION_DEV@
 
 #endif // __GUI_VERSION_H__
index 38c49561ad444a1ca8b54292c99aaa6bb257f882..b14bfd85bfba02889df488d82cafafdd8c0eba74 100644 (file)
@@ -1,28 +1,28 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *-
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 28/06/2001
-# $Header$
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -35,15 +35,17 @@ else !GUI_ENABLE_CORBA
     IDLDIR =
 endif
 
-SUBDIRS = $(IDLDIR) adm_local resources src doc bin 
+SUBDIRS = $(IDLDIR) adm_local resources src doc bin tools
 
-DIST_SUBDIRS = idl adm_local resources src doc bin 
+DIST_SUBDIRS = idl adm_local resources src doc bin tools
 
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool adm_local/unix/config_files/config.guess adm_local/unix/config_files/config.sub adm_local/unix/config_files/depcomp adm_local/unix/config_files/install-sh adm_local/unix/config_files/libtool.m4 adm_local/unix/config_files/ltmain.sh adm_local/unix/config_files/ltoptions.m4 adm_local/unix/config_files/ltsugar.m4 adm_local/unix/config_files/ltversion.m4 adm_local/unix/config_files/lt~obsolete.m4 adm_local/unix/config_files/missing adm_local/unix/config_files/py-compile
 
 salomeinclude_DATA = GUI_version.h
 
 EXTRA_DIST +=          \
+       build_cmake     \
+       build_cmake.bat \
        build_configure \
        clean_configure \
        LICENCE
diff --git a/SUIT.pro b/SUIT.pro
deleted file mode 100644 (file)
index 307a125..0000000
--- a/SUIT.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS = src
index c3877a44042c123f2ba491b200d8c522af51c97b..4781976b73a33791cb504da269a082641d7067e3 100644 (file)
@@ -1,22 +1,23 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 SUBDIRS = unix cmake_files
index 8490c7c66f69cca0762776ee881ff7c546adf900..4b72de6eb5548911afe046f87748744a8a99c0d6 100644 (file)
@@ -1,43 +1,70 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 SET(CASROOT $ENV{CASROOT})
 
-SET(OCC_VERSION_MAJOR 6)
-SET(OCC_VERSION_MINOR 3)
-SET(OCC_VERSION_MAINTENANCE 0)
+# SET(OCC_VERSION_MAJOR 6)
+# SET(OCC_VERSION_MINOR 3)
+# SET(OCC_VERSION_MAINTENANCE 10)
+SET(OCC_VERSION_DEVELOPMENT 0)
+
+FIND_FILE(ff Standard_Version.hxx ${CASROOT}/include/opencascade ${CASROOT}/inc)    
+IF(ff)
+  FILE(STRINGS ${ff} OCC_VERSION_DEVELOPMENT_STR
+      REGEX "^ *#define OCC_VERSION_DEVELOPMENT.*$")
+  IF(OCC_VERSION_DEVELOPMENT_STR)
+    SET(OCC_VERSION_DEVELOPMENT 1)
+  ENDIF(OCC_VERSION_DEVELOPMENT_STR)
+ENDIF(ff)
 
 SET(CAS_CPPFLAGS)
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MINOR=${OCC_VERSION_MINOR})
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAINTENANCE=${OCC_VERSION_MAINTENANCE})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MINOR=${OCC_VERSION_MINOR})
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAINTENANCE=${OCC_VERSION_MAINTENANCE})
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DLIN -DLINTEL -DCSFDB)
+SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DNo_exception)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_CONFIG_H)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_LIMITS_H)
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${CASROOT}/inc)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_LIMITS_H")
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${CASROOT}/inc) # to be removed
+SET(CAS_INCLUDE_DIRS ${CASROOT}/inc)
+
+IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+  SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -D_OCC64)
+ENDIF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+
+IF(NOT WINDOWS)
+  FIND_LIBRARY(Xmu Xmu)
+  IF(Xmu)
+    SET(CAS_LDPATH ${Xmu})
+  ENDIF(Xmu)
+ENDIF(NOT WINDOWS)
 
 IF(WINDOWS)
-  SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
+  IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+    SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
+    SET(CASROOT_LIBDIR ${CASROOT}/win32/lib)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
 ELSE(WINDOWS)
   SET(CASROOT_LIBDIR ${CASROOT}/lib)
 ENDIF(WINDOWS)
index 14ca37915f461a1610c971dc146e6547c6dc3b6b..fa255f786f8521538cf719395067c46c071c44ce 100644 (file)
@@ -1,23 +1,20 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 SET(GUI_CXXFLAGS -I${GUI_ROOT_DIR}/include/salome)
@@ -32,6 +29,7 @@ FIND_LIBRARY(LightApp LightApp ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(LogWindow LogWindow ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(ObjBrowser ObjBrowser ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(OpenGLUtils OpenGLUtils ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(Plot2d Plot2d ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(PyConsole PyConsole ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(PyInterp PyInterp ${GUI_ROOT_DIR}/lib/salome)
@@ -39,9 +37,14 @@ FIND_LIBRARY(QDS QDS ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(qtx qtx ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(QxScene QxScene ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomeApp SalomeApp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeAppTest SalomeAppTest ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomeIDLGUI SalomeIDLGUI ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomeObject SalomeObject ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomePrs SalomePrs ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQtGUILight SalomePyQtGUILight ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQtGUI SalomePyQtGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQt SalomePyQt ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePy SalomePy ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomeSession SalomeSession ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SalomeStyle SalomeStyle ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SOCC SOCC ${GUI_ROOT_DIR}/lib/salome)
@@ -52,4 +55,7 @@ FIND_LIBRARY(suit suit ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SUPERVGraph SUPERVGraph ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SVTK SVTK ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(ToolsGUI ToolsGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(ViewerTools ViewerTools ${GUI_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(VTKViewer VTKViewer ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(vtkEDFOverloads vtkEDFOverloads ${GUI_ROOT_DIR}/lib/paraview)
+FIND_LIBRARY(vtkTools vtkTools ${GUI_ROOT_DIR}/lib/salome)
index 14584056e3ff65f9ed2a10944e596a0bc26bbbd7..d7e8d4fed9e89710035d5761ba92f3490af1187e 100644 (file)
@@ -1,27 +1,27 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 IF(${WINDOWS})
   FIND_LIBRARY(OpenGL_LIB OpenGL32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
   FIND_LIBRARY(GlU_LIB GlU32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
-  SET(OGL_LIBS ${OpenGL_LIB} ${GlU_LIB})
+ELSE(${WINDOWS})
+  FIND_LIBRARY(OpenGL_LIB GL)
+  FIND_LIBRARY(GlU_LIB GLU)
 ENDIF(${WINDOWS})
+SET(OGL_LIBS ${OpenGL_LIB} ${GlU_LIB})
index 6b98c5f3108ea41a8778e04df00aeec80537fb68..bf713c01fb665d138b5158030c41531c817f6bea 100644 (file)
@@ -1,23 +1,20 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 INCLUDE(FindQt4)
@@ -28,6 +25,8 @@ SET(DIRS ${DIRS} -I${D})
 ENDFOREACH(D ${QT_INCLUDES})
 SET(QT_INCLUDES ${DIRS})
 SET(QT_INCLUDES ${QT_INCLUDES} -DQT_THREAD_SUPPORT)
-SET(QT_MT_LIBS ${QT_LIBRARIES} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY})
+SET(QT_MT_LIBS ${QT_LIBRARIES} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
+SET(QT_LIBS ${QT_MT_LIBS})
+SET(qt4_ldflags ${QT_MT_LIBS})
 
 FIND_PROGRAM(QT_LRELEASE_EXECUTABLE lrelease)
index ea5f11dd872ccef0ff381a688312aa39a41447f9..18634126770703145c83d30b168b2aad5126e6ef 100644 (file)
@@ -1,33 +1,39 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 SET(QWTHOME $ENV{QWTHOME})
-FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h ${QWTHOME}/include)
+IF(NOT QWTHOME)
+  SET(QWTHOME /usr)
+ENDIF(NOT QWTHOME)
+
+FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h PATHS ${QWTHOME}/include ${QWTHOME}/include/qwt)
 SET(QWT_INCLUDES -I${QWT_INCLUDE_DIR})
 IF(WINDOWS)
 SET(QWT_INCLUDES ${QWT_INCLUDES} -DQWT_DLL)
 ENDIF(WINDOWS)
+
 IF(WINDOWS)
+IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+FIND_LIBRARY(QWT_LIBS qwtd5 ${QWTHOME}/lib)
+ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
 FIND_LIBRARY(QWT_LIBS qwt5 ${QWTHOME}/lib)
+ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
 ELSE(WINDOWS)
-FIND_LIBRARY(QWT_LIBS qwt ${QWTHOME}/lib)
+FIND_LIBRARY(QWT_LIBS qwt PATHS ${QWTHOME}/lib ${QWTHOME}/lib64)
 ENDIF(WINDOWS)
index 1f4ff9503333481c05bf34e79b3946528eb2cbf1..6a76d6a7e7ae9bba8724b44b378cbc6e01b07ab0 100644 (file)
@@ -1,23 +1,20 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 FIND_PROGRAM(SIP_EXECUTABLE sip)
@@ -29,8 +26,15 @@ GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} PATH)
 ENDIF(SIP_ROOT)
 
 SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION})
+IF(WINDOWS)
+  SET(SIP_INCLUDES ${SIP_INCLUDES} -I${SIP_ROOT}/include)
+ENDIF(WINDOWS)
 
-FIND_PROGRAM(PYUIC_EXECUTABLE pyuic4)
+IF(WINDOWS)
+  FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat)
+ELSE(WINDOWS)
+  FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4)
+ENDIF(WINDOWS)
 
 SET(PYUIC_ROOT ${PYUIC_EXECUTABLE})
 IF(PYUIC_ROOT)
@@ -38,11 +42,18 @@ GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
 GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
 ENDIF(PYUIC_ROOT)
 
-IF(WINDOWS)
-  SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
-ELSE(WINDOWS)
-  SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
-ENDIF(WINDOWS)
+SET(PYQT_SIPS $ENV{PYQT_SIPS})
+IF(NOT PYQT_SIPS)
+  IF(WINDOWS)
+    SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
+  ELSE(WINDOWS)
+    IF(PYUIC_ROOT STREQUAL /usr)
+      SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip/PyQt4)
+    ELSE(PYUIC_ROOT STREQUAL /usr)
+      SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
+    ENDIF(PYUIC_ROOT STREQUAL /usr)
+  ENDIF(WINDOWS)
+ENDIF(NOT PYQT_SIPS)
 
 SET(PYQT_INCLUDES -I${PYQT_SIPS})
 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtCore -I${PYQT_SIPS}/QtGui)
@@ -51,5 +62,15 @@ SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtAssistant -I${PYQT_SIPS}/QtD
 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtNetwork -I${PYQT_SIPS}/QtSql)
 SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtSvg -I${PYQT_SIPS}/QtTest)
 
-SET(PYQT_SIPFLAGS -x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t Qt_4_4_1 -g -s .cc -c .)
-SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES})
+EXECUTE_PROCESS(
+  COMMAND ${PYTHON_EXECUTABLE} -c "import re, PyQt4.pyqtconfig ; s = PyQt4.pyqtconfig.Configuration().pyqt_sip_flags ; print s;"
+  OUTPUT_VARIABLE COMPILE_FLAGS
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+string(REPLACE " " ";" FLAGS_LIST ${COMPILE_FLAGS})
+FOREACH(FLG ${FLAGS_LIST})
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${FLG})
+ENDFOREACH(FLG ${FLAGS_LIST})
+
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -s .cc -c . )
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES} )
\ No newline at end of file
index 550256c7234fd122e477ee12880768ecaeee4fba..4e0871c89316d07b0b5914bc9244fa9bba55707e 100644 (file)
@@ -1,23 +1,20 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 INCLUDE(FindVTK)
@@ -28,21 +25,44 @@ FOREACH(dir ${VTK_INCLUDE_DIRS})
 ENDFOREACH(dir ${VTK_INCLUDE_DIRS})
 
 SET(VTK_LIBS)
-FIND_LIBRARY(VTK_COMMON vtkCommon ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_COMMON vtkCommon PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_COMMON})
-FIND_LIBRARY(VTK_GRAPHICS vtkGraphics ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_GRAPHICS vtkGraphics PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_GRAPHICS})
-FIND_LIBRARY(VTK_IMAGING vtkImaging ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_IMAGING vtkImaging PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_IMAGING})
-FIND_LIBRARY(VTK_FILTERING vtkFiltering ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_FILTERING vtkFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_FILTERING})
-FIND_LIBRARY(VTK_IO vtkIO ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_IO vtkIO PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_IO})
-FIND_LIBRARY(VTK_RENDERING vtkRendering ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_RENDERING vtkRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_RENDERING})
-FIND_LIBRARY(VTK_HYBRID vtkHybrid ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_HYBRID vtkHybrid PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_HYBRID})
-FIND_LIBRARY(VTK_PARALLEL vtkParallel ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_PARALLEL vtkParallel PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_PARALLEL})
-FIND_LIBRARY(VTK_WIDGETS vtkWidgets ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_WIDGETS vtkWidgets PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
 SET(VTK_LIBS ${VTK_LIBS} ${VTK_WIDGETS})
+FIND_LIBRARY(VTK_GENERIC_FILTERING vtkGenericFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_GENERIC_FILTERING})
+FIND_LIBRARY(VTK_INFOVIS vtkInfovis PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_INFOVIS})
+FIND_LIBRARY(VTK_VOLUME_RENDERING vtkVolumeRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_VOLUME_RENDERING})
+
+FIND_LIBRARY(vtkCommonPythonD vtkCommonPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkGraphicsPythonD vtkGraphicsPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkImagingPythonD vtkImagingPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkPythonCore vtkPythonCore PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+
+
+#IF(NOT WINDOWS)
+#  IF(VTK_MAJOR_VERSION STREQUAL 5)
+#    IF(VTK_MINOR_VERSION STREQUAL 0)
+#      SET(VTK_INCLUDES ${VTK_INCLUDES} -Wno-deprecated)
+#    ENDIF(VTK_MINOR_VERSION STREQUAL 0)
+#  ENDIF(VTK_MAJOR_VERSION STREQUAL 5)
+#ENDIF(NOT WINDOWS)
+
+SET(VTK_INCLUDES ${VTK_INCLUDES} -DVTK_EXCLUDE_STRSTREAM_HEADERS)
+SET(VTK_DEFINITIONS -DVTK_EXCLUDE_STRSTREAM_HEADERS)
\ No newline at end of file
index d94ed4ebf543cbb1f468092c31aceb5eefcb8764..11f2ecd878cd5d16963e13f95a2bde7cdd62ad2c 100644 (file)
@@ -1,30 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 dist_admlocal_cmake_DATA = \
 FindCAS.cmake \
 FindOPENGL.cmake \
 FindQT4.cmake \
+UseQT4EXT.cmake \
 FindQWT.cmake \
 FindSIPPYQT.cmake \
 FindVTK.cmake \
index 5f6d5f7536c72fc43090c511c2a26518cb92af5d..dc81a356d689415698448a933be3259068e06d62 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = config_files
index c370531796e5fbd7fcba493d2c119a57111d77eb..fab65aae3dfee6d977d8e3f9d06bbaf52347744a 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 dist_admlocalm4_DATA =         \
@@ -36,8 +37,7 @@ check_qwt.m4                  \
 check_SalomeObject.m4          \
 check_sip.m4                   \
 check_SupervGraphViewer.m4     \
-check_vtk.m4                   \
 check_VTKViewer.m4             \
-check_corba_in_GUI.m4          \
 check_QxGraphViewer.m4          \
-check_TestRecorder.m4
+check_TestRecorder.m4           \
+check_salome_version.m4
index 064a60ae06f2a1c333741ec2fd33b0b7482252a2..48dc02092491a6a9deeb81385f1724e4c32245ba 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-glViewer=[yes|no|DIR] taking into account that
 # DISABLE_GLVIEWER may be already set during build_configure,
index ec07762f324976e49fa1abc31d0a912db33c16a8..ef1836958d064a0d9e45d00f25e34154372d91bb 100755 (executable)
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #  Check availability of Salome binary distribution
 #
 #  Author : Marc Tajchman (CEA, 2002)
 #------------------------------------------------------------
 
-AC_DEFUN([CHECK_GUI],[
+AC_DEFUN([CHECK_GUI_MODULE],[
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
 
-AC_CHECKING(for $2 $1 )
-
-SalomeGUI_ok=no
+LightGUI_ok=no
+FullGUI_ok=no
 
 GUI_LDFLAGS=""
 GUI_CXXFLAGS=""
 
-AC_ARG_WITH(gui,
-           --with-salome_gui=DIR root directory path of SALOME GUI installation,
-           SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="")
+SALOME_GUI_DIR=""
 
-if test "x${SALOME_GUI_DIR}" = "x" ; then
-  # no --with-gui-dir option used
-  AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
-  if test "x${GUI_ROOT_DIR}" != "x" ; then
-    # SALOME_ROOT_DIR environment variable defined
-    SALOME_GUI_DIR=${GUI_ROOT_DIR}
+AC_ARG_WITH(gui, 
+           [--with-gui=DIR root directory path of SALOME GUI installation],
+           [],
+            [with_gui=auto])
+
+if test "${with_gui}" = "no"; then
+  SalomeGUI_need=no
+else
+  # define SALOME_GUI_DIR
+  if test "${with_gui}" = "yes" -o "${with_gui}" = "auto"; then
+    SalomeGUI_need="$with_gui"
+    AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
+    if test "x${GUI_ROOT_DIR}" != "x" ; then
+      # GUI_ROOT_DIR environment variable defined
+      SALOME_GUI_DIR=${GUI_ROOT_DIR}
+    else
+      # search Salome binaries in PATH variable
+      AC_PATH_PROG(TEMP, SUITApp)
+      if test "x${TEMP}" != "x" ; then
+        AC_MSG_RESULT(SUITApp was found at : ${TEMP})
+        SALOME_BIN_DIR=`dirname ${TEMP}`
+        SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
+      fi
+    fi 
   else
-    # search Salome binaries in PATH variable
-    AC_PATH_PROG(TEMP, $1)
-    if test "x${TEMP}" != "x" ; then
-      AC_MSG_RESULT($1 was found at : ${TEMP})
-      SALOME_BIN_DIR=`dirname ${TEMP}`
-      SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
-    fi
+    # GUI directory defined by user
+    SalomeGUI_need=yes
+    SALOME_GUI_DIR="$with_gui"
   fi
-fi
 
-if test -f ${SALOME_GUI_DIR}/bin/salome/$1 ; then
-  SalomeGUI_ok=yes
-  AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
-
-  if test "x${GUI_ROOT_DIR}" == "x" ; then
+  # check GUI installation
+  AC_CHECKING(for light GUI)
+  if test -f ${SALOME_GUI_DIR}/bin/salome/SUITApp ; then
+    LightGUI_ok=yes
+    AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
+       
     GUI_ROOT_DIR=${SALOME_GUI_DIR}
-  fi
 
-  AC_SUBST(GUI_ROOT_DIR)
+    GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+    GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
 
-  GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
-  GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
-
-  AC_SUBST(GUI_LDFLAGS)
-  AC_SUBST(GUI_CXXFLAGS)
-else
-  AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
+    AC_CHECKING(for full GUI)
+    if test -f ${SALOME_GUI_DIR}/bin/salome/SALOME_Session_Server ; then
+      FullGUI_ok=yes
+    fi
+  else
+    AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
+  fi
+  AC_MSG_RESULT(for light GUI: ${LightGUI_ok})
+  AC_MSG_RESULT(for full GUI: ${FullGUI_ok})
 fi
-  
-AC_MSG_RESULT(for $2: ${SalomeGUI_ok})
+
+AC_SUBST(GUI_LDFLAGS)
+AC_SUBST(GUI_CXXFLAGS)
+AC_SUBST(GUI_ROOT_DIR)
  
 ])dnl
 
 AC_DEFUN([CHECK_SALOME_GUI],[
-  CHECK_GUI([SUITApp],
-            [SALOME GUI])
+  CHECK_GUI_MODULE()
+  SalomeGUI_ok=${LightGUI_ok}
+])dnl
+
+AC_DEFUN([CHECK_CORBA_IN_GUI],[
+  CHECK_GUI_MODULE()
+  CORBA_IN_GUI=${FullGUI_ok}
+  AC_SUBST(CORBA_IN_GUI)
 ])dnl
index ee23fd53d2eb78647538ed7ed41d3091924badae..6f1ca7109072e3442f5fe393a6af72b3ecd85591 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-occViewer=[yes|no|DIR] taking into account that
 # DISABLE_OCCVIEWER may be already set during build_configure,
index ebef2706894746504fa9e30f8d0a3e064becd902..72915af59260129ae06d60f8f70daa297118f6da 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-plot2dViewer=[yes|no|DIR] taking into account that
 # DISABLE_PLOT2DVIEWER may be already set during build_configure,
index 304867485121579143dbe2333ca1a23f3676eb6a..fcb4223a4a3f5de552137b0256c13203ed6f1437 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-pyConsole=[yes|no|DIR] taking into account that
 # DISABLE_PYCONSOLE may be already set during build_configure,
index ddd2a3c9488d802b4002f3f1ed22fac0af7b5361..2ec1403faf27d51b32a0c8a70e23f8c4ca4763ac 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-qxGraphViewer=[yes|no|DIR] taking into account that
 # DISABLE_QXGRAPHVIEWER may be already set during build_configure,
index 76d83431ff34d3403c181faf029ef6f0e633185e..14c93dffe05a8134fd157eb0bbc5bd698960d8ae 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-salomeObject=[yes|no|DIR] taking into account that
 # DISABLE_SALOMEOBJECT may be already set during build_configure,
index 2ba31b6fa0b49461c9b6fc0d8bc5f11095181646..f73979a7c88a69c1ce0902ff02a1173d17bb72b7 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-supervGraphViewer=[yes|no|DIR] taking into account that
 # DISABLE_SUPERVGRAPHVIEWER may be already set during build_configure,
index 0dbe0b6aeb689f96a2992b41ed1c70c039cde234..6baec44f6d4a1a1720f025f5b2a90143d2a32561 100644 (file)
@@ -1,24 +1,22 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check existence of Test recorder sources and libraries.
 # Set ENABLE_TESTRECORDER to yes|no
index 774de209fc38e9208d7db9bf2c1b5f8dc4563952..56065212cd33ada2b9bee69f64492d4eddba46ad 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-vtkViewer=[yes|no|DIR] taking into account that
 # DISABLE_VTKVIEWER may be already set during build_configure,
diff --git a/adm_local/unix/config_files/check_corba_in_GUI.m4 b/adm_local/unix/config_files/check_corba_in_GUI.m4
deleted file mode 100755 (executable)
index cfa4a04..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
-dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
-dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
-#  Check availability of full Salome binary distribution
-#
-#  Author : Marc Tajchman (CEA, 2002)
-#------------------------------------------------------------
-
-AC_DEFUN([CHECK_CORBA_IN_GUI],[
-  CHECK_GUI([SALOME_Session_Server],
-            [CORBA SALOME GUI])
-  CORBA_IN_GUI=${SalomeGUI_ok}
-  AC_SUBST(CORBA_IN_GUI)
-])dnl
index 94105766b060a0e123670f8ddbe2a93d25c4b387..eea675cdc60f0891455bf840b2aa2e90d2d6aae5 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 #
 # Check configure option --disable-corba=[yes|no|DIR] taking into account that
 # GUI_DISABLE_CORBA may be already set during build_configure,
index afda71bea18b0dd03b95bfb2823e0a5ea6f4bc23..a8eea4e142befdecc2b2e64ee3b53ce857c3397f 100755 (executable)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 # Check availability of Qt's msg2qm tool binary distribution
 #
 # Author : Jerome Roy (CEA, 2003)
index dc94b12715c14da06f2376694a5f2c61f22b03c9..f003684c11bf6e6e208a43c70240f02e54faccf3 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 AC_DEFUN([CHECK_OPENGL],[
 AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_PROG_CPP])dnl
index 9f201a915893b8f64979aa0c98c4afc3179e90ab..ec0acce592e82ca9e2c1c77ea1ab6155b9d924fd 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 AC_DEFUN([CHECK_PYQT],[
 AC_REQUIRE([CHECK_PYTHON])dnl
 AC_REQUIRE([CHECK_QT])dnl
@@ -46,28 +47,34 @@ AC_ARG_WITH(pyuic4,
       AC_MSG_RESULT([Try $withval as pyuic4 executable])
     ])
 
+AC_ARG_WITH(pyrcc4,
+    [  --with-pyrcc4=EXEC pyrcc4 executable ],
+    [PYRCC="$withval"
+      AC_MSG_RESULT([Try $withval as pyrcc4 executable])
+    ])
+
 AC_CHECKING(for pyqt)
 
 pyqt_ok=no
 
+TEST_BIN_DIRS=""
+if test "x${PYQTDIR}" != "x" ; then
+    TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYQTDIR} ${PYQTDIR}/bin"
+fi
+TEST_BIN_DIRS="${TEST_BIN_DIRS} __CHECK__PATH__"
+if test "x${SIPDIR}" != "x" ; then
+    TEST_BIN_DIRS="${TEST_BIN_DIRS} ${SIPDIR} ${SIPDIR}/bin"
+fi
+if test "x${PYTHONHOME}" != "x" ; then
+    TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYTHONHOME}/bin"
+fi
+TEST_BIN_DIRS="${TEST_BIN_DIRS} /usr/bin"
+
 dnl check pyuic4
 if test "x$PYUIC" != "x" ; then
     dnl try $withval value
     AC_CHECK_FILE($PYUIC,pyqt_ok=yes,pyqt_ok=no)
 else
-    TEST_BIN_DIRS=""
-    if test "x${PYQTDIR}" != "x" ; then
-        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYQTDIR} ${PYQTDIR}/bin"
-    fi
-    TEST_BIN_DIRS="${TEST_BIN_DIRS} __CHECK__PATH__"
-    if test "x${SIPDIR}" != "x" ; then
-        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${SIPDIR} ${SIPDIR}/bin"
-    fi
-    if test "x${PYTHONHOME}" != "x" ; then
-        TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYTHONHOME}/bin"
-    fi
-    TEST_BIN_DIRS="${TEST_BIN_DIRS} /usr/bin"
-
     dnl search pyuic4
     pyqt_ok=no
     for d in ${TEST_BIN_DIRS} ; do
@@ -120,6 +127,37 @@ else
     AC_MSG_RESULT(Warning! pyuic4 is not found!)
 fi
 
+dnl check pyrcc4
+if test "x$PYRCC" != "x" ; then
+    dnl try $withval value
+    AC_CHECK_FILE($PYRCC,pyqt_ok=yes,pyqt_ok=no)
+else
+    dnl search pyrcc4
+    pyqt_ok=no
+    for d in ${TEST_BIN_DIRS} ; do
+        if test "x${d}" = "x__CHECK__PATH__" ; then
+            AC_PATH_PROG(TEMP, pyrcc4)
+            if test "x${TEMP}" != "x" ; then
+                PYRCC=${TEMP}
+                if test "x$PYQTDIR" = "x" ; then
+                    PYQTDIR=`dirname ${PYRCC}`
+                    PYQTDIR=`dirname ${PYQTDIR}`
+                fi
+                pyqt_ok=yes
+                break
+            fi
+        else
+            if test -d $d ; then
+                AC_CHECK_FILE(${d}/pyrcc4,pyqt_ok=yes,pyqt_ok=no)
+               if test "x$pyqt_ok" == "xyes" ; then
+                    PYRCC=${d}/pyrcc4
+                    break
+                fi
+            fi
+        fi
+    done
+fi
+
 if test "x$pyqt_ok" == "xyes" ; then
     TESTLIBFILE=QtCore.so
     TESTSIPFILE=QtCore/QtCoremod.sip
@@ -148,6 +186,11 @@ if test "x$pyqt_ok" == "xyes" ; then
     fi
     TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
     TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages/PyQt4"
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/pymodules/python${PYTHON_VERSION}/PyQt4"
+    if test "${build_cpu::6}" = "x86_64" ; then
+      TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib64/python2.6/site-packages/PyQt4"
+    fi
     TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip"
     TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip/PyQt4"
 
@@ -183,17 +226,18 @@ if test "x$pyqt_ok" == "xyes" ; then
                     PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtSvg -I ${d}/QtTest"
 
                     # check compatibility with Qt
-                    SUPPORTED=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/QtCore/QtCoremod.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
-                    SUPPORTED=`echo $SUPPORTED | sed -e "s/Qt_//g" -e "s/_/./g"`
-                    SUPPORTED_ID=`echo $SUPPORTED | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
-                    if test $SUPPORTED_ID -lt $QT_VERSION_ID ; then 
-                        AC_MSG_RESULT(Warning! Used Qt version ($QT_VERSION) is not supported by PyQt)
-                        AC_MSG_RESULT(Latest supported Qt version is ${SUPPORTED})
-                    else
-                        SUPPORTED=${QT_VERSION}
-                    fi
-                    SUPPORTED="Qt_`echo ${SUPPORTED} | sed -e 's/\./_/g'`"
-                    PYQT_SIPFLAGS="-x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t ${SUPPORTED} -g -s ".cc" -c . ${PYQT_INCLUDES}"
+                    #SUPPORTED=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/QtCore/QtCoremod.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
+                    #SUPPORTED=`echo $SUPPORTED | sed -e "s/Qt_//g" -e "s/_/./g"`
+                    #SUPPORTED_ID=`echo $SUPPORTED | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+                    #if test $SUPPORTED_ID -lt $QT_VERSION_ID ; then 
+                    #    AC_MSG_RESULT(Warning! Used Qt version ($QT_VERSION) is not supported by PyQt)
+                    #    AC_MSG_RESULT(Latest supported Qt version is ${SUPPORTED})
+                    #else
+                    #    SUPPORTED=${QT_VERSION}
+                    #fi
+                    #SUPPORTED="Qt_`echo ${SUPPORTED} | sed -e 's/\./_/g'`"
+                   PYQT_SIPFLAGS=`python -c "from PyQt4 import pyqtconfig; print pyqtconfig.Configuration().pyqt_sip_flags"`
+                    PYQT_SIPFLAGS="${PYQT_SIPFLAGS} -s .cc -c . ${PYQT_INCLUDES}"
                     break
                 fi
             fi
@@ -205,6 +249,7 @@ AC_SUBST(PYQT_INCLUDES)
 AC_SUBST(PYQT_LIBS)
 AC_SUBST(PYQT_SIPS)
 AC_SUBST(PYUIC)
+AC_SUBST(PYRCC)
 AC_SUBST(PYQT_SIPFLAGS)
 
 dnl AC_LANG_RESTORE
@@ -214,4 +259,3 @@ AC_MSG_RESULT(for pyqt: $pyqt_ok)
 ])dnl
 dnl
 
-
index 5859b6afce7671fdbb82edea677fbff19921a807..c1e1d3e08433e7eb7fef1f4ab1ba36430634ca28 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 dnl  OPTIONS_QT
 dnl  ------------------------------------------------------------------------
 dnl  Adds the --with-qt=path
@@ -40,6 +41,7 @@ AC_REQUIRE([AC_PROG_CPP])dnl
 AC_REQUIRE([AC_PROG_CXXCPP])dnl
 AC_REQUIRE([CHECK_OPENGL])dnl
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
 AC_REQUIRE([OPTIONS_QT])dnl
 
@@ -51,6 +53,8 @@ fi
 
 qt_ok=yes
 
+QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 
@@ -75,32 +79,79 @@ fi
 if test "x$with_qt" != "x" ; then
   dnl Using "--with-qt" prefix path
   QTDIR="$with_qt"
-else
-  if test -z $QTDIR ; then
-    AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
-    for d in /usr/local/lib/qt4 /usr/lib/qt4 ; do
-      if test -f ${d}/include/Qt/qconfig.h ; then
-        AC_MSG_RESULT(trying ${d})
-        QTDIR="${d}"
-        break
+elif test "$QTDIR" = "/usr/lib/qt3" ; then
+  dnl Using QTDIR environment variable
+  AC_MSG_RESULT(current QTDIR is $QTDIR)
+  dnl 
+  if test -d /usr/lib/qt4 ; then
+    AC_MSG_RESULT(it is strange for a qt4 installation !)
+    AC_MSG_RESULT(/usr/lib/qt4 is present)
+    AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4)
+    QTDIR=/usr/lib/qt4
+  fi
+elif test -z $QTDIR ; then
+  AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed, trying to guess using pkg-config)
+  PKG_PROG_PKG_CONFIG()
+  AS_IF([test "x$PKG_CONFIG" != "x"],
+    [
+      QT_REQUIRED_VERSION=4.0.0
+      if $PKG_CONFIG --exists "QtCore >= $QT_REQUIRED_VERSION"
+      then
+       QT_USING_PKGCONFIG=yes
+        QT_VERSION=`$PKG_CONFIG --modversion QtCore --atleast-version=$QT_REQUIRED_VERSION`
+        QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+
+       MOC=`$PKG_CONFIG --variable=moc_location "QtCore >= $QT_REQUIRED_VERSION"`
+       UIC=`$PKG_CONFIG --variable=uic_location "QtCore >= $QT_REQUIRED_VERSION"`
+       QRCC=`$PKG_CONFIG --variable=rcc_location "QtCore >= $QT_REQUIRED_VERSION"`
+       LRELEASE=`$PKG_CONFIG --variable=lrelease_location "QtCore >= $QT_REQUIRED_VERSION"`
+
+        QTCORE_CPPFLAGS=`$PKG_CONFIG --cflags "QtCore >= $QT_REQUIRED_VERSION"`
+        QTGUI_CPPFLAGS=`$PKG_CONFIG --cflags "QtGui >= $QT_REQUIRED_VERSION"`
+        QTOPENGL_CPPFLAGS=`$PKG_CONFIG --cflags "QtOpenGL >= $QT_REQUIRED_VERSION"`
+        QTXML_CPPFLAGS=`$PKG_CONFIG --cflags "QtXml >= $QT_REQUIRED_VERSION"`
+        QTASSISTANT_CPPFLAGS=`$PKG_CONFIG --cflags "QtAssistant >= $QT_REQUIRED_VERSION"`
+        QTNETWORK_CPPFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= $QT_REQUIRED_VERSION"`
+       QTWEBKIT_CPPFLAGS=`$PKG_CONFIG --cflags "QtWebKit >= $QT_REQUIRED_VERSION"`
+
+       QTCORE_LDFLAGS=`$PKG_CONFIG --libs "QtCore >= $QT_REQUIRED_VERSION"`
+        QTGUI_LDFLAGS=`$PKG_CONFIG --libs "QtGui >= $QT_REQUIRED_VERSION"`
+        QTOPENGL_LDFLAGS=`$PKG_CONFIG --libs "QtOpenGL >= $QT_REQUIRED_VERSION"`
+        QTXML_LDFLAGS=`$PKG_CONFIG --libs "QtXml >= $QT_REQUIRED_VERSION"`
+        QTASSISTANT_LDFLAGS=`$PKG_CONFIG --libs "QtAssistant >= $QT_REQUIRED_VERSION"`
+        QTNETWORK_LDFLAGS=`$PKG_CONFIG --libs "QtNetwork >= $QT_REQUIRED_VERSION"`
+       QTWEBKIT_LDFLAGS=`$PKG_CONFIG --libs "QtWebKit >= $QT_REQUIRED_VERSION"`
       else
-        if test -f ${d}/include/qconfig.h ; then
-          AC_MSG_RESULT(trying ${d})
-          QTDIR="${d}"
-          break
-        fi
+       AC_MSG_WARN(Qt not found)
       fi
-    done
-  else
-    dnl Using QTDIR environment variable
-    AC_MSG_RESULT(QTDIR is $QTDIR)
-  fi
+    ],
+    [
+      AC_MSG_WARN([pkg-config not found])
+    ]
+  )
+fi
+if test -z $QTDIR ; then
+  AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
+  for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do
+    if test -f ${d}/lib/libQtCore.so ; then
+      AC_MSG_RESULT(trying ${d})
+      QTDIR="${d}"
+      break
+    elif test -f ${d}/lib64/libQtCore.so ; then
+      AC_MSG_RESULT(trying ${d})
+      QTDIR="${d}"
+      break
+    elif test -f ${d}/libQtCore.so ; then
+      AC_MSG_RESULT(trying ${d})
+      QTDIR="${d}"
+      break
+    fi
+  done
 fi
-
 #
 # check QTDIR environment variable
 #
-if test "x$QTDIR" = "x"
+if test "x$QTDIR" = "x" -a "x$QT_USING_PKGCONFIG" != "xyes"
 then
    AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
    qt_ok=no
@@ -111,19 +162,28 @@ fi
 #
 if  test "x$qt_ok" = "xyes"
 then
-   qt_inc_ok=no
-   QTINC=""
-   AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
-   if test "x$QTINC" = "x"
+   AC_MSG_CHECKING(whether Qt version >= 4.0)
+   if test "x$QT_USING_PKGCONFIG" != "xyes"
    then
-     AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
-   else
-     qt_inc_ok=yes
+     qt_inc_ok=no
+     QTINC=""
+     AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
+     if test "x$QTINC" = "x"
+     then
+       AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
+     else
+       qt_inc_ok=yes
+     fi
+
+     if test "x$qt_inc_ok" = "xyes"
+     then
+       QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+     fi
    fi
-   if test "x$qt_inc_ok" = "xyes"
-   then
-     AC_MSG_CHECKING(whether Qt version >= 4.0)
-     QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+
+
+  if test "x$qt_inc_ok" = "xyes" -o "x$QT_USING_PKGCONFIG" = "xyes"
+  then
      QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
      if test $QT_VERSION_ID -ge 40000
      then
@@ -142,14 +202,20 @@ fi
 #
 # check moc presence (meta-object compiler)
 #
+qt_add=no
+
 if  test "x$qt_ok" = "xyes"
 then
-  if test -f ${QTDIR}/bin/moc
+  if test "x$QT_USING_PKGCONFIG" != "xyes"
   then
-    MOC=${QTDIR}/bin/moc
-  else
-    AC_PATH_PROG(MOC, moc)
+    if test -f ${QTDIR}/bin/moc
+    then
+      MOC=${QTDIR}/bin/moc
+    else
+      AC_PATH_PROG(MOC, moc)
+    fi
   fi
+
   if test "x$MOC" = "x"
   then
     qt_ok=no
@@ -162,30 +228,61 @@ then
   if test "x$qt_ok" = "xyes"
   then
     dnl check moc version
-    AC_MSG_CHECKING(cheching equality Qt and moc tool version)
+    AC_MSG_CHECKING( equality Qt and moc tool version)
     MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS="[[ ()]]"};{print $(NF-1)}'`
     if test "x$QT_VERSION" = "x$MOC_VERSION"
     then
       AC_MSG_RESULT(yes)
       qt_ok=yes
     else
-      AC_MSG_RESULT(moc tool and Qt product are inpompatible $MOC_VERSION)
-      qt_ok=no
+      AC_MSG_RESULT(moc tool and Qt product are incompatible $MOC_VERSION)
+      QT_VERSION_MAJ=`echo $QT_VERSION | awk -F. '{v=$[1];print v}'`
+      AC_MSG_CHECKING(for moc-qt$QT_VERSION_MAJ compatible version)
+      if test -f ${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
+      then
+       MOC=${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
+        qt_ok=yes
+       qt_add=$QT_VERSION_MAJ
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+        qt_ok=no
+      fi
     fi
   fi
 fi
+AC_MSG_CHECKING(moc tool and Qt product done)
+AC_MSG_RESULT(yes)
 
 #
 # check uic presence (user interface compiler)
 #
 if  test "x$qt_ok" = "xyes"
 then
-  if test -f ${QTDIR}/bin/uic
+  if test "x$QT_USING_PKGCONFIG" != "xyes"
   then
-    UIC=${QTDIR}/bin/uic
-  else
-    AC_PATH_PROG(UIC, uic)
+    if test "x$qt_add" = "xno"
+    then
+       AC_MSG_CHECKING(uic)
+       if test -f ${QTDIR}/bin/uic
+       then
+         UIC=${QTDIR}/bin/uic
+       else
+         AC_PATH_PROG(UIC, uic)
+       fi
+       AC_MSG_RESULT(yes)
+    else
+       AC_MSG_CHECKING(uic-qt$qt_add)
+       if test -f ${QTDIR}/bin/uic-qt$qt_add
+       then
+         UIC=${QTDIR}/bin/uic-qt$qt_add
+       else
+         AC_PATH_PROG(UIC, uic)
+       fi
+       AC_MSG_RESULT(yes)
+    fi
   fi
+
   if test "x$UIC" = "x"
   then
     qt_ok=no
@@ -194,6 +291,21 @@ then
     qt_ok=yes
     AC_MSG_RESULT(uic (Qt user interface compiler) is found)
   fi
+
+  if test "x$qt_ok" = "xyes"
+  then
+    dnl check uic version
+    AC_MSG_CHECKING(cheching equality Qt and uic tool version)
+    UIC_VERSION=`$UIC -version 2>&1 | awk '{print $NF}'`
+    if test "x$QT_VERSION" = "x$UIC_VERSION"
+    then
+      AC_MSG_RESULT(yes)
+      qt_ok=yes
+    else
+      AC_MSG_RESULT(uic tool and Qt product are incompatible)
+      qt_ok=no
+    fi
+  fi
 fi
 
 #
@@ -201,12 +313,26 @@ fi
 #
 if  test "x$qt_ok" = "xyes"
 then
-  if test -f ${QTDIR}/bin/rcc
+  if test "x$QT_USING_PKGONFIG" != "xyes"
   then
-    QRCC=${QTDIR}/bin/rcc
-  else
-    AC_PATH_PROG(QRCC, rcc)
+    if test "x$qt_add" = "xno"
+    then
+       if test -f ${QTDIR}/bin/rcc
+       then
+         QRCC=${QTDIR}/bin/rcc
+       else
+         AC_PATH_PROG(QRCC, rcc)
+       fi
+    else
+       if test -f ${QTDIR}/bin/rcc-qt$qt_add
+       then
+         QRCC=${QTDIR}/bin/rcc-qt$qt_add
+       else
+         AC_PATH_PROG(QRCC, rcc)
+       fi
+    fi
   fi
+
   if test "x$QRCC" = "x"
   then
     qt_ok=no
@@ -226,7 +352,7 @@ then
       AC_MSG_RESULT(yes)
       qt_ok=yes
     else
-      AC_MSG_RESULT(rcc tool and Qt product are inpompatible)
+      AC_MSG_RESULT(rcc tool and Qt product are incompatible)
       qt_ok=no
     fi
   fi
@@ -237,12 +363,26 @@ fi
 #
 if  test "x$qt_ok" = "xyes"
 then
-  if test -f ${QTDIR}/bin/lrelease
+  if test "x$QT_USING_PKGCONFIG" != "xyes"
   then
-    LRELEASE=${QTDIR}/bin/lrelease
-  else
-    AC_PATH_PROG(LRELEASE, lrelease)
+    if test "x$qt_add" = "xno"
+    then
+       if test -f ${QTDIR}/bin/lrelease
+       then
+         LRELEASE=${QTDIR}/bin/lrelease
+       else
+         AC_PATH_PROG(LRELEASE, lrelease)
+       fi
+    else
+       if test -f ${QTDIR}/bin/lrelease-qt$qt_add
+       then
+         LRELEASE=${QTDIR}/bin/lrelease-qt$qt_add
+       else
+         AC_PATH_PROG(LRELEASE, lrelease)
+       fi
+    fi
   fi
+
   if test "x$LRELEASE" = "x"
   then
     qt_ok=no
@@ -262,7 +402,7 @@ then
       AC_MSG_RESULT(yes)
       qt_ok=yes
     else
-      AC_MSG_RESULT(lrelease tool and Qt product are inpompatible)
+      AC_MSG_RESULT(lrelease tool and Qt product are incompatible)
       qt_ok=no
     fi
   fi
@@ -278,7 +418,12 @@ then
   AC_CHECKING(include Qt header files)
 
   CPPFLAGS_old=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+  if test "x$QT_USING_PKGCONFIG" != "xyes"
+  then
+    CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+  else
+    CPPFLAGS="$CPPFLAGS $QTCORE_CPPFLAGS"
+  fi
   AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
   CPPFLAGS=$CPPFLAGS_old
 
@@ -288,27 +433,24 @@ then
     AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
   else
     AC_MSG_RESULT(qt header files seem to be OK)
-    QT_INCLUDES="-I${QTDIR}/include${QTINC}"
-    # user header files
-    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore"
-    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui"
-    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL"
-    QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml"
-    # not used currently header files (uncomment if required)
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest"
-    #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools"
-
-    QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant"
-    QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork"
+    if test "x$QT_USING_PKGCONFIG" != "xyes"
+    then
+       QT_BASE="-I${QTDIR}/include${QTINC}"
+       # user header files
+       QTCORE_CPPFLAGS="${QT_BASE}/QtCore"
+       QTGUI_CPPFLAGS="${QT_BASE}/QtGui"
+       QTOPENGL_CPPFLAGS="${QT_BASE}/QtOpenGL"
+       QTWEBKIT_CPPFLAGS="${QT_BASE}/QtWebKit"
+       QTXML_CPPFLAGS="${QT_BASE}/QtXml"
+
+       QTASSISTANT_CPPFLAGS="${QT_BASE}/QtAssistant"
+       QTNETWORK_CPPFLAGS="${QT_BASE}/QtNetwork"
+     fi
 
-    # this flag is obsolete with Qt 4
-    QT_MT_INCLUDES="$QT_INCLUDES"
+     QT_INCLUDES="$QT_BASE $QTCORE_CPPFLAGS $QTGUI_CPPFLAGS $QTOPENGL_CPPFLAGS $QTXML_CPPFLAGS $QTWEBKIT_CPPFLAGS"
+
+     QT_ASSISTANT_INCLUDES="$QTASSISTANT_CPPFLAGS $QTNETWORK_CPPFLAGS"
+     QT_MT_INCLUDES="${QT_INCLUDES}"
   fi
 fi
 
@@ -323,18 +465,24 @@ then
   CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
 
   LIBS_old=$LIBS
-  if test "x$QTDIR" = "x/usr"
+  if test "x$QT_USING_PKGCONFIG" = "xyes"
   then
-    QT_LIB_DIR=""
-  elif test -d ${QTDIR}/lib; then
-    QT_LIB_DIR="-L$QTDIR/lib"
-  elif test -d ${QTDIR}/lib64; then
-    QT_LIB_DIR="-L$QTDIR/lib64"
+    LIBS="$LIBS $QTCORE_LDFLAGS"
   else
-    AC_MSG_ERROR(Can't detect of Qt library directory )
-    qt_ok=no
+    if test "x$QTDIR" = "x/usr" ; then
+      QT_LIB_DIR=""
+    elif test -d ${QTDIR}/lib; then
+      QT_LIB_DIR="-L$QTDIR/lib"
+    elif test -d ${QTDIR}/lib64; then
+      QT_LIB_DIR="-L$QTDIR/lib64"
+    elif test "x$QTDIR" = "x/usr/lib/qt4" ; then
+      QT_LIB_DIR=""
+    else
+      AC_MSG_ERROR(Can't detect Qt library directory )  #'
+      qt_ok=no
+    fi
+    LIBS="$LIBS $QT_LIB_DIR -lQtCore"
   fi
-  LIBS="$LIBS $QT_LIB_DIR -lQtCore"
 
   AC_CACHE_VAL(salome_cv_lib_qt,[
     AC_TRY_LINK(
@@ -374,14 +522,21 @@ then
   else
     AC_MSG_RESULT(yes)
     # core libs
-    QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
-    # gui libs
-    QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL"
-    # other libs (currently not used)
-    QT_OTHER_LIBS="$QT_LIB_DIR"
-    # other libs (can be used if necessary)
-    #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
-    QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
+    if test "x$QT_USING_PKGCONFIG" = "xyes"
+    then
+      QT_CORE_LIBS="$QTCORE_LDFLAGS $QTXML_LDFLAGS"
+      QT_GUI_LIBS="$QTGUI_LDFLAGS $QTOPENGL_LDFLAGS $QTWEBKIT_LDFLAGS"
+      QT_ASSISTANT_LIBS="$QTASSISTANT_LDFLAGS $QTNETWORK_LDFLAGS"
+    else
+      QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
+      # gui libs
+      QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL -lQtWebKit"
+      # other libs (currently not used)
+      QT_OTHER_LIBS="$QT_LIB_DIR"
+      # other libs (can be used if necessary)
+      #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
+      QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
+    fi
     # all libs
     QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_OTHER_LIBS"
     # this flag is obsolete with Qt 4
index c62506993e6b1203f8d81038fd442c8027a5e530..65180571f435e665f28e4a42c241b79bcf243201 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 AC_DEFUN([CHECK_QWT],[
 AC_REQUIRE([CHECK_QT])dnl
 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
@@ -44,18 +45,47 @@ AC_ARG_WITH(qwt_inc,
       AC_MSG_RESULT("select $withval as path to QWT includes")
     ])
 
+libqwt_name=qwt
 if test -z $QWTHOME; then
   AC_MSG_RESULT(QWTHOME not defined)
+  AC_MSG_NOTICE(Trying native Qwt...)
   exist_ok=no  
   if test "x$exist_ok" = "xno"; then
-     for d in /usr/local /usr ; do
-        AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exist_ok=yes,exist_ok=no)
+     for d in /usr /usr/local ; do
+        for extension in qwt-qt4 qwt; do
+           AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/lib${extension}.so,exist_ok=yes,exist_ok=no)
+           if test "x$exist_ok" = "xyes"; then
+              QWTHOME=$d
+              AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+              libqwt_name=${extension}
+              dnl  break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+              break
+           fi
+        done
         if test "x$exist_ok" = "xyes"; then
-           QWTHOME=$d
-           AC_MSG_RESULT(libqwt.so detected in $d/lib)
+           break
         fi
      done
   fi
+  if test "x$exist_ok" = "xno"; then
+     if test "${build_cpu::6}" = "x86_64" ; then
+       for d in /usr /usr/local ; do
+          for extension in qwt-qt4 qwt; do
+             AC_CHECK_FILE(${d}/lib64/lib${extension}.so,exist_ok=yes,exist_ok=no)
+             if test "x$exist_ok" = "xyes"; then
+                QWTHOME=$d
+                AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+                libqwt_name=${extension}
+                dnl  break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+                break
+             fi
+          done
+          if test "x$exist_ok" = "xyes"; then
+             break
+          fi
+       done
+    fi
+  fi
   if test "x$exist_ok" = "xno"; then
      for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
         if test -f $d/libqwt.so ; then
@@ -69,7 +99,10 @@ if test -z $QWTHOME; then
   fi
   if test "x$exist_ok" = "xyes"; then
      if test -z $QWT_INCDIR; then
-        QWT_INCDIR=$QWTHOME"/include/qwt"
+        QWT_INCDIR=$QWTHOME"/include/qwt-qt4"
+        if test ! -f $QWT_INCDIR/qwt.h ; then
+          QWT_INCDIR=/usr/include/qwt
+        fi
         if test ! -f $QWT_INCDIR/qwt.h ; then
           QWT_INCDIR=$QWTHOME"/include"
         fi
@@ -81,6 +114,7 @@ if test -z $QWTHOME; then
      qwt_ok=no
   fi
 else
+  AC_MSG_NOTICE(Trying Qwt from $QWTHOME ...)
   if test -z $QWT_INCDIR; then
      QWT_INCDIR="$QWTHOME/include"
   fi           
@@ -116,9 +150,9 @@ else
     LIBS_old=$LIBS
     LIBS="$LIBS $QT_LIBS"
     if test "x$QWTHOME" = "x/usr" ; then
-      LIBS="$LIBS -lqwt"
+      LIBS="$LIBS -l${libqwt_name}"
     else
-      LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+      LIBS="$LIBS -L$QWTHOME/lib -l${libqwt_name}"
     fi
 
     CXXFLAGS_old=$CXXFLAGS
@@ -145,9 +179,9 @@ else
     else
       AC_MSG_RESULT(yes)
       if test "x$QWTHOME" = "x/usr" ; then
-        QWT_LIBS=" -lqwt"
+        QWT_LIBS=" -l${libqwt_name}"
       else
-        QWT_LIBS="-L$QWTHOME/lib -lqwt"
+        QWT_LIBS="-L$QWTHOME/lib -l${libqwt_name}"
       fi
     fi
 
index 464bdfd7eb8b47fcf2e24b2613fa67d87f49f449..f7c60477ed01c116eef0d762586ccef1d5a76194 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
 dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
 dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
+
 AC_DEFUN([CHECK_SIP],[
 AC_REQUIRE([CHECK_PYTHON])dnl
 AC_REQUIRE([CHECK_QT])dnl
@@ -71,7 +72,11 @@ if test "x$sip_ok" = "xyes" ; then
     fi
     TEST_INC_DIRS="${TEST_INC_DIRS} /usr/include /usr/include/python${PYTHON_VERSION}"
     TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages/PyQt4"
+    TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/pymodules/python${PYTHON_VERSION}"
+    if test "${build_cpu::6}" = "x86_64" ; then
+      TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib64/python${PYTHON_VERSION}/site-packages"
+    fi
     dnl Search sip.h file
     sip_ok=no
     for d in ${TEST_INC_DIRS} ; do
diff --git a/adm_local/unix/config_files/check_vtk.m4 b/adm_local/unix/config_files/check_vtk.m4
deleted file mode 100644 (file)
index c70c5ad..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl  This library is free software; you can redistribute it and/or
-dnl  modify it under the terms of the GNU Lesser General Public
-dnl  License as published by the Free Software Foundation; either
-dnl  version 2.1 of the License.
-dnl
-dnl  This library is distributed in the hope that it will be useful,
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl  Lesser General Public License for more details.
-dnl
-dnl  You should have received a copy of the GNU Lesser General Public
-dnl  License along with this library; if not, write to the Free Software
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-dnl
-dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
-dnl  OPTIONS_VTK
-dnl  ------------------------------------------------------------------------
-dnl  Adds the --with-vtk=path and --with-vtk-version configure options
-dnl
-AC_DEFUN([OPTIONS_VTK], [
-  AC_ARG_WITH([vtk],
-              [AC_HELP_STRING([--with-vtk], [The prefix where VTK is installed (default "" means taking from environment variable)])],
-              [with_vtk=$withval], [with_vtk=""])
-
-  AC_ARG_WITH([vtk-version],
-              [AC_HELP_STRING([--with-vtk-version], [VTK include directory name is vtk-suffix, e.g. vtk-5.0/. What is the suffix? (Default "yes" means taking from environment variable)])],
-              [vtk_suffix=$withval], [vtk_suffix="yes"])
-
-  AC_ARG_WITH([paraview],
-              [AC_HELP_STRING([--with-paraview], [ParaView from the specified location is used instead of VTK (default "" means ParaView should not be used)])])
-])
-
-dnl
-dnl  CHECK_VTK
-dnl  ------------------------------------------------------------------------
-dnl
-AC_DEFUN([CHECK_VTK], [
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_CXX])dnl
-AC_REQUIRE([AC_PROG_CPP])dnl
-AC_REQUIRE([AC_PROG_CXXCPP])dnl
-AC_REQUIRE([AC_LINKER_OPTIONS])dnl
-
-AC_REQUIRE([OPTIONS_VTK])dnl
-
-AC_CHECKING(for VTK)
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-AC_SUBST(VTK_INCLUDES)
-AC_SUBST(VTK_LIBS)
-AC_SUBST(VTKPY_MODULES)
-
-VTK_INCLUDES=""
-VTK_LIBS=""
-VTKPY_MODULES=""
-
-vtk_ok=no
-
-if test "x$OpenGL_ok" != "xyes" ; then
-   AC_MSG_WARN(VTK needs OpenGL correct configuration, check configure output)
-fi
-
-AC_PATH_X
-if test "x$x_libraries" != "x"
-then
-   LXLIB="-L$x_libraries"
-else
-   LXLIB=""
-fi
-
-if test "x$x_libraries" = "x/usr/lib"
-then
-   LXLIB=""
-fi
-
-if test "x$x_libraries" = "x/usr/lib${LIB_LOCATION_SUFFIX}"
-then
-   LXLIB=""
-fi
-
-LOCAL_INCLUDES="$OGL_INCLUDES"
-LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $LXLIB -lX11 -lXt"
-TRY_LINK_LIBS="-lvtkCommon $LXLIB -lX11 -lXt"
-
-dnl VTK version suffix
-if test -z $vtk_suffix ; then
-  vtk_suffix="yes"
-fi
-if test "x$vtk_suffix" == "xno" ; then
-  dnl in case user wrote --with-vtk-version=no, use empty suffix
-  vtk_suffix=""
-fi
-if test "x$vtk_suffix" != "xyes" ; then
-  VTKSUFFIX="$vtk_suffix"
-else
-  dnl in case user wrote --with-vtk-version=yes, get the suffix from env
-  if test -z $VTKSUFFIX ; then
-    VTKSUFFIX="-5.0"
-  fi
-fi
-
-dnl VTK install dir
-if test -z $with_vtk ; then
-  with_vtk=""
-fi
-if test "x$with_vtk" = "xyes" ; then
-  dnl in case user wrote --with-vtk=yes
-  with_vtk=""
-fi
-if test "x$with_vtk" = "xno" ; then
-  dnl in case user wrote --with-vtk=no
-  with_vtk=""
-  AC_MSG_WARN(Value "no", specified for option --with-vtk, is not supported)
-fi
-
-if test "x$with_vtk" != "x" ; then
-  VTKHOME="$with_vtk"
-else
-  if test -z $VTKHOME ; then
-    AC_MSG_WARN(undefined VTKHOME variable which specify where vtk was compiled)
-    for d in /usr/local /usr ; do
-      if test -f ${d}/include/vtk${VTKSUFFIX}/vtkPlane.h ; then
-        AC_MSG_RESULT(trying ${d})
-        VTKHOME="${d}"
-        break
-      else
-        if test -f ${d}/include/vtk-5.0/vtkPlane.h ; then
-          AC_MSG_RESULT(trying ${d})
-          VTKHOME="${d}"
-          VTKSUFFIX="-5.0"
-          break
-        else
-          if test -f ${d}/include/vtk/vtkPlane.h ; then
-            AC_MSG_RESULT(trying ${d})
-            VTKHOME="${d}"
-            VTKSUFFIX=""
-            break
-          fi
-        fi
-      fi
-    done
-  fi
-fi
-
-# Using regular VTK installation
-if test "x$with_paraview" = "x" ; then
-  LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
-  LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
-  TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $TRY_LINK_LIBS"
-  if test "x$VTKHOME" != "x/usr" ; then
-    LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} $LOCAL_LIBS"
-  fi
-else
-# VTK from ParaView overrides other VTK versions
-  if test "${with_paraview}" = "yes" ; then
-    if test -z $PVHOME ; then
-      PVHOME="/usr"
-    fi
-  else
-    PVHOME=${with_paraview}
-  fi
-
-  if test -z $PVSRCHOME ; then
-    PVSRCHOME="$PVHOME/src"
-  fi
-
-  if test -z $PVINSTALLHOME ; then
-    PVINSTALLHOME="$PVHOME/bin"
-  fi
-
-  LOCAL_INCLUDES="-I$PVSRCHOME/VTK/Common -I$PVSRCHOME/VTK/Filtering -I$PVSRCHOME/VTK/GenericFiltering -I$PVSRCHOME/VTK/Graphics -I$PVSRCHOME/VTK/Hybrid -I$PVSRCHOME/VTK/Imaging -I$PVSRCHOME/VTK/Infovis -I$PVSRCHOME/VTK/IO -I$PVSRCHOME/VTK/Parallel -I$PVSRCHOME/VTK/Rendering -I$PVSRCHOME/VTK/Utilities -I$PVSRCHOME/VTK/Views -I$PVSRCHOME/VTK/VolumeRendering -I$PVSRCHOME/VTK/Widgets -I$PVINSTALLHOME/VTK -I$PVINSTALLHOME/VTK/Common -I$PVINSTALLHOME/VTK/Filtering -I$PVINSTALLHOME/VTK/GenericFiltering -I$PVINSTALLHOME/VTK/Graphics -I$PVINSTALLHOME/VTK/Hybrid -I$PVINSTALLHOME/VTK/Imaging -I$PVINSTALLHOME/VTK/Infovis -I$PVINSTALLHOME/VTK/IO -I$PVINSTALLHOME/VTK/Parallel -I$PVINSTALLHOME/VTK/Rendering -I$PVINSTALLHOME/VTK/Utilities -I$PVINSTALLHOME/VTK/Views -I$PVINSTALLHOME/VTK/VolumeRendering -I$PVINSTALLHOME/VTK/Widgets $LOCAL_INCLUDES"
-  LOCAL_LIBS="-L$PVINSTALLHOME/bin -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc $LOCAL_LIBS"
-  TRY_LINK_LIBS="-L$PVINSTALLHOME/bin -lvtksys $TRY_LINK_LIBS"
-fi
-
-dnl vtk headers
-CPPFLAGS_old="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
-
-AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no")
-
-CPPFLAGS="$CPPFLAGS_old"
-
-if test "x$vtk_ok" = "xyes"
-then
-   VTK_INCLUDES="$LOCAL_INCLUDES"
-
-   dnl vtk libraries
-
-   AC_MSG_CHECKING(linking VTK library)
-
-   LIBS_old="$LIBS"
-   LIBS="$LIBS $TRY_LINK_LIBS"
-   #LIBS="$LIBS $LOCAL_LIBS"
-   CPPFLAGS_old="$CPPFLAGS"
-   CPPFLAGS="$CPPFLAGS $VTK_INCLUDES"
-
-   dnl VTKPY_MODULES="$VTKHOME/python"
-
-   AC_CACHE_VAL(salome_cv_lib_vtk,[
-     AC_TRY_LINK([#include "vtkPlane.h"
-                 ],
-                [vtkPlane::New()],
-                [salome_cv_lib_vtk=yes],
-                [salome_cv_lib_vtk=no])
-   ])
-   vtk_ok="$salome_cv_lib_vtk"
-   LIBS="$LIBS_old"
-   CPPFLAGS="$CPPFLAGS_old"
-fi
-
-if  test "x$vtk_ok" = "xno"
-then
-  AC_MSG_RESULT(no)
-  AC_MSG_WARN(unable to link with vtk library)
-else
-  AC_MSG_RESULT(yes)
-  VTK_LIBS="$LOCAL_LIBS"
-  VTK_MT_LIBS="$LOCAL_LIBS"
-fi
-
-AC_MSG_RESULT(for VTK: $vtk_ok)
-
-AC_LANG_RESTORE
-
-# Save cache
-AC_CACHE_SAVE
-
-])dnl
index f21fc707621a86fe4079c2ac337665e211f1356d..260923bdc0375cf5cf1cb720453bd1e7b1a6dd30 100644 (file)
@@ -1,24 +1,33 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
+#
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h -I$(top_builddir)
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h -I$(top_builddir)
+
 # ============================================================
 # This file defines the common definitions used in several
 # Makefile. This file must be included, if needed, by the file
@@ -28,6 +37,7 @@
 #
 salomeincludedir   = $(includedir)/salome
 libdir             = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+libparaviewdir          = $(prefix)/lib@LIB_LOCATION_SUFFIX@/paraview
 bindir             = $(prefix)/bin/salome
 salomescriptdir    = $(bindir)
 salomepythondir    = $(pythondir)/salome
@@ -39,6 +49,9 @@ salomeidldir       = $(prefix)/idl/salome
 # Directory for installing resource files
 salomeresdir       = $(prefix)/share/salome/resources/@MODULE_NAME@
 
+# Directory for installing plugins files
+salomepluginsdir   = $(prefix)/share/salome/plugins/@MODULE_NAME@
+
 # Directories for installing admin files
 admlocaldir        = $(prefix)/adm_local
 admlocalunixdir    = $(admlocaldir)/unix
diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in
deleted file mode 100644 (file)
index 69822e4..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#=======================================================================
-# This section of this makefile comes from the file 
-# 'adm/unix/make_conclude' which was generated with config.status
-# from file adm/unix/make_conclude.in
-#=======================================================================
-# -* Makefile *- 
-# Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
-# Date : 6/07/2001
-# $Header$
-#
-ifneq ($(GUI_DISABLE_CORBA),yes)
-# ORB Specifics rules
-
-@CORBA@
-
-# transform idl reference in appropriate obj file
-LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
-LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
-LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx)
-else
-LIB_CLIENT_SRC = 
-LIB_SERVER_SRC = 
-LIB_SWIG_SRC = 
-endif
-
-LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx)
-LIB_SRC+=$(LIB_MOC_SRC)
-LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC)
-ifneq ($(GUI_DISABLE_CORBA),yes)
-LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
-LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
-LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
-else
-LIB_CLIENT_OBJ = 
-LIB_SERVER_OBJ = 
-LIB_SWIG_OBJ = 
-endif
-# transform c file in appropriate libtool obj file (.c, .cc and .cxx)
-LIB_OBJ_C   = $(patsubst %.c,   %.lo, $(filter %.c, $(LIB_SRC))) 
-LIB_OBJ_CC  = $(patsubst %.cc,  %.lo, $(filter %.cc, $(LIB_SRC))) 
-LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC))) 
-LIB_OBJ_F    = $(patsubst %.f,   %.lo, $(filter %.f, $(LIB_SRC))) 
-
-# all libtool obj file in library
-LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F)
-
-# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
-LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
-LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
-LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
-
-ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
-ifneq ($(GUI_DISABLE_CORBA),yes)
-LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
-else
-LIB_SWIG = 
-endif
-else
-LIB_SWIG = 
-endif
-
-lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
-# we don't build static library !
-
-$(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
-       -$(RM) $@
-       -$(RM) $(patsubst %.la, %.so, $@)
-       -$(RM) $(patsubst %.la, %.a, $@)
-       ln -sf $(CURDIR)/$< $@ || true
-       ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
-             $(patsubst %.la, %.so, $@) || true
-       ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
-             $(patsubst %.la, %.so, $@).0 || true
-
-       if ! test -z $(LIB_SWIG) ; then \
-          ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
-       fi;
-
-$(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
-       -$(RM) $@
-       ln -sf $(CURDIR)/$< $@ || true
-
-$(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
-       -$(RM) $@
-       ln -sf $(CURDIR)/$< $@ || true
-
-$(LIB): $(LIB_OBJ)
-       @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
-
-# transform idl reference in appropriate obj file
-ifneq ($(GUI_DISABLE_CORBA),yes)
-BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
-BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
-else
-BIN_CLIENT_SRC = 
-BIN_SERVER_SRC = 
-endif
-BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
-BIN_SRC+=$(BIN_MOC_SRC)
-BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
-
-ifneq ($(GUI_DISABLE_CORBA),yes)
-BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
-BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) 
-else
-BIN_CLIENT_OBJ = 
-BIN_SERVER_OBJ = 
-endif
-# transform c file in appropriate libtool obj file (.c)
-BIN_OBJ_C =  $(patsubst %.c,  %.o, $(filter %.c, $(BIN_SRC)))
-# transform c++ file in appropriate libtool obj file (.cc and .cxx)
-BIN_OBJ_CC = $(patsubst %.cc,  %.o, $(filter %.cc, $(BIN_SRC)))
-BIN_OBJ_CXX = $(patsubst %.cxx,  %.o, $(filter %.cxx, $(BIN_SRC)))
-# all obj file in bin target
-BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ) 
-
-bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
-
-BIN_LIB=$(LIB:lib%.la=-l%)
-
-$(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
-       -$(RM) $@
-       ln -sf $(CURDIR)/$< $@
-
-$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
-       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
-
-# copy python scripts in $(top_builddir)/bin/salome
-#
-
-UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
-UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
-UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
-
-DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
-DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
-pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
-$(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
-       cp -f $< $@
-
-# generate generic python scripts from *.ui files
-#
-$(UI_PY_FILES): %.py: %.ui
-       $(PYUIC) $< -o $@
-
-# copy ui-generated python scripts in $(top_builddir)/bin
-#
-$(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
-       cp -f $< $@
-
-# copy pyqt files in $(PYTHON_SHARED_SITE)
-#
-PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
-
-$(PYTHON_SHARED_SITE):
-       $(INSTALL) -d  $@
-
-DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
-sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
-$(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
-       cp -f $< $@
-
-check: test
-
-tests: unittest
-
-test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%) 
-
-unittest: 
-       @if test "x$(UNIT_TEST_PROG)" != "x"; then      \
-          $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
-       fi;
-
-# copy header file in $(inc_builddir)
-#
-DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
-inc: $(DEST_HEADERS)
-$(DEST_HEADERS): $(inc_builddir)/%: %
-       cp -f $< $@
-
-# build resources file (icons and messages) : .qm file from .po file
-RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
-RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
-
-resources: resources-po resources-cp 
-
-resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
-
-resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
-
-$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
-       cp -fr $< $@;
-
-# Make installation directories if they don't exist.
-$(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
-       $(INSTALL) -d $@ && chmod 755 $@
-
-# Install the library, the public header files, and programs.
-install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
-       @for f in X $(LIB); do                                                \
-          if test $$f != X; then                                             \
-             ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1);                  \
-          fi;                                                                \
-       done
-       @if ! test -z $(LIB_SWIG) ; then                                      \
-         (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG)  || true); \
-        fi;                                                                  
-       @for f in X $(BIN); do                                                \
-          if test $$f != X; then                                             \
-            ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
-          fi;                                                                \
-       done
-# Install tests programmes in bindir
-       @for f in X $(TEST_PROGS); do                                         \
-          if test $$f != X; then                                             \
-            ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1);                  \
-          fi;                                                                \
-       done
-# Install exported includes in includedir
-       @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do                       \
-          if test $$f != X; then                                             \
-            (cp -p -f $$f $(includedir) || exit 1);                          \
-          fi;                                                                \
-       done
-
-# Install python script in $(bindir)
-install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
-
-$(UI_PY_FILES:%=install-%): install-%: %
-       $(INSTALL_PROGRAM) $< $(bindir)/.
-
-$(EXPORT_PYSCRIPTS:%=install-%): install-%: %
-       $(INSTALL_PROGRAM) $< $(bindir)/.
-
-#install-python: $(bindir) $(EXPORT_PYSCRIPTS)
-#      @for f in X $(EXPORT_PYSCRIPTS); do                           \
-#         if test $$f != X; then                                     \
-#           ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1);          \
-#         fi;                                                        \
-#      done
-
-# Install pyqt script in $(install-sharedpyqt)
-install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%) 
-
-$(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
-       $(INSTALL_PROGRAM) $< $(sharedpydir)/.
-
-
-# generic rule to install .qm files :
-install-qm: resources
-       $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
-       @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
-          if test $$f != X; then                                                        \
-            ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1);                      \
-          fi;                                                                           \
-       done
-
-# generic rule to install resources files (png, ini ...):
-install-res: resources
-       $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
-       @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
-          if test $$f != X; then                                                        \
-            ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1);                      \
-          fi;                                                                           \
-       done  
-
-# Removes those things that `make install' (would have) installed.
-uninstall:
-       @if test "X$(LIB)" != X; then                                         \
-          for f in $(LIB); do                                                \
-             $(LT_UNINSTALL) $(libdir)/$$f;                                  \
-          done;                                                              \
-       fi
-       @if test "X$(BIN)" != X; then                                         \
-          for f in $(BIN); do                                                \
-             $(LT_UNINSTALL) $(bindir)/$$f;                                  \
-          done;                                                              \
-       fi
-       @for f in X $(TEST_PROGS); do                                         \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(bindir)/$$f;                                   \
-          fi;                                                                \
-       done
-# Uninstall exported includes in includedir
-       @for f in X $(EXPORT_HEADERS); do                                     \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(includedir)/$$f;                               \
-          fi;                                                                \
-       done
-# Uninstall python script in $(bindir)
-       @for f in X $(EXPORT_PYSCRIPTS); do                                   \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(bindir)/$$f ;                  \
-          fi;                                                                \
-       done
-
-# Uninstall python script in $(bindir)
-       @for f in X $(UI_PY_FILES); do                                        \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(bindir)/$$f ;                  \
-          fi;                                                                \
-       done
-
-# Uninstall pyqt script in $(sharedpydir)
-       @for f in X $(EXPORT_SHAREDPYSCRIPTS); do                                     \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(sharedpydir)/$$f ;                     \
-          fi;                                                                \
-       done
-
-# Uninstall qm files
-       @for f in X $(PO_FILES:%.po=%.qm); do         \
-          if test $$f != X; then                                             \
-            $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ;                        \
-          fi;                                                                \
-       done
-
-# remove all dependencies files
-#
-cleandep:
-       -$(RM) .dep*
-
-# Removes temporary files without removing the final target files.  That is,
-# remove things like object files but not libraries or executables.
-#
-mostlyclean: cleandep
-       -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
-       -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
-       -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
-       -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
-
-# Like `mostlyclean' except it also removes the final targets: things like
-# libraries and executables.  This target doesn't remove any file that
-# is part of the SALOME distribution.
-#
-clean: mostlyclean
-       -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
-       -$(RM) TAGS *~ *# core *.core 
-       -$(RM) -r .libs
-       -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
-       -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
-       -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
-       -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
-# remove idl generated files (sources)
-       -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
-# remove idl generated files (headers)
-       -$(RM)  $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
-       -$(RM)  $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
-       -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
-       -$(RM) $(LIB_SWIG_SRC)
-
-# Like `clean' except it also removes files that were created by running
-# configure.  If you've unpacked the source and built without creating
-# any other files, then `make distclean' will leave only the files that were
-# in the distribution.
-#
-distclean: clean
-       #remove qm file !
-       -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
-       #remove include files
-       -$(RM) $(DEST_HEADERS)
-       -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
-       @if test -f $(srcdir)/Makefile.in; then                               \
-          (@SETX@; $(RM) Makefile);                                          \
-       fi
-
-
-#implicits rules
-.cc.o:
-       $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cc.lo:
-       $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.o:
-       $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.lo:
-       $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.c.o:
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
-.c.lo:
-       $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
-
-.f.o:
-       $(FC) $(FFLAGS) -c $< -o $@
-
-.f.lo:
-       $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
-
-.ui.h:
-       $(UIC) -o $@  $<
-
-.ui.cxx:
-       $(UIC) -o $@ -i $*.h $<
-
-#pattern rules
-%_moc.cxx : %.h
-       $(MOC) $< -o $@
-
-%_wrap.cxx : %.i
-       $(SWIG) $(SWIG_FLAGS) -o $@ $<
-
-$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
-       $(MSG2QM) $< $@ ; \
-
-#------------------------------------------------------------------------------
-# The following section of this makefile contains dependencies between the
-# source files and the header files.  If GNU make and GCC are being used then
-# the dependencies are in the form of rules that cause the information to
-# be kept updated automatically.  Otherwise the dependencies are listed
-# explicitly and come from the `.distdep' files in the various directories.
-# These files are part of the distribution and are generated automatically on
-# GNU/GCC systems.
-#------------------------------------------------------------------------------
-
-@DEPEND@
index 7d549a912d1fa04d6d4057cda8227e4a02b4364f..3d62fcb8a562902a704bd4fbd48979a042d3dc71 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Guillaume Boulant (CSSI)
 # Module : KERNEL
@@ -33,3 +34,7 @@ nodist_salomescript_DATA = VERSION
 dist_salomescript_SCRIPTS =    \
        runLightSalome.csh      \
        runLightSalome.sh
+
+# python files
+dist_salomescript_PYTHON = \
+        gui_setenv.py
index 1582d527a04e244ec7e7340db05d364577062153..68c192d243407f231dbd99bc45b8d2a9960046ec 100755 (executable)
@@ -1 +1,3 @@
-THIS IS SALOME - SALOMEGUI VERSION: @VERSION@
+[SALOME GUI]  : @VERSION@
+[DEVELOPMENT] : @VERSION_DEV@
+[DESCRIPTION] : SALOME GUI module (SUIT)
index 51b64d9f596de8393aa4bd36577b559e9500bb18..8101300c2a686caf2090b920734b9f4bf38af94f 100755 (executable)
@@ -1,24 +1,24 @@
 #!/bin/csh -f
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 #  File   : runLightSalome.csh
 #  Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
index 8caaaa9165d44e1606378bdff7ea5e4b56861529..7fb4978400756150bef8c39c12aa1583a123cd83 100755 (executable)
 #!/bin/bash -f
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # File   : runLightSalome.sh
 # Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
+
+
 ###
-# set default value for the LightAppConfig variable, which 
-# is necessary for loading of .ini or .xml resources file
+# function show_usage() : print help an exit
 ###
-#
-if [ -z "$LightAppConfig" ] ; then
-  export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
-else
-  export LightAppConfig=${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
-fi
-if [ -z "$LightAppResources" ] ; then
-  export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
-else
-  export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
-fi
+
+show_usage() {
+    local RET=0
+    if [ $# -gt 0 ] ; then RET=$1 ; fi
+    local MOVE1="echo -en \\033[35G"
+    local MOVE2="echo -en \\033[22G"
+    echo
+    echo "Run standalone SALOME desktop".
+    echo
+    echo "Usage: $(basename $0) [options]"
+    echo
+    echo "Options:"
+    echo " * all options have both short and long format;"
+    echo " * some options require additional parameter (below referenced as <param>)"
+    echo "   which should be separated by = symbol from the option itself."
+    echo
+    echo -en " --help"
+    ${MOVE2} ; echo -en "(-h)"
+    ${MOVE1} ; echo "Display this information and exit."
+    echo -en " --version"
+    ${MOVE2} ; echo -en "(-v)"
+    ${MOVE1} ; echo "Print SALOME version and exit."
+    echo -en " --modules=<param>"
+    ${MOVE2} ; echo -en "(-m)"
+    ${MOVE1} ; echo "List of modules, separated by comma, to be used within SALOME session."
+    echo
+    echo "Example:"
+    echo "  $(basename $0) --modules=LIGHT,PYLIGHT"
+    echo
+   exit ${RET}
+}
 
 ###
-# process --modules=... command line option (get list of modules)
+# function show_version() : print SALOME version an exit
 ###
 
-modules=""
-
-for arg in X $* ; do
-    if [ "$arg" != "X" ] ; then
-       case $arg in
-           --modules=* )  modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"` ;;
-            *)             ;;
-        esac
+show_version() {
+    local RET=0
+    local DIR=$(dirname $0)
+    if [ -z "${DIR}" ] ; then DIR=. ; fi
+    if [ -f ${DIR}/VERSION ] ; then
+       cat ${DIR}/VERSION
+    else
+        echo
+       echo "Error: can't find VERSION file"  > /dev/stderr
+        echo
+       RET=1
     fi
-done
-
-modules="KERNEL GUI $modules"
+    exit ${RET}
+}
 
 ###
-# exclude modules duplication
+# function option_modules() : process --modules / -m command line option
 ###
 
-mods=""
-
-for mod in $modules ; do
-    echo $mods | grep -E "\<$mod\>" >/dev/null 2>&1
-    if [ "$?" == "1" ] ; then
-       mods="$mods $mod"
+option_modules() {
+    local MODS=`echo $1 | awk -F "=" '{ if(NF>1) print $2 ; else print $1 }'`
+    if [ "X${MODS}" = "X" ] ; then
+        echo
+        echo "Error: Please, specify list of modules" > /dev/stderr
+        echo
+        exit 1
     fi
-done
+    MODULES=`echo ${MODS} | sed -e "s%,% %g"`
+    return
+}
+
 
 ###
-# set additional environment
+# function run_light_salome(): run SALOME
 ###
 
-python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
-
-MY_PATH=""
-MY_LD_LIBRARY_PATH=""
-MY_PYTHONPATH=""
-
-for mod in $mods ; do
-    if [ "$arg" != "X" ] ; then
-       root_dir=`printenv ${mod}_ROOT_DIR`
-       if [ "$root_dir" != "" ] ; then
-           mod_lower=`echo $mod | tr "A-Z" "a-z"`
-           if [ -d ${root_dir}/bin/salome ] ; then
-               if [ "${MY_PATH}" == "" ] ; then
-                   MY_PATH=${root_dir}/bin/salome
-               else
-                   MY_PATH=${MY_PATH}:${root_dir}/bin/salome
-               fi
-           fi
-           if [ -d ${root_dir}/lib/salome ] ; then
-               if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
-                   MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
-               else
-                   MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
-               fi
+run_light_salome(){
+
+    local MODULES
+
+    ###
+    # process command line options
+    ###
+
+    local OPTION
+    while getopts ":-:hvm:" OPTION "$@" ; do
+       if [ "${OPTION}" = "-" ] ; then
+            case ${OPTARG} in
+               help      )  show_usage                          ;;
+               version   )  show_version                        ;;
+               modules*  )  option_modules  "${OPTARG}"         ;;
+               *         )  echo "!!!Wrong option!!!" ; exit 1  ;;
+            esac
+       else
+           case ${OPTION} in
+               h  )  show_usage                                 ;;
+               v  )  show_version                               ;;
+               m* )  option_modules "${OPTARG}"                 ;;
+               ?  )  echo "!!!Wrong option!!!" ; exit 1         ;;
+           esac
+       fi
+    done
+    shift $((OPTIND - 1))
+
+    ###
+    # by default try to detect all available modules
+    ###
+
+    if [ -z "${MODULES}" ] ; then
+       local ENVVAR
+       local ROOTDIR
+       for ENVVAR in `env | awk -F= '{print $1}' | grep _ROOT_DIR` ; do
+           local MOD=`echo $ENVVAR | awk -F_ '{print $1}'`
+           local LMOD=`echo ${MOD} | tr 'A-Z' 'a-z'`
+           ROOTDIR=`printenv ${ENVVAR}` 
+           if [ -f ${ROOTDIR}/share/salome/resources/${LMOD}/LightApp.xml ] || [ -f ${ROOTDIR}/share/salome/resources/LightApp.xml ] ; then
+               MODULES="${MODULES} ${MOD}"
            fi
-           if [ "${python_version}" != "" ] ; then
-               if [ -d ${root_dir}/bin/salome ] ; then
-                   if [ "${MY_PYTHONPATH}" == "" ] ; then
-                       MY_PYTHONPATH=${root_dir}/bin/salome
-                   else
-                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
-                   fi
-               fi
-               if [ -d ${root_dir}/lib/salome ] ; then
-                   if [ "${MY_PYTHONPATH}" == "" ] ; then
-                       MY_PYTHONPATH=${root_dir}/lib/salome
-                   else
-                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
-                   fi
-               fi
-               if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then 
-                   if [ "${MY_PYTHONPATH}" == "" ] ; then
-                       MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
-                   else
-                       MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
-                   fi
-               fi
+       done
+    fi
+
+    ###
+    #  initial environment
+    ###
+
+    if [ -z "${LightAppResources}" ] ; then
+       export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
+    else
+       export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
+    fi
+
+    MODULES="KERNEL GUI ${MODULES}"
+
+    ###
+    # exclude modules duplication
+    ###
+
+    local MODS=""
+    local MOD
+    for MOD in ${MODULES} ; do
+       echo ${MODS} | grep -E "\<${MOD}\>" >/dev/null 2>&1
+       if [ "$?" == "1" ] ; then
+           MODS="${MODS} ${MOD}"
+       fi
+    done
+    MODULES=${MODS}
+
+    ###
+    # set additional environment
+    ###
+
+    local PVERSION=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
+    
+    local MY_PATH=""
+    local MY_LD_LIBRARY_PATH=""
+    local MY_PYTHONPATH=""
+
+    for MOD in ${MODULES} ; do
+       local ROOTDIR=`printenv ${MOD}_ROOT_DIR`
+       if [ -z "${ROOTDIR}" ] ; then continue ; fi
+       local LMOD=`echo ${MOD} | tr 'A-Z' 'a-z'`
+       if [ -d ${ROOTDIR}/bin/salome ] ; then
+           MY_PATH=${MY_PATH}:${ROOTDIR}/bin/salome
+       fi
+       if [ -d ${ROOTDIR}/lib/salome ] ; then
+           MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${ROOTDIR}/lib/salome
+       fi
+       if [ "${PVERSION}" != "" ] ; then
+           if [ -d ${ROOTDIR}/bin/salome ] ; then
+               MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/bin/salome
            fi
-           if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
-               export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
+           if [ -d ${ROOTDIR}/lib/salome ] ; then
+               MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/lib/salome
            fi
-           if [ "${SALOMEPATH}" == "" ] ; then
-               export SALOMEPATH=${root_dir}
-           else
-               export SALOMEPATH=${SALOMEPATH}:${root_dir}
+           if [ -d ${ROOTDIR}/lib/python${PVERSION}/site-packages/salome ] ; then 
+               MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/lib/python${PVERSION}/site-packages/salome
            fi
        fi
-    fi
-done
-
-if [ "${MY_PATH}" != "" ] ; then
-    export PATH=${MY_PATH}:${PATH}
-fi
-if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
-    export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
-fi
-if [ "${PYTHONPATH}" != "" ] ; then
-    export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
-fi
+       if [ -f ${ROOTDIR}/share/salome/resources/${LMOD}/LightApp.xml ] ; then
+           export LightAppConfig=${LightAppConfig}:${ROOTDIR}/share/salome/resources/${LMOD}
+       elif [ -f ${ROOTDIR}/share/salome/resources/LightApp.xml ] ; then
+           export LightAppConfig=${LightAppConfig}:${ROOTDIR}/share/salome/resources
+       fi
+       export SALOMEPATH=${SALOMEPATH}:${ROOTDIR}
+    done
+
+    PATH=${MY_PATH}:${PATH}
+    PATH=`echo ${PATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+    export PATH
+    LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+    LD_LIBRARY_PATH=`echo ${LD_LIBRARY_PATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+    export LD_LIBRARY_PATH
+    PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
+    PYTHONPATH=`echo ${PYTHONPATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+    export PYTHONPATH
+    LightAppConfig=`echo ${LightAppConfig} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+    export LightAppConfig
+    SALOMEPATH=`echo ${SALOMEPATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+    export SALOMEPATH
+
+    ###
+    # start application
+    ###
+
+    MODULES=`echo $MODULES | tr " " ","`
+    SUITApp LightApp --modules=${MODULES} "$*" &
+}
 
 ###
-# start application
+# call wrapper function (entry point)
 ###
 
-SUITApp LightApp $* &
+run_light_salome  "$@"
\ No newline at end of file
index 844a4f2c4385a9b9b131ee46c982b1b9ba5989df..b8fe099ce4b114903fc3f1eb2e3d3d300f1b2da3 100755 (executable)
@@ -1,24 +1,21 @@
 #!/bin/sh
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 CURRENT_DIR=`pwd`
index 58a10b0a3551da3120710d19504aa0f5a77a59d4..b5e1ffc538aabdbfcfd0cf3b70acaae55fba39d0 100644 (file)
@@ -1,2 +1,20 @@
-\r
+@REM Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
 %PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --gui\r
index 1fc78886f7820f64681a92c05c8fcb039526b729..dfdad322fff9a6ef6eff231ad8daa150ff8d419e 100755 (executable)
@@ -1,25 +1,26 @@
 #!/bin/bash
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Tool for updating list of .in file for the SALOME project
 # and regenerating configure script
 # Author : Marc Tajchman - CEA
@@ -41,34 +42,14 @@ fi
 cd ${CONF_DIR}
 ABS_CONF_DIR=`pwd`
 
-mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-#  check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig \
-#  ac_cxx_typename.m4 check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4
-#do
-#  rm  salome_adm/unix/config_files/${deprecated}
-#done
-
-# remove KERNEL CVS directories in subdirectory salome_adm
-#for deprecated in CVS unix/CVS unix/config_files/CVS
-#do
-#  rm -rf salome_adm/${deprecated}
-#done
-
-cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-
 # ____________________________________________________________________
 # aclocal creates the aclocal.m4 file from the standard macro and the
-# custom macro embedded in the directory salome_adm/unix/config_files
-# and KERNEL config_files directory.
+# custom macro embedded in the directory adm_local/unix/config_files
+# and KERNEL salome_adm/unix/config_files directory.
 # output:
 #   aclocal.m4
 #   autom4te.cache (directory)
-echo "====================================================== aclocal"
+echo "======================================================= aclocal"
 
 aclocal -I adm_local/unix/config_files \
         -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
@@ -79,17 +60,13 @@ aclocal -I adm_local/unix/config_files \
 # version. The files are created in the directory specified with the
 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
 # output:
-#   salome_adm/unix/config_files/config.guess
-#   salome_adm/unix/config_files/config.sub
-#   salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
+#   adm_local/unix/config_files/config.guess
+#   adm_local/unix/config_files/config.sub
+#   adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
 
 libtoolize --force --copy --automake || exit 1
 
-# ____________________________________________________________________
-# make link to KERNEL configuration files to
-#ln -sf ${KERNEL_ROOT_DIR}/salome_adm .
-
 # ____________________________________________________________________
 # autoconf creates the configure script from the file configure.ac (or
 # configure.in if configure.ac doesn't exist)
@@ -106,11 +83,11 @@ autoconf
 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
 # creates the Makefile.in files from the Makefile.am files.
 # output:
-#   salome_adm/unix/config_files/compile
-#   salome_adm/unix/config_files/depcomp
-#   salome_adm/unix/config_files/install-sh
-#   salome_adm/unix/config_files/missing
-#   salome_adm/unix/config_files/py-compile
+#   adm_local/unix/config_files/compile
+#   adm_local/unix/config_files/depcomp
+#   adm_local/unix/config_files/install-sh
+#   adm_local/unix/config_files/missing
+#   adm_local/unix/config_files/py-compile
 #   Makefile.in (from Makefile.am)
 echo "====================================================== automake"
 
index f57f7b3bf98d03cab5f0acc1a75b80d039d61886..ec17918dfcbaa00f1d73a83ec04503b721a2f2e6 100755 (executable)
@@ -1,35 +1,31 @@
 #!/bin/sh
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 rm -rf autom4te.cache aclocal.m4 configure make_config
 find . -name "*~" -print -exec rm {} \;
 find . -name "*.pyc" -print -exec rm {} \;
 #exit
 # ==================== ON SORT AVANT
 
-find bin -name Makefile.in | xargs rm -f
-find doc -name Makefile.in | xargs rm -f
-find idl -name Makefile.in | xargs rm -f
-find resources -name Makefile.in | xargs rm -f
-find salome_adm -name Makefile.in | xargs rm -f
-find src -name Makefile.in | xargs rm -f
-rm -f Makefile.in
+find . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile )
index d8f8664f27078b736ee6cee1eae8c5a370506ad7..379f5bc818f03fbca8df2e356f0243d49ff8b3a7 100644 (file)
@@ -1,38 +1,41 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # Author : Marc Tajchman (CEA)
 # Date : 28/06/2001
 # Modified by : Patrick GOLDBRONN (CEA)
 # Modified by : Marc Tajchman (CEA)
 # Modified by : Mikhail PONIKAROV (OCN) - autotools usage
 #
-AC_INIT([Salome2 Project GUI module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGUI])
-AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
+AC_INIT([Salome2 Project GUI module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeGUI])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
 
 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
 AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
 
 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
 MODULE_NAME=gui
@@ -100,9 +103,6 @@ if test "x${enable_qxGraphViewer}" != "xno" ; then
 else 
     DISABLE_QXGRAPHVIEWER="yes"
 fi
-dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
-dnl AFTER PORTING QXGARPH TO QT4 THE STRING BELOW HAVE TO BE REMOVED
-DISABLE_QXGRAPHVIEWER="yes"
 
 dnl
 dnl Initialize source and build root directories
@@ -140,6 +140,7 @@ echo
 
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
+AC_LOCAL_INSTALL
 dnl
 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
 
@@ -166,7 +167,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
 dnl full-path to the binary instead.
 case "$INSTALL" in
    *install-sh*)
-      INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
+      INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
       ;;
 esac
 
@@ -199,13 +200,14 @@ dnl
 
 AC_CXX_HAVE_SSTREAM
 
-dnl
-dnl ---------------------------------------------
-dnl testing MPICH
-dnl ---------------------------------------------
-dnl
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
 
-CHECK_MPICH
 
 echo
 echo ---------------------------------------------
@@ -226,6 +228,16 @@ echo
 
 CHECK_PYTHON
 
+echo
+echo ---------------------------------------------
+echo testing swig
+echo ---------------------------------------------
+echo
+
+AM_PATH_PYTHON(2.3)
+CHECK_SWIG
+
+
 dnl echo
 dnl echo ---------------------------------------------
 dnl echo testing java
@@ -243,18 +255,6 @@ echo
 CHECK_DISABLE_CORBA
 echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA
 
-if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
-
-echo
-echo ---------------------------------------------
-echo testing swig
-echo ---------------------------------------------
-echo
-
-AM_PATH_PYTHON(2.3)
-CHECK_SWIG
-fi
-
 echo
 echo ---------------------------------------------
 echo testing threads
@@ -476,12 +476,10 @@ if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
     echo "failed : for full configuration of GUI module necessary enable SalomeObject !"
     exit
   fi
-  dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
-  dnl AFTER PORTING QXGARPH TO QT4 THE FOLLOWING CHECK HAVE TO BE UNCOMMENTED
-  dnl if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
-  dnl   echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
-  dnl   exit
-  dnl fi
+  if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
+    echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
+    exit
+  fi
 fi
 
 echo
@@ -533,7 +531,7 @@ variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok
 omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
 else
 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
-occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
+occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok "
 fi
 
 for var in $variables
@@ -579,6 +577,13 @@ AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
 AM_CONDITIONAL(ENABLE_QXGRAPHVIEWER, [test "$DISABLE_QXGRAPHVIEWER" = no])
 AM_CONDITIONAL(ENABLE_TESTRECORDER, [test "$ENABLE_TESTRECORDER" = yes])
 
+if test "$DISABLE_PYCONSOLE" = "no" ; then
+  AC_DEFINE(SUIT_ENABLE_PYTHON)
+fi
+
+dnl Build with GUI observers feature
+AC_DEFINE(WITH_SALOMEDS_OBSERVER)
+
 echo
 echo ---------------------------------------------
 echo generating Makefiles and configure files
@@ -590,67 +595,90 @@ echo
 #  chmod +x ./bin/salome/*; \
 #])
 
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+  $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
 # This list is initiated using autoscan and must be updated manually
 # when adding a new file <filename>.in to manage. When you execute
 # autoscan, the Makefile list is generated in the output file configure.scan.
 # This could be helpfull to update de configuration.
 AC_OUTPUT([ \
-  ./salome_adm/unix/SALOMEconfig.h \
-  ./adm_local/Makefile \
-  ./adm_local/cmake_files/Makefile \
-  ./adm_local/unix/Makefile \
-  ./adm_local/unix/config_files/Makefile \
-  ./bin/VERSION \
-  ./bin/Makefile \
-  ./GUI_version.h \
-  ./doc/Makefile \
-  ./doc/salome/Makefile \
-  ./doc/salome/gui/Makefile \
-  ./doc/salome/gui/doxyfile \
-  ./doc/salome/tui/Makefile \
-  ./doc/salome/tui/doxyfile \
-  ./src/Makefile \
-  ./src/CASCatch/Makefile \
-  ./src/Qtx/Makefile \
-  ./src/Style/Makefile \
-  ./src/DDS/Makefile \
-  ./src/QDS/Makefile \
-  ./src/SUIT/Makefile \
-  ./src/STD/Makefile \
-  ./src/CAF/Makefile \
-  ./src/CAM/Makefile \
-  ./src/SUITApp/Makefile \
-  ./src/LogWindow/Makefile \
-  ./src/ObjBrowser/Makefile \
-  ./src/Prs/Makefile \
-  ./src/OBJECT/Makefile \
-  ./src/GLViewer/Makefile \
-  ./src/VTKViewer/Makefile \
-  ./src/SVTK/Makefile \
-  ./src/OCCViewer/Makefile \
-  ./src/SOCC/Makefile \
-  ./src/PyInterp/Makefile \
-  ./src/PyConsole/Makefile \
-  ./src/Plot2d/Makefile \
-  ./src/SPlot2d/Makefile \
-  ./src/SUPERVGraph/Makefile \
-  ./src/QxGraph/Makefile \
-  ./src/QxScene/Makefile \
-  ./src/LightApp/Makefile \
-  ./src/ResExporter/Makefile \
-  ./src/TOOLSGUI/Makefile \
-  ./src/Event/Makefile \
-  ./src/Session/Makefile \
-  ./src/SalomeApp/Makefile \
-  ./src/SalomeApp/Test/Makefile \
-  ./src/SALOME_SWIG/Makefile \
-  ./src/SALOME_SWIG/supervisionexample.py \
-  ./src/SALOME_SWIG/supervisiongeomexample.py \
-  ./src/SALOME_PY/Makefile \
-  ./src/SALOME_PYQT/Makefile \
-  ./src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
-  ./src/SALOME_PYQT/SalomePyQt/Makefile \
-  ./resources/Makefile \
-  ./idl/Makefile \
+  adm_local/Makefile \
+  adm_local/cmake_files/Makefile \
+  adm_local/unix/Makefile \
+  adm_local/unix/config_files/Makefile \
+  bin/VERSION \
+  bin/Makefile \
+  GUI_version.h \
+  doc/Makefile \
+  doc/salome/Makefile \
+  doc/salome/gui/Makefile \
+  doc/salome/gui/doxyfile \
+  doc/salome/gui/static/header.html \
+  doc/salome/tui/Makefile \
+  doc/salome/tui/doxyfile \
+  doc/salome/tui/static/header.html \
+  src/Makefile \
+  src/CASCatch/Makefile \
+  src/Qtx/Makefile \
+  src/Style/Makefile \
+  src/DDS/Makefile \
+  src/QDS/Makefile \
+  src/SUIT/Makefile \
+  src/STD/Makefile \
+  src/CAF/Makefile \
+  src/CAM/Makefile \
+  src/SUITApp/Makefile \
+  src/LogWindow/Makefile \
+  src/ObjBrowser/Makefile \
+  src/Prs/Makefile \
+  src/OBJECT/Makefile \
+  src/ViewerTools/Makefile \
+  src/GLViewer/Makefile \
+  src/VTKViewer/Makefile \
+  src/SVTK/Makefile \
+  src/OCCViewer/Makefile \
+  src/SOCC/Makefile \
+  src/PyInterp/Makefile \
+  src/PyConsole/Makefile \
+  src/Plot2d/Makefile \
+  src/SPlot2d/Makefile \
+  src/SUPERVGraph/Makefile \
+  src/QxGraph/Makefile \
+  src/QxScene/Makefile \
+  src/LightApp/Makefile \
+  src/ResExporter/Makefile \
+  src/TOOLSGUI/Makefile \
+  src/Event/Makefile \
+  src/OpenGLUtils/Makefile \
+  src/Session/Makefile \
+  src/SalomeApp/Makefile \
+  src/SalomeApp/Test/Makefile \
+  src/SalomeApp/pluginsdemo/Makefile \
+  src/GuiHelpers/Makefile \
+  src/TreeData/Makefile \
+  src/TreeData/Test/Makefile \
+  src/SALOME_SWIG/Makefile \
+  src/SALOME_SWIG/supervisionexample.py \
+  src/SALOME_SWIG/supervisiongeomexample.py \
+  src/SALOME_PY/Makefile \
+  src/SALOME_PYQT/Makefile \
+  src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
+  src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile \
+  src/SALOME_PYQT/SalomePyQt/Makefile \
+  src/GUI_PY/Makefile \
+  resources/Makefile \
+  idl/Makefile \
+  tools/Makefile \
+  tools/dlgfactory/Makefile \
+  tools/vtkEDFOverloads/Makefile \
   Makefile
 ])
index 7ab931dd60a489f2c969fa1c8d0974edd8393e3e..583c18bab56e0fcbf6d9ffcde984fefaa149f244 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 30/11/2001
index 7fce292871455cd8f99460d387146e3d70c0fe85..705a2675b6fae7429e7a83b0ad8f2d688264febc 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Patrick GOLDBRONN (CEA)
 # Date : 30/11/2001
index 61de9ca86ceb9b7317e457d89e1d3dadc9409e5b..9748584109814a092da8bb61a179b19a4088745b 100644 (file)
@@ -1,31 +1,35 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vasily Rusyaev (Open Cascade NN)
 #  Module : doc
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-EXTRA_DIST += images input static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/GUI
+guidoc_DATA = images/head.png
 
 usr_docs: doxyfile
        echo "Running doxygen in directory: "`pwd`; \
@@ -37,8 +41,10 @@ clean-local:
        -rm -fr GUI doxygen.bak
 
 install-data-local: usr_docs
-       $(INSTALL) -d $(DESTDIR)$(docdir)/gui
-       cp -rp GUI $(DESTDIR)$(docdir)/gui
+       if test -d GUI; then \
+       $(INSTALL) -d $(DESTDIR)$(docdir)/gui ; \
+       cp -rp GUI $(DESTDIR)$(docdir)/gui ; \
+       fi
 
 uninstall-local:
        rm -rf $(DESTDIR)$(docdir)/gui/GUI
index dd9ea65289e5171254be8cd8f0a017398bc31854..16006e338fc30a901feafa7f0126e6ffc782a686 100755 (executable)
@@ -1,28 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME      = "GUI Module Reference Manual v.@VERSION@"
+PROJECT_NAME      = "SALOME GUI User's Guide"
 OUTPUT_DIRECTORY  = GUI
 CREATE_SUBDIRS   = NO
 OUTPUT_LANGUAGE   = English
@@ -39,21 +40,31 @@ WARNINGS          = YES
 #---------------------------------------------------------------------------
 INPUT             = @srcdir@/input               
 FILE_PATTERNS     = *.doc
-IMAGE_PATH        = @srcdir@/images
+IMAGE_PATH        = @srcdir@/images @top_srcdir@/src/OCCViewer/resources \
+                    @top_srcdir@/src/VTKViewer/resources \
+                    @top_srcdir@/src/SVTK/resources \
+                    @top_srcdir@/src/Plot2d/resources \
+                    @top_srcdir@/src/GLViewer/resources \
+                    @top_srcdir@/src/QxScene/resources \
 
 #---------------------------------------------------------------------------
 #HTML related options
 #---------------------------------------------------------------------------
 GENERATE_HTML     = YES
 HTML_OUTPUT       = .
-HTML_HEADER       = @srcdir@/static/header.html
+HTML_HEADER       = @builddir@/static/header.html
 HTML_FOOTER       = @srcdir@/static/footer.html
-#HTML_STYLESHEET  = @srcdir@/static/doxygen.css
+HTML_STYLESHEET   = @srcdir@/static/doxygen.css
 TOC_EXPAND        = YES
 DISABLE_INDEX     = NO
 GENERATE_TREEVIEW = YES
 TREEVIEW_WIDTH    = 300
 
+#---------------------------------------------------------------------------
+#SORT related options
+#---------------------------------------------------------------------------
+SORT_GROUP_NAMES = NO
+
 #---------------------------------------------------------------------------
 #LaTeX related option
 #---------------------------------------------------------------------------
@@ -62,4 +73,9 @@ GENERATE_LATEX    = NO
 #---------------------------------------------------------------------------
 #RTF related options
 #---------------------------------------------------------------------------
-GENERATE_RTF      = NO
\ No newline at end of file
+GENERATE_RTF      = NO
+
+#---------------------------------------------------------------------------
+#Search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE      = NO
diff --git a/doc/salome/gui/images/batchmode.png b/doc/salome/gui/images/batchmode.png
deleted file mode 100644 (file)
index 3432946..0000000
Binary files a/doc/salome/gui/images/batchmode.png and /dev/null differ
diff --git a/doc/salome/gui/images/choicepage.png b/doc/salome/gui/images/choicepage.png
deleted file mode 100644 (file)
index 7c99728..0000000
Binary files a/doc/salome/gui/images/choicepage.png and /dev/null differ
diff --git a/doc/salome/gui/images/directorypage.png b/doc/salome/gui/images/directorypage.png
deleted file mode 100755 (executable)
index fafc989..0000000
Binary files a/doc/salome/gui/images/directorypage.png and /dev/null differ
diff --git a/doc/salome/gui/images/featureedgesprops.png b/doc/salome/gui/images/featureedgesprops.png
deleted file mode 100755 (executable)
index 4a41a1a..0000000
Binary files a/doc/salome/gui/images/featureedgesprops.png and /dev/null differ
index e7e1ef67701a8c4d4876349109d7124ecd611113..b76055e50de84accd66a294f5b00f1ea436ab0a9 100755 (executable)
Binary files a/doc/salome/gui/images/geomview-alt.png and b/doc/salome/gui/images/geomview-alt.png differ
index bbbc7a931919d52bf27c6f563daefb1ad2349237..fd6640bda76027cc00ef489ac39842148ef6d642 100755 (executable)
Binary files a/doc/salome/gui/images/icon_about.png and b/doc/salome/gui/images/icon_about.png differ
diff --git a/doc/salome/gui/images/image100.gif b/doc/salome/gui/images/image100.gif
deleted file mode 100644 (file)
index ec56cac..0000000
Binary files a/doc/salome/gui/images/image100.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image100.png b/doc/salome/gui/images/image100.png
deleted file mode 100755 (executable)
index ec56cac..0000000
Binary files a/doc/salome/gui/images/image100.png and /dev/null differ
diff --git a/doc/salome/gui/images/image102.gif b/doc/salome/gui/images/image102.gif
deleted file mode 100644 (file)
index 7880b7e..0000000
Binary files a/doc/salome/gui/images/image102.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image103.gif b/doc/salome/gui/images/image103.gif
deleted file mode 100644 (file)
index b02616f..0000000
Binary files a/doc/salome/gui/images/image103.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image103.png b/doc/salome/gui/images/image103.png
deleted file mode 100755 (executable)
index b02616f..0000000
Binary files a/doc/salome/gui/images/image103.png and /dev/null differ
diff --git a/doc/salome/gui/images/image105.gif b/doc/salome/gui/images/image105.gif
deleted file mode 100644 (file)
index 4f6173f..0000000
Binary files a/doc/salome/gui/images/image105.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image106.gif b/doc/salome/gui/images/image106.gif
deleted file mode 100644 (file)
index 0356a9a..0000000
Binary files a/doc/salome/gui/images/image106.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image106.png b/doc/salome/gui/images/image106.png
deleted file mode 100755 (executable)
index 0356a9a..0000000
Binary files a/doc/salome/gui/images/image106.png and /dev/null differ
diff --git a/doc/salome/gui/images/image108.gif b/doc/salome/gui/images/image108.gif
deleted file mode 100644 (file)
index fa8cbbc..0000000
Binary files a/doc/salome/gui/images/image108.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image108.png b/doc/salome/gui/images/image108.png
deleted file mode 100755 (executable)
index fa8cbbc..0000000
Binary files a/doc/salome/gui/images/image108.png and /dev/null differ
diff --git a/doc/salome/gui/images/image109.gif b/doc/salome/gui/images/image109.gif
deleted file mode 100644 (file)
index 5dbba46..0000000
Binary files a/doc/salome/gui/images/image109.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image157.gif b/doc/salome/gui/images/image157.gif
deleted file mode 100644 (file)
index 69fc55d..0000000
Binary files a/doc/salome/gui/images/image157.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image54.jpg b/doc/salome/gui/images/image54.jpg
deleted file mode 100755 (executable)
index a67ac4c..0000000
Binary files a/doc/salome/gui/images/image54.jpg and /dev/null differ
diff --git a/doc/salome/gui/images/image65.gif b/doc/salome/gui/images/image65.gif
deleted file mode 100755 (executable)
index fbf6a81..0000000
Binary files a/doc/salome/gui/images/image65.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image67.gif b/doc/salome/gui/images/image67.gif
deleted file mode 100755 (executable)
index 4c5d4d6..0000000
Binary files a/doc/salome/gui/images/image67.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image69.gif b/doc/salome/gui/images/image69.gif
deleted file mode 100755 (executable)
index f8ea563..0000000
Binary files a/doc/salome/gui/images/image69.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image70.gif b/doc/salome/gui/images/image70.gif
deleted file mode 100755 (executable)
index c88c53e..0000000
Binary files a/doc/salome/gui/images/image70.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image72.gif b/doc/salome/gui/images/image72.gif
deleted file mode 100755 (executable)
index 4364ce7..0000000
Binary files a/doc/salome/gui/images/image72.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image73.gif b/doc/salome/gui/images/image73.gif
deleted file mode 100755 (executable)
index 0ebcf97..0000000
Binary files a/doc/salome/gui/images/image73.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image75.gif b/doc/salome/gui/images/image75.gif
deleted file mode 100755 (executable)
index 9fdfbdc..0000000
Binary files a/doc/salome/gui/images/image75.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image77.gif b/doc/salome/gui/images/image77.gif
deleted file mode 100644 (file)
index b02616f..0000000
Binary files a/doc/salome/gui/images/image77.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image86.gif b/doc/salome/gui/images/image86.gif
deleted file mode 100644 (file)
index 441482d..0000000
Binary files a/doc/salome/gui/images/image86.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image86.png b/doc/salome/gui/images/image86.png
deleted file mode 100755 (executable)
index 441482d..0000000
Binary files a/doc/salome/gui/images/image86.png and /dev/null differ
diff --git a/doc/salome/gui/images/image88.gif b/doc/salome/gui/images/image88.gif
deleted file mode 100644 (file)
index 9466aa6..0000000
Binary files a/doc/salome/gui/images/image88.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image89.gif b/doc/salome/gui/images/image89.gif
deleted file mode 100644 (file)
index 28ec89f..0000000
Binary files a/doc/salome/gui/images/image89.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image89.png b/doc/salome/gui/images/image89.png
deleted file mode 100755 (executable)
index 28ec89f..0000000
Binary files a/doc/salome/gui/images/image89.png and /dev/null differ
diff --git a/doc/salome/gui/images/image91.gif b/doc/salome/gui/images/image91.gif
deleted file mode 100644 (file)
index 66f81e6..0000000
Binary files a/doc/salome/gui/images/image91.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image91.png b/doc/salome/gui/images/image91.png
deleted file mode 100755 (executable)
index 66f81e6..0000000
Binary files a/doc/salome/gui/images/image91.png and /dev/null differ
diff --git a/doc/salome/gui/images/image94.gif b/doc/salome/gui/images/image94.gif
deleted file mode 100755 (executable)
index 4364ce7..0000000
Binary files a/doc/salome/gui/images/image94.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image95.gif b/doc/salome/gui/images/image95.gif
deleted file mode 100644 (file)
index 88941d0..0000000
Binary files a/doc/salome/gui/images/image95.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image96.gif b/doc/salome/gui/images/image96.gif
deleted file mode 100644 (file)
index 87e001d..0000000
Binary files a/doc/salome/gui/images/image96.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image96.png b/doc/salome/gui/images/image96.png
deleted file mode 100755 (executable)
index 87e001d..0000000
Binary files a/doc/salome/gui/images/image96.png and /dev/null differ
diff --git a/doc/salome/gui/images/image97.gif b/doc/salome/gui/images/image97.gif
deleted file mode 100644 (file)
index 450dc56..0000000
Binary files a/doc/salome/gui/images/image97.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image97.png b/doc/salome/gui/images/image97.png
deleted file mode 100755 (executable)
index 450dc56..0000000
Binary files a/doc/salome/gui/images/image97.png and /dev/null differ
diff --git a/doc/salome/gui/images/image98.gif b/doc/salome/gui/images/image98.gif
deleted file mode 100644 (file)
index 87e001d..0000000
Binary files a/doc/salome/gui/images/image98.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image98.png b/doc/salome/gui/images/image98.png
deleted file mode 100755 (executable)
index 87e001d..0000000
Binary files a/doc/salome/gui/images/image98.png and /dev/null differ
diff --git a/doc/salome/gui/images/image99.gif b/doc/salome/gui/images/image99.gif
deleted file mode 100644 (file)
index ec56cac..0000000
Binary files a/doc/salome/gui/images/image99.gif and /dev/null differ
diff --git a/doc/salome/gui/images/image99.png b/doc/salome/gui/images/image99.png
deleted file mode 100755 (executable)
index ec56cac..0000000
Binary files a/doc/salome/gui/images/image99.png and /dev/null differ
index 093c667f2c6424e7cfbaefddd663d00ccacc0047..100d433e0fedfa00cc7c6cc2f0081c9959f55717 100755 (executable)
Binary files a/doc/salome/gui/images/import.png and b/doc/salome/gui/images/import.png differ
diff --git a/doc/salome/gui/images/installtypepage.png b/doc/salome/gui/images/installtypepage.png
deleted file mode 100755 (executable)
index 8359d54..0000000
Binary files a/doc/salome/gui/images/installtypepage.png and /dev/null differ
diff --git a/doc/salome/gui/images/intropage.png b/doc/salome/gui/images/intropage.png
deleted file mode 100644 (file)
index de29d06..0000000
Binary files a/doc/salome/gui/images/intropage.png and /dev/null differ
diff --git a/doc/salome/gui/images/note1.gif b/doc/salome/gui/images/note1.gif
deleted file mode 100755 (executable)
index b53e21d..0000000
Binary files a/doc/salome/gui/images/note1.gif and /dev/null differ
diff --git a/doc/salome/gui/images/occviewer_axialscale.png b/doc/salome/gui/images/occviewer_axialscale.png
deleted file mode 100644 (file)
index fa8cbbc..0000000
Binary files a/doc/salome/gui/images/occviewer_axialscale.png and /dev/null differ
index 88941d0e83b7a7cbbddee8ddbd89273a34393ff8..3d8a919923b237188d77f3eeaeeeb4ad99256846 100644 (file)
Binary files a/doc/salome/gui/images/occviewer_toolbar.png and b/doc/salome/gui/images/occviewer_toolbar.png differ
diff --git a/doc/salome/gui/images/platformpage.png b/doc/salome/gui/images/platformpage.png
deleted file mode 100755 (executable)
index cfbf60c..0000000
Binary files a/doc/salome/gui/images/platformpage.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_clone.gif b/doc/salome/gui/images/plot2d_clone.gif
deleted file mode 100644 (file)
index 441482d..0000000
Binary files a/doc/salome/gui/images/plot2d_clone.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_clone.png b/doc/salome/gui/images/plot2d_clone.png
deleted file mode 100755 (executable)
index 441482d..0000000
Binary files a/doc/salome/gui/images/plot2d_clone.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_legend.gif b/doc/salome/gui/images/plot2d_legend.gif
deleted file mode 100644 (file)
index 81c0627..0000000
Binary files a/doc/salome/gui/images/plot2d_legend.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_legend.png b/doc/salome/gui/images/plot2d_legend.png
deleted file mode 100755 (executable)
index 81c0627..0000000
Binary files a/doc/salome/gui/images/plot2d_legend.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_lines.gif b/doc/salome/gui/images/plot2d_lines.gif
deleted file mode 100644 (file)
index 9789452..0000000
Binary files a/doc/salome/gui/images/plot2d_lines.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_lines.png b/doc/salome/gui/images/plot2d_lines.png
deleted file mode 100755 (executable)
index 9789452..0000000
Binary files a/doc/salome/gui/images/plot2d_lines.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif b/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif
deleted file mode 100644 (file)
index fb62cd7..0000000
Binary files a/doc/salome/gui/images/plot2d_logarithmic_horizontal.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_horizontal.png b/doc/salome/gui/images/plot2d_logarithmic_horizontal.png
deleted file mode 100755 (executable)
index fb62cd7..0000000
Binary files a/doc/salome/gui/images/plot2d_logarithmic_horizontal.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_vertical.gif b/doc/salome/gui/images/plot2d_logarithmic_vertical.gif
deleted file mode 100644 (file)
index 825d59e..0000000
Binary files a/doc/salome/gui/images/plot2d_logarithmic_vertical.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_logarithmic_vertical.png b/doc/salome/gui/images/plot2d_logarithmic_vertical.png
deleted file mode 100755 (executable)
index 825d59e..0000000
Binary files a/doc/salome/gui/images/plot2d_logarithmic_vertical.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_points.gif b/doc/salome/gui/images/plot2d_points.gif
deleted file mode 100644 (file)
index 3cdea33..0000000
Binary files a/doc/salome/gui/images/plot2d_points.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_points.png b/doc/salome/gui/images/plot2d_points.png
deleted file mode 100755 (executable)
index 3cdea33..0000000
Binary files a/doc/salome/gui/images/plot2d_points.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_settings.gif b/doc/salome/gui/images/plot2d_settings.gif
deleted file mode 100644 (file)
index 64df246..0000000
Binary files a/doc/salome/gui/images/plot2d_settings.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_settings.png b/doc/salome/gui/images/plot2d_settings.png
deleted file mode 100755 (executable)
index 64df246..0000000
Binary files a/doc/salome/gui/images/plot2d_settings.png and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_splines.gif b/doc/salome/gui/images/plot2d_splines.gif
deleted file mode 100644 (file)
index 06a9557..0000000
Binary files a/doc/salome/gui/images/plot2d_splines.gif and /dev/null differ
diff --git a/doc/salome/gui/images/plot2d_splines.png b/doc/salome/gui/images/plot2d_splines.png
deleted file mode 100755 (executable)
index 06a9557..0000000
Binary files a/doc/salome/gui/images/plot2d_splines.png and /dev/null differ
index a9fab8866c6690e956e8cd24fbc1a98d089a4cd1..2b7ddffc78a3576d36460bd6833f0b2f08ebe41d 100644 (file)
Binary files a/doc/salome/gui/images/plot2d_view_settings.png and b/doc/salome/gui/images/plot2d_view_settings.png differ
diff --git a/doc/salome/gui/images/ppref1.png b/doc/salome/gui/images/ppref1.png
deleted file mode 100755 (executable)
index c6783b5..0000000
Binary files a/doc/salome/gui/images/ppref1.png and /dev/null differ
diff --git a/doc/salome/gui/images/ppref2.png b/doc/salome/gui/images/ppref2.png
deleted file mode 100755 (executable)
index 042a49a..0000000
Binary files a/doc/salome/gui/images/ppref2.png and /dev/null differ
diff --git a/doc/salome/gui/images/ppref3.png b/doc/salome/gui/images/ppref3.png
deleted file mode 100755 (executable)
index 8c31ab8..0000000
Binary files a/doc/salome/gui/images/ppref3.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref11.png b/doc/salome/gui/images/pref11.png
deleted file mode 100755 (executable)
index 634da53..0000000
Binary files a/doc/salome/gui/images/pref11.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref12.png b/doc/salome/gui/images/pref12.png
deleted file mode 100755 (executable)
index 6a711f3..0000000
Binary files a/doc/salome/gui/images/pref12.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref13.png b/doc/salome/gui/images/pref13.png
deleted file mode 100755 (executable)
index 56dd24a..0000000
Binary files a/doc/salome/gui/images/pref13.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref14.png b/doc/salome/gui/images/pref14.png
deleted file mode 100755 (executable)
index ec035a8..0000000
Binary files a/doc/salome/gui/images/pref14.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref15.png b/doc/salome/gui/images/pref15.png
deleted file mode 100755 (executable)
index 413a6cd..0000000
Binary files a/doc/salome/gui/images/pref15.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref21.png b/doc/salome/gui/images/pref21.png
deleted file mode 100755 (executable)
index 19e2503..0000000
Binary files a/doc/salome/gui/images/pref21.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref22.png b/doc/salome/gui/images/pref22.png
deleted file mode 100755 (executable)
index 154ad1b..0000000
Binary files a/doc/salome/gui/images/pref22.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref23.png b/doc/salome/gui/images/pref23.png
deleted file mode 100644 (file)
index 6910088..0000000
Binary files a/doc/salome/gui/images/pref23.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref24.png b/doc/salome/gui/images/pref24.png
deleted file mode 100755 (executable)
index a9b9a56..0000000
Binary files a/doc/salome/gui/images/pref24.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref31.png b/doc/salome/gui/images/pref31.png
deleted file mode 100755 (executable)
index 48c0557..0000000
Binary files a/doc/salome/gui/images/pref31.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref33.png b/doc/salome/gui/images/pref33.png
deleted file mode 100755 (executable)
index 0c92552..0000000
Binary files a/doc/salome/gui/images/pref33.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref34.png b/doc/salome/gui/images/pref34.png
deleted file mode 100755 (executable)
index 229ad9c..0000000
Binary files a/doc/salome/gui/images/pref34.png and /dev/null differ
diff --git a/doc/salome/gui/images/pref37.png b/doc/salome/gui/images/pref37.png
deleted file mode 100755 (executable)
index 0d4dd68..0000000
Binary files a/doc/salome/gui/images/pref37.png and /dev/null differ
diff --git a/doc/salome/gui/images/productpage1.png b/doc/salome/gui/images/productpage1.png
deleted file mode 100644 (file)
index 1033c0c..0000000
Binary files a/doc/salome/gui/images/productpage1.png and /dev/null differ
diff --git a/doc/salome/gui/images/productpage2.png b/doc/salome/gui/images/productpage2.png
deleted file mode 100644 (file)
index dc39f2e..0000000
Binary files a/doc/salome/gui/images/productpage2.png and /dev/null differ
diff --git a/doc/salome/gui/images/productpage3.png b/doc/salome/gui/images/productpage3.png
deleted file mode 100755 (executable)
index 7c2db8b..0000000
Binary files a/doc/salome/gui/images/productpage3.png and /dev/null differ
diff --git a/doc/salome/gui/images/productpage4.png b/doc/salome/gui/images/productpage4.png
deleted file mode 100755 (executable)
index 9f0de36..0000000
Binary files a/doc/salome/gui/images/productpage4.png and /dev/null differ
diff --git a/doc/salome/gui/images/progresspage1.png b/doc/salome/gui/images/progresspage1.png
deleted file mode 100644 (file)
index 20ac54b..0000000
Binary files a/doc/salome/gui/images/progresspage1.png and /dev/null differ
diff --git a/doc/salome/gui/images/progresspage2.png b/doc/salome/gui/images/progresspage2.png
deleted file mode 100755 (executable)
index c2aad1f..0000000
Binary files a/doc/salome/gui/images/progresspage2.png and /dev/null differ
diff --git a/doc/salome/gui/images/readmepage.png b/doc/salome/gui/images/readmepage.png
deleted file mode 100644 (file)
index 0ddd39a..0000000
Binary files a/doc/salome/gui/images/readmepage.png and /dev/null differ
diff --git a/doc/salome/gui/images/save.jpg b/doc/salome/gui/images/save.jpg
deleted file mode 100755 (executable)
index be10e0c..0000000
Binary files a/doc/salome/gui/images/save.jpg and /dev/null differ
index f6b20973dc8a868f7b44fc5f788f1987bc073afc..e50858a278ab59d02f0fdaad14a28e996e61bcd8 100755 (executable)
Binary files a/doc/salome/gui/images/studymanagement.png and b/doc/salome/gui/images/studymanagement.png differ
index e4f9f3d6e20b885f38b6cbafe7dee87b752049bc..c86d0bc041b2e12b27b999662f44ecd0ba4b7842 100755 (executable)
Binary files a/doc/salome/gui/images/studyproperties.png and b/doc/salome/gui/images/studyproperties.png differ
diff --git a/doc/salome/gui/images/urbutton.png b/doc/salome/gui/images/urbutton.png
deleted file mode 100755 (executable)
index d7c0841..0000000
Binary files a/doc/salome/gui/images/urbutton.png and /dev/null differ
diff --git a/doc/salome/gui/images/view_rotation_point.png b/doc/salome/gui/images/view_rotation_point.png
deleted file mode 100644 (file)
index fc303e3..0000000
Binary files a/doc/salome/gui/images/view_rotation_point.png and /dev/null differ
diff --git a/doc/salome/gui/input/geometry_preferences.doc b/doc/salome/gui/input/geometry_preferences.doc
deleted file mode 100644 (file)
index 8000f2f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*!
-
-\page geometry_preferences_page Geometry preferences
-
-In the \b Geometry module you can set preferences for visualisation of
-geometrical figures which can be used in later sessions with this
-module.
-
-\image html pref15.png
-
-\par
-For all color definitions click on the respective line to access to
-the \ref select_color_and_font_page "Select Color" dialog box.
-
-<ul>
-<li><b>General</b></li>
-<ul>
-<li><b>Default Display Mode</b> - allows to choose between wireframe
-or shading.</li>
-<li><b>Default Shading Color</b> - allows to select default shading
-color.</li>
-<li><b> Default Wireframe Color</b> - allows to select default
-wireframe color (to be applied to any lines not being free boundaries
-or isolated lines).</li>
-<li><b>Color of free boundaries</b> - allows to select default color for free boundaries.</li>
-<li><b>Color of edges, vectors and wires</b> - allows to select
-default color for edges, vectors and wires (isolated lines).</li>
-<li><b>Color of points</b> - allows to select default color for
-vertices.</li>
-<li><b>Color of isolines</b> - allows to select default color for
-isolines.</li>
-<li><b>Step Value for Spin Boxes</b> - allows to define the increment
-of values set in spin boxes.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Marker of Points</b></li>
-<ul>
-<li><b>Type</b> - allows to select the symbol for representation of
-points (cross, asterisk, etc.).</li>
-<li><b>Size</b> - allows to define the size of the marker from 1
-(smallest) to 7 (largest).</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
index be854bf19040a0e1f7a4c4fb0fef5a225617abd9..f86d4028bc4e454bff4dff56469896800e9782e0 100644 (file)
@@ -54,7 +54,7 @@ The SALOME platform is available in Open Source.
 integrated Python console
 </ul>
 
-\image html image65.gif
+\image html image65.png
 
 <b>What can you do in SALOME? (Some of SALOME main functions)</b>
 <ul>
@@ -68,10 +68,8 @@ integrated Python console
 </ul>
 
 From the point of view of the \subpage salome_architecture_page "Architecture", 
-Salome is composed of several modules, which provides a
-great flexibility in its structure during 
-\subpage installing_salome_page "Installation" and
-\subpage running_salome_page "Running".
+Salome is composed of several modules. 
+To run salome (with different options) refer to \subpage running_salome_page page.
 
 This part of documentation on Salome also covers 
 \subpage introduction_to_gui_page "general Salome functionalities",
diff --git a/doc/salome/gui/input/installing_salome.doc b/doc/salome/gui/input/installing_salome.doc
deleted file mode 100644 (file)
index 5a2f0bd..0000000
+++ /dev/null
@@ -1,708 +0,0 @@
-/*!
-
-\page installing_salome_page SALOME Installation Wizard Help
-
-<hr>
-<ul>
-<li>\ref installing_products "Installing products with the Installation Wizard"
-<ul>
-<li>\ref gui_mode_install "GUI mode"
-<li>\ref batch_mode_install "Batch mode"
-<li>\ref environment_files "Environment files"
-</ul>
-<li>\ref pick_up_env "Pick up the environment"
-<li>\ref modifying_xml "Modifying XML configuration file"
-<li>\ref installation_scripts "Implementing installation scripts for the new products"
-<li>\ref finish_buttons "Customizing Readme page buttons"
-</ul>
-<hr>
-\anchor installing_products 
-<h1>Installing products with the <em>Installation Wizard</em></h1>
-
-The Installation Wizard can be launched in two modes: \b GUI and \b
-batch.
-<br>The root directory of the Installation Wizard contains Python
-script \b runInstall. To run the Installation Wizard just type \b runInstall.
-in the terminal window:
-<br><br>[ python ] \b runInstall [options]
-
-Without options this script will launch the SALOME Installation
-Wizard in the default mode (GUI). \n The default installation settings
-can be overridden by using command line options. Each option has a
-short and a long notation:
-
-<b>-g / --gui</b>
-\par
-Runs the Installation Wizard in the GUI mode (this is the default
-mode).
-
-<b>-b / --batch</b>
-\par
-Runs the Installation Wizard in the terminal mode.
-
-<b>-f FILE / --file=FILE</b>
-\par
-The XML configuration file to be used by the Installation Wizard.  If
-this option is not used then the installation script tries to define
-the \e Linux version and use the corresponding XML file if it exists. For
-examle, for <em>Linux Mandrake 10.1</em>  the <b>config_Mandrake_10.1.xml</b>  file
-will be used by default. If no appropriate file is found, the file
-<b>config.xml</b> will be used. This file refers to the basic target platform 
-which is <em>Linux Mandrake 10.1</em> for SALOME 3.0 and newer. If <b>config.xml</b>
-file is not found either, a warning message box is shown (in GUI mode)
-or printed to the console (in batch mode) and the Installation Wizard 
-quits.
-
-<b>-d DIR / --target=DIR</b>
-\par
-The target directory SALOME platform is to be installed to. 
-If used, this option overrides the default target directory, given in
-the configuration XML file (usually <b>${HOME}/salome_\<version\></b>, 
-see \ref modifying_xml "here" for more details).
-
-<b>-t DIR / --tmp=DIR</b>
-\par
-The directory, which should be used for temporary files. If given,
-this option overrides the default temporary directory, given in the
-configuration xml file (usually \b /tmp, see \ref modifying_xml "here"
-for more information).
-
-<b>-a / --all-from-sources</b>
-\par
-Forces all the products to be installed from sources (including all
-SALOME modules). If this option is used, all default installation
-modes for all products are ignored.
-\n This option is helpful when the user wants to install SALOME on the
-platform which is not officially supported. In this case, the user can
-try to run the SALOME Installation Wizard with the \b -a option in order
-to build all the products from sources.
-\n<b>Note, that this is a time-consuming operation which can take
-more than 24 hours depending on the computer.</b>
-
-<b>-s / --single-directory</b>
-\par
-Install all SALOME binaries packages to one directory. <br><b>
-This option is ignored when --all-from-sources (-a) option is used.</b>
-
-<b>-h / --help</b>
-\par
-Prints help information on the Installation Wizard's use.
-
-<b>-v / --version</b>
-\par
-Prints version information (\b Note: this is the Installation Wizard's
-version number, not the number of SALOME platform version).
-
-The installation procedure supports different \em Linux platforms and
-installs various installation 3d-party prerequisite products which are
-required by SALOME platform. As it was mentioned above, the basic
-target platform for SALOME 3.0 and newer is <em>Linux Mandrake 10.1</em>.
-Use of configuration XML files gives a flexible way to modify the list
-of products to be installed by the Installation Wizard without
-changing the program source code. Just create your own XML
-configuration file and implement installation scripts for the
-prerequisite products you need and then use this XML file with the
-Installation Wizard. This can be done, for example, for some Linux
-platform which is not supported directly by the Installation
-Wizard. See \ref modifying_xml "Modifying XML configuration file" and
-\ref installation_scripts "Implementing installation scripts for the new products"
-sections for more information.
-
-<br>
-<hr>
-\anchor gui_mode_install
-<h2>GUI mode</h2>
-
-The <b>Installation Wizard</b> GUI has been developed using
-Trolltech's <b>Qt 3.0.5</b> toolkit. After launching the Installation
-Wizard in the GUI mode the wizard window is shown to the user. This
-wizard guides the user through several subsequent pages. To navigate
-between the pages use \em "Next" and \em "Back" buttons in the lower
-part of the wizard window. The \em "Cancel" button closes the wizard
-window and quits the installation procedure after the user's
-confirmation. The \em "Help" button opens an additional window to show
-help information.
-
-The first \em "Introduction" page is shown in \ref figure_1 "Figure 1". 
-Skip this page by clicking \em "Next":
-
-\anchor figure_1
-\image html intropage.png 
-\n <center><b>Figure 1:</b> "Introduction" page</center>
-
-In the second page you are proposed to select the type of the SALOME installation.<br><br>
-At this step three possible types of installation are available:
-
-1. <b><em>"Install binaries"</em></b> type:
-\par
-    - all binaries and sources of the chosen modules are installed;
-    - all binaries of the chosen prerequisites are installed.
-
-2. <b><em>"Install sources"</em></b> type:
-\par
-    - all sources of the chosen modules and prerequisites are installed without compilation.
-
-3. <b><em>"Install sources and make compilation"</em></b> type:
-\par
-    - all sources of the chosen modules and prerequisites are installed;<br>
-    - all sources are compiled.
-
-In case you select "Install sources and make compilation" installation type, then you can also check "Remove sources and temporary files after compilation" option.
-
-\anchor figure_2
-\image html installtypepage.png
-\n <center><b>Figure 1:</b> "Type Of Installation" page</center>
-
-After the installation type has been selected you click "Next" button and the Installation Wizard tries to determine the Linux platform to load the corresponding configuration file. If the user system is not defined or the current SALOME package does not support this one, the warning will appear (<em>"Install binaries"</em> and <em>"Install sources"</em> installation types only):
-
-\anchor figure_3
-\image html platformpage.png
-\n <center><b>Figure 3:</b> "Installation platform" page</center>
-
-If <em>"Install sources and make compilation"</em> installation type has been selected, the warning message will be slightly different: <em>"Your Linux platform is not supported by this SALOME package and compilation is not tested on this one".</em><br>
-There is a list of all platforms supported by SALOME, but only those supported by the current package are available for selection. in this page you need to to select the reference platform, if you wish to proceed with the present installation procedure.
-
-\b Note: this page is not displayed if the installation platform has been defined automatically.
-
-In the next page you are proposed to enter the target directory
-where the SALOME platform should be installed to. You can also click
-<em>"Browse..."</em> and choose the destination folder using the standard
-browse directory dialog box.
-\n If the necessary directory does not exist you
-are prompted to confirm directory creation. If you type a wrong
-directory path, or if you do not have write permissions 
-for the directory you use, the corresponding message box is shown.
-
-\b Note: you are strongly recommended to avoid using directory names containing spaces.</b> Otherwise you can experience some troubles with the installation.
-\n
-\anchor figure_4
-\image html directorypage.png
-\n <center><b>Figure 4:</b> "Installation directory" page</center>
-
-You can select the products to be installed in the "Choice of the products to be installed" page.
-\n In the default mode it gives you the possibility to view and select SALOME modules only. There is a hidden list of 3d-party prerequisite products. To show it, just click <em>"Show prerequisites..."</em> button.
-
-\anchor figure_5
-\image html productpage1.png
-\n <center><b>Figure 5:</b> Choice of the SALOME modules</center>
-
-In the full mode you also have the possibility to select prerequisites.
-\n The checkbox before each product indicates if this one will be installed or not (checked or unchecked). The second column shows the disk space occupied by the corresponding module. This value depends on the selected type of installation.
-\n To hide the prerequisites list - click <em>"Hide prerequisites"</em> button.
-
-\anchor figure_6
-\image html productpage2.png
-\n <center><b>Figure 6:</b> Choice of the prerequisites</center>
-
-Some products may require some other prerequisite products to be installed. So the installation procedure has a special feature to automatically mark these products in the list view. For example, to install PyQt it is necessary to have gcc, Python, Qt and Sip installed, and these products will be also turned on when you check on PyQt. GEOM module requires KERNEL, GUI modules and such prerequisites as: OpenCascade, Python, Swig, Qt, etc.
-\n
-\n The dependencies between SALOME modules are managed in the following way:
-\par
-- If one module is unchecked, all modules which depend on this one are also unchecked automatically;\n
-- If one module is checked, all modules required for this one are also checked automatically.
-
-Dependency between modules and prerequisites is realized in the following way:
-\par
--  The choices made by the user in the list of modules have a direct impact on the list of prerequisites;
-- Whenever a module is checked, all the necessary prerequisites are checked automatically with no possibility for the user to uncheck them (see \ref figure_7 "Fig. 7" below);
-- Whenever a module is unchecked, according to the remaining checked modules, the unnecessary prerequisites are unchecked automatically (see \ref figure_7 "Fig. 7" below).
-
-It is possible to check again the prerequisites, which have been automatically unchecked. In other words, it is possible to add more prerequisites than necessary.
-
-\anchor figure_7
-\image html productpage3.png
-\n <center><b>Figure 7:</b> Dependencies between modules and prerequisites</center>
-
-The <em>"Installation with GUI"</em> checkbox allows managing the installation of the graphical interface. Only modules for that 'woguimode' attribute is set to "true" value in the XML file (see \ref modifying_xml "here" for more information about customizing this installation mode) support without GUI mode and will be checked and installed with their necessary prerequisites in case of installation without GUI. And other modules are unchecked with no possibility to check them in this mode (see \ref figure_8 "Figure below").
-\n By default 'Installation with GUI' checkbox is switched on.
-
-\anchor figure_8
-\image html productpage4.png
-\n <center><b>Figure 8:</b> Installation without GUI mode</center>
-
-The box at the right side of the page displays the information about
-currently selected product: name, version and short description,
-required disk space, disk space required for temporary files and the list of
-prerequisites (this information is provided in the XML file).
-
-The <em>"Disk space required:"</em> field displays how much disk space
-on the hard drive is required for installation of selected products.
-\n\b Note: Please, take into account that the displayed amount of
-required disk space is approximate and may differ when you actually install
-products on your hard drive.
-
-The installation procedure uses a special directory to store temporary
-files. The <em>"Space for temporary files:"</em> field shows the information
-about required disk space on the hard drive for extracting and
-compiling the selected products. You can change the temporary directory (this information is provided in the XML file) to the folder you want.
-\n\b Note: Actually, temporary files are not stored directly in the
-directory entered by the user. The Installation Wizard creates in this directory an additional folder named like INSTALLWORK<b>XXXXX</b> where XXXXX is a unique number. This allows launching several Installation Wizards simultaneously. This temporary directory is removed automatically when the installation finishes.
-
-The installation procedure also checks the available disk space. If there is not enough disk space on your hard drive you will see the corresponding error message box.
-
-Also in the current version of Installation Wizard is possible to install all binaries of the selected SALOME modules into a \b single directory. It is "SALOME" directory. For this purpose there is a checkbox "Install modules to a single directory" checkbox exists (see \ref figure_8 "Fig. 8").
-\n This feature helps to get shorter PYTHONPATH and LD_LIBRARY_PATH environment variables.
-\n\b Note: the installation into a single directory is available with the binaries installation type only.
-
-To proceed further click <em>"Next"</em>. At this moment the program will make some tests to check the installation settings: if there is enough disk space on the hard drive, check for the dependencies for each product you have selected to be installed. If any test fails you will see the corresponding warning message box. Otherwise the wizard will proceed to the next page:
-
-\anchor figure_9
-\image html choicepage.png
-\n <center><b>Figure 9:</b> "Check your choice" page</center>
-
-This page summarizes the installation options you've selected in the previous pages. You can review again your choices and change them if necessary returning to the previous pages.
-\n When you are sure that everything is OK, click <em>"Next"</em> to
-follow to the \ref figure_10 "progress page".
-
-\anchor figure_10
-\image html progresspage1.png
-\n <center><b>Figure 10:</b> "Installation progress" page</center>
-
-To start the installation of the selected products click <em>"Start"</em> button. It launches the shell installation script and you will be able to see the output of the script in the topmost frame of the dialog box. If any errors occur during the installation progress, the corresponding messages will be printed to the log window in the bold red font.
-\n It is possible to break the installation at any time by pressing <em>"Stop"</em> button. Then you can get back to the previous pages if you wish to change the installation settings or restart the installation by pressing <em>"Start"</em> button again.
-
-\b Note: in the current implementation it is not possible to resume the stopped installation process; the installation will restart from the very beginning.
-
-\anchor figure_11
-\image html progresspage2.png
-\n <center><b>Figure 11:</b> "Installation progress" page: installation in progress</center>
-
-The <em>"Installation Status"</em> frame window shows you the progress of
-installation. \c "Waiting" status means that installation of this product
-has not been started yet. The product currently being installed is
-marked as \c "Processing" and is displayed in the status bar under "Installation Status" view. All installed products have \c "Completed"
-status.
-
-You can abort installation and close the installation procedure using
-\em "Cancel" button.
-
-\b Note: This button sends the signal "SIGTERM" to the shell
-script. The script tries to clear all temporary files. The process of
-removing temporary files can take some time, so the installation
-wizard will wait 3 seconds before closing.
-
-At the end of the installation <b>"Installation completed"</b> message will appear in the status bar. You can return to the previous pages to start a new installation or click \em"Next" button to go to the readme page:
-
-\anchor figure_12
-\image html readmepage.png
-\n <center><b>Figure 12:</b> "Finish installation" page</center>
-
-In this page you can read important information about the Instalation
-Wizard itself and some tips: how to run and test SALOME or how to
-build SALOME from the sources. This is the contents of the README file
-which you can find in the root directory of the Installation Wizard.
-
-You can also launch SALOME Desktop from this page or read the Release
-Notes file by clicking on the corresponding buttons in the lower part
-of the page (see \ref modifying_xml "here" and \ref finish_buttons
-"here" for more information about customizing these buttons).
-
-<br>
-<hr>
-\anchor batch_mode_install
-<h2>Batch mode</h2>
-
-To launch the Installation Wizard in the batch mode use -\b b (--\b batch)
-parameter.
-\n In this mode the GUI wizard is not shown but all the installation
-status is displayed directly in the console. In the batch mode the
-user does not have a possibility to change installation settings which
-are given in the configuration file, except target and temporary
-directories which can be overridden by the corresponding command line
-options.
-\n The only exception is --\b all-from-sources (-\b a) option which enables
-special installation mode in which all the products (including SALOME
-modules) are installed from sources, ignoring the default mode defined
-in the XML configuration file (see \ref installing_products "here" for details) and <b>--single-directory (-s)</b> option which defines that all SALOME modules have to be installed into the one directory (SALOME_<version>, by default, where <version> is SALOME version).
-
-\anchor figure_13
-\image html batchmode.png
-\n <center><b>Figure 13:</b> Batch mode</center>
-
-<br>
-<hr>
-\anchor environment_files
-<h2>Environment files</h2>
-
-During the process of installation the script creates some environment
-files to simplify the procedure of launching SALOME. These shell
-scripts set all necessary environment variables for all products you
-have installed. To learn how installation scripts collects the
-environment, see \ref pick_up_env "here". These files are: \b
-salome.csh + \b salome.sh in the <b><em>KERNEL module sources</em></b>
-and <b><em>KERNEL module binaries</em></b> root directories and
-\b env_products.csh + \b env_products.sh and \b env_build.csh + 
-\b env_build.sh in the target installation directory.
-
-\b Note: there is some difference between these files: \b env_build.*
-files are optimized to be used for building SALOME modules from
-sources (see \b README file provided with the installation procedure
-on the CD). The \b env_products.* (and \b salome.*) files are
-optimized for SALOME launching. The behavior is defined by the
-environment variable \b ENV_FOR_LAUNCH which is set to \b 0 in
-env_build.* files and to \b 1 in env_products.* (salome.*) files.
-
-<br>
-<hr>
-\anchor pick_up_env
-<h2>Pick up the <em>environment</em></h2>
-
-Please, read carefully the following information. This section
-describes how the installation procedure generates the environment
-scripts for the SALOME platform being installed.
-
-After installing each product shell the script creates a special
-environment file for the product in its installation folder. The name
-of the file is generated from the name of product by the following
-scheme: \b env_<product_name>.sh (for example \b env_Vtk.sh for the
-Vtk). This file includes all necessary environment settings. At the
-final step of the installation the script picks up all the settings
-files and generates two common environment files from them: \b salome.sh
-and \b salome.csh for \b bash and \b csh shells correspondingly.
-Such approach helps to save time when reinstalling products and you may not bother about setting all environment variables manually to build/launch
-SALOME. What you simply need is to source one of these environment
-files.
-
-This also concerns those products which are not being installed. For
-example, you install some SALOME binaries to the directory where you
-have previously installed other products.  The Installation procedure
-tries to collect environment files from the target directory if it
-finds necessary products installed there. If some product is not found
-in the target directory the corresponding section of
-\b salome.sh/salome.csh files will be skipped.
-\n For native products (like \b gcc, \b tcl, etc...) the installation
-procedure tries to find them first using \b PATH / \b LD_LIBRARY_PATH
-variables and then in the system default directories (\b /usr/bin,
-\b /usr/lib etc., depending on the product).
-<br><br>
-In any case you may edit \b salome.* files after the installation
-procedure finishes, if you want.
-
-\n\b Note: As it was mentioned \ref environment_files "above" there are
-other environment files which are generated by the installation
-procedure: \b env_products.csh + \b env_products.sh and \b env_build.csh +
-\b env_build.sh. These files can be found in the target installation root
-directory.
-
-<br>
-<hr>
-\anchor modifying_xml
-<h2>Modifying <em>XML</em> configuration <em>file</em></h2>
-
-You can create your own XML configuration file. The Installation
-Wizard can then take it as a command line argument to provide a list
-of products you want to install with it. The list of products and some
-other settings for the Installation Wizard are provided in the XML
-file.
-\n This section describes the structure of the configuration file, optional sections/tags are in brackets.
-
-\code
-<document>
-      <config [ version=<application_version>      ]
-              [ caption=<application_caption>      ]
-              [ copyright=<application_copyright>  ]
-              [ license=<application_license_info> ]
-                platforms=<target_platform>
-              [ targetdir=<target_directory>       ]
-              [ tempdir=<temp_directory>           ]
-      />
-    [ <buttons>
-      [ <button   label=<button_label>     
-                [ tooltip=<button_tooltip> ]
-                  script=<button_script>   
-                [ disable=<disable_flag>   ]
-        />
-      ]
-      [ <button ...
-        />
-      ]
-        ...
-      </buttons>
-    ]
-    [ <products>
-      [ <product  name=<product_name>
-                  type=<product_type>
-                [ description=<product_description> ]
-          <installation  os=<installation_platform>
-                         version=<product_version>
-                       [ disable=<disable_flag>            ]
-                       [ woguimode=<without_gui_mode_flag> ]
-                         installdiskspace=<install_disk_space>
-                       [ pickupenv=<pickup_env_flag>       ] 
-                         script=<installation_script_name>
-          />
-          ...
-        />
-      ]
-      [ <product ...
-        />
-      ]
-        ...
-      </products>
-    ]
-    [ <dependencies>
-      [ <product  name=<product_name> >
-        [ <dep> <prerequisite_name> </dep> ]
-          ...
-        </product>
-      ]
-        ...
-      </dependencies>
-    ]
-</document> 
-\endcode
-
-<b>\<config\> section</b>
-\n\n This is an optional section; it provides general information about the Installation Wizard itself.<br><br>
-Attributes:
-<ul>
-<li><b>version</b>
-\n\n The application version number to be shown in the caption.<br><br>
-</li>
-<li><b>caption</b>
-\n\n The application main window caption - if this string contains '\%1' text the title will contain the version number in this place (see
-above).<br><br>
-</li>
-<li><b>copyright</b>
-\n\n The application copyright information (shown in the first page).<br><br>
-</li>
-<li><b>license</b>
-\n\n The application license information (shown in the first page).<br><br>
-</li>
-<li><b>platforms</b>
-\n\n This parameter defines the directory (relative from ./Products/BINARIES) where the Installation Wizard will search
-precompiled binaries packages. If this tag is not provided, binaries
-packages are looked for in the ./Products/BINARIES directory.<br><br>
-</li>
-<li><b>targetdir</b>
-\n\n The target directory - the path to the directory where products
-should be installed.<br><br>
-</li>
-<li><b>tempdir</b>
-\n\n The temporary directory - the path to the directory for the
-temporary files.<br><br>
-</li>
-</ul>
-
-<b>\<button\> section</b>
-\n\n This is an optional section. It allows customization of the last
-"Finish installation" page of the Installation Wizard by adding one or
-more buttons in the lower part of the wizard's window. The script
-which is attached to each such button, can perform some specific
-action, for example, launch the application or show the Release Notes
-file by using an external program. See \ref finish_buttons "here" for
-more details about writing scripts.<br><br>
-Attributes:
-<ul>
-<li><b>label</b>
-\n\n This is the button text.<br><br>
-</li>
-<li><b>tooltip</b>
-\n\n The button tooltip (optional).<br><br>
-</li>
-<li><b>script</b>
-\n\n The script attached to the button.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding button
-will not appear in the "<em>Finish installation</em>" page - the section of XML
-file is silently ignored.<br><br>
-</li>
-</ul>
-
-<b>\<product\> section</b>
-\n\n This section describes product to be installed with the
-Installation Wizard. The XML file should include a \<product\> section
-for each product to be installed. The products appear in the tree view
-and are installed in the order they are described in the configuration
-file. It is recommended (but not obligatory) to define native products
-at the top of the list before all other products.
-<br><br>
-Attributes:
-<ul>
-<li><b>name</b>
-\n\n Product name.<br><br>
-</li>
-<li><b>type</b>
-\n\n The type of the product: 'component' - SALOME module or 'prerequisite' - prerequisite product.<br><br>
-</li>
-<li><b>description</b>
-\n\n Product description (optional).<br><br>
-</li>
-</ul>
-
-<b>\<installation\> section</b>
-
-It is a part of the <product> section, that provides installation information by platforms. The <product> section may contains a several <installation> ones for the different platforms. 
-<br><br>
-Attributes:
-<ul>
-<li><b>os</b>
-\n\n A possible installation platform.<br><br>
-</li>
-<li><b>version</b>
-\n\n The version of the product.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding product will not appear in the list of products and will not be installed.<br><br>
-</li>
-<li><b>woguimode</b>
-\n\n This optional flag defines that it's possible to install this module without GUI.<br><br>
-</li>
-<li><b>installdiskspace</b>
-\n\n List of three total amount spaces (integer, in Kbytes, derived by comma), which product occupies on the hard drive after the installation in case 'binary', 'sources' and 'sources and compile' installation type.<br><br>
-</li>
-<li><b>pickenv</b>
-\n\n This flag shows that the pickup environment procedure should be performed for this product. If this flag equal to 'true',  salome.sh and salome.csh files will  be created in the product's installation directory. Usually this option is set to true for SALOME KERNEL module. This is optional key, default value is 'false'.<br><br>
-</li>
-<li><b>script</b>
-\n\n The installation script name. This script is in charge of the installation of the product. It is called automatically by the Installation Wizard when necessary from the main program. See the see 
-\ref installation_scripts "next section" for more information.<br><br>
-</li>
-</ul>
-
-\n\b Note: If you add new products to be installed with Installation
-Wizard, you should also provide installation script for this
-product. See the next section for more details.
-
-<br>
-<hr>
-\anchor installation_scripts
-<h2>Implementing <em>installation scripts</em> for the new products</h2>
-
-When you want some product to be installed with the Installation
-Wizard, you should add its description \ref modifying_xml "to the configuration file"
-and create the installation script, following the rules described in this section.
-
-There are some obligatory functions which should be implemented in
-this installation script. These functions are automatically called by
-the master installation script or/and its GUI shell when it is
-necessary. \n File \b common.sh contains some service functions which can
-be used in your installation script, like \b make_env(), \b make_dir(),
-\b try_existing(), \b sort_path(), \b find_in_path(), etc.
-
-<ul>
-<li><b>check_version()</b>
-\n\n This function allows to check the version of the product already
-installed on the computer. It should try to find the product (native
-or preinstalled in the target directory) and check its version. This
-helps to avoid unnecessary reinstallation. This is an internal
-function and is not called from the master installation
-script.<br><br>
-</li>
-<li><b>install_binary()</b>
-\n\n This function is called when <em>'Install binaries'</em> installation mode is selected by the user. The function is responsible for the extracting of the product from the binaries package. It should create environment for the product in the temporary directory (see also the description of \b print_env() function). It is not necessary to implement this function if you do not provide binaries mode installation for the current product.<br><br>
-</li>
-<li><b>install_source()</b>
-This function is called to install SALOME modules sources, if <em>'Install binaries'</em> installation mode is selected by the user, and to install prerequisite products sources, in <em>'Install sources'</em> case (\ref Figure_2 "Fig. 2" above). The function is responsible for the building of the product from the sources package. It should create the environment file for the product in the temporary directory (see also the description of print_env() function). It is not necessary to implement this function if you do not provide a sources mode installation for the current product. <br><br>
-</li>
-<li><b>install_source_and_build()</b>
-This function is called when <em>'Install sources and make a compilation'</em> installation mode is selected. This function should be used to unpack SALOME or prerequisite sources package and then call build/install procedure for it.
-For more details please refer to the \ref installing_products "this"
-and \ref gui_mode_install "this" sections for more details.<br><br>
-</li>
-<li><b>try_preinstalled()</b>
-\n\n This function is called when the 'not install' installation mode
-is selected by the user. In this case the script should inspect the
-target directory to try to find an already preinstalled product, pick
-up and check the environment from there. See \ref pick_up_env "here" for more
-details.<br><br>
-</li>
-<li><b>print_env_bin() & print_env_src()</b>
-\n\n These functions are in charge of the creation of the environment scripts. They should create in the temporary directory two files with \b env_<product_name>.sh and \b env_<product_name>_src.sh names and then copy them into the binary and sources product installation directories correspondingly. The file should contain all necessary environment variable settings for the product. It will be collected during the 'pick-up-environment' procedure.<br><br>
-</li>
-<li><b>pickup_env()</b>
-\n\n This procedure corresponds to the \b pickupenv tag of the
-configuration xml file (see previous section). It should call the
-\b make_env procedure to perform the pick-up environment procedure for
-the product.<br><br>
-</li>
-</ul>
-
-The calling signature of the product installation script is the following: 
-<b>\<product_script_name\> \<function_name\> \<temp_folder\>
-\<products_directory\> \<target_directory\> \<dependancies\>
-\<product_name\></b>
-\n\n where \n\n
-<b>\<product_script_name\></b> - installation script name (described in the
-configuration xml file);\n
-<b>\<function_name\></b> - the name of function, corresponding to the selected
-installation mode: \em try_native, \em install_source, \em install_binary or
-\em try_preinstalled;\n
-<b>\<temp_folder\></b> - temporary files directory;\n
-<b>\<products_directory\></b> - directory where the sources/binaries package
-can be found. You should provide the sources package in the
-<em>\<Install_Wizard_root_directory\>/Products/SOURCES</em> directory and
-binaries package in the
-<em>\<InstallWizard_root_directory\>/Products/BINARIES/\<os_version\></em>, where
-\<os_version\> is the target platform description, which appears in the
-corresponding section of the \ref modifying_xml "configuration xml file";
-<em>\<target_directory\></em> - root target directory where the product should be installed to; 
-<em>\<dependancies\></em> - single-quoted list of prerequisite products, separated by space; 
-<em>\<product_name\></em> - product name itself.
-
-\b Example:
-\n <em>med-2.2.3.sh install_binary /tmp/work
-./Products/BINARIES/Mandrake10.1 /usr/salome 'gcc Hdf' med</em>
-
-Copy the created script into the
-<em>\<Install_Wizard_root_directory\>/config_files</em> sub-directory where all
-installation scripts are stored. Installation Wizard will
-automatically search and call your script during the installation
-procedure.
-
-<br>
-<hr>
-\anchor finish_buttons
-<h2>Customizing <em>Readme page</em> buttons</h2>
-
-The Installation Wizard allows customizing the look-n-feel of the last
-<em>"Finish installation"</em> page. If you want to add one or more buttons to
-this page in order to perform some specific actions at the end of the
-installation (for example, to show the Release Notes file by using
-Open Office) you can put an additional section to the XML
-configuration file. This is the \b \<button\> section (see 
-\ref modifying_xml "here" for more details).
-
-To implement the action which will be performed when the user clicks
-the button, you need to create a script and put it to the
-<em>\<Install_Wizard_root_directory\>/config_files</em> directory.
-\n There are some obligatory functions which should be implemented in
-this script. These functions are automatically called by the
-Installation Wizard GUI.
-
-<ul>
-<li><b>check_enabled()</b>
-\n\n This procedure is called by the Installation Wizard when the
-<em>"Finish installation"</em> page is displayed and the status of the buttons
-should be modified according to the installation options. This
-procedure should return \b 0 if the corresponding action can be performed
-and, thus, the button should become enabled. Otherwise, it should
-return \b 1 - in this case the corresponding button will be
-disabled.<br><br>
-</li>
-<li><b>execute()</b>
-\n\n This procedure is invoked when the user clicks the button. This
-procedure should return \b 0 if the corresponding action is done
-successfully and \b 1 if any error occurs.<br><br>
-</li>
-</ul>
-
-The calling signature of the script is the following:
-\n <b>\<product_script_name\> \<function_name\> \<target_directory\>
-\<temp_folder\></b>
-\n\n where \n\n
-\b \<product_script_name\> - the script name itself (retrieved from the XML configuration xml file); 
-\n \b \<function_name\> - the name of function; 
-\n \b \<target_directory\> - root target directory where the product is installed to; 
-\n \b \<temp_folder\> - temporary files directory;
-
-\n\b Note: The standard Installation Wizard buttons "Launch SALOME" and
-"Release Notes" are implemented with this feature. Refer to scripts
-\b start_salome.sh and \b release_notes.sh for sample implementation.
-
-\n\b Note: Any button (even standard) can be ignored by the Installation
-Wizard if the attribute \b \<disable\> in the XML configuration file is set
-to the "true" value.
-
-*/
\ No newline at end of file
index ddbccb03f15f0ac846fa33a03e7584da74f9a0e7..ce22412713b2305c11a18ebdb9c2f4d41e5bac39 100644 (file)
@@ -46,22 +46,22 @@ user in \subpage themes_page "Themes" dialog. </li>
 </ul>
 </li>
 
-<li>\b Tools menu gives access to: \subpage using_catalog_generator_page "Catalogue Generator", and 
-\subpage using_registry_tool_page "Registry tool"</li>
+<li>\b Tools menu gives access to: \subpage using_catalog_generator_page "Catalogue Generator", 
+\subpage using_registry_tool_page "Registry tool" and \ref using_pluginsmanager "Python plugins"</li>
 <li>\b Help menu gives access to the help on Salome modules. The
 appropriate help page can also be called from any operation dialog via
 \b Help button.</li>
 </ul>
 
 Help for the GUI module provides information about standard
-\subpage viewers_page "Salome Viewers":
-<ul>
-<li>\ref occ_3d_viewer_page "OCC 3D viewer", </li>
-<li>\ref vtk_3d_viewer_page "VTK 3D viewer" and </li>
-<li>\ref plot2d_viewer_page "Plot 2D viewer". </li>
-</ul>
+\subpage viewers_page "Salome Viewers".
+
+General application preferences are described in the \subpage setting_preferences_page "Preferences" 
+section of SALOME GUI Help.
+
 
-\subpage setting_preferences_page "Preferences" for all Salome modules
-are also described in this section of Salome GUI Help.
+\subpage using_input_widgets_page "Using input widgets" sub-section
+covers specific aspects of behavior of certain kinds of SALOME GUI
+input fields.
 
-*/
\ No newline at end of file
+*/
diff --git a/doc/salome/gui/input/mesh_preferences.doc b/doc/salome/gui/input/mesh_preferences.doc
deleted file mode 100644 (file)
index b9c68e8..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*!
-
-\page mesh_preferences_page Mesh preferences
-
-In the Mesh module you can set mesh preferences, which can be used in
-later sessions with this module.
-
-<h2>General Preferences</h2>
-
-\image html pref21.png
-
-<ul>
-<li><b>Update</b></li>
-<ul>
-<li>If you toggle <b>Automatic Update</b> checkbox, the model in your
-viewer automatically updated whenever you make changes in it.</li>
-</ul>
-<li><b>Quality Controls</b></li>
-<ul>
-<li>If you toggle <b>Display entity</b>, both faces and edges of an
-object will be displayed in the viewer by default.</li>
-<li>If you toggle <b>Use precision</b> checkbox, you can display numbers in
-<b>Quality Control</b> diagrams at the necessary level of precision.</li>
-</ul>
-<li><b>Precision</b> - can be defined by the <b>Number of digits after point</b> in
-the corresponding field. By default, numbers in <b>Quality Control</b>
-diagrams are presented as integers.</li>
-<li><b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink
-presentation mode as default.</li>
-<li><b>Mesh export</b></li>
-<ul>
-<li>If you toggle <b>Automatically create groups for MED export</b> checkbox,
-this operation will be carried out automatically.</li>
-<li>If you toggle <b>Automatic renumbering</b> checkbox, the exported
-mesh will be renumbered automatically</li>
-</ul>
-<li><b>Mesh computation</b></li>
-<ul>
-<li><b>Show a computation result notification</b> combobox allows to
-select the notification mode about a mesh computation result.
-There are 3 possible modes:</li>
-<ul>
-<li><b>Never</b> - do not show the result dialog at all;</li>
-<li><b>Errors only</b> - the result dialog will be shown if there were
-some errors during a mesh computation;</li>
-<li><b>Always</b> - show the result dialog after each mesh
-computation. This is a default mode.</li>
-</ul>
-</ul>
-
-<h2>Mesh Preferences</h2>
-
-\image html pref22.png
-
-<ul>
-<li><b>Nodes</b></li>
-<ul>
-<li><b>Color</b> -  allows to select the color of nodes. Click on the
-colored line to access to the \ref select_color_and_font_page "Select Color" 
-dialog box.</li>
-<li><b>Size</b> - allows to define the size of nodes.</li>
-</ul>
-<li><b>Elements</b></li>
-<ul>
-<li><b>Fill</b>  - allows to select the color of surface of elements
-(seen in Shading mode). Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Outline</b> - allows to select the color of borders of
-elements. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Back Face</b> - allows to select the color of interior surface
-of elements. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of lines (edges and borders of elements).</li>
-<li><b>Shrink coef.</b> - allows to define relative space of elements
-compared to gaps between them in shrink mode.</li>
-</ul>
-<li><b>Orientation of Faces</b> - allows to define the behavior of
-<b>Orientation of faces</b> functionality</li>
-<ul>
-<li> \b Color - allows to define the color of orientation vertors;</li>
-<li> \b Scale - allows to define the size of orientation vectors;</li> 
-<li> <b> 3D Vector </b> checkbox allows to choose between 2D planar
-and 3D vectors.</li>
-</ul>
-</ul>
-
-<br><h2>Selection Preferences</h2>
-
-\image html pref23.png
-
-<ul>
-<li><b>Selection</b> - performed with mouse-indexing (preselection)
-and left-clicking on an object, whose appearance changes as defined in
-the <b>Preferences</b>.</li>
-<ul>
-<li><b>Object Color</b> -  allows to select the color of mesh (edges and
-borders of meshes) of the selected entity. Click on the colored line
-to access to the \ref select_color_and_font_page "Select Color" dialog
-box.</li>
-<li><b>Element color</b> - allows to select the color of surface of selected
-elements (seen in Shading mode). Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of selected edges. </li>
-</ul>
-<li><b>Preselection</b> - performed with mouse-indexing on an object,
-whose appearance changes as defined in the <b>Preferences</b>.</li>
-<ul>
-<li><b>Highlight Color</b> -  allows to select the color of mesh (edges and
-borders of meshes) of the entity . Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of preselected edges.</li>
-</ul>
-<li><b>Precision</b> - in this menu you can set the value of precision
-used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.</li>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref24.png
-
-<ul>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in use.</li>
-<li><b>Orientation</b> - here you can choose between vertical and
-horizontal orientation of the <b>Scalar Bar</b></li>.
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars</li>
-<ul>
-<li><b>X</b>: abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y</b>: ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
index ce1ec2d55f4b229a41ca4310989a0c2609240ba2..e59aafe3febe6011f985e247cf1be91e616d9ce6 100644 (file)
 
 \page occ_3d_viewer_page OCC 3D Viewer
 
+<h2>Operations</h2>
+
 The functionalities of OCC viewer are available via its Viewer
 Toolbar. Buttons marked with small downward triangles have extended
 functionality which can be accessed by locking on them with left mouse
 button.
 
-\image html occviewer_toolbar.png "Viewer Toolbar"
+\image html occviewer_toolbar.png
+<hr>
+
+\image html occ_view_camera_dump.png
 
+<b>Dump View</b> - exports an object from the viewer in bmp, png or
+jpeg image format.
 <hr>
-\image html image77.png
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
+
+\image html occ_view_style_switch.png
+
+<b>Interaction style switch</b> - allows to switch between standard
+and "keyboard free" interaction styles. "Keyboard free" style allows
+to process all view transformations without using keyboard (only by
+mouse) and perform selection in view by pressing "S" key. By default,
+rotation in this mode is performed by left mouse button, panning - by
+middle mouse button, zooming - by left and middle mouse buttons
+pressed simultaneously.
 <hr>
 
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+\image html occ_view_zooming_style_switch.png
+
+<b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the
+current cursor position) zooming styles.
 <hr>
 
-\image html image96.png
-\n <center><b>Fit all</b> - allows to select a point to be the center of a
-scene representing all displayed objects in the visible area.</center>
+\image html occ_view_triedre.png
+
+<b>Show/Hide Trihedron</b> - shows or hides coordinate axes.
 <hr>
 
-\image html image97.png
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
+\image html occ_view_fitall.png
+
+<b>Fit all</b> - allows to select a point to be the center of a scene
+representing all displayed objects in the visible area.
+<hr>
+
+\image html occ_view_fitarea.png
+
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
 <hr>
 
-\image html image98.png
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html occ_view_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
 <hr>
 
-\image html image99.gif
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html occ_view_pan.png
+
+<b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality,
+click on this button and you'll be able to drag the scene to see its
+remote parts.
 <hr>
 
-\image html image100.png
-\n <center><b>Global panning</b> - represents all displayed objects in
-the visible area.</center>
+\image html occ_view_glpan.png
+
+<b>Global panning</b> - represents all displayed objects in the
+visible area.
 <hr>
 
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
+\image html occ_view_rotation_point.png
+
+<b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.
 
 \image html set_rotation_point_dialog1.png
 
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
+By default the rotation point is located in the Center of the bounding
+box of an object.
 
 \image html set_rotation_point_dialog2.png
 
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
+Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.
+
+- <b>Set to Origin</b> button restores the default rotation point
+  coordinates.
+
+- <b>Select Point from View</b> button allows to select the rotation
+  point in the 3D Viewer.
+
+<hr>
+
+\image html occ_view_rotate.png
+
+<b>Rotation</b> - allows to rotate the selected object using the
+mouse.
+<hr>
+
+\image html occ_view_front.png
+\image html occ_view_back.png
+\image html occ_view_top.png
+\image html occ_view_bottom.png
+\image html occ_view_left.png
+\image html occ_view_right.png
 
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
+These buttons orientate the scene strictly about coordinate axes:
+\b Front, \b Back, \b Top, \b Bottom, \b Left or \b Right side.
 <hr>
 
-\image html image89.png
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
+\image html occ_view_anticlockwise.png
+
+<b>Rotate counterclockwise</b> - rotates view 90 @htmlonly &deg; @endhtmlonly counterclockwise.
+<hr>
 
-\image html image102.gif
+\image html occ_view_clockwise.png
 
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
+<b>Rotate clockwise</b> - rotates view 90 @htmlonly &deg; @endhtmlonly clockwise.
 <hr>
 
-\image html image91.png
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
+\image html occ_view_reset.png
+
+<b>Reset</b> - restores the default position (isometric) of objects in
+the scene.
 <hr>
 
-\image html image103.png
-\n <center><b>Memorise view</b> - saves the current position of
-objects in the scene.</center>
+\image html occ_view_shoot.png
+
+<b>Memorise view</b> - saves the current position of objects in the
+scene.
 <hr>
 
-\image html image105.gif
-\n <center><b>Restore view</b> - restores the saved position of
-objects in the scene.</center>
+\image html occ_view_presets.png
+
+<b>Restore view</b> - restores the saved position of objects in the
+scene.
 <hr>
 
-\image html image86.png
-\n <center><b>Clone view</b> - opens a new duplicate scene.</center>
+\image html occ_view_clone.png
+
+<b>Clone view</b> - opens a new duplicate scene.
 <hr>
 
-\image html image106.png
-\n <center><b>Clipping</b> - allows to create cross-section views
-(clipping planes) of geometrical objects.</center>
+\image html occ_view_clipping.png
+
+<b>Clipping</b> - allows to create cross-section views (clipping
+planes) of geometrical objects.
 
 \image html clipping.png
-<ul>
-<li><b>Base point</b> - allows to define the coordinates of the base
-point for the clipping plane.</li>
-<ul>
-<li><b>Reset</b> - returns the base point to coordinate origin.</li>
-</ul>
-<li><b>Direction</b> - allows to define the orientation of the
-clipping plane.</li>
-<ul>
-<li><b>Invert</b> - allows to select which part of the object will be removed
-and which will remain after clipping.</li>
-</ul>
-<li><b>Preview</b> - allows to see the results of clipping in the
-viewer.</li>
-</ul>
-<hr>
-\image html occviewer_axialscale.png
-\n <center><b>Scaling</b> - represents objects deformed (stretched or
-stuffed) along the axes of coordinates.</center>
-
-<b>Note!</b> OCC Viewer features a special <b>Polyline Selection</b> mechanism, which allows selecting an arbitraty part of the graphic area using a polygon frame, instead of the usual selection with a rectangular frame.
-
-To produce a Polyline Selection, lock the right mouse button and draw the first side of the polygon, then change the direction by clicking  the left mouse button add draw another side, etc. The whole selection frame is drawn with the locked right mouse button. 
+
+- <b>Base point</b> - allows to define the coordinates of the base
+  point for the clipping plane.
+
+  - <b>Reset</b> - returns the base point to coordinate origin.
+
+- <b>Direction</b> - allows to define the orientation of the
+  clipping plane.
+
+  - <b>Invert</b> - allows to select which part of the object will be
+    removed and which will remain after clipping.
+
+- <b>Preview</b> - allows to see the results of clipping in the
+  viewer.
+
+<hr>
+
+\image html occ_view_scaling.png
+
+<b>Scaling</b> - represents objects deformed (stretched or stuffed)
+along the axes of coordinates.
+<hr>
+
+\image html occ_view_graduated_axes.png
+
+<b>Graduated axes</b> - allows to define axes parameters and graduate
+them.
+
+\image html graduatedaxes2.png
+
+- <b>Axis name</b> - if checked the axis name is displayed in the viewer.
+
+  - <b>Name</b> - allows to redefine the axis name.
+
+  - <b>Font</b> - allows to define the font color of the axis name.
+
+- <b>Labels</b> - if checked the labels are displayed in the viewer.
+
+  - <b>Number</b> - allows to define the number of labels.
+
+  - <b>Offset</b> - allows to define the distance between labels.
+
+  - <b>Font</b> - allows to define the font color of labels names.
+
+- <b>Tick marks</b> - if checked the tick marks are displayed in the viewer.
+
+  - <b>Length</b> - allows to define the length of tick marks.
+
+- <b>Is visible</b> - if checked the axis is displayed in the viewer.
+
+<hr>
+
+\image html occ_view_ambient.png
+
+<b>Toggle ambient light</b> - toggle "keep only ambient light" flag
+on/off.
+<hr>
+
+\image html occ_view_minimized.png
+\image html occ_view_maximized.png
+
+<b>Minimize/Maximize</b> - these buttons allow switching the current
+view area to the minimized / maximized state.
+<hr>
+
+\image html occ_view_sync.png
+
+<b>Synchronize view</b> - allows to synchronize 3d view
+parameters. This button has two states - checked and
+unchecked. Clicking on this button opens a drop-down menu listing the
+compatible 3d views. As soon as the user selects any view from the
+list, the parameters (view point, position, zoom coefficient, etc.) of
+the current view are synchronized with the selected view (static
+synchronization).
+
+In addition, when this button is in the "checked" state, the dynamic
+synchronization of the views is performed, i.e. any zoom, pan, rotate
+or other view operation done in one view is automatically applied to
+the other view.
+<hr>
+
+\anchor occ_background
+<h2>Background</h2>
+
+OCC Viewer background can be customized using the "Change background"
+popup menu command that opens the following dialog box:
+
+\image html change_background_dlg.png
+
+The following types of the background are supported:
+
+- Single color: the background is colored with the solid color
+  specified by the user in the dialog box.
+
+- Gradient background: the background is gradiently colored according
+  to two colors and the gradient type specified in the dialog box. The
+  following types of background are supported:
+
+  - Horizontal
+
+  - Vertical
+
+  - First diagonal
+
+  - Second diagonal
+
+  - First corner
+
+  - Second corner
+
+  - Third corner
+
+  - Fourth corner
+
+- Image: allows to set image as viewer background and define filling type:
+
+  - Center: the image is located at the center of the viewer backgound
+
+  - Tile: the image fills the entire viewer backgound one by one
+
+  - Stretch: the image is stretched to the entire viewer backgound.
+
+Default background for the viewer is specified via the
+\ref occ_preferences "application preferences".
+
+<h2>Polyline selection</h2>
+
+OCC Viewer features a special <b>Polyline Selection</b> mechanism,
+which allows selecting an arbitraty part of the graphic area using a
+polygon frame (rubber band), instead of the usual selection with a
+rectangular frame.
+
+To produce a Polyline Selection, lock the right mouse button and draw
+the first side of the polygon, then change the direction by clicking
+the left mouse button add draw another side, etc. The whole selection
+frame is drawn with the locked right mouse button.
    
 \image html polyselection1.png
 
index d5a53bfb3e2a94d672e5e841f2a8d34f406097f9..11640c348850618340e378c5564fdc5792f588a0 100644 (file)
 
 \page plot2d_viewer_page Plot 2D viewer
 
-\n <b>Plot 2d viewer</b> toolbar gives fast access to the following
-operations:
+The functionalities of Plot2d viewer are available via its Viewer
+Toolbar. Buttons marked with small downward triangles have extended
+functionality which can be accessed by locking on them with left mouse
+button.
 
-\image html image77.png
-<center><b>Dump View</b> - exports an object from the viewer in bmp,
-png, jpg or jpeg image format.</center>
+\image html plot2dviewer_toolbar.png
+<hr>
 
-\image html image96.png
-<center><b>Fit all</b> - scales the display to show the entire
-scene. Use this to resize the scene so that it could fit within the
-Viewer boundary.</center>
+\image html plot2d_camera_dump.png
 
-\image html image97.png
-<center><b>Fit area</b> - resizes the view to place in the visible
-area only the contents of a frame drawn with pressed left mouse
-button.</center>
+<b>Dump View</b> - exports an object from the viewer in
+bmp, png or jpeg image format.
+<hr>
 
-\image html image98.png
-<center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html plot2d_fitall.png
+<b>Fit all</b> - scales the display to show the entire scene. Use this
+to resize the scene so that it could fit within the Viewer boundary.
+<hr>
 
-\image html image99.png
-<center>\b Panning - if the represented objects are greater that the
-visible area and you don't wish to use Fit all functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html plot2d_fitarea.png
 
-\image html image100.png
-<center><b>Global panning</b> - allows to define the center of the
-scene presenting all displayed objects in the visible area.</center>
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
+<hr>
+
+\image html plot2d_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
+<hr>
+
+\image html plot2d_pan.png
+
+\b Panning - if the represented objects are greater that the visible
+area and you don't wish to use Fit all functionality, click on this
+button and you'll be able to drag the scene to see its remote parts.
+<hr>
+
+\image html plot2d_glpan.png
+
+<b>Global panning</b> - allows to define the center of the scene
+presenting all displayed objects in the visible area.
+<hr>
 
 \image html plot2d_points.png
-<center><b>Draw Points</b> - represents points on the graph.</center>
+
+<b>Draw Points</b> - switches display mode to \em Points. In
+this mode, each curve is displayed as a set of points.
+<hr>
 
 \image html plot2d_lines.png
-<center><b>Draw Lines</b> - represents lines on the graph.</center>
+
+<b>Draw Lines</b> - switches display mode to \em Lines. In this
+mode, each curve is represented as a set of plain line segments.
+<hr>
 
 \image html plot2d_splines.png
-<center><b>Draw Splines</b> - represents splines on the graph.</center>
 
-\image html plot2d_logarithmic_horizontal.png
-<center><b>Horizontal axis logarithmic</b> - changes the scaling on
-horizontal axis to logarithmic.</center>
+<b>Draw Splines</b> - switches display mode to \em Splines. In
+this mode, each curve is represented as a spline.
+<hr>
+
+\image html plot2d_lmin_normalization.png
+
+<b>Normalization to global minimum by left Y axis</b> - switches
+normalization mode to <b>Left Y Axis: Minimum normalization</b>.
+In this mode, all curves are normalized to the global minimum by the left Y axis.
+
+\image html plot2d_lmax_normalization.png
+
+<b>Normalization to global maximum by left Y axis</b> - switches
+normalization mode to <b>Left Y Axis: Maximum normalization</b>. 
+In this mode, all curves are normalized to the global maximum by the left Y axis.
+<hr>
+
+\image html plot2d_rmin_normalization.png
+
+<b>Normalization to global minimum by right Y axis</b> - switches
+normalization mode to <b>Right Y Axis: Minimum normalization</b>.
+In this mode, all curves are normalized to the global minimum by
+the right Y axis.
+
+\image html plot2d_rmax_normalization.png
+
+<b>Normalization to global maximum by right Y axis</b> - switch
+normalization mode to <b>Right Y Axis: Maximum normalization</b>.
+In this mode, all curves are normalized to the global maximum by
+the right Y axis.
+<hr>
 
-\image html plot2d_logarithmic_vertical.png
-<center><b>Vertical axis logarithmic</b> - changes the scaling on vertical
-axis to logarithmic.</center>
+\image html plot2d_linear.png
+\image html plot2d_log.png
+
+These buttons allow to switch horizontal axis scale to the linear or
+logarithmic mode.
+
+\note The logarithmic mode of the horizontal
+axis scale is allowed only if the minimum value of abscissa component
+of displayed points is greater than zero.
+
+<hr>
+
+\image html plot2d_linear_y.png
+\image html plot2d_log_y.png
+
+These buttons allow to switch vertical axis scale to the linear or
+logarithmic mode.
+
+\note The logarithmic mode of the vertical
+axis scale is allowed only if the minimum value of ordinate component
+of displayed points is greater than zero.
+
+<hr>
 
 \image html plot2d_legend.png
-<center><b>Show Legend</b> - reveals all verbal and numerical
-information on the graphs.</center>
+
+<b>Show Legend</b> - Shows / hides information about the displayed
+objects in a legend.
+<hr>
 
 \image html plot2d_settings.png
-<center>\b Settings - calls a menu, in which you can specify advanced
-settings for your Plot 2d Viewer.</center>
 
-\image html plot2d_clone.png
-<center><b>Clone view</b> - opens a new duplicate scene.</center>
+\b Settings - provides an access to the settings dialog box, that
+allows to specify advanced parameters for the Plot 2d Viewer.
 
 \anchor settings
-\n \image html plot2d_view_settings.png
+\image html plot2d_view_settings.png
+
+The options are as follows:
+
+- <b>Main title</b> the title of the XY plot. By default, it will
+  consist of the names of the tables, on the basis of which the curve
+  lines have been constructed.
+
+- <b>Curve type</b> you can select from \em Points, \em Lines or
+  \em Spline.
+
+- <b>Show legend</b> here you can define the position of the
+  description table on the XY plot (to the \em Left, to the \em Right,
+  on \em Top or on \em Bottom).
+
+- <b>Legend font</b> here you can set type, face and color for the
+  font of Legend item.
+
+- <b>Marker size</b> - size of the points (markers) forming curve lines.
+
+- <b>Background color</b> of the XY plot.
+
+- <b>Deviation marker</b> allows specifying the properties of the
+  marker, which is used for drawing deviations data.
+
+  - <b>Line width</b> line width of the marker.
+
+  - <b>Tick size</b> size of the upper and lower horizontal lines of
+    the marker.
+
+  - <b>Color</b> color of the marker.
+
+- <b>Normalization</b> allows selecting the type of
+  normalization (\em minimum or/and \em maximum) for the displayed
+  presentations of 2d curves in the view.
+
+- <b>Scale mode</b> allows selecting the type of scaling (\em Linear
+  or \em Logarithmic) for <b>X (Horizontal)</b> or <b>Y (Vertical)</b>
+  axes separately. Note that the \em Logarithmic scale can be used
+  only if the minimum value of corresponding component (abscissa or
+  ordinate) of all points displayed in the viewer is greater than
+  zero.
+
+- <b>Axis ...</b> options group allows specifying additional settings
+  for each axis separately:
+
+  - <b>Axis title</b> - an axis title.
+
+  - <b>Grid / Axes marks</b> allows defining the maximum number
+    of major and minor scale divisions for a given axis. The real
+    number of intervals fits to {1,2,5}*10^N, where N is a natural
+    number, and does not exceed the maximum.
+
+- <b>Save settings as default</b> If this check box is marked, all XY
+  plots will be displayed with these defined properties. 
+
+<hr>
+
+\anchor analytical_curve
+\image html plot2d_analytical_curve.png
+
+<b>Analytical curves</b> - provides an access to the analytical curves
+dialog box that allows to add, remove and modify analytical curves
+for the Plot 2d Viewer.
+
+\image html analytical_curves_dlg.png
 
 The options are as follows:
-<ul>
-<li><b>Main title:</b> the title of the XY plot. By default, it will
-consist of the names of the tables, on the basis of which the curve
-lines have been constructed.</li>
-<li><b>Curve type:</b> you can select from \b Points, \b Lines and \b Spline.</li>
-<li><b>Show legend:</b> here you can define the position of the
-description table on the XY plot (to the \b Left, to the \b Right, on
-\b Top or on \b Bottom).</li>
-<li><b>Marker size</b> - size of the points (markers) forming curve lines.</li>
-<li><b>Background color</b> of the XY plot.</li>
-<li><b>Scale mode:</b> here you can select the type of scaling (\b
-Linear or \b Logarithmic) along <b>X (Horizontal)</b> or <b>Y (Vertical)</b> axes.</li>
-</ul>
-
-You can define settings for each axis separately:
-<ul>
-<li>\b Horizontal or \b Vertical axis title.</li>
-<li><b>Grid/Axes marks:</b>  here you can define the maximum number of major
-and minor scale divisions for a specified axis. The real number of
-intervals fits to {1,2,5}*10^N, where N is a natural number, and
-doesn't exceed the maximum.</li>
-<li><b>Save settings as default:</b> If this check box is marked, all
-XY plots will be displayed with these defined properties.</li>
-</ul>
+
+- Curve parameters:
+
+  - <b>y(x)=</b> allows specifying a python expression, which is used to
+    calculate the coordinates of the curve points, where <b>x</b>
+    corresponds to the horizontal range, shown in plot 2D viewer.
+
+  - <b>Nb. itervals</b> allows specifying the number of the curve points.
+
+- Curve properties:
+
+  - <b>Auto assign</b> if checked, the properties 
+    (<em>Line type</em>, <em>Line width</em>, <em>Marker type</em> and
+    <em>Color</em>) are assigned to curves automatically. To define
+    the curve properties manually, uncheck this control.
+
+  - <b>Line type</b> allows to choose curve line type from \em None,
+    \em Solid, \em Dash, \em Dot, <em>Dash - Dot</em> and
+    <em>Dash - Dot - Dot</em>.
+
+  - <b>Line width</b> allows to specify line width of the curve.
+
+  - <b>Marker type</b> allows to choose curve marker type from
+    \em Circle, \em Rectangle, \em Diamond, <em>Rightward Triangle</em>,
+    <em>Leftward Triangle</em>, <em>Downward Triangle</em>,
+    <em>Upward Triangle</em>, \em Cross and <em>Diagonal Cross</em>).
+
+  - <b>Color</b> allows specifying the curve color.
+
+<hr>
+
+\image html plot2d_clone.png
+
+<b>Clone view</b> - opens a new duplicate scene.
+<hr>
+
+\image html plot2d_print.png
+
+<b>Print view</b> - prints the current view scene.
 
 */
diff --git a/doc/salome/gui/input/postpro_preferences.doc b/doc/salome/gui/input/postpro_preferences.doc
deleted file mode 100644 (file)
index 0f4c195..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/*!
-
-\page postpro_preferences_page Post-Pro Preferences
-
-In the Post-Pro module you can set preferences, default settings,
-which can be used in later sessions with this module.
-
-<h2>MED import Preferences</h2>
-
-\image html ppref1.png
-
-<ul>
-<li><b>MED files import</b></li>
-<ul>
-<li><b>Use Build Progress</b> - when this option is checked you can choose
-all other import MED options at the moment of loading of each file
-using <b>Build Progress</b> menu, otherwise the loading will be done
-according to the <b>Preferences</b> without addressing to the
-user.</li>
-<li><b>Full MED Loading</b> - when this option is checked, the MED file is
-fully loaded in the study, and no additional access to the MED file is
-needed during the session. Reversibly, when unchecked, the MED file is
-loaded on demand. This is the default behaviour in SALOME and
-recommended for big files to optimize memory usage.</li>
-<li><b>Build at once</b> - when this option is checked, you can't
-perform any operations until the MED file is fully loaded and
-processed.</li>
-<li><b>Build fields</b> - when this option is checked, the fields are
-built automatically at loading.</li>
-<li><b>Build min/max</b> - when this option is checked, minimum and
-maximum values of the time stamps are found at loading.</li>
-<li><b>Build groups</b> - when this option is checked, the groups and
-families are built automatically at loading.</li>
-<li><b>Close dialog at finish</b> - when this option is checked, the
-dialog box is closed after loading of the selected MED file. When
-unchecked, it allows loading other MED files.</li>
-</ul>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref31.png
-
-<ul>
-<li><b>Scalar Range</b></li>
-<ul>
-<li><b>Scalar Mode</b> - this feature allows refining the value to be
-inspected:</li>
-<ul>
-<li><b>Modulus:</b> value of a scalar or modulus of a vector.</li>
-<li><b>Component N:</b> Nth component of a vector, a tensor or a matrix.</li>
-</ul>
-<li><b>Logarithmic Scaling</b> - this checkbox toggles logarithmic
-scaling.</li>
-<li><b>Ranges to Use</b> - you can use either Field Range or Imposed Range.</li>
-</ul>
-<li><b>Min and Max for Imposed Range</b> - in this menu  you can set
-the limits for your Imposed Range, if you have chosen to use it.</li>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in the Scalar bar.</li>
-<li><b>Orientation</b> - here you can choose between vertical and horizontal
-orientation of the Scalar Bar.</li>
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars.</li>
-<ul>
-<li><b>X:</b> abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y:</b> ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-<li><b>Scalar bars default position</b></li>
-<ul>
-<li><b>Arrange Scalar Bars</b> - this option prevents superposition of
-scalar bars during visualisation of several fields in the same
-window. If checked, a separate scalar bar is displayed for each
-presentation.</li>
-</ul>
-</ul>
-
-<br><h2>Cut Lines Preferences</h2>
-
-\image html ppref2.png
-
-<ul>
-<li><b>CutLine Preferences</b></li>
-<ul>
-<li><b>Show preview</b> check box allows to edit the parameters of the
-presentation and simultaneously observe the preview of this
-presentation in the viewer.</li>
-<li><b>Invert all curves</b> check box allows to invert the resulting
-curves.</li>
-<li><b>Use absolute length</b> check box allows to use absolute length
-for curves.</li>
-<li><b>Generate Data Table:</b> If this check box is marked, <b>Post
-Pro</b> will automatically generate a data table on the basis of your
-Cut Lines presentation. This table will be created in the structure of
-the study.</li>
-<li><b>Generate Curves:</b> If this check box is marked, <b>Post Pro</b>  will
-automatically generate curve lines on the basis of values taken from
-the generated data table. These curves will be created in the
-structure of the study and can be visualized in a XY plot.</li>
-</ul>
-</ul>
-
-<br><h2>Sweep and Animation Preferences</h2>
-
-\image html ppref3.png
-
-
-<ul>
-<li><b>3D Cache</b> - allow to define the mode of usage
-and the size of the 3D Cache, which enables to save in RAM and quickly
-restore the states of field animation (\b Sliding functionality).</li>
-<ul>
-<li><b>Memory Mode</b> - allows to define the mode of usage
-of the 3D Cache: <b>Minimal</b> actually disables the Cache,
-<b>Limited</b> Cache size depends on the current system
-configuration.</li>
-<li><b>Memory Limit</b> - allows to define the maximum size of the 3D
-Cache</li> 
-</ul>
-
-<ul>
-<li><b>Animation preferences</b></li>
-<ul>
-<li><b>Speed</b> - allows to define the speed of the animation.</li>
-<li><b>Cycled animation</b> - allows to start a cycled animation of the presentation.</li>
-<li><b>Use proportional timing</b> - allows to render the animation with proportional periods of time between every frame (not depending on the time stamps).</li>
-<li><b>Clean memory at each frame</b> - this option allows to optimize the performance of the operation.</li>
-</ul>
-
-<li><b>Sweeping preferences</b></li>
-<ul>
-<li><b>Mode of the Sweeping</b> - allows to choose between Linear,
-Cosinusoidal and sinusoidal sweeping.</li>
-<li><b>Time step</b> - in this menu you can set the time of
-representation of one step.</li>
-<li><b>Number of cycles</b> - in this menu you can define the number
-of times this animation will be repeated.</li>
-<li><b>Number of steps</b> - in this menu you can define the number of
-steps, which will compose the whole animation.</li>
-<li><b>Parameter varies</b> - allows to choose the range for the
-parameter: from 0 to Pi or from Pi to -Pi.</li>  
-</ul>
-</ul>
-
-<br><h2>Representation Preferences</h2>
-
-\image html pref33.png
-
-<ul>
-<li><b>Representation properties</b> - these checkboxes allow to
-choose the default representation type for each field presentation.</li>
-<ul>
-<li><b>Use Shading</b> - when this option is checked, the objects will
-be displayed with shading.</li>
-<li><b>Display only on creation</b> - when this option is checked, all
-previously created presentations will be automatically removed from
-the viewer when a new presentation is created and displayed. You can
-restore the previously created presentations using the Object
-Browser.</li>
-</ul>
-</ul>
-
-<br><h2>Feature Edges</h2>
-
-\image html featureedgesprops.png
-
-These properties define which contours should be highlighted with
-<b>Feature Edges</b> functionality. 
-<ul>
-<li><b>Feature edges angle</b> - allows to define at which minimum
-angle between two faces a wire is considered an edge </li> 
-<li><b>Show feature edges</b> - allows to display feature edges.</li>
-<li><b>Show boundary edges</b> - allows to display boundary edges.</li>
-<li><b>Show manifold edges</b> - allows to display manifold edges. </li>
-<li><b>Show non-manifold edges</b> - allows to display non-manifold edges.</li>
-</ul>
-  
-
-<br><h2>Gauss Points Preferences</h2>
-
-\image html pref34.png
-
-<ul>
-<li><b>Primitive</b> - this menu allows user to choose the graphic
-primitive to use to present the results at Gauss points in the
-viewer.</li>
-<ul>
-<li><b>Primitive type</b> - provides choice between <b>Point
-sprites</b>, <b>Open GL points</b> and <b>Geometrical Spheres</b>.</li>
-<li><b>Maximum Size (Clamp)</b> - defines the maximum size of sprite
-points ranging from 1 to 512. By default the value is set to 256
-pixels.</li>
-<li><b>Main Texture</b> -  path to the <b>Main Texture</b> (16x16
-pixels) which defines the shape of the point sprite used for
-rendering.</li>
-<li><b>Alpha Channel Texture (16*16)</b> - path to the <b>Alpha
-Channel Texture</b> which defines the texture of the point
-sprite.</li>
-<li><b>Alpha Channel Threshold</b> - defines the level of transparency
-ranging from 0 to 1.</li>
-<li><b>Geometrical Sphere Resolution</b> - defines the number of faces
-of <b>Geometry Spheres</b>.</li>
-<li><b>Notify when number of faces exceeds</b> - limitation of the
-number of faces; the user will be warned if it exceeds the given
-value.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Size</b> - in this menu you can define:</li>
-<ul>
-<li><b>Range value for min and max size</b> - these two parameters
-will be respectively multiplied by a reference length (average size of
-cells of the mesh) to define the range for minimum and maximum size of
-a point during rendering (at magnification = 100%). Default values
-are:</li>
-<ul>
-<li><b>Rainbow</b> scale: <b>min</b> = <b>10%</b>, <b>max</b> =
-<b>33%</b></li>
-<ul>
-<li>Min size is associated to the smallest real value (including
-negative values).</li>
-<li>Max size is associated to the largest real value.</li>
-</ul>
-<li><b>Bicolor</b> scale: <b>min</b> = <b>0</b> (not editable),
-<b>max</b> = <b>33%</b></li>
-<ul>
-<li>Null size is associated to the 0 scalar value.</li>
-<li>Max size is associated to the largest absolute value.</li>
-</ul>
-</ul>
-Both values are dynamically updated by the system according to the
-selected scalar bar. In the case of a Bicolor scale, the minimum value
-is set to 0 in the dialog and the control is disabled.
-<li><b>Magnification (%)</b> corresponds to the change of size of
-results at Gauss point primitives in 2D space. Acceptable values range
-from 0 to N; 100% means no magnification, 50% means half of its size,
-200% mean twice its size and so forth. By default this value is set to
-100%.</li>
-<li><b>+/- Ratio</b> corresponds to the number by which the
-magnification will be respectively multiplied or divided at edition,
-ranging from 0.01 to 10. By default this value is set to 2.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Geometry</b></li>
-<ul>
-<li><b>Size of points (%)</b> defines a value that will be multiplied
-by a reference length (representative of the average size of cells of
-the mesh) to define the size of points during rendering (at
-magnification = 100%). Default values 10%.</li>
-<li><b>Color</b> -  allows to select the color of points used for
-presentations. Click on the colored line to access to the \ref
-select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Gauss Points Scalar Bar</b></li>
-<ul>
-<li><b>Active Bar</b> - this option allows to choose <b>Local</b> or
-<b>Global</b> Bar as active.</li>
-<li><b>Display Global Bar</b> - this option allows to visualize or to
-hide the Global Bar.</li>
-<li><b>Scalar Bar Mode</b> - this option allows to choose between
-<b>Bicolor</b> and <b>Rainbow</b> Scalar Bar Mode.</li>
-<li><b>Spacing</b> - allows to define Spacing from 0.01 to 1.</li>
-</ul>
-</ul>
-
-<ul>
-<b>Spacemouse</b>
-<ul>
-<li><b>Decrease Gauss Points Magnification </b> - divides the current
-magnification by magnification ratio. </li>
-<li><b>Increase Gauss Points Magnification </b> - multiplies the
-current magnification by magnification ratio. </li>
-</ulul>
-</ul>
-
-<br><br><b>Inside<b> and </b>Outside Cursor Preferences</b> allow to set
-<b>Primitives</b>, <b>Size</b> and <b>Magnification</b> for the
-respective zones.
-
-<br><h2>Picking Preferences</h2>
-
-\image html pref37.png
-
-<ul>
-<li><b>Cursor</b> - allows to adjust the Size of the cursor used for
-Picking (ranging from 0.1 to 1), the Height of the pyramids (ranging
-from 0 to 10) and the Selection cursor color.</li>
-<li><b>Tolerance</b> - defines at which distance of the cursor from
-the point it becomes selected (ranges from 0.001 to 10).</li>
-<li><b>Information window</b> - allows to define the
-<b>Transparency</b> (from 0% = opaque to 100% = transparent) and
-<b>Position</b> of the window, which can be:</li>
-<ul>
-<li><b>Centred below the point</b>, or</li>
-<li>located at <b>Top-left corner of the 3D view</b></li>
-</ul>
-<li><b>Movement of the Camera</b> can also be define by the user.</li>
-<ul>
-<li><b>Zoom at first selected point</b> - This value is used to define
-the focal distance at the first selected point (at the end of the
-movement of the camera). This value is a ratio that will be multiplied
-by the current zoom value.</li>
-<li><b>Number of steps between two positions</b> - defines the
-smoothness of camera movement at selection by the number of
-iterations. If set to 1 the camera is zoomed and centered at the point
-momentarily. Greater numbers mean very slow camera movement.</li>
-</ul>
-<li><b>Display parent mesh element</b> - allows to visualize or hide
-the patent mesh element of the selected gauss point.</li>
-</ul>
-</ul>
-
-*/
index d1f637b7b091f5134d07d6d326f860a3a763c6e9..f12d0e580f253439bc88ada9053385f26cf69223 100644 (file)
@@ -12,7 +12,7 @@ specification of physical properties for a given domain. The
 originality of this approach is that the various components must
 cooperate dynamically and be configurable.
 
-\image html image54.jpg
+\image html image54.png
 
 <br>SALOME platform integrates a number of modules each having its own function:
 <ul>
@@ -53,7 +53,7 @@ the Study) to the specific data created and stored in the
 component. All components represent \b CORBA servers and it allows to
 run them on different host stations.
 
-\image html image67.gif
+\image html image67.png
 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 It is equally possible to create engine-independent modules. These
index 5890eae4330897a72f5e864fe592940aa4278621..f6361c6206a82c78d5219d68eae77f2bc447b70b 100644 (file)
@@ -103,6 +103,7 @@ direction.</li>
 them.</li>
 <li>\b Rename - allows to rename the currently selected viewer
 window. </li>
+</ul>
 
 
 
diff --git a/doc/salome/gui/input/salome_preferences.doc b/doc/salome/gui/input/salome_preferences.doc
deleted file mode 100644 (file)
index 9673fa9..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*!
-
-\page salome_preferences_page SALOME preferences
-
-To begin setting preferences for your study, select \b Preferences in the
-main menu, the following dialog box will appear:
-
-\image html pref11.png
-If you've just started your study and haven't yet loaded other
-modules, you'll be able to change only those settings, which refer to
-the whole GUI SALOME session. These settings will be valid for the
-whole study session.
-
-<h2>General Preferences</h2>
-
-<ul>
-<li><b>Study Properties</b></li>
-<ul>
-<li><b>MultiFile Save</b> - if checked in, your study will be saved in
-several HDF files (one basic HDF file which will store the main
-information about the saved study and several other files for the data created by each component
-used during the study session). Opening of this study
-requires that \b ALL saved files should be stored in the \b SAME directory.
-If you would like to copy your saved study in another directory or
-machine, you should copy all stored files. Otherwise, if you try to
-open this study, some data will be lost and it will lead to invalid
-functioning of the SALOME platform.</li>
-<li><b>ASCII Save</b> - if checked in, your study will be saved in
-ASCII format file (or files).</li>
-<li><b>Store positions of windows</b> -  if checked in, positions of windows
-will be saved in a special file at the end of the current session and
-then restored for a new session.</li>
-<li><b>Store/restore last GUI state</b> - if checked in, all GUI settings are
-saved with the rest of the data whenever you save the study. When the
-study is reopened, the GUI state is restored.</li>
-</ul>
-<li><b>External browser</b></li>
-<ul>
-<li>\b Application - this option allows you to set an external browser (IE,
-Netscape) which will be used for viewing SALOME reference manuals. By
-default, Mozilla is used. Press the &quot;<b>...</b>&quot; button(see
-the picture below) to browse for the application you need in the data
-tree of your computer.</li>
-<li>\b Parameters</li>
-</ul>
-<li><b>Python console properties</b> - here you can quickly set the
-parameters (style, size, face) of the font used in your Python
-console.</li>
-<li><b>Show MRU items</b> - allows to define the maximum \b Number of
-items in <b>Most Recently Used</b> list and the <b>Link type</b>: 
-<ul>
-<li>\b Long - shows the full path to the file. </li>
-<li>\b Short - shows the file name only. </li>
-<li>\b Auto - shows full paths to the files only if some files from
-different locations have the same name. </li>
-</ul>
-</li>  
-</ul>
-\par
-For detailed settings in \ref select_color_and_font_page "Select Font"
-dialog box press the &quot;<b>...</b>&quot; button(see the picture below).
-
-\image html image69.gif "&quot;...&quot; button"
-
-<br><h2>Viewers Preferences</h2>
-
-\image html pref12.png
-
-<ul>
-<li><b>OCC and VTK 3D Viewers</b></li>
-<ul>
-<li><b>Trihedron size</b> - this submenu allows to set the size of
-coordinate axes displayed in the viewer.</li>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Number of isolines along U</b> (or <b>V</b>) - this submenu allows to specify
-the number of isolines along the axes of coordinates.</li>
-<li><b>Relative size</b> - if checked in, trihedron axes scale to fit the
-size of the area displayed in 3D Viewer.</li>
-<li><b>Projection mode</b> - allows choosing between \b Orthogonal and
-\b Perspective projection mode. </b>
-<li><b>Navigation mode</b> - this option allows to choose one of the
-modes of work with mouse in VTK viewer.</li>
-<ul>
-<li><b>Salome Standard Controls</b> - allows to manipulate objects in the
-viewer with the mouse and locked Ctrl button: increase or decrease the
-zoom ratio with the left mouse button, translate object in any
-direction with the central mouse button or rotate it with the right
-mouse button.</li>
-<li><b>Keyboard Free</b> - allows to manipulate objects in the viewer
-with the mouse without locking Ctrl button. In this case the
-operations are assigned to the buttons differently: rotation is made
-with the left button, translation with the right and zoom with both
-pressed in the same time.</li>
-</ul>
-<li><b>[+]/[-] Speed Increment</b> - defines the number of units by
-which the speed increases or respectively decreases after pressing [+]
-or [-] keyboard buttons.</li>
-<li><b>Modification Mode</b> - allows choosing between \b Arithmetic
-and \b Geometrical progression used for zooming</li> 
-</ul>
-<li><b>Spacemouse</b> - a mouse-like manipulator device specially designed
-for working with 3D presentations, objects, etc. You can reassign the
-actions listed below to any of its buttons.</li>
-<ul>
-<li><b>Decrease Speed Increment</b> - decreases by 1 the speed increment used for the keyboard (same as [-] key).</li>
-<li><b>Increase Speed Increment</b> - increase by 1 the speed increment used for the keyboard (same as [+] key).</li>
-<li><b>Dominant / combined switch</b> - toggles button to switch to dominant or combined movements.</li>
-</ul>
-<li><b>AVI Recording</b></li>
-<ul>
-<li><b>Mode</b> - allows to choose from two recording regimes:</li>
-<ul>
-<li><b>Recording all displayed frames</b> - records exactly at the FPS rate specified by the user.</li>
-<li><b>Recording at a given FPS</b> - records only when the contents
-of the viewer change (some activity is performed).  In the AVI file
-non-recorded images are substituted with the copies of the latest
-recorded image, which produces files with lower quality but requires
-less system resources.   </li>
-</ul>
-<li><b>FPS</b> - allows to define the FPS (frames per second) rate for
-the clip. Set greater value for better quality.</li>
-<li><b>Quality</b> - allows to set the quality of the clip in the
-interval between 0 and 100.</li>
-<li><b>Progressive</b> - allows to record a progressive API
-file.</li>
-</ul>
-
-<br>
-<li><b>Plot2d Viewer</b></li>
-<ul>
-<li><b>Legend Position</b> - this submenu allows to set the default position
-of the legend, it can be located to the left, to the right, on top or
-on bottom of the graph.</li>
-<li><b>Curve Type</b> - this allows to set the representation of graphs in
-your presentations. You can see only <b>Points</b>, points connected with
-<b>Lines</b> or points connected with smooth <b>Splines</b>.</li>
-<li><b>Marker Size</b> - this submenu allows you to set the size of
-markers in your graphs</li>
-<li><b>Horizontal & Vertical Axis Scale</b> - this submenu allows you to set
-the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
-<b>Logarithmic</b></li>
-<li>Background Color - this submenu allows to select the background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-<br>
-<li><b>Graph Supervisor</b></li>
-<ul>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Title Color</b> - this submenu allows to select title color. Click on
-the colored line to access to the 
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<br><h2>Directories Preferences</h2>
-
-\image html pref13.png
-
-<ul>
-<li>
-<b>Quick Directory List</b> - this section allows to create and manage
-a custom quick directory list. To add a directory in the list, press
-the "Add directory" button:
-\image html image70.gif
-
-then the &quot;<b>...</b>&quot; button and browse the data tree for the
-directory you need.
-The "Up" and "Down" buttons(see the picture below) help you to sort
-the directories in the list:
-\image html image73.gif
-
-\image html image75.gif
-To remove the selected directory from the list, press the "Delete"
-button:
-\image html image72.png
-</li>
-</ul>
-
-<br><h2>Object Browser Preferences</h2>
-
-\image html pref14.png
-
-<ul>
-<li><b>Enable auto-hiding</b> checkbox - hides the 
-\ref using_find_tool_page if nor used</li>
-<li><b>Object browser settings</b></li>
-<ul>
-<li><b>Auto size for the first column</b> - this checkbox enables automatic
-resizing for the first column.</li>
-<li><b>Auto size for other columns</b> - this checkbox enables
-automatic resizing for the other columns.</li>
-<li><b>Resize columns after expanding an item</b> - this checkbox enables
-resizing columns on expanding an object browser item.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
-<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.</li>
-</ul>
-
-*/
\ No newline at end of file
index 96b570a991712fc673754cbdf42f0f86b69a6dfa..4e6e6258e90bff7d0a605e0921e311176ebb444d 100644 (file)
@@ -2,6 +2,7 @@
 
 \page select_color_and_font_page Select Color and Font
 
+\anchor select_color_dlg
 <b>Select Color</b> and <b>Select Font</b> menus are used in many
 Preferences.
 
@@ -17,6 +18,7 @@ colors or by typing in its numeric parameters in the lower right
 corner of the window, then click <b>Add to Custom Colors</b> button. The
 chosen color will be added to <b>Custom Colors</b> table.
 
+\anchor font_color_dlg
 <br><h2>Select font</h2>
 
 \image html selectfont.png
@@ -27,4 +29,4 @@ preview them in the \b Sample window. \b Script dialog-box gives the
 possibility to use not only Latin and Latin Extended but also
 Cyrillic, Greek, Arabic, Runic and many other subsets.
 
-*/
\ No newline at end of file
+*/
index 33608f4d2c6ec37d24840ab7fe442b5adf9bc946..c85fc8e29818a22d39aa5822b8933e1b4f749ed3 100644 (file)
 
 \page setting_preferences_page Setting Preferences
 
-In \b SALOME you can set preferences for each module in the common editor
-of preferences. \subpage salome_preferences_page "SALOME preferences" refer to the whole GUI SALOME
-session, other preferences are module-specific and are accessible only
-after you load a respective module.
-It is possible to set preferences for 
-\subpage geometry_preferences_page "Geometry", 
-\subpage mesh_preferences_page "Mesh" and
-\subpage postpro_preferences_page "Post-Pro" modules. 
+All user preferences of \b SALOME application can be customized using the
+common \b Preferences dialog box. This dialog can be open using the
+<b><i>File > Preferences...</i></b> menu item.
+
+The \b Preferences dialog box consists of two parts:
+- Available preferences sections are listed in the left part of the dialog
+box; usually this list contains "SALOME" item that specifies general
+application preferences and a separate section for each SALOME module
+available in the current session.
+- The tabbed widget at the right side of the dialog box provides
+controls that can be used to customize the preferences.
+
+\note The preferences for modules become accessible only after
+explicit loading of these modules. Until then the dialog box will
+show the corresponding warning message. 
+
+More detailed information about preferences for certain modules can be found in the User's guide of the corresponding module.
+
+General application preferences are specified in the \b SALOME section
+of the \b Preferences dialog box. These preferences affect on the
+application look-n-feel and common functionality.
+
+If the study has just been started and other
+modules have not been loaded yet, it will be possible to change only the settings which refer to
+the whole GUI SALOME session. 
+
+<h2>General Preferences</h2>
+
+\image html pref_salome_general.png
+
+- <b>Language</b>
+  - <b>Current language</b> - the language used by the application
+  GUI. The language change will come in force only after the application is restarted.
+- <b>Look and feel</b>
+  - <b>Opaque resize</b> - force opaque resize mode for viewers area (tabbed workspace).
+  Clear this checkbox for less perfomant workstations.
+  - <b>Drop-down buttons in toolbars for action groups</b> - when
+  checked, the action groups are represented in the viewer toolbars as
+  a single drop-down button, switchable by the user. Otherwise, all
+  the buttons from the action groups are displayed in the toolbar. 
+- <b>Study Properties</b>
+  - <b>Multi file save</b> - if checked in, your study will be saved in
+    several HDF files (one basic HDF file which will store the main
+    information about the saved study and several other files for the
+    data created by each component used during the study
+    session). Opening of this study requires that \b ALL saved files
+    should be stored in the \b SAME directory. If you would like to
+    copy your saved study in another directory or machine, you should
+    copy all stored files. Otherwise, if you try to open this study,
+    some data will be lost and it will lead to invalid functioning of
+    the SALOME platform. 
+  - <b>ASCII save</b> - if checked in, your study will be saved in
+    ASCII format file (or files).
+  - <b>Store positions of windows</b> -  if checked in, positions of windows
+    will be saved in a special file at the end of the current session and
+    then restored for a new session.
+  - <b>Auto-save interval (min)</b> - allows to specify the time interval (in
+    minutes) for automatic study saving operation. If the time interval is
+    equal to 0 ("Disabled" value is shown) the automatic saving is not performed.
+  - <b>Store/restore last GUI state</b> - if checked in, all GUI settings are
+    saved with the rest of the data whenever you save the study. When the
+    study is reopened, the GUI state is restored.
+  - <b>Multi file python dump</b> - allows to generate multiple files
+    (separately for each component) for dumping of a study to a python script.
+    If the option is disabled, the study is dumped to a single python script.
+  - <b>Publish in study in python dump</b> - if this option is switched on,
+    the Python script resulting from Dump Python operation will
+    include commands related to the publication of the data in the
+    study (if this option is supported by specific module).
+  - <b>Save GUI state in python dump</b> - if this option is switched on,
+    the Python script resulting from Dump Python operation will
+    include commands related to the GUI state.
+- <b>External browser</b> - allow to define what browser will 
+    be used to show SALOME reference manuals: internal (built-in
+    SALOME browser) or external (IE, Netscape, Mozilla, ...). In
+    addition, it is possible to specify 
+    - \b Application - this option allows you to set an external browser (IE,
+    Netscape) which will be used for viewing SALOME reference manuals. By
+    default, Mozilla is used.
+    - \b Parameters - additional parameters required for launching of
+    the external browser (if applicable).
+- <b>Python console</b> - here you can quickly set the parameters
+  (style, size, face) of the \ref font_color_dlg "font" used in
+  embedded Python console. 
+- <b>Show MRU items</b> - allows to define the maximum \b Number of
+items in <b>Most Recently Used</b> list and the <b>Link type</b>: 
+  - \b Long - shows the full path to the file. 
+  - \b Short - shows the file name only.
+  - \b Auto - shows full paths to the files only if some files from
+different locations have the same name.
+
+\anchor occ_preferences
+<h2>OCC 3D Viewer Preferences</h2>
+
+\image html pref_salome_occviewer.png
+
+- <b>Trihedron</b> - viewer trihedron settings:
+  - <b>Size</b> - size of the coordinate axes (global trihedron)
+    displayed in the viewer.
+  - <b>Relative size</b> - if this option is switched on, trihedron
+    axes scale to fit the size of the scene displayed in 3D viewer.
+  - <b>Show static trihedron</b> - allows to show/hide the static
+    mini-trihedron located in the bottom-left corner of the viewer.
+- <b>Number of isolines</b> - this submenu allows to specify the
+  number of isolines along the axes of coordinates:
+  - <b>Along U</b> and
+  - <b>Along V</b>
+- <b>Background</b> - specifies the default background for the viewers,
+  separately for (for more details, refer to the \ref occ_background
+  "this page"):
+  - <b>3D View</b>
+  - <b>XZ View</b>
+  - <b>YZ View</b>
+  - <b>XY View</b>
+- <b>Navigation style</b> - this option allows to choose one of the
+  modes of work with mouse in OCC and VTK 3D viewers.
+  - <b>Salome Standard Controls</b> - allows to manipulate objects in the
+  viewer with the mouse and locked Ctrl button: increase or decrease the
+  zoom ratio with the left mouse button, translate object in any
+  direction with the central mouse button or rotate it with the right
+  mouse button.
+  - <b>Keyboard Free</b> - allows to manipulate objects in the viewer
+  with the mouse without locking Ctrl button. In this case the
+  operations are assigned to the buttons differently: rotation is made
+  with the left button, translation with the right and zoom with both
+  pressed in the same time.
+- <b>Zooming style</b> - this option allows to choose a zooming mode.
+  - <b>Relative to the view's center</b> - allows to zoom the view 
+  relatively to its center.
+  - <b>Relative to the cursor</b> - allows to zoom the view
+  relatively to the current cursor position.
+
+\anchor vtk_preferences
+<h2>VTK 3D Viewer Preferences</h2>
+
+\image html pref_salome_vtkviewer.png
+
+- <b>Projection mode</b> - allows choosing between \b Orthogonal and
+\b Perspective projection mode.
+- <b>Background</b> - specifies the default background for the viewer;
+  for more details, refer to the \ref vtk_background "this page".
+- <b>Navigation style</b> - this option allows to choose one of the
+  modes of work with mouse in OCC and VTK 3D viewers (for more details
+  see \ref occ_preferences "preferences for OCC Viewer 3d").
+- <b>Zooming style</b> - this option allows to choose a zooming mode
+  (for more details see \ref occ_preferences "preferences for OCC Viewer 3d").
+- <b>Speed Increment</b> - defines the number of units by
+  which the speed increases or respectively decreases after pressing [+]
+  or [-] keyboard buttons.
+- <b>Modification Mode</b> - allows choosing between \b Arithmetic
+  and \b Geometrical progression used for zooming.
+- <b>Dynamic pre-selection</b> - switches dynamic pre-selection on/off.
+- <b>Trihedron</b> - viewer trihedron settings:
+  - <b>Size</b> - size of the coordinate axes displayed in the viewer.
+  - <b>Relative size</b> - if this option is switched on, trihedron
+    axes scale to fit the size of the scene displayed in 3D viewer.
+  - <b>Show static trihedron</b> - allows to show/hide the static
+    mini-trihedron located in the bottom-left corner of the viewer.
+- <b>Spacemouse</b> - a mouse-like manipulator device specially designed
+  for working with 3D presentations, objects, etc. You can reassign the
+  actions listed below to any of its buttons.
+  - <b>Decrease Speed Increment</b> - decreases by 1 the speed
+  increment used for the keyboard (same as [-] key).
+  - <b>Increase Speed Increment</b> - increase by 1 the speed
+  increment used for the keyboard (same as [+] key).
+  - <b>Dominant / combined switch</b> - toggles button to switch to
+  dominant or combined movements. 
+- <b>AVI Recording</b>
+  - <b>Mode</b> - allows to choose from two recording regimes:
+    - <b>Recording all displayed frames</b> - records exactly at the
+    FPS rate specified by the user. 
+    - <b>Recording at a given FPS</b> - records only when the contents
+    of the viewer change (some activity is performed).  In the AVI file
+    non-recorded images are substituted with the copies of the latest
+    recorded image, which produces files with lower quality but requires
+    less system resources.
+  - <b>FPS</b> - allows to define the FPS (frames per second) rate for
+  the clip. Set greater value for better quality.
+  - <b>Quality</b> - allows to set the quality of the clip in the
+  interval between 0 and 100.
+  - <b>Progressive</b> - allows to record a progressive API file.
+- <b>Names of groups</b> - allows to specify parameters of the
+titles displayed in the viewer:
+  - <b>Text color</b> - allows selecting the text color;
+  - <b>Transparency</b> - allows selecting the text transparency.
+
+\anchor plot2d_preferences
+<h2>Plot 2D Viewer Preferences</h2>
+
+\image html pref_salome_plot2dviewer.png
+
+- <b>Show legend</b> - this options specifies if it's necessary to
+show legend by default.
+- <b>Legend Position</b> - this submenu allows to set the default position
+of the legend, it can be located to the left, to the right, on top or
+on bottom of the graph.
+- <b>Legend font</b> - this allows to set type and face for the font of Legend item.
+- <b>Curve Type</b> - this allows to set the representation of graphs in
+your presentations. You can see only <b>Points</b>, points connected with
+<b>Lines</b> or points connected with smooth <b>Splines</b>.
+- <b>Marker Size</b> - this submenu allows you to set the size of
+markers in your graphs.
+- <b>Horizontal</b> and <b>Vertical axis scale</b> - this submenus allow you to set
+the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
+<b>Logarithmic</b>. Note that the <b>Logarithmic</b> scale can be used only
+if the minimum value of corresponding component (abscissa or ordinate)
+of all points displayed in the viewer is greater than zero.
+If this condition is not met, the scale is switched to <b>Linear</b>
+automatically, even if it is set to <b>Logarithmic</b>.
+- <b>Background color</b> - this submenu allows to select the background
+color. Click on the colored line to access to the
+\ref select_color_and_font_page "Select Color" dialog box.
+- <b>Legend font color</b> - this allows to select the color of the
+font of the legend item. 
+- <b>Highlighted legend font color</b> - this submenu allows to select
+the color of the font of the selected legend item. 
+- <b>Selection color</b> - this submenu allows to select the color of
+selected object in the viewer. 
+- <b>Deviation marker color</b> - this submenu allows to select the
+color of the deviation marker. 
+- <b>Deviation marker line width</b> allows to define line width of
+the deviation marker. 
+- <b>Deviation marker tick size</b> allows to define size of the upper
+and lower horizontal lines of the deviation marker. 
+
+<br><h2>Directories Preferences</h2>
+
+\image html pref_salome_directories.png
+
+- <b>Quick Directory List</b> - this section allows to create and manage
+a custom quick directory list. To add a directory in the list, press
+the "Add directory" button:
+\image html image70.png
+then the &quot;<b>...</b>&quot; button and browse the data tree for the
+directory you need.
+The "Up" and "Down" buttons(see the picture below) help you to sort
+the directories in the list:
+\image html image73.png
+\image html image75.png
+To remove the selected directory from the list, press the "Delete"
+button:
+\image html image72.png
+
+<br><h2>Object Browser Preferences</h2>
+
+\image html pref_salome_objbrowser.png
+
+- <b>Search Tool</b> - specifies behavior of the
+\ref using_find_tool_page "Search tool".
+  - <b>Enable auto-hiding</b> checkbox - hides the search tool
+  automatically after short perioud of time when it is not used.
+- <b>Look and feel</b>
+  - <b>Auto size for the first column</b> - this checkbox enables automatic
+  resizing for the first column.
+  - <b>Auto size for other columns</b> - this checkbox enables
+  automatic resizing for the other columns.
+  - <b>Resize columns after expanding an item</b> - this checkbox enables
+  resizing columns on expanding an object browser item.
+  - <b>Browse to the published object</b> - this combobox allows to enable
+  automatic browsing to the objects just published to the study (using GUI
+  dialogs only). It means that the object browser will be scrolled to the
+  published objects, make them visible if they are collapsed and select the
+  first of them. Three modes are allowed for activating this feature:
+    - <b>Never</b> - automatic browsing is disabled.
+    - <b>After Apply & Close only</b> - browsing is activated when the
+    dialog is accepted by <b>Apply & Close</b> or <b>Ok</b> buttons (or if
+    the objects are published without using a dialog, for example, by
+    clicking a context menu button) and not activated when the
+    <b>Apply</b> button is pressed and therefore the dialog remains visible.
+    - <b>Always</b> - automatic browsing is always enabled.
+- <b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
+<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.
+
+<br><h2>Shortcuts Preferences</h2>
+
+\image html pref_salome_shortcuts.png
+
+- <b>Shortcuts settings</b> widget allows to define custom shortcuts for
+various operations. To change keyboard sequence for a certain action - select the
+action and press the custom keys combination.
+
 
 \subpage select_color_and_font_page "Font and color preferences"
-dialogs are often called from other \b Preferences dialogs.
+are most oftenly used types of user settings.
 
-\n When you change settings (click \b OK or \b Apply button) each module
+When you change settings (click \b OK or \b Apply button) each module
 receives the notification about what preferences are changed. You can
 also click \b Defaults button to restore default preferences or \b Close
-button to quit the menu without any changes. 
-\n \b Import button allows to load a user file containing preferences
-from your home directory through a standard Import dialog box.
+button to quit the dialog box without any changes. 
+
+\b Import button allows loading specific user file containing
+preferences from any location at the computer through a standard
+Import dialog box.
 
 \image html import.png
 
-This file has no extension and by default starts with
-.SalomeApprc. followed by Salome version number. There exists one file
-for each Salome version in use.
-\n The preferences, set during the current study session, are
-automatically saved in this file at the end of the session. Next time
-you launch SALOME application, these preferences will be restored.
+The preferences files usually have *.xml extension. Also,
+preferences files automatically saved by the application (stored in the
+~/.config/salome directory) have no extension and by default start with
+.SalomeApprc. followed by SALOME version number. Usually there is a
+separate preferences file for each SALOME version in use. Preferences
+are saved to the file in the end of the working session and restored
+at the application start-up.
 
 \note The preferences you set will be default preferences for all \b new
 objects, but they are not retroactive and do not automatically apply
 to the existing objects.
 
-*/
\ No newline at end of file
+*/
index f855d4397ba5e9ea2cf2a7a9604f2e7f9073e324..71f3ed5e260fa54bc10a041ad4d97f94c3fb63af 100644 (file)
@@ -16,9 +16,14 @@ All operations with studies are available from the \b File menu.
 \b New - creates a new study. The study will be created
 with default name \b Study1. It is possible to create
 several studies, each accessible from the task bar.
+
 \b Open - allows to open an existing study by browsing for it in a
 standard Search File dialog box, choosing the required
 *.hdf file and clicking \b Open button.
+
+\b Reopen - reloads the current study from the *.hdf file. This menu command
+can be used to reverse the study to the latest saved state.
+
 \b Connect - allows to open an unloaded study.
 \image html loadstudy2.png
 Select one of the studies, which has been previously
@@ -73,7 +78,7 @@ saved in the Python file.
 </ul>
 To confirm your choice click \b Save.
 
-<b>Notebook</b> - allows to manage study variables using \subpage using_notebook "NoteBook".
+\subpage using_notebook "Notebook" - allows to predefine study variables.
 
 <b>Load Script</b> - allows to load a saved Python Script.
 
@@ -86,18 +91,19 @@ To confirm your choice click \b Open.
 \image html studyproperties.png
 
 <ul>
-<li>\b Author - allows to change the name of the study author</li>
-<li>\b Created - gives the date and time of Study creation</li>
+<li>\b Author - allows to change the name of the study author.</li>
+<li><b> Creation date</b> - gives the date and time of Study creation.</li>
 <li>\b Locked - allows to lock the  study for modifications. 
-Just click on this field and choose \b Yes item. In this case your study will be locked for any modifications
+In case if \b Locked checkbox is checked your study will be locked for any modifications
 for all users. Next time you try to edit it, you will see the
 following warning message:
 \image html lockedstudy.png </li>
-<li>\b Modified - allows to see if any modifications have been
+<li><b>Modified/Not Modified</b>  - allows to see if any modifications have been
 introduced into study since its last save. </li>
+<li><b>Length units</b> - allows to change the units of the study.</li>
+<li>\b Comment - allows to change the comment of the study.</li>
 <li>\b Modifications - allows to  view the list of changes made in the study.
-In this dialog box click on the \b Modifications field and scroll it
-down. Each record contains the date and time of the
+Each record contains the date and time of the
 modification and the name of the user, who has introduced it.</li>
 </ul>
 
@@ -110,4 +116,4 @@ studies, giving the possibility to fast load the required study.
 \b Exit - unlike \b Close, closes not only the current, but all opened
 Salome studies.
 
-*/
\ No newline at end of file
+*/
index ac0bc56143f2e8f3b4a6f61241be5108ad331486..0e3f617096297921af0a7f245e1dce2aeb48cd03 100644 (file)
@@ -318,7 +318,9 @@ studyName = salome.sg.getActiveStudyName()
 selCount = salome.sg.SelectedCount() # total number of selected items
 for i in range(selCount):
     print salome.sg.getSelected(i) # print entry ID of i-th selected item
+\endcode
 
+\code
 # get list of all selected objects' IDs
 selected = salome.sg.getAllSelected()
 
index 9fff17ae3a510150307a169c54c0e69ab7e6f986..d5f459f73af4627f3c8944c7d16db83f11b23127 100755 (executable)
@@ -2,26 +2,41 @@
 
 \page themes_page Theme 
 
-\b Theme dialog is used for customization of the look and feel of
-Salome. To open it, select in the Main menu <b>View -> Theme </b>.
+The look and feel of the SALOME desktop can be customized by the user
+via SALOME style preferences.
+
+<b>SALOME style prefereces</b> dialog box is used for customization of
+the look and feel of SALOME style. To open it, select in the Main menu
+<b>View -> Theme </b> item.
 
 \image html theme1.png
 
-It is possible to choose a predefined color scheme in the list to the left
-or to edit your custom color scheme using the controls to the right.
+It is possible to choose a predefined scheme in the list to the left
+or to create a custom scheme using the controls to the right.
+
+The dialog box contains two pages.
 
-\b Quick button allows to apply color change made in one position to all
-other positions using this color.
+The first page allows specifying the color palette.
+- \b Quick button allows automatic color palette definition basing on
+the main color specified by the user.
 
 \image html theme2.png
 
-<ul>
-<li>\b Font group allows to edit the default font used in Salome menus.</li>
-<li>\b Lines group allows to apply dashing to Salome elements. </li>
-<li><b> Widgets rounding</b> allows to round corners of Salome dialog
-boxes and define their parameters.</li>
-<li>\b Handle allows to define parameters of the handle.</li>
-<li><b> Widget effect </b> allows to apply special effects to Salome
-dialog boxes.</li>
-</ul>
-*/
\ No newline at end of file
+The second page allows specifying different properties of the theme:
+
+- \b Font group allows to edit the font used in menus, dialog boxes, etc.
+- \b Lines group allows to apply dashing to Salome elements.
+- <b>Widgets rounding</b> allows to round corners of Salome dialog
+boxes and define their parameters.
+- \b Handle allows to define parameters of the handle.
+- <b>Widget effect</b> allows to apply special effects to Salome
+dialog boxes.
+
+If SALOME Theme is not used (<b>Use SALOME Style</b> checkbox is
+switched off), the global system settings are applied (for
+example, KDE settings). So, the look and feel of the application (for
+example, palette and/or font) can be customized by using the Qt utility
+<em>qtconfig</em>.
+
+
+*/
index d48fe8fcb33daabf50684579c962dec0d76bbda3..009f05f67b554daa2b63fae9450ddd3a6d3a913d 100644 (file)
@@ -2,9 +2,8 @@
 
 \page using_notebook Using NoteBook
 
-SALOME <b>NoteBook</b> is destined for managing numerical and boolean
-parameters (variables) which are used to create and modify objects in
-different components.
+SALOME <b>NoteBook</b> allows to predefine numerical and boolean
+parameters (variables).
 
 To open the <b>NoteBook</b> choose <b>File > Notebook</b>, the following
 dialog box will appear:
@@ -19,8 +18,22 @@ study, you should click <b>Update Study</b> button to apply your changes
 to the study.
 
 \note The dialog will not be validated until at least one of variables in
-the table has invalid name or value (marked by red color). Names of
+the table has an invalid name or value (marked by red color). The names of
 variables should be unique and their values should be numerical (integer or
 double) or boolean ("True" / "False").
 
+Here is an example of setting of variables in python scripts:
+\code
+import salome_notebook
+
+notebook = salome_notebook.notebook
+
+notebook.set("Length", 100)
+notebook.set("Radius", 37.5)
+notebook.set("Flag", True)
+\endcode
+
+Later these values can be used as parameters for any operations in
+various components.
+
 */
\ No newline at end of file
index 5aea2694907678273431a5b80c2ddf0d585c21af..6511e7995e537449ab4c13f2cf257e3bac79bcd5 100644 (file)
@@ -26,7 +26,7 @@ right-click on a definite object in the Object Browser.
 The Object Browser may contain supplementary attributes of the objects
 displayed in additional columns. By default, these columns are not
 displayed -  displaying/hiding these columns is possible through
-\ref salome_preferences_page "setting study preferences" or
+\ref setting_preferences_page "setting study preferences" or
 right-clicking on the attributes bar and toggling the necessary
 attributes.
 
@@ -42,5 +42,17 @@ to the objects</li>
 </ul>
 
 \note <b>Entry, IOR and Reference entry</b> attributes are displayed for debugging purposes only.
-*/
\ No newline at end of file
+
+<h2> Enable sorting </h2>
+
+By default the objects in the object browser are sorted in the creation order. 
+\n
+However, it is possible to enable sorting 
+in the alphabetical order (or the reverse alphabetical order) by right
+clicking in the header of the tree (near the "Name" field) and
+checking "enable sorting" in the popup menu.
+\n
+It is possible to use the arrow near "Name" to reverse the order.
+If "enable sorting" is unchecked, the objects are sorted in the default order again.
+
+*/
index be85863d3e891d16b64d29966326aeaaccd8861e..b3a3b92de94417153ee0aab44a31e1217f5fbe2c 100644 (file)
@@ -2,29 +2,33 @@
 
 \page viewers_page Viewers
 
-Salome provides a selection of viewers for data representation. Some
-of them are used in several modules, others are used only in one
-module or in some particular cases. 
-
-<ul>
-<li>\subpage occ_3d_viewer_page "OCC (Open CasCade) 3D viewer" has been developed on the basis of Open
-CASCADE Technology. This is the default viewer for Geometry Module,
-providing good representation of construction and transformation of
-geometrical objects. Only this viewer allows to work with groups and
-sub-shapes. This viewer can also work in Mesh module, however, it
-doesn't allow to visualize meshes. </li>
-<li>\subpage vtk_3d_viewer_page "VTK 3D viewer" has been developed
-basing on Visualization ToolKit library by Kitware, Inc. This is the default viewer for Mesh Module, allowing to
-visualize meshes. It is also used in Post-Pro module for all 3D presentations.</li>
-<li>\subpage plot2d_viewer_page "Plot 2D viewer" has been developed
-basing on open-source Qwt library. It is destined for the representation of 2d
-plots and graphs in Post-Pro module.</li>
-<li>GL 2D viewer - general purpose OpenGL-based viewer, which can be
-used for visualization of 2D scenes.</li>
-<li>QxScene 2D viewer - has been developed on the basis of
-QGraphicsView scene by Trolltech. This viewer is used in YACS module
-for visualization of computation schemes.</li>
-</ul>
+SALOME provides a set of viewers for data representation. SALOME GUI
+module includes several 2D and 3D viewers, that are used for
+different purposes within the platform:
+
+- \subpage occ_3d_viewer_page has been developed on
+the basis of Open CASCADE Technology (http://www.opencascade.org).
+This is the default viewer for SALOME Geometry module, it provids good
+representation of construction and transformation of geometrical objects.
+
+- \subpage vtk_3d_viewer_page has been developed
+basing on Kitware Visualization ToolKit library (http://www.vtk.org).
+This is the default viewer for SALOME Mesh module, where it is used
+for visualization of meshes. It is also used in SALOME Post-Pro module
+for all 3D presentations.
+
+- \subpage plot2d_viewer_page has been developed
+basing on the open-source Qwt library (http://qwt.sourceforge.net).
+It is used, for example, for the representation of 2D plots and graphs
+in the SALOME Post-Pro module.
+
+- \subpage gl_2d_viewer_page is a general purpose
+OpenGL-based viewer, which can be used for visualization of 2D
+scenes. This type of viewer is not currently used in SALOME platform
+directly, but can be used in custom modules for 2D visualization purposes.
+
+- \subpage qxscene_2d_viewer_page has been
+developed on the basis of Qt QGraphicsView scene. This viewer is used
+in SALOME YACS module for visualization of computation schemes.
 
 */
index c0600f7589274fdb7fb4c83f63d7d70e37f70c48..529bf3a39983379e921a7371ccb0fed7e59d3de4 100644 (file)
 
 \page vtk_3d_viewer_page VTK 3D Viewer
 
+<h2>Operations</h2>
+
 The functionalities of VTK viewer are available via its Viewer
 Toolbar. Buttons marked with small downward triangles have extended
 functionality which can be accessed by locking on them with left mouse
 button.  
 
-\image html image157.gif "Viewer Toolbar"
+\image html vtkviewer_toolbar.png
+<hr>
+
+\image html vtk_view_camera_dump.png
 
+<b>Dump View</b> - exports an object from the viewer in bmp, png or
+jpeg image format.
 <hr>
-\image html image77.png
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
+
+\image html vtk_view_style_switch.png
+
+<b>Interaction style switch</b> - allows to switch between standard
+and "keyboard free" interaction styles. "Keyboard free" style allows
+to process all view transformations without using keyboard (only by
+mouse) and perform selection in view by pressing "S" key. By default,
+rotation in this mode is performed by left mouse button, panning - by
+middle mouse button, zooming - by left and middle mouse buttons
+pressed simultaneously.
+<hr>
+
+\image html vtk_view_zooming_style_switch.png
+
+<b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the
+current cursor position) zooming styles. The second mode is available
+only for parallel (non-perspective) view's mode.
 <hr>
 
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+\image html vtk_view_highlight.png
+
+<b>Dynamic pre-selection switch</b> - allows to switch on/off dynamic
+pre-selection of objects. When the dynamic pre-selection is switched
+on, an objects can be selected by clicking the point/cell belonging to
+this object, with some performance loss. Switch dynamic pre-selection
+off to have a good performance on big objects (for example, huge
+meshes).
 <hr>
 
-\image html image96.png
-\n <center><b>Fit all</b> - scales the presentation so that it could
-fit within the Viewer boundaries. </center>
+\image html vtk_view_triedre.png
+
+<b>Show/Hide Trihedron</b> - shows or hides coordinate axes.
 <hr>
 
-\image html image97.png
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
+\image html vtk_view_fitall.png
+
+<b>Fit all</b> - scales the presentation so that it could fit within
+the Viewer boundaries.
 <hr>
 
-\image html image98.png
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html vtk_view_fitarea.png
+
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
 <hr>
 
-\image html image99.png
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html vtk_view_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
 <hr>
 
-\image html image100.png
-\n <center><b>Global panning</b> - allows to select a point to be the
-center of the presentation showing all displayeed objects in the
-visible ares <center>
+\image html vtk_view_pan.png
+
+<b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality,
+click on this button and you'll be able to drag the scene to see its
+remote parts.
 <hr>
 
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
+\image html vtk_view_glpan.png
+
+<b>Global panning</b> - allows to select a point to be the center of
+the presentation showing all displayed objects in the visible ares.
+<hr>
+
+\image html vtk_view_rotation_point.png
+
+<b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.
 
 \image html set_rotation_point_dialog1.png
 
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
+By default the rotation point is located in the Center of the bounding
+box of an object.
 
 \image html set_rotation_point_dialog2.png
 
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
+Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.
+
+- <b>Set to Origin</b> button restores the default rotation point
+  coordinates.
+
+- <b>Select Point from View</b> button allows to select the rotation
+  point in the 3D Viewer.
 
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
 <hr>
 
-\image html image89.png
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
+\image html vtk_view_rotate.png
 
-\image html image102.gif
+<b>Rotation</b> - allows to rotate the selected object using the
+mouse.
+<hr>
 
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
+\image html vtk_view_front.png
+\image html vtk_view_back.png
+\image html vtk_view_top.png
+\image html vtk_view_bottom.png
+\image html vtk_view_left.png
+\image html vtk_view_right.png
+
+These buttons orientate the scene strictly about coordinate axes:
+\b Front, \b Back, \b Top, \b Bottom, \b Left or \b Right side.
+<hr>
+
+\image html vtk_view_anticlockwise.png
+
+<b>Rotate counterclockwise</b> - rotates view 90° counterclockwise.
 <hr>
 
-\image html image91.png
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
+\image html vtk_view_clockwise.png
+
+<b>Rotate clockwise</b> - rotates view 90° clockwise.
 <hr>
 
-\image html urbutton.png
-\n <center><b>Update Rate</b> - allows to define the Update Rate for
-the presentations displayed in the viewer</center>
+\image html vtk_view_reset.png
+
+<b>Reset</b> - restores the default position (isometric) of objects in
+the scene.
+<hr>
+
+\image html vtk_view_update_rate.png
+
+<b>Update Rate</b> - allows to define the Update Rate for the
+presentations displayed in the viewer.
 
 \image html updaterate.png
 
-<ul>
-<li><b>Desired Update Rate, FPS</b> - allows to set the target Update
-Rate</li>
-<li><b>Still Update Rate, FPS</b> - allows to set the Update Rate for
-the periods when both the user and the application do not perform any
-actions in the viewer</li>
-<li><b>Current Update Rate, FPS</b> - shows the Update Rate currently
-available on your configuration</li>
-<li><b>Number of Cells</b> - shows the number of cells currently in
-display</li> 
-</ul>
+- <b>Desired Update Rate, FPS</b> - allows to set the target Update
+  Rate  
+
+- <b>Still Update Rate, FPS</b> - allows to set the Update Rate for
+  the periods when both the user and the application do not perform
+  any actions in the viewer
+
+- <b>Current Update Rate, FPS</b> - shows the Update Rate currently
+  available on your configuration 
+
+- <b>Number of Cells</b> - shows the number of cells currently in
+  display 
 
-\image html image108.png
-\n <center><b>Scaling</b> - represents objects deformed (stretched or
-stuffed) along the axes of coordinates.</center>
 <hr>
 
-\image html image109.gif
-\n <center><b>Graduated axes</b> - allows to define parameters of axes
-and graduate them.</center>
+\image html vtk_view_scaling.png
+
+<b>Scaling</b> - represents objects deformed (stretched or stuffed)
+along the axes of coordinates.
+<hr>
+
+\image html vtk_view_graduated_axes.png
+
+<b>Graduated axes</b> - allows to define parameters of axes and
+graduate them.
 
 \image html graduatedaxes1.png
 
-<ul>
-<li><b>Axis name</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the axis name is displayed in the
-viewer.</li>
-<li><b>Name</b> - allows to redefine the name of the axis.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-axis name.</li>
-</ul>
-<li><b>Labels</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the labels are displayed in the
-viewer.</li>
-<li><b>Number</b> - allows to define the number of labels.</li>
-<li><b>Offset</b> - allows to define the distance between labels.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-labels names.</li>
-</ul>
-<li><b>Tick marks</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the tick marks are displayed in the
-viewer.</li>
-<li><b>Length</b> - allows to define the length of tick marks.</li>
-</ul>
-<li><b>Is visible</b> - if checked the axis is displayed in the
-viewer. </li>
-</ul>
-
-*/
\ No newline at end of file
+- <b>Axis name</b> - if checked the axis name is displayed in the viewer.
+
+  - <b>Name</b> - allows to redefine the name of the axis.
+
+  - <b>Font</b> - allows to define color and properties of the font of axis name.
+
+- <b>Labels</b> - if checked the labels are displayed in the viewer.<
+
+  - <b>Number</b> - allows to define the number of labels.
+
+  - <b>Offset</b> - allows to define the distance between labels.
+
+  - <b>Font</b> - allows to define color and properties of the font of labels names.
+
+- <b>Tick marks</b> - if checked the tick marks are displayed in the viewer.
+
+  - <b>Length</b> - allows to define the length of tick marks.
+
+- <b>Is visible</b> - if checked the axis is displayed in the viewer.
+
+<hr>
+
+\image html vtk_view_parameters.png
+
+<b>Change View Parameters</b> - this button provides access to the
+dialog box allowing customization different parameters of the view.
+
+\image html vtk_view_parameters_dlg.png
+
+- <b>Projection Mode</b> - switchs to the Orthogonal / Perspective
+  projection mode
+
+- <b>Focal Point</b> - allows to specify the focal point of the view
+
+  - <b>Set to Bounding Box Center</b> - chooses the center of the
+    bounding box of the current scene as the focal point.
+
+  - <b>Set to Origin</b> - chooses the global coordinates system origin as
+    the focal point
+
+  - <b>Select Point from View</b> - allows to specify the focal point by the
+    direct selection of a point in the view window
+
+  - <b>X</b>, <b>Y</b>, <b>Z</b> - allows to input the coordinates of the focal
+    point directly
+
+- <b>Camera Position</b> - allows to specify the position of the view camera:
+
+  - <b>Absolute Coordinates</b> - either in absolute coordinates,
+
+  - <b>Relative to Focal Point</b> - or as a offset to the focal point;
+
+  - <b>Projection Direction</b> - allows specify the direction of the
+    projection vector;
+
+  - <b>Focal Distance</b> - the focal distance value;
+
+  - <b>View Up Direction</b> - direction of the "view up" vector.
+
+- <b>Zooming</b> - the current zoom factor (available in the <b>Orthogonal
+  mode</b> only)
+
+- <b>View Angle</b> - the current view angle (available in the <b>Perspective
+  mode</b> only)
+
+<hr>
+
+\image html vtk_view_sync.png
+
+<b>Synchronize view</b> - allows to synchronize 3d view
+parameters. This button has two states - checked and
+unchecked. Clicking on this button opens a drop-down menu listing the
+compatible 3d views. As soon as the user selects any view from the
+list, the parameters (view point, position, zoom coefficient, etc.) of
+the current view are synchronized with the selected view (static
+synchronization).
+
+In addition, when this button is in the "checked" state, the dynamic
+synchronization of the views is performed, i.e. any zoom, pan, rotate
+or other view operation done in one view is automatically applied to
+the other view.
+<hr>
+
+\image html vtk_view_parallel.png
+
+<b>Orthogonal mode</b> - Switches the view to the orthogonal mode.
+<hr>
+
+\image html vtk_view_perspective.png
+
+<b>Perspective mode</b> - Switches the view to the perspective mode.
+<hr>
+
+\image html vtk_view_recording_start.png
+\image html vtk_view_recording_play.png
+\image html vtk_view_recording_pause.png
+\image html vtk_view_recording_stop.png
+
+These buttons allow recording viewing operations as a video file in
+the AVI format using external software (jpeg2yuv):
+
+- <b>Start recording</b> - specify parameters and start recording;
+
+- <b>Pause recording</b> - suspend recording;
+
+- <b>Continue recording</b> - resume recording;
+
+- <b>Stop recording</b> - stop recording.
+
+<hr>
+
+\anchor vtk_background
+<h2>Background</h2>
+
+VTK Viewer background can be customized using the "Change background"
+popup menu command that opens the following dialog box:
+
+\image html change_background_dlg.png
+
+The following types of the background are supported:
+
+- Single color: the background is colored with the solid color
+  specified by the user in the dialog box.
+
+- Gradient background: the background is gradiently colored according
+  to two colors and the gradient type specified in the dialog
+  box. The following types of background are supported:
+
+  - Horizontal
+
+  - Vertical
+
+  - First diagonal
+
+  - Second diagonal
+
+  - First corner
+
+  - Second corner
+
+  - Third corner
+
+  - Fourth corner
+
+- Image: allows to set image as viewer background and define filling type:
+
+  - Center: the image is located at the center of the viewer backgound
+
+  - Tile: the image fills the entire viewer backgound one by one
+
+  - Stretch: the image is stretched to the entire viewer backgound.
+
+
+Default background for the viewer is specified via the
+\ref vtk_preferences "application preferences".
+
+*/
index 9211d570fa977e8749aadf7eed6497d7bad3e1f8..4c89a2ba1ed1150de49b5f1bc72ca9975f411550 100755 (executable)
@@ -1,10 +1,12 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-</head>
-<body>
-<hr style="width: 100%; height: 2px;">
-<div style="text-align: center;">Copyright &copy; 2003-2009 CEA, EDF<br>
-</div>
+    <li class="footer"></li>
+   </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright &copy; 2007-2012  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
+ Copyright &copy; 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS<br>
+ </div>
+ </div>
 </body>
 </html>
+               
\ No newline at end of file
diff --git a/doc/salome/gui/static/header.html b/doc/salome/gui/static/header.html
deleted file mode 100755 (executable)
index a70a95e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <title>$title</title>
-   <link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<hr>
-<center>
-SALOME documentation central
-</center>
-<hr>
index af6eaab262a4e5fd28dd0d269389228ac38986c3..9725980e0bd5b0f57d2bfac9afa6337ec376aa86 100644 (file)
@@ -1,31 +1,35 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vasily Rusyaev (Open Cascade NN)
 #  Module : doc
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-EXTRA_DIST += images static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+tuidocdir = $(docdir)/tui/GUI
+tuidoc_DATA = images/head.png
 
 dev_docs: doxyfile
        echo "Running doxygen in directory: "`pwd`; \
@@ -41,4 +45,11 @@ install-data-local:
        fi;
 
 uninstall-local:
-       rm -rf $(DESTDIR)$(docdir)/tui/GUI
+       @test -d $(DESTDIR)$(tuidocdir) && chmod -R +w $(DESTDIR)$(tuidocdir) ; \
+       for filen in `find $(DESTDIR)$(tuidocdir) -mindepth 1 -maxdepth 1` dummy ; do \
+         case $${filen} in \
+           dummy ) ;; \
+           $(DESTDIR)$(tuidocdir)/head.png ) ;; \
+           * ) echo "removing $${filen}" && rm -rf $${filen} ;; \
+         esac ; \
+       done
index 201628e66860f4460ecefcbd2b167ac81cfa5c35..f3e7fed86ed5db037e2eae338b662e8c0d636637 100755 (executable)
@@ -1,30 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-# Doxyfile 1.4.6
 
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "GUI Module Programming Guide v.@VERSION@"
+PROJECT_NAME           = "SALOME GUI Developer"
 PROJECT_NUMBER         = 
 OUTPUT_DIRECTORY       = GUI
 CREATE_SUBDIRS         = NO
@@ -99,8 +98,9 @@ WARN_LOGFILE           =
 INPUT                  = @top_srcdir@/src \
                         @top_srcdir@/bin \
                         @top_srcdir@/idl \
-                        @top_builddir@/bin
-FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+                        @top_builddir@/bin \
+                        @srcdir@/input
+FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc
 RECURSIVE              = YES
 EXCLUDE                = 
 EXCLUDE_SYMLINKS       = NO
@@ -137,7 +137,7 @@ IGNORE_PREFIX          =
 GENERATE_HTML          = YES
 HTML_OUTPUT            = .
 HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = @srcdir@/static/myheader.html
+HTML_HEADER            = @builddir@/static/header.html
 HTML_FOOTER            = @srcdir@/static/footer.html
 HTML_STYLESHEET        = @srcdir@/static/doxygen.css
 HTML_ALIGN_MEMBERS     = YES
@@ -246,7 +246,8 @@ INCLUDED_BY_GRAPH      = NO
 CALL_GRAPH             = NO
 GRAPHICAL_HIERARCHY    = YES
 DIRECTORY_GRAPH        = YES
-DOT_IMAGE_FORMAT       = jpg
+DOT_IMAGE_FORMAT       = png
+DOT_FONTNAME           = Arial
 DOT_PATH               = 
 DOTFILE_DIRS           = 
 MAX_DOT_GRAPH_WIDTH    = 1024
diff --git a/doc/salome/tui/images/Application-About.png b/doc/salome/tui/images/Application-About.png
deleted file mode 100755 (executable)
index 7b58330..0000000
Binary files a/doc/salome/tui/images/Application-About.png and /dev/null differ
diff --git a/doc/salome/tui/images/application.gif b/doc/salome/tui/images/application.gif
deleted file mode 100755 (executable)
index 0b05d5c..0000000
Binary files a/doc/salome/tui/images/application.gif and /dev/null differ
diff --git a/doc/salome/tui/images/html_comments.gif b/doc/salome/tui/images/html_comments.gif
deleted file mode 100755 (executable)
index f0c0f0b..0000000
Binary files a/doc/salome/tui/images/html_comments.gif and /dev/null differ
diff --git a/doc/salome/tui/images/logocorp.gif b/doc/salome/tui/images/logocorp.gif
deleted file mode 100755 (executable)
index 7697e08..0000000
Binary files a/doc/salome/tui/images/logocorp.gif and /dev/null differ
index 4893b5e2a4b6bde236f1cd83edd01a7f69b0aefd..7a2dcbde8e1abe74a42ba5554635bdfa6473a572 100755 (executable)
-H1 { 
-   text-align: center; 
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+       font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+       font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+       font-size: 150%;
+}
+
+h2 {
+       font-size: 120%;
+}
+
+h3 {
+       font-size: 100%;
+}
+
+dt {
+       font-weight: bold;
+}
+
+div.multicol {
+       -moz-column-gap: 1em;
+       -webkit-column-gap: 1em;
+       -moz-column-count: 3;
+       -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+       margin-top: 2px;
+}
+
+p.endli {
+       margin-bottom: 0px;
+}
+
+p.enddd {
+       margin-bottom: 4px;
+}
+
+p.endtd {
+       margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+       font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+       background-color: #EBEFF6;
+       border: 1px solid #A3B4D7;
+       text-align: center;
+       margin: 2px;
+       padding: 2px;
+}
+
+div.qindex, div.navpath {
+       width: 100%;
+       line-height: 140%;
+}
+
+div.navtab {
+       margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+       color: #3D578C;
+       font-weight: normal;
+       text-decoration: none;
+}
+
+.contents a:visited {
+       color: #4665A2;
+}
+
+a:hover {
+       text-decoration: underline;
+}
+
+a.qindex {
+       font-weight: bold;
+}
+
+a.qindexHL {
+       font-weight: bold;
+       background-color: #9CAFD4;
+       color: #ffffff;
+       border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+       font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+       color: #4665A2;
 }
 
-CAPTION { 
-   font-weight: bold 
+a.codeRef {
+       color: #4665A2;
 }
 
-/* Link in the top navbar */
-A.qindex {}
+/* @end */
 
-A.qindexRef {}
+dl.el {
+       margin-left: -1cm;
+}
 
-/* Link to any cross-referenced Doxygen element */
-A.el { 
-   text-decoration: none; 
-   font-weight: bold 
+.fragment {
+       font-family: monospace, fixed;
+       font-size: 105%;
 }
 
-A.elRef { 
-   font-weight: bold 
+pre.fragment {
+       border: 1px solid #C4CFE5;
+       background-color: #FBFCFD;
+       padding: 4px 6px;
+       margin: 4px 8px 4px 2px;
+       overflow: auto;
+       word-wrap: break-word;
+       font-size:  9pt;
+       line-height: 125%;
+}
+
+div.ah {
+       background-color: black;
+       font-weight: bold;
+       color: #ffffff;
+       margin-bottom: 3px;
+       margin-top: 3px;
+       padding: 0.2em;
+       border: solid thin #333;
+       border-radius: 0.5em;
+       -webkit-border-radius: .5em;
+       -moz-border-radius: .5em;
+       box-shadow: 2px 2px 3px #999;
+       -webkit-box-shadow: 2px 2px 3px #999;
+       -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+       background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+       background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       font-weight: bold;
+}
+
+div.version {
+       border:1px solid #0000FF;
+        color: #CCCCCC;
+       font-family: Arial, Helvetica, sans-serif;
+       font-size: 9pt;
+       text-align: center;
+       width:100px;
+       -moz-border-radius: 8px;
+       margin: 5px;
+}
+                    
+div.footer1 {
+    background-color: #DFE5F1;
+    border: 1px solid #AAAAAA;
+    font-family: Arial, Helvetica, sans-serif;
+    font-size: 11px;
+    padding: 10px;
+    margin-top: 15px;
 }
+           
 
-/* Link to any cross-referenced Doxygen element inside a code section 
-   (ex: header)
+div.groupText {
+       margin-left: 16px;
+       font-style: italic;
+}
+
+body {
+       background: white;
+       color: black;
+        margin: 0;
+}
+
+div.contents {
+       margin-top: 10px;
+       margin-left: 10px;
+       margin-right: 10px;
+}
+
+td.indexkey {
+       background-color: #EBEFF6;
+       font-weight: bold;
+       border: 1px solid #C4CFE5;
+       margin: 2px 0px 2px 0;
+       padding: 2px 10px;
+}
+
+td.indexvalue {
+       background-color: #EBEFF6;
+       border: 1px solid #C4CFE5;
+       padding: 2px 10px;
+       margin: 2px 0px;
+}
+
+tr.memlist {
+       background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+       text-align: center;
+}
+
+img.formulaDsp {
+       
+}
+
+img.formulaInl {
+       vertical-align: middle;
+}
+
+div.center {
+       text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
+}
+
+div.center img {
+       border: 0px;
+}
+
+address.footer {
+       text-align: right;
+       padding-right: 12px;
+}
+
+img.footer {
+       border: 0px;
+       vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+       color: #008000
+}
+
+span.keywordtype {
+       color: #604020
+}
+
+span.keywordflow {
+       color: #e08000
+}
+
+span.comment {
+       color: #800000
+}
+
+span.preprocessor {
+       color: #806020
+}
+
+span.stringliteral {
+       color: #002080
+}
+
+span.charliteral {
+       color: #008080
+}
+
+span.vhdldigit { 
+       color: #ff00ff 
+}
+
+span.vhdlchar { 
+       color: #000000 
+}
+
+span.vhdlkeyword { 
+       color: #700070 
+}
+
+span.vhdllogic { 
+       color: #ff0000 
+}
+
+/* @end */
+
+/*
+.search {
+       color: #003399;
+       font-weight: bold;
+}
+
+form.search {
+       margin-bottom: 0px;
+       margin-top: 0px;
+}
+
+input.search {
+       font-size: 75%;
+       color: #000080;
+       font-weight: normal;
+       background-color: #e8eef2;
+}
 */
-A.code { 
-   text-decoration: none; 
-   font-weight: normal; 
-   color: #4444ee 
+
+td.tiny {
+       font-size: 75%;
 }
 
-A.codeRef { 
-   font-weight: normal; 
-   color: #4444ee 
+.dirtab {
+       padding: 4px;
+       border-collapse: collapse;
+       border: 1px solid #A3B4D7;
 }
 
-A:hover { 
-   text-decoration: none; 
-   background-color: lightblue 
+th.dirtab {
+       background: #EBEFF6;
+       font-weight: bold;
 }
 
-DL.el { 
-   margin-left: -1cm 
+hr {
+       height: 0px;
+       border: none;
+       border-top: 1px solid #4A6AAA;
 }
 
-/* A code fragment (ex: header) */
-DIV.fragment { 
-   width: 100%; 
-   border: none; 
-   background-color: #CCCCCC 
+hr.footer {
+       height: 1px;
 }
 
-/* In the alpha list (coumpound index), style of an alphabetical index letter */
-DIV.ah { 
-   background-color: #CCCCCC; 
-   font-weight: bold; 
-   color: #ffffff; 
-   margin-bottom: 3px; 
-   margin-top: 3px 
+/* @group Member Descriptions */
+
+table.memberdecls {
+       border-spacing: 0px;
+       padding: 0px;
 }
 
-/* Method name (+ type) */
-TD.md { 
-   background-color: lightblue; 
-   font-weight: bold; 
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+       background-color: #F9FAFC;
+       border: none;
+       margin: 4px;
+       padding: 1px 0 0 8px;
 }
 
-/* Method parameter (some of them) */
-TD.mdname1 { 
-   background-color: lightblue; 
-   font-weight: bold; color: #602020; 
+.mdescLeft, .mdescRight {
+       padding: 0px 8px 4px 8px;
+       color: #555;
 }
 
-/* Method parameter (some of them) */
-TD.mdname { 
-   background-color: lightblue; 
-   font-weight: bold; 
-   color: #602020; 
-   width: 600px; 
+.memItemLeft, .memItemRight, .memTemplParams {
+       border-top: 1px solid #C4CFE5;
 }
 
-/* Separator between methods group (usually empty, seems not supported by IE) */
-DIV.groupHeader { 
-   margin-left: 16px; 
-   margin-top: 12px; 
-   margin-bottom: 6px; 
-   font-weight: bold 
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
 }
 
-DIV.groupText { 
-   margin-left: 16px; 
-   font-style: italic; 
-   font-size: smaller 
+.memTemplParams {
+       color: #4665A2;
+        white-space: nowrap;
 }
 
-BODY { background: #FFFFFF
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+       font-size: 80%;
+       color: #4665A2;
+       font-weight: normal;
+       margin-left: 9px;
+}
+
+.memnav {
+       background-color: #EBEFF6;
+       border: 1px solid #A3B4D7;
+       text-align: center;
+       margin: 2px;
+       margin-right: 15px;
+       padding: 2px;
+}
+
+.memitem {
+       padding: 0;
+       margin-bottom: 10px;
+}
+
+.memname {
+        white-space: nowrap;
+        font-weight: bold;
+        margin-left: 6px;
+}
+
+.memproto {
+        border-top: 1px solid #A8B8D9;
+        border-left: 1px solid #A8B8D9;
+        border-right: 1px solid #A8B8D9;
+        padding: 6px 0px 6px 0px;
+        color: #253555;
+        font-weight: bold;
+        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+        /* opera specific markup */
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        border-top-right-radius: 8px;
+        border-top-left-radius: 8px;
+        /* firefox specific markup */
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        -moz-border-radius-topright: 8px;
+        -moz-border-radius-topleft: 8px;
+        /* webkit specific markup */
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        -webkit-border-top-right-radius: 8px;
+        -webkit-border-top-left-radius: 8px;
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+
+}
+
+.memdoc {
+        border-bottom: 1px solid #A8B8D9;      
+        border-left: 1px solid #A8B8D9;      
+        border-right: 1px solid #A8B8D9; 
+        padding: 2px 5px;
+        background-color: #FBFCFD;
+        border-top-width: 0;
+        /* opera specific markup */
+        border-bottom-left-radius: 8px;
+        border-bottom-right-radius: 8px;
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        /* firefox specific markup */
+        -moz-border-radius-bottomleft: 8px;
+        -moz-border-radius-bottomright: 8px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+        /* webkit specific markup */
+        -webkit-border-bottom-left-radius: 8px;
+        -webkit-border-bottom-right-radius: 8px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+       text-align: right;
+}
+
+.paramtype {
+       white-space: nowrap;
+}
+
+.paramname {
+       color: #602020;
+       white-space: nowrap;
+}
+.paramname em {
+       font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+        border-spacing: 6px 2px;
+}       
+
+.params .paramname, .retval .paramname {
+        font-weight: bold;
+        vertical-align: top;
+}
+        
+.params .paramtype {
+        font-style: italic;
+        vertical-align: top;
+}       
+        
+.params .paramdir {
+        font-family: "courier new",courier,monospace;
+        vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+       font-family: sans-serif;
+       margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+       font-size: 9pt;
+       font-weight: bold;
+       margin: 5px;
+}
+
+.directory h3 {
+       margin: 0px;
+       margin-top: 1em;
+       font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice.  Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+       height: 61px;
+       background-repeat: no-repeat;
+       background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+       display: none;
+}
+*/
+
+.directory > h3 {
+       margin-top: 0;
+}
+
+.directory p {
+       margin: 0px;
+       white-space: nowrap;
+}
+
+.directory div {
+       display: none;
+       margin: 0px;
+}
+
+.directory img {
+       vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+       font-size: 100%;
+       font-weight: bold;
+}
+
+.directory-alt h3 {
+       margin: 0px;
+       margin-top: 1em;
+       font-size: 11pt;
+}
+
+.directory-alt > h3 {
+       margin-top: 0;
+}
+
+.directory-alt p {
+       margin: 0px;
+       white-space: nowrap;
 }
 
-/* BODY { 
-   background: url(sources/bg_salome.gif) 
-} */
+.directory-alt div {
+       display: none;
+       margin: 0px;
+}
+
+.directory-alt img {
+       vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+        margin-top: 8px;
+}
+
+address {
+       font-style: normal;
+       color: #2A3D61;
+}
+
+table.doxtable {
+       border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+       border: 1px solid #2D4068;
+       padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+       background-color: #374F7F;
+       color: #FFFFFF;
+       font-size: 110%;
+       padding-bottom: 4px;
+       padding-top: 5px;
+       text-align:left;
+}
+
+.tabsearch {
+       top: 0px;
+       left: 10px;
+       height: 36px;
+       background-image: url('tab_b.png');
+       z-index: 101;
+       overflow: hidden;
+       font-size: 13px;
+}
+
+.navpath ul
+{
+       font-size: 11px;
+       background-image:url('tab_b.png');
+       background-repeat:repeat-x;
+       height:30px;
+       line-height:30px;
+       color:#8AA0CC;
+       border:solid 1px #C2CDE4;
+       overflow:hidden;
+       margin:0px;
+       padding:0px;
+}
+
+.navpath li
+{
+       list-style-type:none;
+       float:left;
+       padding-left:10px;
+       padding-right:15px;
+       background-image:url('bc_s.png');
+       background-repeat:no-repeat;
+       background-position:right;
+       color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+       height:32px;
+       display:block;
+       text-decoration: none;
+       outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+       color:#6884BD;
+}
+
+.navpath li.footer
+{
+        list-style-type:none;
+        float:right;
+        padding-left:10px;
+        padding-right:15px;
+        background-image:none;
+        background-repeat:no-repeat;
+        background-position:right;
+        color:#364D7C;
+        font-size: 8pt;
+}
+
+
+div.summary
+{
+       float: right;
+       font-size: 8pt;
+       padding-right: 5px;
+       width: 50%;
+       text-align: right;
+}       
+
+div.summary a
+{
+       white-space: nowrap;
+}
 
-div.tabs { 
-  text-align: justify; 
-  font-weight: bold;
-  color: #FFFFFF;
+div.ingroups
+{
+       font-size: 8pt;
+       padding-left: 5px;
+       width: 50%;
+       text-align: left;
 }
 
-DIV.div-footer { 
-  margin-left: 1em;
-  margin-right: 1em;
-  margin-bottom: 0.2em;
-  text-align: right;
-  font-size: 9pt; 
+div.ingroups a
+{
+       white-space: nowrap;
+}
+
+div.header
+{
+        background-image:url('nav_h.png');
+        background-repeat:repeat-x;
+       background-color: #F9FAFC;
+       margin:  0px;
+       border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+       padding: 5px 5px 5px 10px;
+}
+
+.title {
+        font-size: 150%;
+        font-weight: bold;
+        margin: 10px 2px;
+}
+
+dl
+{
+        padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+        border-left:4px solid;
+        padding: 0 0 0 6px;
+}
+
+dl.note
+{
+        border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+        border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+        border-color: #00D000;
+}
+
+dl.deprecated
+{
+        border-color: #505050;
+}
+
+dl.todo
+{
+        border-color: #00C0E0;
+}
+
+dl.test
+{
+        border-color: #3030E0;
+}
+
+dl.bug
+{
+        border-color: #C08050;
+}
+
+#projectlogo
+{
+       text-align: center;
+       vertical-align: bottom;
+       border-collapse: separate;
+}
+#projectlogo img
+{ 
+       border: 0px none;
+}
+#projectname
+{
+        background-color: #175783;
+        border: 1px solid;
+        height: 80px;
+       background-repeat: no-repeat;
+/*     font: 300% arial,sans-serif;*/
+       margin: 0px;
+       padding: 0px;
+}
+    
+#projectbrief
+{
+       font: 120% arial,sans-serif;
+       margin: 0px;
+       padding: 0px;
 }
 
-/* In File List, Coumpound List, etc, 1st column of the index */
-TD.indexkey { 
-   background-color: #CCCCCC; 
-   font-weight: bold; 
-   padding-right  : 10px; 
-   padding-top    : 2px; 
-   padding-left   : 10px; 
-   padding-bottom : 2px; 
-   margin-left    : 0px; 
-   margin-right   : 0px; 
-   margin-top     : 2px; 
-   margin-bottom  : 2px  
+#projectnumber
+{
+       font: 50% arial,sans-serif;
+       margin: 0px;
+       padding: 0px;
 }
 
-/* In File List, Coumpound List, etc, 2nd column of the index */
-TD.indexvalue { 
-   background-color: #CCCCCC; 
-   font-style: italic; 
-   padding-right  : 10px; 
-   padding-top    : 2px; 
-   padding-left   : 10px; 
-   padding-bottom : 2px; 
-   margin-left    : 0px; 
-   margin-right   : 0px; 
-   margin-top     : 2px; 
-   margin-bottom  : 2px  
+#titlearea
+{
+        background: url("head.png");
+        background-color: #175783;
+        border: 1px solid;
+        height: 80px;
+        background-repeat: no-repeat;
+       padding: 0px;
+       margin: 0px;
+       width: 100%;
+       border-bottom: 1px solid #5373B4;
 }
 
-span.keyword       { color: #008000 }
-span.keywordtype   { color: #604020 }
-span.keywordflow   { color: #e08000 }
-span.comment       { color: #800000 }
-span.preprocessor  { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral   { color: #008080 }
index cb55f397acf510370ed145be8d3c5d7cb09d4f43..5b030c0214278fc821e3965b3c7d23de85f9c743 100755 (executable)
@@ -1,5 +1,14 @@
-</DIV>
-<DIV class="div-footer">
-Generated on $datetime for $projectname by&nbsp;<A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<div class="footer1">
+<!--hr style="width: 100%; height: 2px;"-->
+<div style="text-align: center;">
+Copyright &copy; 2007-2012  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
+Copyright &copy; 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS<br>
+</div>
+</div>
+</body>
+</html>
diff --git a/doc/salome/tui/static/myheader.html b/doc/salome/tui/static/myheader.html
deleted file mode 100755 (executable)
index d2efb75..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
-   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-   <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
-   <title>Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-&nbsp;
-</body>
-</html>
index ada73f25bbacc8f3256b0e578f3059ed5d703633..233fd107a09f45f4673c1b9e1bafcae1b287a402 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # This Makefile is responsible of generating the client and server
 # implementation of IDL interfaces for both C++ and python usage.
 # The building process of the C++ files is in charge of each source
@@ -28,6 +29,8 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 BASEIDL_FILES = SalomeApp_Engine.idl
 
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
 # This variable defines the files to be installed
 dist_salomeidl_DATA = $(BASEIDL_FILES)
 
@@ -41,7 +44,6 @@ nodist_libSalomeIDLGUI_la_SOURCES = SalomeApp_EngineSK.cc
 nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
 
 libSalomeIDLGUI_la_CPPFLAGS = \
-       -I$(top_builddir)/salome_adm/unix \
        -I$(top_builddir)/idl \
        @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@
 libSalomeIDLGUI_la_LDFLAGS = -no-undefined -version-info=0:0:0
@@ -51,7 +53,7 @@ libSalomeIDLGUI_la_LIBADD  = @CORBA_LIBS@
 OMNIORB_IDL         = @OMNIORB_IDL@
 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome 
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = @IDLPYFLAGS@ -I$(KERNEL_ROOT_DIR)/idl/salome
 
 # potential problem on parallel make on the following - multiple outputs
@@ -67,9 +69,15 @@ install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
          $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
        done
 
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
 uninstall-local:
-       rm -rf $(DESTDIR)$(salomepythondir)/*
+       @for modulen in SalomeApp ; do \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+       done ; \
+       for filen in $(BASEIDL_FILES_PY) ; do \
+         echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+       done
 
 mostlyclean-local:
        -rm -f *.hh *.cc .depidl
index 64fcfdcd3fc9e71504160750648756cb17295e27..61b3b99c2bd3cb6f21de13f1df46ae13310ba3ec 100644 (file)
@@ -1,27 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SalomeApp_Engine.idl
 //  Author : Alexander SLADKOV
-//
+
 #ifndef __SalomeApp_Engine__
 #define __SalomeApp_Engine__
 
@@ -35,7 +35,7 @@ module SalomeApp
    *  SalomeApp::Engine: special CORBA pseudo-engine for persistance needs of components
    *  with no CORBA-based Engine.
    */
-  interface Engine : Engines::Component, 
+  interface Engine : Engines::EngineComponent, 
                      SALOMEDS::Driver
   {
   };
index 150e510d8fd07d8118ec7a4267c7eb49df4c7c64..9f4e08508a1cb6316794ccd63e9ca436b259f458 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # -* Makefile *- 
 # Author : Guillaume Boulant (CSSI)
 # Module : KERNEL 
index b37265c5f24e2f75128f786fa4058109d2b97949..a8393da0949d43baa2194b8a560e7af6385c3440 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAF_H
 #define CAF_H
 
 #if defined WIN32
-#  if defined CAF_EXPORTS
+#  if defined CAF_EXPORTS || defined caf_EXPORTS
 #    define CAF_EXPORT __declspec( dllexport )
 #  else
 #    define CAF_EXPORT __declspec( dllimport )
diff --git a/src/CAF/CAF.pro b/src/CAF/CAF.pro
deleted file mode 100644 (file)
index 9b05bd5..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = caf
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
-LIBS += -L../../lib -lqtx -lsuit -lstd
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += CAF_EXPORTS
-
-HEADERS  = CAF.h
-HEADERS += CAF_Application.h
-HEADERS += CAF_Operation.h
-HEADERS += CAF_Study.h
-HEADERS += CAF_Tools.h
-
-SOURCES  = CAF_Application.cxx
-SOURCES += CAF_Operation.cxx
-SOURCES += CAF_Study.cxx
-SOURCES += CAF_Tools.cxx
-
-TRANSLATIONS = resources/CAF_images.ts \
-               resources/CAF_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
index d92c181d93f3a103335a29273e50e748fd822661..46418ea4462e23e735ea9677abecd86c30637642 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAF_Application.h"
 
 #include "CAF_Tools.h"
@@ -165,15 +166,15 @@ void CAF_Application::createActions()
 
   QtxListAction* editUndo = 
     new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ), 
-                      resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ),
-                      tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk );
+                       resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ),
+                       tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk );
   editUndo->setStatusTip( tr( "PRP_APP_EDIT_UNDO" ) );
   registerAction( EditUndoId, editUndo );
 
   QtxListAction* editRedo =
     new QtxListAction( tr( "TOT_APP_EDIT_REDO" ), 
-                      resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ),
-                      tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk );
+                       resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ),
+                       tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk );
   editRedo->setStatusTip( tr( "PRP_APP_EDIT_REDO" ) );
   registerAction( EditRedoId, editRedo );
 
@@ -207,7 +208,8 @@ bool CAF_Application::undo( CAF_Study* doc )
   bool success = false;
   if ( doc )
   {
-    if ( success = doc->undo() )
+    success = doc->undo();
+    if ( success )
       doc->update();
   }
   return success;
@@ -223,7 +225,8 @@ bool CAF_Application::redo(CAF_Study* doc)
   bool success = false;
   if ( doc )
   {
-    if ( success = doc->redo() )
+    success = doc->redo();
+    if ( success )
       doc->update();
   }
   return success;
@@ -247,8 +250,8 @@ bool CAF_Application::onUndo( int numActions )
     {
       if ( !undo( cafStudy ) )
       {
-       ok = false;
-       break;
+        ok = false;
+        break;
       }
       numActions--;
     }
@@ -275,8 +278,8 @@ bool CAF_Application::onRedo( int numActions )
     {
       if ( !redo( cafStudy ) )
       {
-       ok = false;
-       break;
+        ok = false;
+        break;
       }
       numActions--;
     }
index c96016680c8c8108dff280a155480407423d703b..c0264d4236fa4665f86bafc3926e836d52862fb2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAF_APPLICATION_H
 #define CAF_APPLICATION_H
 
index 41ca0863509eefb6b6b64b38a6e4ce3c3646e030..823dae149124efc3e92c71ead0cba9cf1eaf0b87 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAF_Operation.h"
 
 #include "CAF_Study.h"
index 42781ed14230486c169a4e8601981cb274c46046..a86bb3fcdadba6fea13978af6efc5de71b9c5fe4 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAF_OPERATION_H
 #define CAF_OPERATION_H
 
index fa5dd5787b0c59e7c21052016376e0c9877585de..3f3be8e2671ded3836084a944887b9f492d4c473 100755 (executable)
@@ -1,29 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAF_Study.h"
 
 #include "CAF_Tools.h"
 #include "CAF_Application.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Application.h>
@@ -105,7 +108,7 @@ bool CAF_Study::createDocument( const QString& doc )
   if ( res && app && !app->stdApp().IsNull() )
   {
     try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
 #endif
       TColStd_SequenceOfExtendedString formats;
@@ -146,10 +149,15 @@ bool CAF_Study::openDocument( const QString& fname )
 
   bool status = false;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
+
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+    status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
+#else
     status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
+#endif
   }
   catch ( Standard_Failure ) {
     status = false;
@@ -177,11 +185,15 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
 
   bool status = false;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if ( save )
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+      status = app->Save( stdDoc() ) == PCDM_SS_OK;
+#else
       status = app->Save( stdDoc() ) == CDF_SS_OK;
+#endif
     else
     {
       TCollection_ExtendedString format, path( CAF_Tools::toExtString( fname ) );
@@ -190,7 +202,11 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
       if ( format.Length() )
         stdDoc()->ChangeStorageFormat( format );
 
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+      status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
+#else
       status = app->SaveAs( stdDoc(), path ) == CDF_SS_OK;
+#endif
     }
   }
   catch ( Standard_Failure ) {
@@ -217,7 +233,7 @@ bool CAF_Study::openTransaction()
 
   bool res = true;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     if ( myStdDoc->HasOpenCommand() )
@@ -243,7 +259,7 @@ bool CAF_Study::abortTransaction()
 
   bool res = true;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     myStdDoc->AbortCommand();
@@ -266,7 +282,7 @@ bool CAF_Study::commitTransaction( const QString& name )
 
   bool res = true;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     myStdDoc->CommitCommand();
@@ -371,7 +387,7 @@ bool CAF_Study::undo()
     return false;
 
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     myStdDoc->Undo();
@@ -379,7 +395,7 @@ bool CAF_Study::undo()
   }
   catch ( Standard_Failure ) {
     SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ),
-                             tr( "ERR_DOC_UNDO" ));
+                              tr( "ERR_DOC_UNDO" ));
     return false;
   }
   return true;
@@ -395,7 +411,7 @@ bool CAF_Study::redo()
     return false;
 
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     myStdDoc->Redo();
@@ -403,7 +419,7 @@ bool CAF_Study::redo()
   }
   catch ( Standard_Failure ) {
     SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ),
-                              tr( "ERR_DOC_REDO" ) );
+                               tr( "ERR_DOC_REDO" ) );
     return false;
   }
   return true;
index 4cde4fff96acf6020908249c3bd636ed435f3e40..5fd2e91685ce114e620fe9a097b1382d846245a6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAF_STUDY_H
 #define CAF_STUDY_H
 
index f3ea13ed2f2a102d7702ede7f11bc90b98d88dc3..b0a387b22a4f6bd659938e5a7fe21bca83d35014 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : CAF_Tools.cxx
 //  Author : UI team
 //
index 2674afeb54016d7d0ae2656a93b4cea85ec4a671..159722ce1e0b18448ca1d3248b1ea9d2c240bc3d 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : CAF_Tools.h
 //  Author : UI team
 //
index 578822503e16ef332fa32e94cd885ae798d2a354..9206827b0cf1e2c3d476432ca38d44e1f660a4e4 100755 (executable)
@@ -1,29 +1,30 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : caf
 #  $Header$
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libcaf.la
@@ -45,12 +46,14 @@ MOC_FILES =                 \
        CAF_Application_moc.cxx \
        CAF_Operation_moc.cxx   \
        CAF_Study_moc.cxx
+
 nodist_libcaf_la_SOURCES = $(MOC_FILES)
 
 nodist_salomeres_DATA = \
-       CAF_msg_en.qm
+       CAF_msg_en.qm \
+       CAF_msg_fr.qm
 
-libcaf_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libcaf_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@  \
+       -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 libcaf_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS)
 libcaf_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la
-
diff --git a/src/CAF/resources/CAF_images.po b/src/CAF/resources/CAF_images.po
deleted file mode 100755 (executable)
index 89a031c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_APP_EDIT_UNDO"
-msgstr "undo.png"
-
-msgid "ICON_APP_EDIT_REDO"
-msgstr "redo.png"
diff --git a/src/CAF/resources/CAF_msg_en.po b/src/CAF/resources/CAF_msg_en.po
deleted file mode 100755 (executable)
index fcb2775..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "CAF_Application::ABOUT_INFO"
-msgstr "SUIT Caf application"
-
-msgid "CAF_Application::MEN_APP_EDIT"
-msgstr "&Edit"
-
-msgid "CAF_Application::MEN_DESK_EDIT"
-msgstr "&Edit"
-
-msgid "CAF_Application::MEN_APP_EDIT_REDO"
-msgstr "&Redo"
-
-msgid "CAF_Application::MEN_APP_EDIT_UNDO"
-msgstr "&Undo"
-
-msgid "CAF_Application::PRP_APP_EDIT_REDO"
-msgstr "Redoes the last operation"
-
-msgid "CAF_Application::PRP_APP_EDIT_UNDO"
-msgstr "Undoes the last operation"
-
-msgid "CAF_Application::TOT_APP_EDIT_REDO"
-msgstr "Redo"
-
-msgid "CAF_Application::TOT_APP_EDIT_UNDO"
-msgstr "Undo"
-
-msgid "CAF_Application::INF_APP_UNDOACTIONS"
-msgstr " Undoes %1 action(s) "
-
-msgid "CAF_Application::INF_APP_REDOACTIONS"
-msgstr " Redoes %1 action(s) "
-
-msgid "CAF_Application::INF_ALL_DOCUMENTS_FILTER"
-msgstr "All Readable Documents"
-
-msgid "CAF_Application::INF_ALL_FILTER"
-msgstr "All Files (*.*)"
index 06bbb3d24d738d9bf799560788e3af901b03293b..ed2ac521df9aa62a053232bfa65adfb22aa6fe31 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>CAF_Application</name>
     <message>
index 91efa9af1ff2183f8ace5dc942e7348e5d01a355..5f378926b288aaba23084298625fc15d33b885f6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_H
 #define CAM_H
 
diff --git a/src/CAM/CAM.pro b/src/CAM/CAM.pro
deleted file mode 100644 (file)
index 565af14..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = CAM
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
-LIBS += -L../../lib -lqtx -lsuit -lstd
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += CAM_EXPORTS
-
-HEADERS  = CAM.h
-HEADERS += CAM_Application.h
-HEADERS += CAM_DataModel.h
-HEADERS += CAM_DataObject.h
-HEADERS += CAM_Module.h
-HEADERS += CAM_Study.h
-
-SOURCES  = CAM_Application.cxx
-SOURCES += CAM_DataModel.cxx
-SOURCES += CAM_DataObject.cxx
-SOURCES += CAM_Module.cxx
-SOURCES += CAM_Study.cxx
-
-TRANSLATIONS = resources/CAM_images.ts \
-               resources/CAM_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 354394bfb53e3efe7576061e6f1f8295667ba5c8..fc99c754c652d4463fe1de5529deab84285fd33f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAM_Application.h"
 
 #include "CAM_Study.h"
@@ -30,6 +31,9 @@
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 
+#include <KERNEL_version.h>
+#include <GUI_version.h>
+
 #include <QApplication>
 #include <QRegExp>
 
 #include <dlfcn.h>
 #endif
 
+#include <cstdio>
+
+namespace
+{
+class BusyLocker
+{
+public:
+  BusyLocker( bool& busy ) : myPrev( busy ), myBusy( busy ) { myBusy = true; }
+  ~BusyLocker() { myBusy = myPrev; }
+private:
+  bool  myPrev;
+  bool& myBusy;
+};
+}
+
 /*!
   \brief Create new instance of CAM_Application.
   \return new instance of CAM_Application class
@@ -76,7 +95,8 @@ extern "C" CAM_EXPORT SUIT_Application* createApplication()
 CAM_Application::CAM_Application( const bool autoLoad )
 : STD_Application(),
   myModule( 0 ),
-  myAutoLoad( autoLoad )
+  myAutoLoad( autoLoad ),
+  myBlocked( false )
 {
   readModuleList();
 }
@@ -88,6 +108,9 @@ CAM_Application::CAM_Application( const bool autoLoad )
 */
 CAM_Application::~CAM_Application()
 {
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end(); ++it )
+    delete *it;
+  myModules.clear();
 }
 
 /*! 
@@ -122,7 +145,7 @@ CAM_Module* CAM_Application::module(  const QString& modName ) const
 {
   CAM_Module* mod = 0;
   for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
-       it != myModules.end() && !mod; ++it )
+        it != myModules.end() && !mod; ++it )
     if ( (*it)->moduleName() == modName )
       mod = *it;
   return mod;
@@ -146,7 +169,7 @@ void CAM_Application::modules( CAM_Application::ModuleList& out ) const
   out.clear();
 
   for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
-       it != myModules.end(); ++it )
+        it != myModules.end(); ++it )
     out.append( *it );
 }
 
@@ -166,13 +189,13 @@ void CAM_Application::modules( QStringList& lst, const bool loaded ) const
   if ( loaded )
   {
     for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); 
-         it != myModules.end(); ++it )
+          it != myModules.end(); ++it )
       lst.append( (*it)->moduleName() );
   }
   else
   {
     for ( ModuleInfoList::const_iterator it = myInfoList.begin(); 
-         it != myInfoList.end(); ++it )
+          it != myInfoList.end(); ++it )
       lst.append( (*it).title );
   }
 }
@@ -197,7 +220,7 @@ void CAM_Application::addModule( CAM_Module* mod )
 
   ModuleList newList;
   for ( ModuleInfoList::const_iterator it = myInfoList.begin(); 
-       it != myInfoList.end(); ++it )
+        it != myInfoList.end(); ++it )
   {
     if ( (*it).title == mod->moduleName() )
       newList.append( mod );
@@ -210,7 +233,7 @@ void CAM_Application::addModule( CAM_Module* mod )
   }
 
   for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
-       it != myModules.end(); ++it )
+        it != myModules.end(); ++it )
   {
     if ( !newList.contains( *it ) )
       newList.append( *it );
@@ -233,15 +256,18 @@ void CAM_Application::loadModules()
 {
   for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it )
   {
+    if ( !isModuleAccessible( (*it).title ) ) {
+      continue;
+    }
     CAM_Module* mod = loadModule( (*it).title );
     if ( mod )
       addModule( mod );
     else {
+      QString wrn = tr( "Can not load module %1" ).arg( (*it).title );
       if ( desktop() && desktop()->isVisible() )
-       SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ),
-                                  tr( "Can not load module %1" ).arg( (*it).title ) );
+        SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ), wrn );
       else
-       qWarning( tr( "Can not load module %1" ).arg( (*it).title ).toLatin1().data() ); 
+        qWarning( qPrintable( wrn ) ); 
     }
   }
 }
@@ -261,19 +287,25 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show
 {
   if ( myInfoList.isEmpty() )
   {
-    qWarning( tr( "Modules configuration is not defined." ).toLatin1().data() );
+    qWarning( qPrintable( tr( "Modules configuration is not defined." ) ) );
+    return 0;
+  }
+
+  if ( !isModuleAccessible( modName ) ) {
+    qWarning( qPrintable( tr( "Module \"%1\" cannot be loaded in this application." ).arg( modName ) ) );
     return 0;
   }
 
   QString libName = moduleLibrary( modName );
   if ( libName.isEmpty() )
   {
-    qWarning( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ).toLatin1().data() );
+    qWarning( qPrintable( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ) ) );
     return 0;
   }
 
   QString err;
   GET_MODULE_FUNC crtInst = 0;
+  GET_VERSION_FUNC getVersion = 0;
 
 #ifdef WIN32
   HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() ); 
@@ -296,6 +328,8 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show
     err = QString( "Failed to find  %1 function. %2" ).arg( GET_MODULE_NAME ).arg( (LPTSTR)lpMsgBuf );
     ::LocalFree( lpMsgBuf );
     }
+
+    getVersion = (GET_VERSION_FUNC)::GetProcAddress( modLib, GET_VERSION_NAME );
   }
 #else
   void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY );
@@ -306,6 +340,8 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show
     crtInst = (GET_MODULE_FUNC)dlsym( modLib, GET_MODULE_NAME );
     if ( !crtInst )
       err = QString( "Failed to find function %1. %2" ).arg( GET_MODULE_NAME ).arg( dlerror() );
+
+    getVersion = (GET_VERSION_FUNC)dlsym( modLib, GET_VERSION_NAME );
   }
 #endif
 
@@ -320,9 +356,22 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show
     if ( desktop() && desktop()->isVisible() )
       SUIT_MessageBox::warning( desktop(), tr( "Error" ), err );
     else
-      qWarning( err.toLatin1().data() ); 
+      qWarning( qPrintable( err ) ); 
   }
 
+  char* version = getVersion ? getVersion() : 0;
+
+  if(version) {    
+    for ( ModuleInfoList::iterator it = myInfoList.begin(); it != myInfoList.end(); ++it ) {
+      if ( (*it).title == modName ) {
+        if( (*it).version.isEmpty() ) {
+          (*it).version = QString(version);
+        }
+        break;
+      }
+    }
+  }
+  
   return module;
 }
 
@@ -333,9 +382,13 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show
 */
 bool CAM_Application::activateModule( const QString& modName )
 {
-  if ( !modName.isEmpty() && !activeStudy() )
+  if ( !modName.isEmpty() && !activeStudy() || myBlocked )
     return false;
 
+  // VSR 25/10/2011: prevent nested activation/deactivation
+  // See issues 0021307, 0021373
+  BusyLocker lock( myBlocked );
+
   bool res = false;
   if ( !modName.isEmpty() )
   {
@@ -377,7 +430,7 @@ bool CAM_Application::activateModule( CAM_Module* mod )
     {
       // ....      
     }    
-  }    
+  }     
   myModule = mod;
 
   if ( myModule ){
@@ -387,10 +440,11 @@ bool CAM_Application::activateModule( CAM_Module* mod )
     {
       myModule->setMenuShown( false );
       myModule->setToolShown( false );
+      QString wrn = tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() );
       if ( desktop() && desktop()->isVisible() )
-       SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ) );
+        SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), wrn );
       else
-       qWarning( tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ).toLatin1().data() ); 
+        qWarning( qPrintable( wrn ) ); 
       myModule = 0;
       return false;
     }
@@ -434,6 +488,10 @@ void CAM_Application::beforeCloseDoc( SUIT_Study* theDoc )
     (*it)->studyClosed( theDoc );
 }
 
+void CAM_Application::afterCloseDoc()
+{
+}
+
 /*!
   \brief Set active study.
   \param study study to be made active
@@ -503,6 +561,38 @@ QString CAM_Application::moduleIcon( const QString& name ) const
   return res;
 }
 
+/*!
+  \brief Returns \c true if module is accessible for the current application.
+  Singleton module can be loaded only in one application object. In other application
+  objects this module will be unavailable.
+  \param title module title (user name)
+  \return \c true if module is accessible (can be loaded) or \c false otherwise
+ */
+bool CAM_Application::isModuleAccessible( const QString& title ) const
+{
+  bool found   = false;
+  bool blocked = false;
+  
+  QStringList somewhereLoaded;
+  QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+  foreach( SUIT_Application* app, apps ) {
+    CAM_Application* camApp = dynamic_cast<CAM_Application*>( app );
+    if ( !camApp ) continue;
+    QStringList loaded;
+    camApp->modules( loaded, true );
+    foreach( QString lm, loaded ) {
+      if ( !somewhereLoaded.contains( lm ) ) somewhereLoaded << lm;
+    }
+  }
+
+  for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && !found; ++it )
+  {
+    found = (*it).title == title;
+    blocked = (*it).isSingleton && somewhereLoaded.contains((*it).title);
+  }
+  return found && !blocked;
+}
+
 /*!
   \brief Get module library name by its title (user name).
   \param title module title (user name)
@@ -582,7 +672,7 @@ void CAM_Application::readModuleList()
     QStringList mods = modules.split( QRegExp( "[:|,\\s]" ), QString::SkipEmptyParts );
     for ( int i = 0; i < mods.count(); i++ ) {
       if ( !mods[i].trimmed().isEmpty() )
-       modList.append( mods[i].trimmed() );
+        modList.append( mods[i].trimmed() );
     }
   }
 
@@ -605,8 +695,8 @@ void CAM_Application::readModuleList()
     if ( modTitle.isEmpty() )
     {
       printf( "****************************************************************\n" );
-      printf( "*    Warning: %s not found in resources.\n", (*it).toLatin1().data() );
-      printf( "*    Module will not be available\n" );
+      printf( "*    Warning: %s GUI resources are not found.\n", qPrintable(*it) );
+      printf( "*    %s GUI will not be available.\n", qPrintable(*it) );
       printf( "****************************************************************\n" );
       continue;
     }
@@ -633,11 +723,17 @@ void CAM_Application::readModuleList()
     else
       modLibrary = modName;
 
+    bool aIsSingleton = resMgr->booleanValue(*it, "singleton", false);
+
+    QString ver = resMgr->stringValue(*it, "version", QString());
+
     ModuleInfo inf;
     inf.name = modName;
     inf.title = modTitle;
     inf.internal = modLibrary;
     inf.icon = modIcon;
+    inf.isSingleton = aIsSingleton;
+    inf.version = ver;
     myInfoList.append( inf );
   }
 
@@ -646,9 +742,9 @@ void CAM_Application::readModuleList()
       SUIT_MessageBox::warning( desktop(), tr( "Warning" ), tr( "Modules list is empty" ) );
     else
       {
-       printf( "****************************************************************\n" );
-       printf( "*    Warning: modules list is empty.\n" );
-       printf( "****************************************************************\n" );
+        printf( "****************************************************************\n" );
+        printf( "*    Warning: modules list is empty.\n" );
+        printf( "****************************************************************\n" );
       }
   }
 }
@@ -677,3 +773,29 @@ void CAM_Application::createEmptyStudy()
   /*SUIT_Study* study = */activeStudy();
   STD_Application::createEmptyStudy();
 }
+
+/*!
+  \brief Return information about version of the each module.
+*/
+CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo() const {
+
+  ModuleShortInfoList info;
+
+  ModuleShortInfo kernel;
+  kernel.name = "KERNEL";
+  kernel.version = KERNEL_VERSION_STR;
+  info.append(kernel);
+
+  ModuleShortInfo gui;
+  gui.name = "GUI";
+  gui.version = GUI_VERSION_STR;
+  info.append(gui);
+
+  for(int i = 0; i < myInfoList.size(); i++) {
+    ModuleShortInfo infoItem;
+    infoItem.name = myInfoList.at(i).title;
+    infoItem.version = myInfoList.at(i).version;
+    info.append(infoItem);
+  }  
+  return info;
+}
index 5ce540555e89d284dc6224aba22761ad166cac3f..45b527a65ddac9ef62efad8515029b6a082f5328 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_APPLICATION_H
 #define CAM_APPLICATION_H
 
@@ -40,6 +41,8 @@ class CAM_EXPORT CAM_Application : public STD_Application
 
 public:
   typedef QList<CAM_Module*> ModuleList;
+  typedef struct { QString name;  QString version; } ModuleShortInfo;
+  typedef QList<ModuleShortInfo> ModuleShortInfoList;
 
 public:
   CAM_Application( const bool = true );
@@ -66,15 +69,19 @@ public:
   QString             moduleName( const QString& ) const;
   QString             moduleTitle( const QString& ) const;
   QString             moduleIcon( const QString& ) const;
+  bool                isModuleAccessible( const QString& ) const;
 
   virtual void        createEmptyStudy();
 
+  ModuleShortInfoList getVersionInfo() const;
+
 protected:
   virtual SUIT_Study* createNewStudy();
   virtual void        updateCommandsStatus();
 
   virtual void        moduleAdded( CAM_Module* );
   virtual void        beforeCloseDoc( SUIT_Study* );
+  virtual void        afterCloseDoc();
   virtual bool        activateModule( CAM_Module* = 0 );
 
   virtual void        setActiveStudy( SUIT_Study* );
@@ -85,7 +92,7 @@ private:
   void                readModuleList();
 
 private:
-  typedef struct { QString name, title, internal, icon; } ModuleInfo;
+  typedef struct { QString name, title, internal, icon; bool isSingleton; QString version; } ModuleInfo;
   typedef QList<ModuleInfo> ModuleInfoList;
 
 private:
@@ -93,6 +100,7 @@ private:
   ModuleList          myModules;       //!< loaded modules list
   ModuleInfoList      myInfoList;      //!< modules info list
   bool                myAutoLoad;      //!< auto loading flag
+  bool                myBlocked;       //!< "blocked" flag, internal usage
 };
 
 #ifdef WIN32
index a9c5142fd061f98fdb5c65e2b1e7be5f749e7cef..eff5e08f0bb5f240c05b40ace5c96d961093c8df 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAM_DataModel.h"
 
 #include "CAM_Module.h"
@@ -94,13 +95,13 @@ void CAM_DataModel::setRoot( const CAM_DataObject* newRoot )
 
   if ( myRoot )
     myRoot->disconnect( SIGNAL( destroyed( SUIT_DataObject* ) ), 
-                       this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+                        this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 
   myRoot = (CAM_DataObject*)newRoot;
 
   if ( myRoot )
     myRoot->connect( SIGNAL( destroyed( SUIT_DataObject* ) ), 
-                    this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+                     this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
 
   emit rootChanged( this );
 }
@@ -139,8 +140,8 @@ void CAM_DataModel::onDestroyed( SUIT_DataObject* obj )
   \return \c true if data model is loaded successfully
 */
 bool CAM_DataModel::open( const QString& /*name*/, 
-                         CAM_Study*     /*study*/, 
-                         QStringList    /*files*/ )
+                          CAM_Study*     /*study*/, 
+                          QStringList    /*files*/ )
 {
   return true;
 }
@@ -171,8 +172,8 @@ bool CAM_DataModel::save( QStringList& )
   \return \c true if data model is saved successfully
 */
 bool CAM_DataModel::saveAs( const QString& /*name*/,
-                           CAM_Study*     /*study*/,
-                           QStringList&   /*files*/ )
+                            CAM_Study*     /*study*/,
+                            QStringList&   /*files*/ )
 {
   return true;
 }
index 5a9b96cfbc48c79b35197e61be00c300320170de..dad7450415fce839bb66d8f9506fc00331225417 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_DATAMODEL_H
 #define CAM_DATAMODEL_H
 
index 29563ef8ad38d65495262877c6fc55481677124d..beb5eb742b1eebfc4156dfc20e68a39308ff711f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAM_DataObject.h"
 
 #include "CAM_Module.h"
index a2f9aae40f311b8472d6bd212c332ae07cee44cd..ff69fab723b06fba4b6637db0f07aabfda9449ac 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_DATAOBJECT_H
 #define CAM_DATAOBJECT_H
 
index d3dde1a21557299bf381095074cfa5612bcc0aa7..9983c43d269fbfae149c887e83edac81b78b48c2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAM_Module.h"
 
 #include "CAM_DataModel.h"
   Provides support of menu/toolbars management.
 */
 
+class ActionMgrLocker
+{
+public:
+  ActionMgrLocker( QtxActionMgr* m, bool use ) : myMgr( m ), myUseLock( use )
+  {
+    if ( myUseLock ) {
+      myUpdEnabled = myMgr->isUpdatesEnabled();
+      myMgr->setUpdatesEnabled( false );
+    }
+  }
+  ~ActionMgrLocker()
+  {
+    if ( myUseLock ) {
+      myMgr->setUpdatesEnabled( myUpdEnabled );
+      //myMgr->update();
+    }
+  }
+
+  QtxActionMgr* myMgr;
+  bool          myUseLock;
+  bool          myUpdEnabled;
+};
+
 /*!
   \brief Default constructor.
 
@@ -63,7 +87,9 @@ CAM_Module::CAM_Module( const QString& name )
 : QObject(),
   myApp( 0 ),
   myName( name ),
-  myDataModel( 0 )
+  myDataModel( 0 ),
+  myMenuShown( false ),
+  myToolShown( false )
 {
 }
 
@@ -375,7 +401,9 @@ int CAM_Module::createTool( const QString& name )
   if ( !toolMgr() )
     return -1;
 
-  return toolMgr()->createToolBar( name );
+  ActionMgrLocker lock( toolMgr(), !myToolShown );
+
+  return toolMgr()->createToolBar( name, myToolShown );
 }
 
 /*!
@@ -402,8 +430,14 @@ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int
   if ( !toolMgr() )
     return -1;
 
+  ActionMgrLocker lock( toolMgr(), !myToolShown );
+
   int regId = registerAction( id, a );
   int intId = toolMgr()->insert( a, tBar, idx );
+
+  if ( !myToolShown )
+    setToolShown( a, false );
+
   return intId != -1 ? regId : -1;
 }
 
@@ -431,8 +465,14 @@ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const
   if ( !toolMgr() )
     return -1;
 
+  ActionMgrLocker lock( toolMgr(), !myToolShown );
+
   int regId = registerAction( id, a );
   int intId = toolMgr()->insert( a, tBar, idx );
+
+  if ( !myToolShown )
+    setToolShown( a, false );
+
   return intId != -1 ? regId : -1;
 }
 
@@ -459,7 +499,13 @@ int CAM_Module::createTool( const int id, const int tBar, const int idx )
   if ( !toolMgr() )
     return -1;
 
+  ActionMgrLocker lock( toolMgr(), !myToolShown );
+
   int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+  if ( !myToolShown )
+    setToolShown( action( id ), false );
+
   return intId != -1 ? id : -1;
 }
 
@@ -486,7 +532,13 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
   if ( !toolMgr() )
     return -1;
 
+  ActionMgrLocker lock( toolMgr(), !myToolShown );
+
   int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+  if ( !myToolShown )
+    setToolShown( action( id ), false );
+
   return intId != -1 ? id : -1;
 }
 
@@ -520,7 +572,7 @@ int CAM_Module::createMenu( const QString& subMenu, const int menu,
 {
   if ( !menuMgr() )
     return -1;
-
+  
   return menuMgr()->insert( subMenu, menu, group, id, idx );
 }
 
@@ -584,9 +636,15 @@ int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int
 {
   if ( !a || !menuMgr() )
     return -1;
+  
+  ActionMgrLocker lock( menuMgr(), !myMenuShown );
 
   int regId = registerAction( id, a );
   int intId = menuMgr()->insert( a, menu, group, idx );
+
+  if ( !myMenuShown )
+    setMenuShown( a, false );
+
   return intId != -1 ? regId : -1;
 }
 
@@ -621,8 +679,14 @@ int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const
   if ( !a || !menuMgr() )
     return -1;
 
+  ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
   int regId = registerAction( id, a );
   int intId = menuMgr()->insert( a, menu, group, idx );
+
+  if ( !myMenuShown )
+    setMenuShown( a, false );
+  
   return intId != -1 ? regId : -1;
 }
 
@@ -652,7 +716,13 @@ int CAM_Module::createMenu( const int id, const int menu, const int group, const
   if ( !menuMgr() )
     return -1;
 
+  ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
   int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+  if ( !myMenuShown )
+    setMenuShown( action( id ), false );
+
   return intId != -1 ? id : -1;
 }
 
@@ -686,7 +756,13 @@ int CAM_Module::createMenu( const int id, const QString& menu, const int group,
   if ( !menuMgr() )
     return -1;
 
+  ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
   int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+  if ( !myMenuShown )
+    setMenuShown( action( id ), false );
+
   return intId != -1 ? id : -1;
 }
 
@@ -697,6 +773,8 @@ int CAM_Module::createMenu( const int id, const QString& menu, const int group,
 */
 void CAM_Module::setMenuShown( const bool on )
 {
+  myMenuShown = on;
+
   QtxActionMenuMgr* mMgr = menuMgr();
   if ( !mMgr )
     return;
@@ -744,6 +822,8 @@ void CAM_Module::setMenuShown( const int id, const bool on )
 */
 void CAM_Module::setToolShown( const bool on )
 {
+  myToolShown = on;
+
   QtxActionToolMgr* tMgr = toolMgr();
   if ( !tMgr )
     return;
@@ -834,9 +914,10 @@ int CAM_Module::actionId( const QAction* a ) const
 */
 QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
                                    const QString& menu, const QString& tip, const int key,
-                                   QObject* parent, const bool toggle, QObject* reciever, const char* member )
+                                   QObject* parent, const bool toggle, QObject* reciever,
+                                  const char* member, const QString& shortcutAction )
 {
-  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
+  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
   a->setStatusTip( tip );
 
   if ( reciever && member )
@@ -934,6 +1015,14 @@ QAction* CAM_Module::separator()
   return QtxActionMgr::separator();
 }
 
+/*!
+  \brief Update visibility state of the module objects.
+*/
+void CAM_Module::updateModuleVisibilityState() {
+
+}
+
+
 /*!
   \brief Connect data model of the module to the active study
   \param camStudy CAM study object
@@ -952,9 +1041,9 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy )
     if( (*it) == this && !camStudy->containsDataModel( dm ) )
     {
       if ( prev )
-       camStudy->insertDataModel( (*it)->dataModel(), prev );
+        camStudy->insertDataModel( (*it)->dataModel(), prev );
       else
-       camStudy->insertDataModel( (*it)->dataModel(), 0 );
+        camStudy->insertDataModel( (*it)->dataModel(), 0 );
     }
     prev = dm;
   }
index 628623f115d4efcaece3e0895f3b09663b7c1ad4..c469049b90708b6d5f2259fad891b4e3e534e0fc 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_MODULE_H
 #define CAM_MODULE_H
 
@@ -79,6 +80,8 @@ public:
   void                   setToolShown( QAction*, const bool );
   void                   setToolShown( const int, const bool );
 
+  virtual void           updateModuleVisibilityState();
+
 public slots:
   virtual bool           activateModule( SUIT_Study* );
   virtual bool           deactivateModule( SUIT_Study* );
@@ -127,7 +130,7 @@ protected:
   bool                   unregisterAction( QAction* );
   QAction*               createAction( const int, const QString&, const QIcon&, const QString&,
                                        const QString&, const int, QObject* = 0,
-                                       const bool = false, QObject* = 0, const char* = 0 );
+                                       const bool = false, QObject* = 0, const char* = 0, const QString& = QString() );
 
 private:
   CAM_Application*       myApp;             //!< parent application object
@@ -136,6 +139,8 @@ private:
   QString                myInfo;            //!< latest info message
   CAM_DataModel*         myDataModel;       //!< data model
   QMap<int, QAction*>    myActionMap;       //!< menu actions
+  bool                   myMenuShown;       //!< menu shown flag
+  bool                   myToolShown;       //!< tool shown flag
 
   friend class CAM_Application;
 };
@@ -147,8 +152,9 @@ private:
 extern "C"
 {
   typedef CAM_Module* (*GET_MODULE_FUNC)();
+  typedef char* (*GET_VERSION_FUNC)();
 }
 
 #define GET_MODULE_NAME "createModule"
-
+#define GET_VERSION_NAME "getModuleVersion"
 #endif
index 95bee0699c8882fa12f4929694542c50ad7abd0d..1cff3277ac7d7aa21f2140b0fb113b97ed32bd45 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "CAM_Study.h"
 
 #include "CAM_DataModel.h"
index a90d0e5c5079959b5c5caba81b4accede99a8550..775754ff924ff43c8675695e2c694d234e864a27 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef CAM_STUDY_H
 #define CAM_STUDY_H
 
index 145a77214271158a63c7df152b5fe49eb147e959..4359790fbfe9bc1f223fc71671496489a9e9f241 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : CAM
@@ -50,7 +51,7 @@ MOC_FILES =                   \
        CAM_DataModel_moc.cxx
 nodist_libCAM_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = CAM_msg_en.qm
+nodist_salomeres_DATA = CAM_msg_en.qm CAM_msg_fr.qm
 
 libCAM_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../STD -I$(srcdir)/../Qtx
 libCAM_la_LDFLAGS  = $(QT_MT_LIBS)
diff --git a/src/CAM/resources/CAM_msg_en.po b/src/CAM/resources/CAM_msg_en.po
deleted file mode 100755 (executable)
index e03419f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ERROR_TLT"
-msgstr "Error"
-
-msgid "ERROR_ACTIVATE_MODULE_MSG"
-msgstr "Failed to activate module %1"
index 949dc1eace41085e455493080e49b3c54a21b57e..6779ef2282e2a0d0cf9043aef928bee251b68e5e 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index 111e69ff018ff94de22ef59707d23ddc63247c27..be815a8c38c372e84c066dc0971abe2de0eee2f1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch.hxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
index 90f90d55b2631516fa1d6bbbd7fa4dc628808888..b9802be49b566db21056833db8fd17e3318c969b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_CatchSignals.cxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
@@ -173,7 +174,7 @@ void CASCatch_CatchSignals::Activate()
 #endif
   act.sa_handler = (SIG_PFV) &SegvHandler ;
 
-#ifdef SA_SIGINFO      // OSF,SOLARIS,IRIX
+#ifdef SA_SIGINFO       // OSF,SOLARIS,IRIX
   act.sa_flags = act.sa_flags | SA_SIGINFO ;
 # ifdef SOLARIS
   act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ;
index baca0837bf2a3146f8ee39e7f3becb67ab57a1ad..e392b9af523390d64bc7020ae34bb05deb4440f9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_CatchSignals.hxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
index b2843e02c0b6f842897bea05e9c422edc775d2d1..2a39a61105002ec1ae7a0d415c000d24f2aa7b42 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_ErrorHandler.cxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
index 7b44dfa03ccfcde198c2fd60075f18b4dc860d4e..763335b31537942c09385ef5475fe7c3450ead4e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_ErrorHandler.hxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
index a0e2909890b34ea6c9b695bde1cc0f6cf7e4d9a3..f8d9ff29dcfcd5fc033f4c085bde7b6c9da8a28d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_Failure.cxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
@@ -41,7 +42,7 @@ static Handle(CASCatch_Failure) RaisedError;
  * \brief creates a CASCatch_Failure
  */
 //================================================================================ 
-CASCatch_Failure::CASCatch_Failure () { myMessage = "Signal detected";}
+CASCatch_Failure::CASCatch_Failure () { myMessage = (Standard_Character*)"Signal detected";}
 
 
 //================================================================================
index 262a0c836a76023b1fa2c85f95237adc9ba446e2..8e4a1990b95c34675342b8d98511cb0f34087df0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : CASCatch_Failure.hxx
 // Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
 //
index 82629d8c81ede928dbb9d9324bcd1a41a0711950..1eaa57cdfa77849064a0d9c168b79de346d10cfe 100644 (file)
@@ -1,27 +1,28 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # File   : Makefile.am
 # Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 
index 7cfb41ec3932423dc4586a75e343eea445a213d5..87fafcba19abd2133f1f274151a2d21318c91e32 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef DDS_H
 #define DDS_H
 
diff --git a/src/DDS/DDS.pro b/src/DDS/DDS.pro
deleted file mode 100644 (file)
index 6a5c8d1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = DDS
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-CAS_OCAF = -L$${CASROOT}/Linux/lib -lPTKernel -lTKernel -lTKCDF -lTKLCAF -lTKPCAF -lTKStdSchema
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
-LIBS += $${CAS_KERNEL} $${CAS_OCAF}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=2 OCC_VERSION_MAINTENANCE=0 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = DDS.h
-HEADERS += DDS_DicGroup.h
-HEADERS += DDS_DicItem.h
-HEADERS += DDS_Dictionary.h
-HEADERS += DDS_KeyWords.h
-
-SOURCES  = DDS_DicGroup.cxx
-SOURCES += DDS_DicItem.cxx
-SOURCES += DDS_Dictionary.cxx
-SOURCES += DDS_KeyWords.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 1d7d736f1cea860a4eccb07f1dbc16c606e8a85f..ea2c65593771f3bfccf850bfa5467e6a900e1771 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DDS_DicGroup.h"
 
 #include "DDS_Dictionary.h"
index 1ef6afda7f7c979d9295122d4141dc7c4435ae04..5b7d2f6c85c1aa14c0ee672d64346a784dbf62d6 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef DDS_DICGROUP_H
 #define DDS_DICGROUP_H
 
index 6a8954546c2fe97cab83b5d3d50996816d0b6968..4ec5f83a4ed9fd2e87829abde24a55392be78b46 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DDS_DicItem.h"
 #include "DDS_Dictionary.h"
 
@@ -199,7 +200,7 @@ Standard_Real DDS_DicItem::GetMinValue() const
 /*!
   \brief Get the minimum value of the parameter for the specified 
          units system \a theSystem.
-        
+         
   Returned value is converted to SI.
 
   \param theUnitsSystem units system
@@ -774,9 +775,9 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
             {
               //  Read the text in the element "value"
               //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);
+              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
@@ -855,12 +856,12 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
         LDOMString v = attr.getValue();
         if( v.Type()==LDOMBasicString::LDOM_Integer )
         {
-               Standard_Integer ival;
-               v.GetInteger( ival );
-               value = TCollection_ExtendedString( ival );
+                Standard_Integer ival;
+                v.GetInteger( ival );
+                value = TCollection_ExtendedString( ival );
         }
         else
-               value = ( Standard_CString )v.GetString();
+                value = ( Standard_CString )v.GetString();
       }
       else
         continue;
@@ -894,7 +895,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
       else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100
         anUnitData.myScale = 0.01;
     }
-         catch( Standard_Failure ) {
+          catch( Standard_Failure ) {
       anUnitData.myUnits.Clear();
     }
 
index d81a5e744ca7575e1ce330701bd5ee1a7c945419..96efab7fae2abf946ce23b78827762c398d450e8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef DDS_DICITEM_H
 #define DDS_DICITEM_H
 
index ff4c516f34c1467ae7f123947cbbf0b00d558f72..28c309574dc5435aabef61e3e453f00ea96be51c 100644 (file)
@@ -1,28 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DDS_Dictionary.h"
 
 #include "DDS_KeyWords.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <LDOMString.hxx>
 #include <LDOMParser.hxx>
 
@@ -550,7 +553,7 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
 #endif
       aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
@@ -577,7 +580,7 @@ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standa
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
 #endif
       aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
index 5ecf488da89092988ca20eec52c8b901892199db..a091f8b8ae59d76c10994ad145de27399ed59400 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef DDS_DICTIONARY_H
 #define DDS_DICTIONARY_H
 
index 6eb6215640caa331c6086ae272b497de15330cab..425d06a1ebc2923e44467d3001a828befc99e087 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DDS_KeyWords.h"
 
 IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
index 4d249b5f3dd7df8ecb9fbdca8a96474858b2c5da..59dee8d2f951c80853de66cb12ea6b7123d3e038 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef DDS_KEYWORDS_H
 #define DDS_KEYWORDS_H
 
index dd8553b1488203f5c1611b27a32c1bb3928b2ccb..c3b333fc931e02d956e137435efe0f60e89ba97a 100755 (executable)
@@ -1,29 +1,30 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Alexander SOLOVYOV (OCN)
 #  Module : DDS
-#  $Header: /home/server/cvs/GUI/GUI_SRC/src/DDS/Makefile.in
-#
+#  $Header$
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libDDS.la
@@ -41,9 +42,6 @@ dist_libDDS_la_SOURCES =      \
        DDS_Dictionary.cxx      \
        DDS_KeyWords.cxx
 
-libDDS_la_CPPFLAGS = $(CAS_CPPFLAGS)
+libDDS_la_CPPFLAGS = $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@
 
 libDDS_la_LDFLAGS  = $(CAS_KERNEL) $(CAS_OCAF)
-
-
-
index d9052d07e3c070957f1b6b4a1506650cfebbe8ab..9c979d99c6e158fed8f2744ea7e540b64fb9bdf8 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #if !defined ( EVENT_H )
 #define EVENT_H
 
 #ifdef WIN32
-#  ifdef EVENT_EXPORTS
+#  if defined EVENT_EXPORTS || defined Event_EXPORTS
 #    define EVENT_EXPORT __declspec(dllexport)
 #  else
 #    define EVENT_EXPORT __declspec(dllimport)
diff --git a/src/Event/Event.pro b/src/Event/Event.pro
deleted file mode 100644 (file)
index 3b3457b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = Event
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include
-LIBS += 
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += EVENT_EXPORTS
-
-HEADERS  = Event.h
-HEADERS += SALOME_Event.h 
-HEADERS += SALOME_EventFilter.h
-
-SOURCES  = SALOME_Event.cxx 
-SOURCES += SALOME_EventFilter.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 49ecd27fae4f88c083f53c5039cb06aca8d9cdea..612abc06d27bd853929e47d65cb5f1d005bc650c 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOME Utils : general SALOME's definitions and tools
 #  File   : Makefile.in
 #  Author : Marc Tajchman (CEA)
index 60a5dc254ee790643fc37421f624733cfc5abc05..e7dc3e5aebb903639da07608de23eded0b30d162 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  KERNEL SALOME_Event : Define event posting mechanism
 //  File   : SALOME_Event.cxx
 //  Author : Sergey ANIKIN
@@ -136,7 +137,7 @@ void SALOME_CustomEvent::setData( void* data )
   \class SALOME_Event
   \brief The class which encapsulates data and functionality required for 
          posting component-specific events to perform arbitrary operations 
-        in the main GUI thread. 
+         in the main GUI thread. 
 
   SALOME_Event objects can be posted by any thread belonging to the GUI process.
   
index 8493680737e0547b1e21bb79088f5c4177b3fd69..44712ebe1dabd552dda5094207ed013850a3961a 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  KERNEL SALOME_Event : Define event posting mechanism
 //  File   : SALOME_Event.h
 //  Author : Sergey ANIKIN
@@ -75,7 +73,7 @@ public:
   TResult myResult;
   typedef TResult (TObject::* TAction)();
   TMemFunEvent(TObject* theObject, TAction theAction, 
-              TResult theResult = TResult()):
+               TResult theResult = TResult()):
     myObject(theObject),
     myAction(theAction),
     myResult(theResult)
@@ -114,7 +112,7 @@ public:
   TResult myResult;
   typedef TResult (TObject::* TAction)(TArg);
   TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg, 
-                  TResult theResult = TResult()):
+                   TResult theResult = TResult()):
     myObject(theObject),
     myAction(theAction),
     myResult(theResult),
@@ -158,8 +156,8 @@ public:
   TResult myResult;
   typedef TResult (TObject::* TAction)(TArg,TArg1);
   TMemFun2ArgEvent(TObject* theObject, TAction theAction, 
-                  TArg theArg, TArg1 theArg1,
-                  TResult theResult = TResult()):
+                   TArg theArg, TArg1 theArg1,
+                   TResult theResult = TResult()):
     myObject(theObject),
     myAction(theAction),
     myResult(theResult),
index 074213c9ad41fe8448905ddc8cd9689eb0f9281c..209113ecc49fbe710f7ad4936bf5834bfd3c6117 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SALOME_EventFilter.h"
 #include "SALOME_Event.h"
 
index 3881d6ac1148837d97a881af35394ea2f2182b62..8336a7cd00e8d7825788553cad3367b3485899e8 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOME_EVENTFILTER_H
 #define SALOME_EVENTFILTER_H
 
index 1748eeaa286131a378284b3ce41900ccd0649a67..dde033dbabf573b7cb521a36e39859e399963c17 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer.h
 // Created:   November, 2004
@@ -26,7 +27,7 @@
 //
 #ifdef WIN32
 
-#ifdef GLVIEWER_EXPORTS
+#if defined GLVIEWER_EXPORTS || defined GLViewer_EXPORTS
 #define GLVIEWER_API __declspec(dllexport)
 #else
 #define GLVIEWER_API __declspec(dllimport)
diff --git a/src/GLViewer/GLViewer.pro b/src/GLViewer/GLViewer.pro
deleted file mode 100644 (file)
index e342254..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = GLViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-GL_LIBS = -L/usr/X11R6/lib$$(LIB_LOCATION_SUFFIX) -lGLU
-
-INCLUDEPATH += $$(QTDIR)/include/QtOpenGL ../../include $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${GL_LIBS} $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += GLVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = GLViewer.h
-HEADERS += GLViewer_AspectLine.h
-HEADERS += GLViewer_BaseDrawers.h
-HEADERS += GLViewer_BaseObjects.h
-HEADERS += GLViewer_Compass.h
-HEADERS += GLViewer_Context.h
-HEADERS += GLViewer_CoordSystem.h
-HEADERS += GLViewer_Defs.h
-HEADERS += GLViewer_Drawer.h
-HEADERS += GLViewer_Geom.h
-HEADERS += GLViewer_Grid.h
-HEADERS += GLViewer_Group.h
-HEADERS += GLViewer_MimeData.h
-HEADERS += GLViewer_Object.h
-HEADERS += GLViewer_Selector.h
-HEADERS += GLViewer_Selector2d.h
-HEADERS += GLViewer_Text.h
-HEADERS += GLViewer_Tools.h
-HEADERS += GLViewer_ToolTip.h
-HEADERS += GLViewer_ViewFrame.h
-HEADERS += GLViewer_ViewManager.h
-HEADERS += GLViewer_ViewPort.h
-HEADERS += GLViewer_ViewPort2d.h
-HEADERS += GLViewer_Viewer.h
-HEADERS += GLViewer_Viewer2d.h
-HEADERS += GLViewer_Widget.h
-
-SOURCES  = GLViewer_AspectLine.cxx
-SOURCES += GLViewer_BaseDrawers.cxx
-SOURCES += GLViewer_BaseObjects.cxx
-SOURCES += GLViewer_Compass.cxx
-SOURCES += GLViewer_Context.cxx
-SOURCES += GLViewer_CoordSystem.cxx
-SOURCES += GLViewer_Drawer.cxx
-SOURCES += GLViewer_Geom.cxx
-SOURCES += GLViewer_Grid.cxx
-SOURCES += GLViewer_Group.cxx
-SOURCES += GLViewer_MimeData.cxx
-SOURCES += GLViewer_Object.cxx
-SOURCES += GLViewer_Selector.cxx
-SOURCES += GLViewer_Selector2d.cxx
-SOURCES += GLViewer_Text.cxx
-SOURCES += GLViewer_Tools.cxx
-SOURCES += GLViewer_ToolTip.cxx
-SOURCES += GLViewer_ViewFrame.cxx
-SOURCES += GLViewer_ViewManager.cxx
-SOURCES += GLViewer_ViewPort.cxx
-SOURCES += GLViewer_ViewPort2d.cxx
-SOURCES += GLViewer_Viewer.cxx
-SOURCES += GLViewer_Viewer2d.cxx
-SOURCES += GLViewer_Widget.cxx
-
-TRANSLATIONS = resources/GLViewer_images.ts \
-               resources/GLViewer_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index a3db1329dbdaea283077f2a8a804fc1897512968..8dce8c53f3907fd3decc263f9e2c53578826a539 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_AspectLine.cxx
 // Created:   26/05/2005 3:17:00 PM
index 25e25412b81cdbeb75ede7c0fc2358d86425ccdc..82351300cc575bd58e18dc6784a0b1667e6e620e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_AspectLine.h
 // Created:   November, 2004
index b861c68e18bd9f133a855b92e7866e5a0407321b..d97bad977394ac49eda0d4dc0a83415c5530938b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_BaseDrawers.cxx
 // Created:   November, 2004
index 8c451efbac51641561693a8561fca44e97737ff6..d668d7864e5a4eec281b5e356141a2fea25ac038 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_BaseDrawers.h
 // Created:   November, 2004
index 29bff9d44fdd3df32dee8b889ad43e6753685752..e14e6f32dfa056b9a92dfc2b239b1f1789f42867 100644 (file)
@@ -1,41 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
-//
-//  Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_BaseObjects.h"
 #include "GLViewer_BaseDrawers.h"
 #include "GLViewer_AspectLine.h"
 #include "GLViewer_CoordSystem.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_Group.h"
-
 #include "GLViewer_Drawer.h"
 
 #include <QFile>
 
-//#include <cmath>
-//using namespace std;
-
 /*!
   Constructor
 */
@@ -373,8 +367,8 @@ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLbo
     ydist = ( myYCoord[i] - y ) * myYScale;
 
 //    if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
-    if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
-    !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+    if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+         ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
     {
       isFound = FALSE;
       count++;
@@ -462,8 +456,8 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
     ydist = ( myYCoord[i] - y ) * myYScale;
 
     //if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
-    if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
-          !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+    if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+         ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
     {
       count++;
       if ( isShift )
@@ -1101,7 +1095,7 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer
         return false;
     GLfloat xa, xb, ya, yb, l;
     GLfloat rsin, rcos, r, ra, rb;
-    GLboolean update;
+    // GLboolean update;
     GLboolean selected = myIsSel;
 
     myIsSel = GL_FALSE;
@@ -1146,7 +1140,7 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer
     else
         myHighFlag = GL_TRUE;
 
-    update = ( GLboolean )( myIsSel != selected );
+    // update = ( GLboolean )( myIsSel != selected );
 
     //  cout << "GLViewer_Polyline::select complete with " << (int)myIsSel << endl;
 
index 464c63049634a8ac757eb4d2844c40a6c65183dd..7647cd9fad6f69e62b01b1592bfedf32ff6424b1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_BaseObjects.h
 // Created:   November, 2004
@@ -178,7 +179,7 @@ public:
   
   //! Export numbers of highlighted/selected lines
   void                    exportNumbers( QList<int>& high, QList<int>& unhigh,
-                                        QList<int>& sel, QList<int>& unsel );
+                                         QList<int>& sel, QList<int>& unsel );
 
   //! Returns numbers of selected lines
   QList<int>              getSelectedElements() { return mySelNumbers; }
index 9ceee0874d8e83562a71ad59b9e7b9b5ccda2b51..dbb4d10445e3ee09d20101fe2aff55e9a11befcd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Compass.cxx
 // Created:   November, 2004
@@ -112,7 +113,7 @@ void GLViewer_Compass::setArrowWidthTop( const int WidthTop )
 void GLViewer_Compass::setArrowWidthBottom( const int WidthBot )
 { 
   if( WidthBot > myArrowWidthTop || WidthBot < 1 )
-    return;    
+    return;     
   myArrowWidthBottom=WidthBot;
 }
 
index 0ace9ae752630f023988406adaed38b4aad717e8..3e580499aaf75b882670407ee9b56253c76eb72c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Compass.h
 // Created:   November, 2004
index c839a22f04d4ccb0977f268a31c9b7b88138452c..55781a2db12e4eb24138113f2505004aa8125294 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Context.cxx
 // Created:   November, 2004
@@ -210,10 +211,10 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         if ( !Append )
         {
             for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
-                   if( myLastPicked != *it )
+                    if( myLastPicked != *it )
                 {
-                       updateAll = (*it)->unselect() || updateAll;
-                       aList.append( *it );
+                        updateAll = (*it)->unselect() || updateAll;
+                        aList.append( *it );
                 }
 
             if( updateAll || myUpdateAll )
@@ -257,10 +258,10 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         if ( !Append )
         {
             for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
-                   if ( myLastPicked != *it )
+                    if ( myLastPicked != *it )
                 {
-                       updateAll = (*it)->unselect() || updateAll;
-                       aList.append( *it );
+                        updateAll = (*it)->unselect() || updateAll;
+                        aList.append( *it );
                 }
 
             if( updateAll || myUpdateAll )
index 0090a107a039054d3a478d5941ad5f96bf05478b..702fe9f5251a1625a563c39ae818bf51265c01af 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Context.h
 // Created:   November, 2004
index cc5d11820d35fdef7aef89c52d101aad24db66a8..d6451577b03294d97413cd2effe51a5108fb9975 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Context.cxx
 // Created:   November, 2004
@@ -163,6 +164,7 @@ void GLViewer_CoordSystem::fromReference( double& x, double& y )
         double eps = 1E-8, pi = 3.14159265;
 
         if( r>eps )
+        {
             if( fabs(x)>eps )
             {
                 double arg = y/x;
@@ -174,6 +176,7 @@ void GLViewer_CoordSystem::fromReference( double& x, double& y )
                 phi = pi/2.0;
             else
                 phi = 3*pi/2.0;
+        }
 
         x = r;
         y = phi-myRotation;
index 105b64c90adf46ee4c53c0b120103d0834065bdb..f72f6f36de40ffc53e7c7b7d491042a8ff8ffac3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_CoordSystem.h
 // Created:   November, 2004
index cace175439b982e0545c72eda2dac594411e2dd1..75007477caf648283c324bd6fc610d4503beccc4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Defs.h
 // Created:   March, 2005
index 5da2863e2ec499bde93c126e7bbed89e07b399ba..9936897bf9f1174eaa6cfb6ff0258b26fea20335 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Drawer.cxx
 // Created:   November, 2004
@@ -516,25 +517,25 @@ void GLViewer_Drawer::destroyAllTextures()
 */
 void GLViewer_Drawer::setAntialiasing(const bool on)
 {
-       if (on)
-       {
+        if (on)
+        {
     glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
     glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
 
-               glEnable(GL_POINT_SMOOTH);
-               glEnable(GL_LINE_SMOOTH);
-               glEnable(GL_POLYGON_SMOOTH);
-               glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
-               glEnable (GL_BLEND);
-       }
-       else
-       {
-               glDisable(GL_POINT_SMOOTH);
-               glDisable(GL_LINE_SMOOTH);
-               glDisable(GL_POLYGON_SMOOTH);
-               glBlendFunc (GL_ONE, GL_ZERO);
-               glDisable (GL_BLEND);
-       }
+                glEnable(GL_POINT_SMOOTH);
+                glEnable(GL_LINE_SMOOTH);
+                glEnable(GL_POLYGON_SMOOTH);
+                glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
+                glEnable (GL_BLEND);
+        }
+        else
+        {
+                glDisable(GL_POINT_SMOOTH);
+                glDisable(GL_LINE_SMOOTH);
+                glDisable(GL_POLYGON_SMOOTH);
+                glBlendFunc (GL_ONE, GL_ZERO);
+                glDisable (GL_BLEND);
+        }
 }
 
 /*! Loads texture from file
@@ -949,7 +950,7 @@ bool GLViewer_Drawer::translateToEMF( HDC hDC, GLViewer_CoordSystem* aViewerCS,
   \param fillingColor - color of filling
 */
 void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLfloat gap,
-                                    QColor color, bool filled, QColor fillingColor )
+                                     QColor color, bool filled, QColor fillingColor )
 {
   if( !rect )
     return;
@@ -1014,7 +1015,7 @@ void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color
   \param isStripe - enables line stipple
 */
 void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat lineWidth,
-                                  GLushort pattern, bool isStripe )
+                                   GLushort pattern, bool isStripe )
 {
   float x1 = rect->left();
   float x2 = rect->right();
@@ -1137,9 +1138,9 @@ void GLViewer_Drawer::drawCross( GLfloat x, GLfloat y, QColor color )
   \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,
-                                GLfloat x, GLfloat y, GLfloat angle, GLboolean filled )
+                                 GLfloat lineWidth,
+                                 GLfloat staff, GLfloat length, GLfloat width,
+                                 GLfloat x, GLfloat y, GLfloat angle, GLboolean filled )
 {
   GLfloat vx1 = x;
   GLfloat vy1 = y + staff + length;
index 89a3ed58f2d5d8caf407c4a2a0fc8b008239b654..b91a6dd87c7936da7f854ee5523640cf16b2df74 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Drawer.h
 // Created:   November, 2004
@@ -236,8 +237,8 @@ public:
   //! Returns object priority
   int                             getPriority() const { return myPriority; }
 
-       //! The function enables and disables antialiasing in Open GL (for points, lines and polygons).
-       void                            setAntialiasing(const bool on);
+        //! The function enables and disables antialiasing in Open GL (for points, lines and polygons).
+        void                            setAntialiasing(const bool on);
   
   //! Clears all generated textures
   static void                     destroyAllTextures();
@@ -342,7 +343,7 @@ public:
   */
   void                            drawText( const QString& text,
                                             GLfloat xPos,
-                                                                         GLfloat yPos,
+                                                                          GLfloat yPos,
                                             const QColor& color,
                                             QFont* aFont,
                                             int theSeparator,
@@ -359,8 +360,8 @@ public:
    *\param smallFont - font format
   */
   void                            drawGLText( QString text,
-                                                                           float x,
-                                                                           float y,
+                                                                            float x,
+                                                                            float y,
                                               int hPosition = GLText_Center,
                                               int vPosition = GLText_Center,
                                               QColor color = Qt::black,
@@ -404,7 +405,7 @@ protected:
   //! Draw basic primitives: rectangle, contour, polygon, vertex, cross, arrow
   //* with predefined color
   static void                     drawRectangle( GLViewer_Rect*, GLfloat, GLfloat = 0, QColor = Qt::black, 
-                                                bool = false, QColor = Qt::white );
+                                                 bool = false, QColor = Qt::white );
   static void                     drawContour( GLViewer_Rect*, QColor, GLfloat, GLushort, bool );
   static void                     drawContour( const GLViewer_PntList&, QColor, GLfloat );
   static void                     drawPolygon( GLViewer_Rect*, QColor, GLushort, bool );
@@ -412,8 +413,8 @@ protected:
   static void                     drawVertex( GLfloat, GLfloat, QColor );
   static void                     drawCross( GLfloat, GLfloat, QColor );
   static void                     drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue,
-                                            GLfloat, GLfloat, GLfloat, GLfloat,
-                                            GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE );
+                                             GLfloat, GLfloat, GLfloat, GLfloat,
+                                             GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE );
 
   //! Draw object text
   virtual void                    drawText( GLViewer_Object* theObject );
index 8ad608cfea59f28a23d50f4ecd3bc6723fcbbc49..f0b67c7a624ec92c050317c971ec8c7cff6869bc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 //#include <GLViewerAfx.h>
 //
index 4b75d3e782b3767db196c8be114f421b5ce4fb44..f01c7902f94e0675c30f438830428805376d6f34 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Geom.h
 // Created:   November, 2004
@@ -32,8 +33,6 @@
 #include <QtOpenGL>
 #include <math.h>
 
-//using namespace QGL;
-
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
index 27b4d7dacef8691e2dd7d55d241e87d3b7759845..cf94b8f3d13e947152f82372c1d39d4b6f19447e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Grid.cxx
 // Created:   November, 2004
index 5d3f15e1d23579926e693ad56a8c73723f481f50..383ae9496e8a957d8e835808d9f5f92dc0539d5d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Grid.h
 // Created:   November, 2004
@@ -58,10 +59,10 @@ public:
   * \param xScale and \param yScal  - scale factors along x and y direction
   */
   GLViewer_Grid( GLfloat width, GLfloat height,
-                GLfloat winW, GLfloat winH,
-                GLfloat xSize, GLfloat ySize,
-                GLfloat xPan, GLfloat yPan,
-                GLfloat xScale, GLfloat yScale );
+                 GLfloat winW, GLfloat winH,
+                 GLfloat xSize, GLfloat ySize,
+                 GLfloat xPan, GLfloat yPan,
+                 GLfloat xScale, GLfloat yScale );
   ~GLViewer_Grid();
 
   //! Draws grid
index f04bc8ce884e95d7ce6a448aa1ae40f050b113a4..c4b724a6e00a0d50080ee2e440ef791896e1a1de 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Group.xx
 // Created:   March, 2005
index 92c05288847833561e5bcd7a176ccbf7f6c5b449..05884ce00875873c277719cf6405c3a460eb7cc1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Group.h
 // Created:   March, 2005
index 1fbe5e90a9babdb59b64fcf4eabb953b09274d80..e9e6f287886322827cb4841d721e6204b9063d0f 100644 (file)
@@ -1,33 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
-//
-//  Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_MimeData.h"
 #include "GLViewer_BaseObjects.h"
 
-//#include <cmath>
-//using namespace std;
-
 /*!
   Destructor
 */
@@ -204,7 +196,7 @@ QList<GLViewer_Object*> GLViewer_MimeData::getObjects( QByteArray theArray, QStr
             for( j = 0; j < aObjNum; j++ )
             {
                 QByteArray aTempArray;
-               aTempArray.resize(aObjSizeList[j]);
+                aTempArray.resize(aObjSizeList[j]);
                 for( ; anIndex < aCurIndex + aObjSizeList[j]; anIndex++ )
                     aTempArray[anIndex-aCurIndex] = theArray[anIndex];
                 aObjects.append( aTempArray );
index 9dd6df85485d4edcde1c1cbe4c90fcefe3cc272a..4ed7ea853be383d3cd38b1d9c6cdc3dd3f7055bf 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_MimeData.h
 // Created:   November, 2004
index 6afe3be259603e258319633ae88afe62bd2d3233..9fe97531b8f8e3e884ca5a60fe2040ec95bab43d 100644 (file)
@@ -1,27 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
-//
-//  Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_Object.h"
 #include "GLViewer_Drawer.h"
 #include "GLViewer_AspectLine.h"
@@ -30,9 +28,6 @@
 
 #include <SUIT_DataOwner.h>
 
-//#include <cmath>
-//using namespace std;
-
 /*!
   Default constructor
 */
@@ -168,8 +163,8 @@ QByteArray GLViewer_Object::getByteCopy()
 
     QByteArray aResult;
     aResult.resize( 2*anISize + sizeOf8Float + 
-                   aTypeLength + aToolTipLength +
-                   aGLText.size() + aAspect.size() );
+                    aTypeLength + aToolTipLength +
+                    aGLText.size() + aAspect.size() );
     // puts 8 float values into the byte array
     char* aPointer = (char*)&aRectData;
     for( i = 0; i < sizeOf8Float; i++, aPointer++ )
index a694e88b691762421f0112db0c8fbd3108cc287e..3775ed6db81bb20722bd14350a99d6b1ef87659c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Object.h
 // Created:   November, 2004
@@ -82,7 +83,7 @@ public:
    *\param isCircle - = true if sensitive area of detection is round
   */
   virtual GLboolean         highlight( GLfloat x,
-                                      GLfloat y,
+                                       GLfloat y,
                                        GLfloat tol,
                                        GLboolean isCircle = GL_FALSE ) = 0;
   //! Clears all highlight information
index 7700e5c4092916c7c23c2c6b10a552c89864cb94..5f98cad00d337a7f19e1b2030ccfd3a989032bad 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Selector.cxx
 // Created:   November, 2004
index f5d4c94c229a48344b73fae13d791b115e424edd..67c6a77b5c9b774152aae08511e6904441796b8c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Selector.h
 // Created:   November, 2004
index 3d925dfff5bc48c76d9bd3967a30bb816b6dc82a..5bf916e17efc838110f61370ce6f1946f3487673 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Selector2d.cxx
 // Created:   November, 2004
index e5cd153106795e755f989e636dcb98e8bca66322..7cc1a5e7229740601c0eb2efa63717df75e794f0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Selector2d.h
 // Created:   November, 2004
index 26e03eb7dc4dbf4322d1851b12ff9626effe8079..47391a1fde36c7012d8663474585fdf21a1eeb32 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 //#include <GLViewerAfx.h>
 //
index 9dc2869f63aae2653f1a2739c85dc69626254fb8..47859031593f9427912985fe9be9973fc92e58d4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Text.h
 // Created:   November, 2004
index 0397cb1224b414df0e2628a02d66efbb8406ff95..606c6054ede6f770c471e4f63ee9158e563024bf 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ToolTip.xx
 // Created:   March, 2005
@@ -48,7 +49,7 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent )
   mypViewPort = theParent;
   //mypLabel = NULL;
   mypLabel = new QLabel( "Test", NULL, 
-                        Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
+                         Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
   mypLabel->setObjectName("ObjectTipText");
   mypLabel->setMargin( 1 );
   //mypLabel->setAutoMask( FALSE );
@@ -146,9 +147,9 @@ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e )
     case QEvent::MouseButtonDblClick:
     case QEvent::KeyPress:
     case QEvent::KeyRelease:
-           // input - turn off tool tip mode
-           hideTipAndSleep();
-           break;*/
+            // input - turn off tool tip mode
+            hideTipAndSleep();
+            break;*/
     case QEvent::MouseMove:
       {
         //hideTipAndSleep();
index fc81dfe27a3504dc36f15408a826e669d2e35737..8408ef4ba431504d57b29fb3fb496e7326234986 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ToolTip.h
 // Created:   March, 2005
index ffc2098e98dd20d17badd2422b8a9ab003ac0c79..6a109b85e9c7e9444946c5855004d352d350d828 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Tools.cxx
 // Created:   April, 2005
index 222c27052640bc72b437746ee4c3b265b1401bc7..a62a84ec351489e4f8879f2a569e6b3285550aed 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Tools.h
 // Created:   April, 2005
@@ -39,8 +40,8 @@
 class GLVIEWER_API GLViewer_Tools
 {
 public:
-       //GLViewer_Tools();
-       //virtual ~GLViewer_Tools();
+        //GLViewer_Tools();
+        //virtual ~GLViewer_Tools();
   //static 
 
 };
index b52bdb69f1a7bf5acf51acd3b1c5c14965c5bdea..a2beb06836171c5f4263d1b36c61de25941f8fed 100644 (file)
@@ -1,29 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
-//
-//  Author : OPEN CASCADE
-// File:      GLViewer_ViewFrame.cxx
-// Created:   November, 2004
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_ViewFrame.h"
 #include "GLViewer_Viewer.h"
 #include "GLViewer_ViewPort2d.h"
@@ -50,7 +46,6 @@
 #ifdef WIN32
 #include <Standard_Integer.hxx>
 #include <iostream>
-using namespace std;
 #endif
 
 /*!
@@ -94,55 +89,55 @@ void GLViewer_ViewFrame::createActions()
 
   // Dump view
   aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ),
-                         tr( "MNU_DUMP_VIEW" ), 0, this);
+                          tr( "MNU_DUMP_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
   toolMgr()->registerAction( aAction, DumpId );
 
   // FitAll
   aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ),
-                         tr( "MNU_FITALL" ), 0, this);
+                          tr( "MNU_FITALL" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITALL"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
   toolMgr()->registerAction( aAction, FitAllId );
 
   // FitRect
   aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ),
-                         tr( "MNU_FITRECT" ), 0, this);
+                          tr( "MNU_FITRECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITRECT"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
   toolMgr()->registerAction( aAction, FitRectId );
 
   // FitSelect
   aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ),
-                         tr( "MNU_FITSELECT" ), 0, this);
+                          tr( "MNU_FITSELECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITSELECT"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect()));
   toolMgr()->registerAction( aAction, FitSelectId );
 
   // Zoom
   aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ),
-                         tr( "MNU_ZOOM_VIEW" ), 0, this);
+                          tr( "MNU_ZOOM_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
   toolMgr()->registerAction( aAction, ZoomId );
 
   // Panning
   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ),
-                         tr( "MNU_PAN_VIEW" ), 0, this);
+                          tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
   toolMgr()->registerAction( aAction, PanId );
 
   // Global Panning
   aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ),
-                         tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+                          tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
   toolMgr()->registerAction( aAction, GlobalPanId );
 
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ),
-                         tr( "MNU_RESET_VIEW" ), 0, this);
+                          tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
   toolMgr()->registerAction( aAction, ResetId );
@@ -153,7 +148,7 @@ void GLViewer_ViewFrame::createActions()
 */
 void GLViewer_ViewFrame::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
+  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false );
   toolMgr()->append( DumpId, tid );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
index 86cb9ccf73c8384922ad82e7f32d25bbe1031246..af7c6c8685d5051387727ca685f22f442e81b687 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewFrame.h
 // Created:   November, 2004
index 60ddf0df54743f28156d34d9e7544d383e572da6..1d35a68b07cbcf9d6fb63d52d7bf7637a8f52351 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewManager.cxx
 // Created:   November, 2004
index 65652d49dadceea1cbb60a5e15097f69b5e555fc..da6c5912428951081f923de16d89eab0bb15d58e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewManager.h
 // Created:   November, 2004
index 699d245a6bd717e4ccacbc02ad2cf2a740e1d499..b11d7d29f87124bc978c13d450a95c74acad37ed 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort.cxx
 // Created:   November, 2004
index 4ca9525ffb81709072fdda456122a8c47dd5a738..0cbfcb24451ddf8004e981c21c8fedac88343ac0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort.h
 // Created:   November, 2004
index 0cd5b9371a988114675d4e6494566f75d505d5b1..c4fc80d6d09bd2ccfce8194f58d7073c556adfd0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort2d.cxx
 // Created:   November, 2004
@@ -1188,12 +1189,12 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y )
     {
         myRectBand->hide();    /* erase */
 
-       mypLastPoint->setX( x );
+        mypLastPoint->setX( x );
         mypLastPoint->setY( y );
 
-       QRect aRect = selectionRect();
-       myRectBand->setGeometry( aRect );    /* draw */
-       myRectBand->setVisible( aRect.isValid() );
+        QRect aRect = selectionRect();
+        myRectBand->setGeometry( aRect );    /* draw */
+        myRectBand->setVisible( aRect.isValid() );
     }
 
 }
@@ -1215,8 +1216,8 @@ void GLViewer_ViewPort2d::finishSelectByRect()
         mypFirstPoint = NULL;
         mypLastPoint = NULL;
 
-       delete myRectBand;
-       myRectBand = 0;
+        delete myRectBand;
+        myRectBand = 0;
     }
 }
 
@@ -1380,13 +1381,11 @@ void GLViewer_ViewPort2d::onMaybeTip( QPoint thePoint, QString& theText, QFont&
 
     if( !aList.isEmpty() )
     {
-      int index = 0;
       int str_size = aList.first().length();
       for( int i = 1, size = aList.count(); i < size; i++ )
       {
         if ( str_size < (int)aList[i].length() )
         {
-          index = i;
           str_size = aList[i].length();
         }
       }
index e62616310345d0f1e404dc0f96aebf2ea547481a..6e1c27c9d7529ffd67cbabaf3b4ba91108bca1c7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort2d.h
 // Created:   November, 2004
index 95647f30bf831e3585bb7a35edc9b1de22e44c73..0051cf1848ba379cee666ce520e7089111d40b08 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Viewer.cxx
 // Created:   November, 2004
@@ -873,7 +874,7 @@ void GLViewer_ViewSketcher::onSketch( SketchState state )
                         qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) );
             if ( !rect.isEmpty() )
             {
-               if ( !sketchRect->isEmpty() && myRectBand )
+                if ( !sketchRect->isEmpty() && myRectBand )
                     myRectBand->hide();    /* erase */
                 *sketchRect = rect;
                 if ( state != Fin )
index c6626f6228b99c3e9ac007c8208ce1febc94ec93..80d9a12d3f57e76ead60a7af136ec04f288090e0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Viewer.h
 // Created:   November, 2004
index d801cb6425c65a1d3e9bba79a482e0cc953fa6a9..734e03c3b492bbf9ff938b10f3a529ea067a9f64 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Viewer2d.cxx
 // Created:   November, 2004
@@ -103,7 +104,7 @@ void GLViewer_Viewer2d::onChangeBgColor()
     return;
   GLViewer_ViewPort2d* vp = ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() );
 
-  QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp );       
+  QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp );        
   if ( selColor.isValid() ) {
     vp->setBackgroundColor( selColor );
   }
index 968aef8d390f154e265af4942e1118f834c647bf..f7547b76076e631dea2a3e71ae41609ffe994dc2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Viewer2d.h
 // Created:   November, 2004
@@ -164,7 +165,7 @@ public:
    * output paper size \param aPType, with margins in mm
   */
   virtual bool         translateTo( VectorFileType aType, QString FileName, PaperType aPType, 
-                                  double mmLeft, double mmRight, double mmTop, double mmBottom );
+                                   double mmLeft, double mmRight, double mmTop, double mmBottom );
     
   //bool                 isSketchingActive();
   //int                  getSketchingType();
index 30e1fa91548a4304b0eadce5c21b6bc4d69b029f..5cb0ecadc7875503802af00bc8144a4fb4dd5b6f 100644 (file)
@@ -1,51 +1,40 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
-//
-//  Author : OPEN CASCADE
-// File:      GLViewer_Widget.cxx
-// Created:   November, 2004
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_Widget.h"
 #include "GLViewer_ViewPort2d.h"
 #include "GLViewer_Viewer2d.h"
-//#include "GLViewer_Compass.h"
 #include "GLViewer_Grid.h"
-//#include "GLViewer_Object.h"
 #include "GLViewer_CoordSystem.h"
 #include "GLViewer_ViewFrame.h"
 
 #include <cmath>
-using namespace std;
 
 #include <QEvent>
 #include <QPaintEvent>
 #include <QRect>
-
 #include <QFile>
-//#include <qpixmap.h>
 #include <QImage>
 #include <QApplication>
-//#include <qintdict.h>
-//#include <qpaintdevicemetrics.h>
-//#include <qsize.h>
 #include <QToolTip>
 
 /*!
@@ -131,7 +120,7 @@ void GLViewer_Widget::setScale( GLfloat xScale, GLfloat yScale, GLfloat zScale )
   \return start point of curren rotation of Window in OpenGL global scene
 */
 void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX,
-                                       GLfloat& rotationStartY,
+                                        GLfloat& rotationStartY,
                                         GLfloat& rotationStartZ )
 {
     rotationStartX = myRotationStartX;
@@ -143,7 +132,7 @@ void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX,
   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 rotationStartY,
                                         GLfloat rotationStartZ )
 {
     myRotationStartX = rotationStartX;
@@ -159,9 +148,9 @@ void GLViewer_Widget::setRotationStart( GLfloat rotationStartX,
   \param rotationCenterZ - center z
 */
 void GLViewer_Widget::getRotation( GLfloat& rotationAngle,
-                                  GLfloat& rotationCenterX,
-                                  GLfloat& rotationCenterY,
-                                  GLfloat& rotationCenterZ )
+                                   GLfloat& rotationCenterX,
+                                   GLfloat& rotationCenterY,
+                                   GLfloat& rotationCenterZ )
 {
     rotationAngle = myRotationAngle;
     rotationCenterX = myRotationCenterX;
@@ -177,9 +166,9 @@ void GLViewer_Widget::getRotation( GLfloat& rotationAngle,
   \param rotationCenterZ - center z
 */
 void GLViewer_Widget::setRotation( GLfloat rotationAngle,
-                                  GLfloat rotationCenterX,
-                                  GLfloat rotationCenterY,
-                                  GLfloat rotationCenterZ )
+                                   GLfloat rotationCenterX,
+                                   GLfloat rotationCenterY,
+                                   GLfloat rotationCenterZ )
 {
     myRotationAngle = rotationAngle;
     myRotationCenterX = rotationCenterX;
@@ -488,20 +477,20 @@ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2,
     {           
       uchar* theCurLine = image.scanLine( i ), cur;
       for( int j=w1; j<=w2; j++ )
-       for( int k=0; k<3; k++ )
-       {
-         cur = *(theCurLine+4*j+2-k);
-         *(line+cur_index) = hex( cur/16 ); //HI
-         *(line+cur_index+1) = hex( cur%16 ); //LO
-         full++;
-         cur_index+=2;
-         if( cur_index>=80 )
-         {
-           aBuffer += line;
-           aBuffer += "\n";
-           cur_index = 0;
-         }
-       }           
+        for( int k=0; k<3; k++ )
+        {
+          cur = *(theCurLine+4*j+2-k);
+          *(line+cur_index) = hex( cur/16 ); //HI
+          *(line+cur_index+1) = hex( cur%16 ); //LO
+          full++;
+          cur_index+=2;
+          if( cur_index>=80 )
+          {
+            aBuffer += line;
+            aBuffer += "\n";
+            cur_index = 0;
+          }
+        }           
     }
     
     aBuffer += "> false 3 colorimage\n\n";
index 5a4d428e82d924c7de81b79b040e770cf8fa5467..69017724fd44141c8c10efbd44de5b23e9f62361 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_Widget.h
 // Created:   November, 2004
@@ -63,11 +64,11 @@ public:
   //! Returns scales on OpenGL scene along 3 directions
   /*! in 2d scene zScale = 1.0 */
   void                   getScale( GLfloat& xScale,
-                                  GLfloat& yScale,
-                                  GLfloat& zScale );
+                                   GLfloat& yScale,
+                                   GLfloat& zScale );
   //! A function for installing the scales of OpenGL scene
   void                   setScale( GLfloat xScale,
-                                  GLfloat yScale,
+                                   GLfloat yScale,
                                    GLfloat zScaleGLfloat );
   
   //! Returns offset parameters of Window in OpenGL global scene
@@ -84,17 +85,17 @@ public:
 
   //! Returns start point of curren rotation of Window in OpenGL global scene
   void                   getRotationStart( GLfloat& rotationStartX,
-                                          GLfloat& rotationStartY,
-                                          GLfloat& rotationStartZ );
+                                           GLfloat& rotationStartY,
+                                           GLfloat& rotationStartZ );
   //! A function for installing the start point of curren rotation of Window in OpenGL global scene
   void                   setRotationStart( GLfloat rotationStartX,
-                                          GLfloat rotationStartY,
-                                          GLfloat rotationStartZ );
+                                           GLfloat rotationStartY,
+                                           GLfloat rotationStartZ );
   //! Returns parameters of current rotation
   void                   getRotation( GLfloat& rotationAngle,
-                                     GLfloat& rotationCenterX,
-                                     GLfloat& rotationCenterY,
-                                     GLfloat& rotationCenterZ );
+                                      GLfloat& rotationCenterX,
+                                      GLfloat& rotationCenterY,
+                                      GLfloat& rotationCenterZ );
   //! A function for installing the parameters of current rotation
   void                   setRotation( GLfloat, GLfloat, GLfloat, GLfloat );
 
index 4c4594a52e825e7bef90c1c3654ade249220f266..7ac304a93474994f8bd8cb6e3997b35edb75cc81 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : caf
@@ -110,7 +111,8 @@ dist_salomeres_DATA =                       \
 
 nodist_salomeres_DATA =                \
        GLViewer_images.qm      \
-       GLViewer_msg_en.qm
+       GLViewer_msg_en.qm      \
+       GLViewer_msg_fr.qm
 
 libGLViewer_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 libGLViewer_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS)
diff --git a/src/GLViewer/resources/GLViewer_images.po b/src/GLViewer/resources/GLViewer_images.po
deleted file mode 100644 (file)
index d9fb5ff..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      GLViewer_images.po
-#  Created:   10/25/2004 12:46:36 PM
-#  Author:    Sergey Anikin
-
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-05 10:17+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_GL_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_GL_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_GL_FITSELECT"
-msgstr "view_fitselect.png"
-
-msgid "ICON_GL_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_GL_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_GL_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_GL_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_GL_DUMP"
-msgstr "view_dump.png"
-
-msgid "ICON_GL_CURSOR_ZOOM"
-msgstr "cursor_zoom.png"
-
-msgid "ICON_GL_CURSOR_ROTATE"
-msgstr "cursor_rotate.png"
-
-msgid "ICON_GL_CURSOR_SKETCH"
-msgstr "cursor_sketch.png"
index 5358816e4e0df198ef6fb07d3a75b04067528a37..dd032bd9f6477d2dfd89e2d293bc0c8f2381b56a 100644 (file)
@@ -1,26 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
diff --git a/src/GLViewer/resources/GLViewer_msg_en.po b/src/GLViewer/resources/GLViewer_msg_en.po
deleted file mode 100644 (file)
index 91c6aa0..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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
-
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_FITSELECT"
-msgstr "Fit area of selection within the view frame"
-
-msgid "MNU_FITSELECT"
-msgstr "Fit Selection"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump"
-
-msgid "GL_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "CHANGE_BGCOLOR"
-msgstr "Change background..."
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_SAVE_FILE_DLG_CAPTION"
-msgstr "Save Dump View in file"
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_ERROR_DLG_CAPTION"
-msgstr "Error"
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_ERROR_DLG_TEXT"
-msgstr "Can't save Dump View in file"
-
-msgid "GLViewer_ViewManager::GL_VIEW_TITLE"
-msgstr "GL Scene:%M - viewer:%V"
index 3099db15545da80775f38dd4d43503706f2088bd..d99e2af4c218e827d122739caa2c5726b5f0a256 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index 6afaa2b65075975eca048d558ce28e800db1e27a..51e6bb3a26cd50d7689b3efd6d2ed0f676654cb1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp.h
 // Author : OCC team
 //
@@ -26,7 +27,7 @@
 #define LIGHTAPP_H
 
 #ifdef WIN32
-#  ifdef LIGHTAPP_EXPORTS
+#  if defined LIGHTAPP_EXPORTS || defined LightApp_EXPORTS
 #    define LIGHTAPP_EXPORT __declspec(dllexport)
 #  else
 #    define LIGHTAPP_EXPORT __declspec(dllimport)
diff --git a/src/LightApp/LightApp.pro b/src/LightApp/LightApp.pro
deleted file mode 100644 (file)
index ffe32e5..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = LightApp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-VTK_INCLUDES = $$(VTKHOME)/include/vtk
-
-QWT_INCLUDES = $$(QWTHOME)/include
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${CAS_CPPFLAGS} $${HDF5_INCLUDES} $${KERNEL_CXXFLAGS} ../SUIT ../STD ../CAM ../LogWindow ../Prs ../Qtx ../Event #../ObjBrowser
-
-#if ENABLE_VTKVIEWER
-  INCLUDEPATH += $${VTK_INCLUDES} ../VTKViewer
-#else
-#  DEFINES += DISABLE_VTKVIEWER
-#endif
-
-#if ENABLE_PLOT2DVIEWER
-  INCLUDEPATH += $${QWT_INCLUDES} ../Plot2d
-#else
-#  DEFINES += DISABLE_PLOT2DVIEWER
-#endif
-
-#if ENABLE_OCCVIEWER
-  INCLUDEPATH += ../OCCViewer
-#else !ENABLE_OCCVIEWER
-#  DEFINES += DISABLE_OCCVIEWER
-#endif
-
-#if ENABLE_PYCONSOLE
-  INCLUDEPATH += $${PYTHON_INCLUDES} ../PyConsole ../PyInterp
-#else !ENABLE_PYCONSOLE
-#  DEFINES += DISABLE_PYCONSOLE
-#endif
-
-#if ENABLE_GLVIEWER
-  INCLUDEPATH += ../GLViewer
-#else !ENABLE_GLVIEWER
-#  DEFINES += DISABLE_GLVIEWER
-#endif
-
-#if ENABLE_SUPERVGRAPHVIEWER
-  INCLUDEPATH += ../SUPERVGraph
-#else !ENABLE_SUPERVGRAPHVIEWER
-#  DEFINES += DISABLE_SUPERVGRAPHVIEWER
-#endif
-
-#if ENABLE_SALOMEOBJECT
-
-  INCLUDEPATH += ../OBJECT
-#if ENABLE_PLOT2DVIEWER
-  INCLUDEPATH += ../SPlot2d
-#endif
-
-#if ENABLE_OCCVIEWER
-  INCLUDEPATH += ../SOCC
-#endif
-
-#if ENABLE_VTKVIEWER
-  INCLUDEPATH += ../SVTK
-#endif
-
-#else !ENABLE_SALOMEOBJECT
-#  DEFINES += DISABLE_SALOMEOBJECT
-  
-#endif
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit -lstd -lCAM -lLogWindow $${CAS_KERNEL} -lSalomePrs $${HDF5_LIBS} $${KERNEL_LDFLAGS} -lSalomeHDFPersist #-lObjBrowser
-
-#if ENABLE_PYCONSOLE
-  LIBS += $${PYTHON_LIBS}
-#endif
-
-#if ENABLE_SALOMEOBJECT
-  LIBS += -lSalomeObject
-#endif
-
-#if ENABLE_VTKVIEWER
-  LIBS += -lVTKViewer
-#if ENABLE_SALOMEOBJECT
-  LIBS += -lSVTK
-#endif
-#endif
-
-#if ENABLE_OCCVIEWER
-  LIBS += -lOCCViewer
-#if ENABLE_SALOMEOBJECT
-  LIBS += -lSOCC
-#endif
-#endif
-
-#if ENABLE_GLVIEWER
-  LIBS += -lGLViewer
-#endif
-
-#if ENABLE_PLOT2DVIEWER
-  LIBS += -lPlot2d
-#if ENABLE_SALOMEOBJECT
-  LIBS += -lSPlot2d
-#endif
-#endif
-
-#if ENABLE_PYCONSOLE
-  LIBS += -lPyInterp -lPyConsole
-#endif
-
-#if ENABLE_SUPERVGRAPHVIEWER
-  LIBS += -lSUPERVGraph
-#endif
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += LIGHTAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = LightApp.h
-HEADERS += LightApp_AboutDlg.h
-HEADERS += LightApp_Application.h
-HEADERS += LightApp_DataModel.h
-HEADERS += LightApp_DataObject.h
-HEADERS += LightApp_DataOwner.h
-HEADERS += LightApp_DataSubOwner.h
-HEADERS += LightApp_Dialog.h
-HEADERS += LightApp_Displayer.h
-HEADERS += LightApp_Driver.h
-HEADERS += LightApp_EventFilter.h
-HEADERS += LightApp_HDFDriver.h
-HEADERS += LightApp_Module.h
-HEADERS += LightApp_ModuleAction.h
-HEADERS += LightApp_ModuleDlg.h
-HEADERS += LightApp_NameDlg.h
-#HEADERS += LightApp_OBFilter.h
-HEADERS += LightApp_OBSelector.h
-HEADERS += LightApp_Operation.h
-HEADERS += LightApp_Selection.h
-HEADERS += LightApp_SelectionMgr.h
-HEADERS += LightApp_ShowHideOp.h
-HEADERS += LightApp_Study.h
-HEADERS += LightApp_SwitchOp.h
-HEADERS += LightApp_Preferences.h
-HEADERS += LightApp_PreferencesDlg.h
-HEADERS += LightApp_RootObject.h
-HEADERS += LightApp_UpdateFlags.h
-HEADERS += LightApp_WidgetContainer.h
-
-#if ENABLE_VTKVIEWER
-#if ENABLE_SALOMEOBJECT
-  HEADERS += LightApp_VTKSelector.h
-#endif
-#endif
-#if ENABLE_OCCVIEWER
-  HEADERS += LightApp_OCCSelector.h
-#endif
-#if ENABLE_GLVIEWER
-  HEADERS += LightApp_GLSelector.h
-#endif
-
-SOURCES  = LightApp_AboutDlg.cxx
-SOURCES += LightApp_Application.cxx
-SOURCES += LightApp_DataModel.cxx
-SOURCES += LightApp_DataObject.cxx
-SOURCES += LightApp_DataOwner.cxx
-SOURCES += LightApp_DataSubOwner.cxx
-SOURCES += LightApp_Dialog.cxx
-SOURCES += LightApp_Displayer.cxx
-SOURCES += LightApp_Driver.cxx
-SOURCES += LightApp_EventFilter.cxx
-SOURCES += LightApp_HDFDriver.cxx
-SOURCES += LightApp_Module.cxx
-SOURCES += LightApp_ModuleAction.cxx
-SOURCES += LightApp_ModuleDlg.cxx
-SOURCES += LightApp_NameDlg.cxx
-#SOURCES += LightApp_OBFilter.cxx
-SOURCES += LightApp_OBSelector.cxx
-SOURCES += LightApp_Operation.cxx
-SOURCES += LightApp_Selection.cxx
-SOURCES += LightApp_SelectionMgr.cxx
-SOURCES += LightApp_ShowHideOp.cxx
-SOURCES += LightApp_Study.cxx
-SOURCES += LightApp_SwitchOp.cxx
-SOURCES += LightApp_Preferences.cxx
-SOURCES += LightApp_PreferencesDlg.cxx
-SOURCES += LightApp_WidgetContainer.cxx
-
-#if ENABLE_VTKVIEWER
-#if ENABLE_SALOMEOBJECT
-  SOURCES += LightApp_VTKSelector.cxx
-#endif
-#endif
-#if ENABLE_OCCVIEWER
-  SOURCES += LightApp_OCCSelector.cxx
-#endif
-#if ENABLE_GLVIEWER
-  SOURCES += LightApp_GLSelector.cxx
-#endif
-
-TRANSLATIONS = resources/LightApp_images.ts \
-               resources/LightApp_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 0a48f79612045f511e6a99f3cecea0564e854f7b..122e585a45ef17b892eb917ad377ec345abfe9ca 100644 (file)
@@ -1,29 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
 //
 #include "LightApp_AboutDlg.h"
+#include "LightApp_Application.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -35,6 +37,8 @@
 #include <QPixmap>
 #include <QIcon>
 #include <QGroupBox>
+#include <QTabWidget>
+#include <QPushButton>
 
 /*!Constructor.*/
 LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& defVer, QWidget* parent )
@@ -56,15 +60,36 @@ LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& def
   pal.setBrush( QPalette::Inactive, QPalette::WindowText, QBrush( Qt::darkBlue ) );
   pal.setBrush( QPalette::Inactive, QPalette::Window,     QBrush( Qt::white ) );
 
+
   pal.setBrush( QPalette::Disabled, QPalette::WindowText, QBrush( Qt::darkBlue ) );
   pal.setBrush( QPalette::Disabled, QPalette::Window,     QBrush( Qt::white ) );
 
+
+
   setPalette(pal);
 
-  QVBoxLayout* main = new QVBoxLayout( mainFrame() );
-  QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, mainFrame(), 0, 0 );
+  QTabWidget* tw = new QTabWidget( mainFrame() );
+  
+  QGridLayout* main = new QGridLayout( mainFrame() );
+  main->addWidget( tw, 0, 0, 1, 3 );
+  
+  QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, tw, 0, 0 );
   base->setInsideMargin( 0 );
-  main->addWidget( base );
+
+  tw->addTab(base, tr("ABOUT_BASE") );
+
+  tw->addTab(getModulesInfoWidget(tw), tr("ABOUT_MODULE_INFOS") );
+
+  QPushButton * btn = new QPushButton( tr("ABOUT_CLOSE"), mainFrame() );
+
+  main->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 1, 0, 1, 1);
+
+  main->addWidget( btn, 1, 1, 1, 1);
+
+  main->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 1, 2, 1, 1);
+
+  connect(btn, SIGNAL( clicked() ), this, SLOT( accept()) );
+
 
   QLabel* screen = new QLabel( base );
   screen->setScaledContents( true );
@@ -122,12 +147,6 @@ LightApp_AboutDlg::~LightApp_AboutDlg()
   //! Do nothing.
 }
 
-/*!On mouse press event.*/
-void LightApp_AboutDlg::mousePressEvent( QMouseEvent* )
-{
-  accept();
-}
-
 /*!Change font of widget \a wid.
  *\param wid - QWidget
  *\param bold - boolean value
@@ -158,3 +177,35 @@ void LightApp_AboutDlg::checkLabel( QLabel* lab ) const
              ( lab->pixmap() && !lab->pixmap()->isNull() );
   vis ? lab->show() : lab->hide();
 }
+
+/*! Return widget with info about versions of modules */
+QWidget* LightApp_AboutDlg::getModulesInfoWidget(QWidget* parent) const {
+
+  QWidget* modulesInfo = new QWidget(parent);
+  QGridLayout* gridLayout = new QGridLayout(modulesInfo);
+
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>(SUIT_Session::session()->activeApplication());
+  if(app) {
+
+    CAM_Application::ModuleShortInfoList info = app->getVersionInfo();
+    
+    CAM_Application::ModuleShortInfoList::const_iterator it = info.constBegin();
+    int i = 0;
+    
+    QString unknownVersion = tr("ABOUT_UNKNOWN_VERSION");
+
+    while (it != info.constEnd()) {
+      QLabel * name = new QLabel( "<h4>" + (*it).name + ":</h4>", modulesInfo);
+      QString v = (*it).version.isEmpty() ?  unknownVersion : (*it).version;
+      QLabel * version = new QLabel("<h4>" + v + "</h4>",modulesInfo);
+      gridLayout->addWidget(name , i, 0);
+      gridLayout->addWidget(version , i, 1);
+      gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), i, 2);
+      it++;
+      i++;
+    }
+    gridLayout->addItem(new QSpacerItem(0, 0,  QSizePolicy::Minimum, QSizePolicy::Expanding), i, 0);
+    gridLayout->addItem(new QSpacerItem(0, 0,  QSizePolicy::Minimum, QSizePolicy::Expanding), i, 1);
+  }  
+  return modulesInfo;
+}
index 71216a37e5950f09a9f3d563ae7639d850c54532..61629eaba7fb6cb37f15943962ef0357a65ac108 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
@@ -44,13 +45,12 @@ public:
   LightApp_AboutDlg( const QString&, const QString&, QWidget* = 0 );
   virtual ~LightApp_AboutDlg();
 
-protected:
-  virtual void mousePressEvent( QMouseEvent* );
-
 private:
   void checkLabel( QLabel* ) const;
   void changeFont( QWidget*, const bool = false, const bool = false,
                    const bool = false, const int = 0 ) const;
+
+  QWidget* getModulesInfoWidget(QWidget* parent) const;
 };
 
 #endif
index 2b81c7a0b71f1ba8a724b09b2b445cc205b839dd..8880510ceb7385349396b8f42e4c36a3dc6fb176 100644 (file)
@@ -1,30 +1,41 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+  #include <Standard_math.hxx>
+  #ifndef DISABLE_PYCONSOLE
+    #include <pymath.h>
+  #endif
+#endif
+
 #ifndef DISABLE_PYCONSOLE
-  #include <PyConsole_Interp.h> // WARNING! This include must be the first!
+  #include "LightApp_PyInterp.h" // WARNING! This include must be the first!
   #include <PyConsole_Console.h>
 #endif
 
 #include "LightApp_OBSelector.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_DataObject.h"
+#include "LightApp_WgViewModel.h"
+#include "LightApp_FullScreenHelper.h"
+
+
+#include <GUI_version.h>
+#include <Basics_OCCTVersion.hxx>
 
 #include <SALOME_Event.h>
 
@@ -59,6 +76,7 @@
 #include <SUIT_Study.h>
 #include <SUIT_FileDlg.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_ShortcutMgr.h>
 #include <SUIT_Tools.h>
 #include <SUIT_Accel.h>
 #include <SUIT_MessageBox.h>
@@ -73,6 +91,8 @@
 #include <QtxActionToolMgr.h>
 #include <QtxSearchTool.h>
 #include <QtxWorkstack.h>
+#include <QtxMap.h>
+#include <QtxWebBrowser.h>
 
 #include <LogWindow.h>
 
 #ifndef DISABLE_PLOT2DVIEWER
   #include <Plot2d_ViewManager.h>
   #include <Plot2d_ViewModel.h>
+  #include <Plot2d_ViewWindow.h>
+  #include <Plot2d_ViewFrame.h>
   #include "LightApp_Plot2dSelector.h"
 #ifndef DISABLE_SALOMEOBJECT
   #include <SPlot2d_ViewModel.h>
 #endif
 #endif
 
-#include <QxScene_ViewManager.h>
-#include <QxScene_ViewModel.h>
-#include <QxScene_ViewWindow.h>
-
 #ifndef DISABLE_OCCVIEWER
   #include <OCCViewer_ViewManager.h>
+  #include <OCCViewer_ViewFrame.h>
 #ifndef DISABLE_SALOMEOBJECT
   #include <SOCC_ViewModel.h>
 #else
 //#endif
 
 #ifndef DISABLE_QXGRAPHVIEWER
-  #include <QxGraph_ViewModel.h>
-  #include <QxGraph_ViewWindow.h>
-  #include <QxGraph_ViewManager.h>
+//VSR: QxGraph has been replaced by QxScene
+//  #include <QxGraph_ViewModel.h>
+//  #include <QxGraph_ViewWindow.h>
+//  #include <QxGraph_ViewManager.h>
+  #include <QxScene_ViewManager.h>
+  #include <QxScene_ViewModel.h>
+  #include <QxScene_ViewWindow.h>
 #endif
 
+
+#define VISIBILITY_COLUMN_WIDTH 25
+
 #include <QDir>
 #include <QImage>
 #include <QString>
 #include <QByteArray>
 #include <QMenu>
 #include <QProcess>
+#include <QTimer>
+#include <QHeaderView>
+#include <QTreeView>
+#include <QMimeData>
+#include <QShortcut>
 
 #include <utilities.h>
 
   #include <SALOME_ListIO.hxx>
 #endif
 
+#include <Standard_Version.hxx>
+
 #define ToolBarMarker    0
 #define DockWidgetMarker 1
 
 static const char* imageEmptyIcon[] = {
 "20 20 1 1",
-".     c None",
+".      c None",
 "....................",
 "....................",
 "....................",
@@ -205,6 +238,7 @@ extern "C" LIGHTAPP_EXPORT SUIT_Application* createApplication()
 /*! \var global preferences of LightApp */
 LightApp_Preferences* LightApp_Application::_prefs_ = 0;
 
+
 /*!
   \class LightApp_Application
   Application containing LightApp module
@@ -213,15 +247,36 @@ LightApp_Preferences* LightApp_Application::_prefs_ = 0;
 /*!Constructor.*/
 LightApp_Application::LightApp_Application()
 : CAM_Application( false ),
-  myPrefs( 0 )
+  myPrefs( 0 ),
+  myScreenHelper(new LightApp_FullScreenHelper())
 {
+  Q_INIT_RESOURCE( LightApp );
+
   STD_TabDesktop* desk = new STD_TabDesktop();
+  desk->setFullScreenAllowed(false);
 
   setDesktop( desk );
 
+  // initialize auto save timer
+  myAutoSaveTimer = new QTimer( this );
+  myAutoSaveTimer->setSingleShot( true );
+  connect( myAutoSaveTimer, SIGNAL( timeout() ), this, SLOT( onSaveDoc() ) );
+
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
 
+  QtxWebBrowser::setData("browser:icon",          aResMgr->loadPixmap( "LightApp", tr( "BROWSER_ICON" ) ) );
+  QtxWebBrowser::setData("browser:title",         tr( "BROWSER_TITLE" ) );
+  QtxWebBrowser::setData("toolbar:title",         tr( "BROWSER_TOOLBAR_TITLE" ) );
+  QtxWebBrowser::setData("menu:file:title",       tr( "BROWSER_FILEMENU" ) );
+  QtxWebBrowser::setData("action:close:title",    tr( "BROWSER_CLOSE" ) );
+  QtxWebBrowser::setData("action:close:icon",     aResMgr->loadPixmap( "LightApp", tr( "BROWSER_CLOSE_ICON" ) ) );
+  QtxWebBrowser::setData("action:back:title",     tr( "BROWSER_BACK" ) );
+  QtxWebBrowser::setData("action:forward:title",  tr( "BROWSER_FORWARD" ) );
+  QtxWebBrowser::setData("action:find:title",     tr( "BROWSER_FIND" ) );
+  QtxWebBrowser::setData("action:findnext:title", tr( "BROWSER_FINDNEXT" ) );
+  QtxWebBrowser::setData("action:findprev:title", tr( "BROWSER_FINDPREV" ) );
+
   desktop()->setWindowIcon( aLogo );
   desktop()->setDockableMenuBar( false );
   desktop()->setDockableStatusBar( false );
@@ -289,15 +344,15 @@ LightApp_Application::LightApp_Application()
   QStringList anAddFamilies = aResMgr->stringValue( "PyConsole", "additional_families" ).split( ";", QString::SkipEmptyParts );
   QString aFamily;
   for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
+  {
+    aFamily = *it;
+    if ( famdb.contains(aFamily) )
     {
-      aFamily = *it;
-      if ( famdb.contains(aFamily) )
-       {
-         f.setFamily( aFamily );
-         aResMgr->setValue( "PyConsole", "font", f );
-         break;
-       }
+      f.setFamily( aFamily );
+      aResMgr->setValue( "PyConsole", "font", f );
+      break;
     }
+  }
 }
 
 /*!Destructor.
@@ -309,6 +364,7 @@ LightApp_Application::LightApp_Application()
 LightApp_Application::~LightApp_Application()
 {
   delete mySelMgr;
+  delete myScreenHelper;
 }
 
 /*!Start application.*/
@@ -328,7 +384,10 @@ void LightApp_Application::start()
 /*!Gets application name.*/
 QString LightApp_Application::applicationName() const
 {
-  return tr( "APP_NAME" );
+  static QString _app_name;
+  if ( _app_name.isEmpty() )
+    _app_name = tr( "APP_NAME" );
+  return _app_name;
 }
 
 /*!Gets application version.*/
@@ -345,27 +404,7 @@ QString LightApp_Application::applicationVersion() const
     }
     else
     {
-      QString path( ::getenv( "GUI_ROOT_DIR" ) );
-      if ( !path.isEmpty() )
-        path += QDir::separator();
-      path += QString( "bin/salome/VERSION" );
-
-      QFile vf( path );
-      if ( vf.open( QIODevice::ReadOnly ) )
-      {
-        QString line( vf.readLine( 1024 ) );
-       vf.close();
-
-       if ( !line.isEmpty() )
-        {
-         while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
-           line.remove( line.length() - 1, 1 );
-
-         int idx = line.lastIndexOf( ":" );
-         if ( idx != -1 )
-           _app_version = line.mid( idx + 1 ).trimmed();
-        }
-      }
+      _app_version = GUI_VERSION_STR;
     }
   }
   return _app_version;
@@ -427,14 +466,23 @@ void LightApp_Application::createActionForViewer( const int id,
                                                   const QString& suffix,
                                                   const int accel )
 {
-  QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), QIcon(),
-                            tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
-                            tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
-                            accel, desktop(), false, this, SLOT( onNewWindow() ) );
+  QString vtlt = tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() );
+  QString tip = tr( "CREATING_NEW_WINDOW" ).arg( vtlt.remove( "&" ) );
+  QAction* a = createAction( id,                      // menu action id
+                            tip,                     // status tip
+                            QIcon(),                 // icon
+                            vtlt,                    // menu text
+                             tip,                     // tooltip
+                             accel,                   // shortcut
+                            desktop(),               // parent
+                             false,                   // toggle flag
+                            this,                    // receiver
+                             SLOT( onNewWindow() ) ); // slot
   createMenu( a, parentId, -1 );
 }
 
 /*!Create actions:*/
+
 void LightApp_Application::createActions()
 {
   STD_Application::createActions();
@@ -444,77 +492,83 @@ void LightApp_Application::createActions()
 
   //! Preferences
   createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
-               tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
-               Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
+                tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
+                Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
 
   //! Help for modules
   int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
-  int helpModuleMenu = createMenu( tr( "MEN_DESK_MODULE_HELP" ), helpMenu, -1, 0 );
   createMenu( separator(), helpMenu, -1, 1 );
-
   QStringList aModuleList;
   modules( aModuleList, false );
+  aModuleList.prepend( "GUI" );
+  aModuleList.prepend( "KERNEL" );
 
   int id = LightApp_Application::UserID + FIRST_HELP_ID;
-  // help for KERNEL and GUI
-  QString dir;//QByteArray dir;
-  QString aFileName = "index.html";
-  QString root;
-  QAction* a;
-  dir = getenv("GUI_ROOT_DIR");
-  if ( !dir.isEmpty() ) {
-    root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
-                          Qtx::addSlash("salome") + Qtx::addSlash("gui") +  Qtx::addSlash("GUI") );
-    if ( QFileInfo( root + aFileName ).exists() ) {
-      a = createAction( id, tr( QString("GUI Help").toLatin1().constData() ),
-                       resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
-                       tr( QString("GUI Help").toLatin1().constData() ),
-                       tr( QString("GUI Help").toLatin1().constData() ),
-                       0, desk, false, this, SLOT( onHelpContentsModule() ) );
-      a->setObjectName( QString("GUI") );
-      createMenu( a, helpModuleMenu, -1 );
-      id++;
-    }
-  }
-  dir = getenv("KERNEL_ROOT_DIR");
-  if ( !dir.isEmpty() ) {
-    root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
-                         Qtx::addSlash("salome") );
-    if ( QFileInfo( root + aFileName ).exists() ) {
-      a = createAction( id, tr( QString("KERNEL Help").toLatin1().constData() ),
-                       resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
-                       tr( QString("KERNEL Help").toLatin1().constData() ),
-                       tr( QString("KERNEL Help").toLatin1().constData() ),
-                       0, desk, false, this, SLOT( onHelpContentsModule() ) );
-      a->setObjectName( QString("KERNEL") );
-      createMenu( a, helpModuleMenu, -1 );
-      id++;
-    }
-  }
+
   // help for other existing modules
-  QStringList::Iterator it;
-  for ( it = aModuleList.begin(); it != aModuleList.end(); ++it )
-  {
-    if ( (*it).isEmpty() )
+
+  QString aModule;
+  foreach( aModule, aModuleList ) {
+    if ( aModule.isEmpty() )                                         // module title (user name)
       continue;
+    IMap <QString, QString> helpData;                                // list of help files for the module
+    QString helpSubMenu;                                             // help submenu name (empty if not needed)
+    QString modName = moduleName( aModule );                         // module name
+    if ( modName.isEmpty() ) modName = aModule;                      // for KERNEL and GUI
+    QString rootDir = QString( "%1_ROOT_DIR" ).arg( modName );       // module root dir variable
+    QString modDir  = getenv( rootDir.toLatin1().constData() );      // module root dir
+    QString docSection;
+    if (resMgr->hasValue( modName, "documentation" ) )
+      docSection = resMgr->stringValue(modName, "documentation");
+    else if ( resMgr->hasSection( modName + "_documentation" ) )
+      docSection = modName + "_documentation";
+    if ( !docSection.isEmpty() ) {
+      helpSubMenu = resMgr->stringValue( docSection, "sub_menu", "" ).arg( aModule );
+      QStringList listOfParam = resMgr->parameters( docSection );
+      foreach( QString paramName, listOfParam ) {
+        QString valueStr = resMgr->stringValue( docSection, paramName );
+        if ( !valueStr.isEmpty() ) {
+          QFileInfo fi( valueStr );
+          if ( fi.isRelative() && !modDir.isEmpty() )
+            valueStr = Qtx::addSlash( modDir ) + valueStr;
+          if ( QFile::exists( valueStr ) )
+            helpData.insert( paramName.arg( aModule ), valueStr );
+        }
+      }
+    }
+
+    if ( helpData.isEmpty() && !modDir.isEmpty() ) {
+      QStringList idxLst = QStringList() << modDir << "share" << "doc" << "salome" << "gui" << modName << "index.html";
+      QString indexFile = idxLst.join( QDir::separator() );          // index file
+      if ( QFile::exists( indexFile ) )
+        helpData.insert( tr( "%1 module Users's Guide" ).arg( aModule ), indexFile );
+    }
 
-    QString modName = moduleName( *it );
-
-    dir = getenv( (modName + "_ROOT_DIR").toLatin1().constData() );
-    if ( !dir.isEmpty() ) {
-      root = Qtx::addSlash( Qtx::addSlash(dir) +  Qtx::addSlash("share") + 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")).toLatin1().constData() ),
-                                  resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
-                                  tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
-                                  tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
-                                  0, desk, false, this, SLOT( onHelpContentsModule() ) );
-       a->setObjectName( modName );
-       createMenu( a, helpModuleMenu, -1 );
-       id++;
+    IMapConstIterator<QString, QString > fileIt;
+    for ( fileIt = helpData.begin(); fileIt != helpData.end(); fileIt++ ) {
+      QString helpFileName = fileIt.key();
+      // remove all '//' occurances 
+      while ( helpFileName.contains( "//" ) )
+       helpFileName.replace( "//", "" );
+      // obtain submenus hierarchy if given
+      QStringList smenus = helpFileName.split( "/" );
+      helpFileName = smenus.last();
+      smenus.removeLast();
+      QAction* a = createAction( id, helpFileName,
+                                 resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+                                 helpFileName, helpFileName,
+                                 0, desk, false, this, SLOT( onHelpContentsModule() ) );
+      a->setData( fileIt.value() );
+      if ( !helpSubMenu.isEmpty() ) {
+       smenus.prepend( helpSubMenu );
+      }
+      // create sub-menus hierarchy
+      int menuId = helpMenu;
+      foreach ( QString subMenu, smenus ) {
+        menuId = createMenu( subMenu, menuId, -1, 0 );
       }
+      createMenu( a, menuId, -1, 0 );
+      id++;
     }
   }
 
@@ -546,24 +600,29 @@ void LightApp_Application::createActions()
 
     const int iconSize = 20;
 
+    QStringList::Iterator it;
     for ( it = modList.begin(); it != modList.end(); ++it )
     {
       if ( !isLibExists( *it ) )
         continue;
 
+      QString modName = moduleName( *it );
+
+      if ( !isModuleAccessible( *it ) )
+        continue;
+
       QString iconName;
       if ( iconMap.contains( *it ) )
         iconName = iconMap[*it];
 
-      QString modName = moduleName( *it );
-
       QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
       if ( icon.isNull() )
       {
-       icon = modIcon;
-       INFOS ( "****************************************************************" << std::endl
-            << "*    Icon for " << (*it).toLatin1().constData() << " not found. Using the default one." << std::endl
-            << "****************************************************************" << std::endl );
+        icon = modIcon;
+        INFOS ( "****************************************************************" << std::endl
+                <<  "*    Icon for " << (*it).toLatin1().constData()
+                << " not found. Using the default one." << std::endl
+                << "****************************************************************" << std::endl );
       }
 
       icon = Qtx::scaleIcon( icon, iconSize );
@@ -571,8 +630,8 @@ void LightApp_Application::createActions()
       moduleAction->insertModule( *it, icon );
     }
 
-
-    connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ), this, SLOT( onModuleActivation( const QString& ) ) );
+    connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ),
+             this, SLOT( onModuleActivation( const QString& ) ) );
     registerAction( ModulesListId, moduleAction );
   }
 
@@ -581,7 +640,7 @@ void LightApp_Application::createActions()
   int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
 
   createAction( CloseId, tr( "TOT_CLOSE" ), QIcon(), tr( "MEN_DESK_CLOSE" ), tr( "PRP_CLOSE" ),
-                Qt::SHIFT+Qt::Key_C, desk, false, this, SLOT( onCloseWindow() ) );
+                Qt::CTRL+Qt::Key_F4, desk, false, this, SLOT( onCloseWindow() ) );
   createAction( CloseAllId, tr( "TOT_CLOSE_ALL" ), QIcon(), tr( "MEN_DESK_CLOSE_ALL" ), tr( "PRP_CLOSE_ALL" ),
                 0, desk, false, this, SLOT( onCloseAllWindow() ) );
   createAction( GroupAllId, tr( "TOT_GROUP_ALL" ), QIcon(), tr( "MEN_DESK_GROUP_ALL" ), tr( "PRP_GROUP_ALL" ),
@@ -605,13 +664,13 @@ void LightApp_Application::createActions()
   createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), Qt::ALT+Qt::Key_K );
 #endif
 #ifndef DISABLE_QXGRAPHVIEWER
-  createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
+//VSR: QxGraph has been replaced by QxScene
+//  createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
+  createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_S );
 #endif
 
-  createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_S );
-
   createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
-               Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
+                Qt::ALT+Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
   createMenu( RenameId, windowMenu, -1 );
 
   int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
@@ -625,9 +684,14 @@ void LightApp_Application::createActions()
   createAction( StyleId, tr( "TOT_THEME" ), QIcon(), tr( "MEN_DESK_THEME" ), tr( "PRP_THEME" ),
                 0, desk, false, this, SLOT( onStylePreferences() ) );
 
+  createAction( FullScreenId, tr( "TOT_FULLSCREEN" ), QIcon(), tr( "MEN_DESK_FULLSCREEN" ), tr( "PRP_FULLSCREEN" ),
+                Qt::Key_F11, desk, false, this, SLOT( onFullScreen() ) );
+
+
   int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1 );
   createMenu( separator(), viewMenu, -1, 20, -1 );
   createMenu( StyleId, viewMenu, 20, -1 );
+  createMenu( FullScreenId, viewMenu, 20, -1 );
 
   int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) );
   createTool( ModulesListId, modTBar );
@@ -661,9 +725,9 @@ void LightApp_Application::onModuleActivation( const QString& modName )
       putInfo( tr("INF_CANCELLED") );
 
       LightApp_ModuleAction* moduleAction =
-       qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+        qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
       if ( moduleAction )
-       moduleAction->setActiveModule( QString() );
+        moduleAction->setActiveModule( QString() );
       cancelled = true;
     }
   }
@@ -714,13 +778,14 @@ void LightApp_Application::onNewWindow()
     break;
 #endif
 #ifndef DISABLE_QXGRAPHVIEWER
-  case NewQxGraphViewId:
-    type = QxGraph_Viewer::Type();
-    break;
-#endif
+//VSR: QxGraph has been replaced by QxScene
+//  case NewQxGraphViewId:
+//    type = QxGraph_Viewer::Type();
+//    break;
   case NewQxSceneViewId:
     type = QxScene_Viewer::Type();
     break;
+#endif
   }
 
   if ( !type.isEmpty() )
@@ -732,7 +797,9 @@ void LightApp_Application::onNewWindow()
 */
 void LightApp_Application::onNewDoc()
 {
-  saveDockWindowsState();
+  //asl: fix for 0020515
+  if ( activeStudy() )
+    saveDockWindowsState();
 
   CAM_Application::onNewDoc();
 }
@@ -838,13 +905,12 @@ void LightApp_Application::updateCommandsStatus()
 #endif
 
 #ifndef DISABLE_QXGRAPHVIEWER
-  a = action( NewQxGraphViewId );
-  if( a )
-    a->setEnabled( activeStudy() );
-#endif
+//VSR: QxGraph has been replaced by QxScene
+//  a = action( NewQxGraphViewId );
   a = action( NewQxSceneViewId );
   if( a )
     a->setEnabled( activeStudy() );
+#endif
 }
 
 /*!
@@ -855,38 +921,34 @@ class RunBrowser: public QThread
 {
 public:
   RunBrowser( LightApp_Application* app,
-             const QString&        theApp,
-             const QString&        theParams,
-             const QString&        theHelpFile,
-             const QString&        theContext = QString() )
+              const QString&        theApp,
+              const QString&        theParams,
+              const QString&        theHelpFile,
+              const QString&        theContext = QString() )
     : myApp( theApp ),
       myParams( theParams ),
-#ifdef WIN32
-      myHelpFile( "file://" + theHelpFile ),
-#else
-      myHelpFile( "file:" + theHelpFile ),
-#endif
       myContext( theContext ),
       myStatus(0),
       myLApp( app )
   {
+    //For the external browser always specify 'file://' protocol,
+    //because some WEB browsers (for example Mozilla Firefox) can't open local file without protocol.
+    myHelpFile = QString("file://%1").arg( QFileInfo( theHelpFile ).canonicalFilePath() );
   }
 
   virtual void run()
   {
-    if ( !myApp.isEmpty()) {
-      QString aCommand = QString( "%1 %2 %3" ).arg( myApp, myParams, myHelpFile );
-      if ( !myContext.isEmpty() )
-       aCommand += "#" + myContext;
+    if ( !myApp.isEmpty() && !myHelpFile.isEmpty()) {
+      QString aCommand = QString( "%1 %2 \"%3%4\"" ).arg( myApp, myParams, myHelpFile, myContext.isEmpty() ? QString("") : QString( "#%1" ).arg( myContext ) );
 
       QProcess* proc = new QProcess();
 
       proc->start( aCommand );
       if ( !proc->waitForStarted() ) {
-       SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
-       QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
-       ce2000->setData( msg );
-       QApplication::postEvent( myLApp, ce2000 );
+        SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
+        QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
+        ce2000->setData( msg );
+        QApplication::postEvent( myLApp, ce2000 );
       }
     }
   }
@@ -905,44 +967,47 @@ private:
 */
 void LightApp_Application::onHelpContentsModule()
 {
-  const QAction* obj = (QAction*) sender();
-
-  QString aComponentName = obj->objectName();
-  QString aFileName = "index.html";
+  const QAction* a = (QAction*) sender();
+  QString helpFile = a->data().toString();
+  if ( helpFile.isEmpty() ) return;
 
-  QString dir = getenv( (aComponentName + "_ROOT_DIR").toLatin1().constData() );
-  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("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash("gui") +  Qtx::addSlash(aComponentName) );
-
-  QString helpFile = QFileInfo( homeDir + aFileName ).absoluteFilePath();
   SUIT_ResourceMgr* resMgr = resourceMgr();
-       QString platform;
+  QString platform;
 #ifdef WIN32
-       platform = "winapplication";
+  platform = "winapplication";
 #else
-       platform = "application";
+  platform = "application";
 #endif
-       QString anApp = resMgr->stringValue("ExternalBrowser", platform);
+  QString anApp = resMgr->stringValue("ExternalBrowser", platform);
 #ifdef WIN32
-       QString quote("\"");
-       anApp.prepend( quote );
-       anApp.append( quote );
+  QString quote("\"");
+  anApp.prepend( quote );
+  anApp.append( quote );
 #endif
   QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
+  bool useExtBrowser = resMgr->booleanValue("ExternalBrowser", "use_external_browser", false );
 
-  if ( !anApp.isEmpty() )
-  {
-    RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
-    rs->start();
-  }
-  else
-  {
-    if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
-                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                   SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+  if( useExtBrowser ) {
+    if ( !anApp.isEmpty() ) {
+      RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
+      rs->start();
+    }
+    else {
+      if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+                                      SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                      SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
 
-      showPreferences( tr( "PREF_APP" ) );
+        showPreferences( tr( "PREF_APP" ) );
+    }
+  }
+  else {
+#ifdef WIN32
+    // On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol 
+    // is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
+    QtxWebBrowser::loadUrl(helpFile);
+#else
+       QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile));
+#endif
   }
 }
 
@@ -950,48 +1015,73 @@ void LightApp_Application::onHelpContentsModule()
   SLOT: Displays help contents for choosen dialog
 */
 void LightApp_Application::onHelpContextModule( const QString& theComponentName,
-                                               const QString& theFileName,
-                                               const QString& theContext )
-{
+                                                const QString& theFileName,
+                                                const QString& theContext )
+{
+  QString fileName = theFileName;
+  QString context  = theContext;
+  if ( !QFile::exists( fileName ) && theContext.isEmpty() ) {
+    // context might be passed within theFileName argument
+    QStringList comps = fileName.split("#");
+    if ( comps.count() > 1 ) {
+      context = comps.last();
+      comps.removeLast();
+      fileName = comps.join("#");
+    }
+  }
+
   QString homeDir = "";
   if ( !theComponentName.isEmpty() ) {
     QString dir = getenv( ( theComponentName + "_ROOT_DIR" ).toLatin1().constData() );
     if ( !dir.isEmpty() )
       homeDir = Qtx::addSlash( Qtx::addSlash( dir )      +
-                              Qtx::addSlash( "share" )  +
-                              Qtx::addSlash( "doc" )    +
-                              Qtx::addSlash( "salome" ) +
-                              Qtx::addSlash( "gui" )    +
-                              Qtx::addSlash( theComponentName ) );
+                               Qtx::addSlash( "share" )  +
+                               Qtx::addSlash( "doc" )    +
+                               Qtx::addSlash( "salome" ) +
+                               Qtx::addSlash( "gui" )    +
+                               Qtx::addSlash( theComponentName ) );
   }
 
-  QString helpFile = QFileInfo( homeDir + theFileName ).absoluteFilePath();
+  QString helpFile = QFileInfo( homeDir + fileName ).absoluteFilePath();
   SUIT_ResourceMgr* resMgr = resourceMgr();
-       QString platform;
+        QString platform;
 #ifdef WIN32
-       platform = "winapplication";
+        platform = "winapplication";
 #else
-       platform = "application";
+        platform = "application";
 #endif
-       QString anApp = resMgr->stringValue("ExternalBrowser", platform);
+        QString anApp = resMgr->stringValue("ExternalBrowser", platform);
 #ifdef WIN32
-       QString quote("\"");
-       anApp.prepend( quote );
-       anApp.append( quote );
+        QString quote("\"");
+        anApp.prepend( quote );
+        anApp.append( quote );
 #endif
-  QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
 
-  if ( !anApp.isEmpty() )
-  {
-    RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile, theContext );
-    rs->start();
+  bool useExtBrowser = resMgr->booleanValue("ExternalBrowser", "use_external_browser", false );
+
+  if(useExtBrowser) {
+    QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
+
+    if ( !anApp.isEmpty() ) {
+      RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile, context );
+      rs->start();
+    }
+    else {
+      if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+                                      SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                      SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+        showPreferences( tr( "PREF_APP" ) );
+    }
   }
-  else
-  {
-    if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
-                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                   SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
-      showPreferences( tr( "PREF_APP" ) );
+  else {
+#ifdef WIN32
+    // On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol 
+    // is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
+       QtxWebBrowser::loadUrl(helpFile, context);
+#else
+       QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile),context);
+#endif
+    
   }
 }
 
@@ -1000,6 +1090,12 @@ void LightApp_Application::onHelpContextModule( const QString& theComponentName,
 */
 void LightApp_Application::onSelectionChanged()
 {
+  LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+  bool canCopy  = m ? m->canCopy() : false;
+  bool canPaste = m ? m->canPaste() : false;
+
+  action( EditCopyId )->setEnabled(canCopy);
+  action( EditPasteId )->setEnabled(canPaste);
 }
 
 /*!
@@ -1055,8 +1151,8 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
       f = resourceMgr()->fontValue( "PyConsole", "font" );
     else
       {
-       f = ( ( PyConsole_Console* )wid )->font();
-       resourceMgr()->setValue( "PyConsole", "font", f );
+        f = ( ( PyConsole_Console* )wid )->font();
+        resourceMgr()->setValue( "PyConsole", "font", f );
       }
   }
   else
@@ -1109,6 +1205,11 @@ void LightApp_Application::insertDockWindow( const int id, QWidget* wid )
   dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
   dock->setObjectName( QString( "window_%1" ).arg( id ) );
   dock->setWidget( wid );
+
+  QKeySequence accel = wid->property( "shortcut" ).value<QKeySequence>();
+  if ( !accel.isEmpty() )
+    dock->toggleViewAction()->setShortcut( accel );
+
   dock->show();
 }
 
@@ -1133,8 +1234,11 @@ void LightApp_Application::removeDockWindow( const int id )
 void LightApp_Application::placeDockWindow( const int id, Qt::DockWidgetArea place )
 {
   QDockWidget* dock = windowDock( dockWindow( id ) );
-  if ( dock && desktop() )
+  if ( dock && desktop() ) {
     desktop()->addDockWidget( place, dock );
+    QtxDockAction* a = qobject_cast<QtxDockAction*>( action( ViewWindowsId ) );
+    if ( a ) a->update();
+  }
 }
 
 /*!
@@ -1202,7 +1306,7 @@ void LightApp_Application::updateObjectBrowser( const bool updateModels )
       study->dataModels( dm_list );
       QListIterator<CAM_DataModel*> it( dm_list );
       while ( it.hasNext() ) {
-       CAM_DataModel* camDM = it.next();
+        CAM_DataModel* camDM = it.next();
         if ( camDM && camDM->inherits( "LightApp_DataModel" ) )
           ((LightApp_DataModel*)camDM)->update();
       }
@@ -1289,13 +1393,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     }
   }
 #endif
-  if( vmType == QxScene_Viewer::Type() )
-  {
-    viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
-    QxScene_Viewer* vm = new QxScene_Viewer();
-    viewMgr->setViewModel( vm  );
-    //QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
-  }
   //#ifndef DISABLE_SUPERVGRAPHVIEWER
   //  if( vmType == SUPERVGraph_Viewer::Type() )
   //  {
@@ -1303,10 +1400,18 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   //  }
   //#endif
 #ifndef DISABLE_QXGRAPHVIEWER
-  if( vmType == QxGraph_Viewer::Type() )
-    {
-      viewMgr = new QxGraph_ViewManager( activeStudy(), desktop(), new QxGraph_Viewer() );
-    }
+//VSR: QxGraph has been replaced by QxScene
+//  if( vmType == QxGraph_Viewer::Type() )
+//    {
+//      viewMgr = new QxGraph_ViewManager( activeStudy(), desktop(), new QxGraph_Viewer() );
+//    }
+  if( vmType == QxScene_Viewer::Type() )
+  {
+    viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
+    QxScene_Viewer* vm = new QxScene_Viewer();
+    viewMgr->setViewModel( vm  );
+    //QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
+  }
 #endif
 #ifndef DISABLE_OCCVIEWER
   if( vmType == OCCViewer_Viewer::Type() )
@@ -1316,15 +1421,26 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
 #ifndef DISABLE_SALOMEOBJECT
     vm = new SOCC_Viewer();
 #else
-    vm = new OCCViewer_Viewer( true, resMgr->booleanValue( "OCCViewer", "static_trihedron", true ) );
+    vm = new OCCViewer_Viewer( true );
 #endif
-    vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
-    vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
+    vm->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
+                      resMgr->backgroundValue( "OCCViewer", "xz_background", vm->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
+    vm->setBackground( OCCViewer_ViewFrame::TOP_RIGHT,
+                      resMgr->backgroundValue( "OCCViewer", "yz_background", vm->background(OCCViewer_ViewFrame::TOP_RIGHT) ) );
+    vm->setBackground( OCCViewer_ViewFrame::BOTTOM_LEFT,
+                      resMgr->backgroundValue( "OCCViewer", "xy_background", vm->background(OCCViewer_ViewFrame::BOTTOM_LEFT) ) );
+    vm->setBackground( OCCViewer_ViewFrame::BOTTOM_RIGHT,
+                      resMgr->backgroundValue( "OCCViewer", "background", vm->background(OCCViewer_ViewFrame::MAIN_VIEW) ) );
+
+    vm->setTrihedronSize(  resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ),
+                           resMgr->booleanValue( "OCCViewer", "relative_size", vm->trihedronRelative() ));
     int u( 1 ), v( 1 );
     vm->isos( u, v );
     u = resMgr->integerValue( "OCCViewer", "iso_number_u", u );
     v = resMgr->integerValue( "OCCViewer", "iso_number_v", v );
     vm->setIsos( u, v );
+    vm->setInteractionStyle( resMgr->integerValue( "OCCViewer", "navigation_mode", vm->interactionStyle() ) );
+    vm->setZoomingStyle( resMgr->integerValue( "OCCViewer", "zooming_mode", vm->zoomingStyle() ) );
     viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface
     new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
   }
@@ -1342,22 +1458,25 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     if( vm )
     {
       vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
-      vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
+      vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
       vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
-                           resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+                            resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+      vm->setStaticTrihedronVisible( resMgr->booleanValue( "VTKViewer", "show_static_trihedron", vm->isStaticTrihedronVisible() ) );
       vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) );
+      vm->setZoomingStyle( resMgr->integerValue( "VTKViewer", "zooming_mode", vm->zoomingStyle() ) );
+      vm->setDynamicPreSelection( resMgr->booleanValue( "VTKViewer", "dynamic_preselection", vm->dynamicPreSelection() ) );
       vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
-                              resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
+                               resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
       vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
-                               resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
-                               resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
+                                resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
+                                resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
       new LightApp_VTKSelector( vm, mySelMgr );
     }
 #else
     viewMgr = new VTKViewer_ViewManager( activeStudy(), desktop() );
     VTKViewer_Viewer* vm = dynamic_cast<VTKViewer_Viewer*>( viewMgr->getViewModel() );
     if ( vm )
-      vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
+      vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
 #endif
   }
 #endif
@@ -1368,12 +1487,36 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   addViewManager( viewMgr );
   SUIT_ViewWindow* viewWin = viewMgr->createViewWindow();
 
-  if ( viewWin && desktop() )
+  if ( viewWin && desktop() ) {
     viewWin->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
+    viewWin->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+  }
 
   return viewMgr;
 }
 
+SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, QWidget* w )
+{
+  SUIT_ResourceMgr* resMgr = resourceMgr();
+
+  SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(),
+                                               desktop(),
+                                               new LightApp_WgViewModel( vmType, w ) );
+  vm->setTitle( QString( "%1: %M - viewer %V" ).arg( vmType ) );
+
+  addViewManager( vm );
+  SUIT_ViewWindow* vw = vm->createViewWindow();
+  if ( vw && desktop() ) {
+    vw->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
+    vw->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+  }
+
+  if ( !vmType.isEmpty() && !myUserWmTypes.contains( vmType ) )
+    myUserWmTypes << vmType;
+
+  return vm;
+}
+
 /*!
   SLOT: Removes view manager from application
 */
@@ -1449,6 +1592,9 @@ void LightApp_Application::onStudySaved( SUIT_Study* s )
 /*!Protected SLOT. On study closed.*/
 void LightApp_Application::onStudyClosed( SUIT_Study* s )
 {
+  // stop auto-save timer
+  myAutoSaveTimer->stop();
+
   // Bug 10396: clear selection
   mySelMgr->clearSelected();
 
@@ -1475,6 +1621,16 @@ void LightApp_Application::studyOpened( SUIT_Study* s )
   updateViewManagers();
 }
 
+void LightApp_Application::studySaved( SUIT_Study* s )
+{
+  CAM_Application::studyOpened( s );
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  if ( aResMgr && activeStudy() ) {
+    int autoSaveInterval = aResMgr->integerValue( "Study", "auto_save_interval", 0 );
+    if ( autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+  }
+}
+
 void LightApp_Application::studyCreated( SUIT_Study* s )
 {
   CAM_Application::studyCreated( s );
@@ -1529,6 +1685,18 @@ void LightApp_Application::onRefresh()
   updateObjectBrowser( true );
 }
 
+/*!Private SLOT. Support drag-and-drop operation.*/
+void LightApp_Application::onDropped( const QList<SUIT_DataObject*>& objects, SUIT_DataObject* parent, int row, Qt::DropAction action )
+{
+  LightApp_DataObject* parentObj = dynamic_cast<LightApp_DataObject*>( parent );
+  if ( !parentObj )
+    return;
+
+  LightApp_Module* aModule = dynamic_cast<LightApp_Module*>( parentObj->module() );
+  if ( aModule )
+    aModule->dropObjects( objects, parentObj, row, action );
+}
+
 /*!Private SLOT. On preferences.*/
 void LightApp_Application::onPreferences()
 {
@@ -1554,6 +1722,9 @@ void LightApp_Application::showPreferences( const QString& itemText )
     if ( desktop() )
       resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
     resourceMgr()->save();
+
+    // Update shortcuts
+    shortcutMgr()->updateShortcuts();
   }
 
   delete prefDlg;
@@ -1627,6 +1798,19 @@ QWidget* LightApp_Application::createWindow( const int flag )
     ob->setWindowTitle( tr( "OBJECT_BROWSER" ) );
     connect( ob, SIGNAL( requestUpdate() ), this, SLOT( onRefresh() ) );
 
+    QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
+    SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( ob->model() );
+    treeModel->setSearcher( this );
+    treeModel->registerColumn( 0, EntryCol, LightApp_DataObject::EntryId );
+    treeModel->setAppropriate( EntryCol, Qtx::Toggled );
+
+    // Mantis issue 0020136: Drag&Drop in OB
+    SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
+    if ( proxyModel ) {
+      connect( proxyModel, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+              this,       SLOT( onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+    }
+
     // temporary commented
     /*
     OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
@@ -1639,15 +1823,22 @@ QWidget* LightApp_Application::createWindow( const int flag )
     // Create OBSelector
     new LightApp_OBSelector( ob, mySelMgr );
 
+    ob->treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
+    ob->treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId);
+    ob->treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
+    ob->setProperty( "shortcut", QKeySequence( "Alt+Shift+O" ) );
     wid = ob;
-
     ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
 #ifndef DISABLE_PYCONSOLE
   else  if ( flag == WT_PyConsole )
   {
-    PyConsole_Console* pyCons = new PyConsole_Console( desktop() );
+    PyConsole_Console* pyCons = new PyConsole_Console( desktop(),new LightApp_PyInterp());
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
+    pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
+    pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
+    pyCons->setProperty( "shortcut", QKeySequence( "Alt+Shift+P" ) );
+
     wid = pyCons;
     pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
@@ -1656,6 +1847,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
   {
     LogWindow* logWin = new LogWindow( desktop() );
     logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
+    logWin->setProperty( "shortcut", QKeySequence( "Alt+Shift+L" ) );
     wid = logWin;
     logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
@@ -1701,7 +1893,10 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
 
   that->myPrefs = _prefs_;
 
-  if ( !toCreate )
+  connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
+           this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
+
+  if ( !crt )
     return myPrefs;
 
   SUIT_ResourceMgr* resMgr = resourceMgr();
@@ -1721,12 +1916,12 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
 
     for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it )
     {
-      if ( !app->isLibExists( *it ) )
-       continue;
+      if ( !app->isLibExists( *it ) || _prefs_->hasModule( *it ) )
+        continue;
 
       int modId = _prefs_->addPreference( *it );
       if ( iconMap.contains( *it ) )
-       _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) );
+        _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) );
     }
 
     ModuleList modList;
@@ -1738,21 +1933,18 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const
 
       CAM_Module* anItem = itr.next();
       if ( anItem->inherits( "LightApp_Module" ) )
-       mod = (LightApp_Module*)anItem;
+        mod = (LightApp_Module*)anItem;
 
       if ( mod && !_prefs_->hasModule( mod->moduleName() ) )
       {
-       _prefs_->addPreference( mod->moduleName() );
-       mod->createPreferences();
-       that->emptyPreferences( mod->moduleName() );
+        _prefs_->addPreference( mod->moduleName() );
+        mod->createPreferences();
+        that->emptyPreferences( mod->moduleName() );
       }
     }
   }
   _prefs_->setItemProperty( "info", tr( "PREFERENCES_NOT_LOADED" ) );
 
-  connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
-           this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
-
   return myPrefs;
 }
 
@@ -1781,7 +1973,7 @@ void LightApp_Application::emptyPreferences( const QString& modName )
   if ( !item || !item->isEmpty() )
     return;
 
-  printf( "---------------------> Modify for empty module.\n" );
+  //  printf( "---------------------> Modify for empty module.\n" );
 
   QtxPagePrefFrameItem* frm = new QtxPagePrefFrameItem( item->title(), item->parentItem() );
   frm->setIcon( item->icon() );
@@ -1801,284 +1993,487 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
 
   QStringList     aValuesList;
   QList<QVariant> anIndicesList;
+  QIntList        idList;
+  QIntList        txtList;
 
+  // . Top-level "SALOME" preferences group <<start>>
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
   pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
 
+  // .. "General" preferences tab <<start>>
   int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
-  int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
 
+  // ... "Language" group <<start>>
+  int langGroup = pref->addPreference( tr( "PREF_GROUP_LANGUAGE" ), genTab );
+  pref->setItemProperty( "columns", 2, langGroup );
+  // .... -> application language
+  int curLang = pref->addPreference( tr( "PREF_CURRENT_LANGUAGE" ), langGroup,
+                                          LightApp_Preferences::Selector, "language", "language" );
+  QStringList aLangs = SUIT_Session::session()->resourceMgr()->stringValue( "language", "languages", "en" ).split( "," );
+  QList<QVariant> aIcons;
+  foreach ( QString aLang, aLangs ) {
+    aIcons << QPixmap( QString( ":/images/%1" ).arg( aLang ) );
+  }
+  pref->setItemProperty( "strings", aLangs, curLang );
+  pref->setItemProperty( "icons",   aIcons, curLang );
+  // ... "Language" group <<end>>
+
+  // ... "Look and feel" group <<start>>
+  int lookGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), genTab );
+  // .... -> opaque resize
+  pref->addPreference( tr( "PREF_OPAQUE_RESIZE" ), lookGroup, LightApp_Preferences::Bool, "desktop", "opaque_resize" );
+  // .... -> drop-down buttons 
+  pref->addPreference( tr( "PREF_DROP_DOWN_BUTTONS" ), lookGroup, LightApp_Preferences::Bool, "viewers", "drop_down_buttons" );
+  // ... "Look and feel" group <<end>>
+
+  // ... "Study properties" group <<start>>
+  int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
   pref->setItemProperty( "columns", 2, studyGroup );
-
+  // .... -> multi-file save
   pref->addPreference( tr( "PREF_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file" );
+  // .... -> ascii save mode
   pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "ascii_file" );
+  // .... -> store windows geometry
   pref->addPreference( tr( "PREF_STORE_POS" ),  studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
-
-  int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab );
-  QString platform;
+  // .... -> auto-save
+  int autoSaveInterval = pref->addPreference( tr( "PREF_AUTO_SAVE" ),  studyGroup,
+                                              LightApp_Preferences::IntSpin, "Study", "auto_save_interval" );
+  pref->setItemProperty( "min",        0, autoSaveInterval );
+  pref->setItemProperty( "max",     1440, autoSaveInterval );
+  pref->setItemProperty( "special", tr( "PREF_AUTO_SAVE_DISABLED" ), autoSaveInterval );
+  // ... "Study properties" group <<end>>
+
+  // ... "Help browser" group <<start>>
+  int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab, LightApp_Preferences::Auto, "ExternalBrowser", "use_external_browser");
 #ifdef WIN32
-  platform = "winapplication";
+  QString platform = "winapplication";
 #else
-  platform = "application";
+  QString platform = "application";
 #endif
+  // .... -> browser application
   int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, LightApp_Preferences::File, "ExternalBrowser", platform );
   pref->setItemProperty( "mode", Qtx::PT_OpenFile, apppref );
-
+  // .... -> browser parameters
   pref->addPreference( tr( "PREF_PARAM" ), extgroup, LightApp_Preferences::String, "ExternalBrowser", "parameters" );
+  // ... "Help browser" group <<end>>
 
+  // ... "Python console properties" group <<start>>
   int pythonConsoleGroup = pref->addPreference( tr( "PREF_GROUP_PY_CONSOLE" ), genTab );
+  // .... -> font
   pref->addPreference( tr( "PREF_FONT" ), pythonConsoleGroup, LightApp_Preferences::Font, "PyConsole", "font" );
+  // .... -> show banner
+  pref->addPreference( tr( "PREF_SHOW_BANNER" ), pythonConsoleGroup, LightApp_Preferences::Bool, "PyConsole", "show_banner" );
+  // ... "Python console properties" group <<end>>
 
-  int viewTab = pref->addPreference( tr( "PREF_TAB_VIEWERS" ), salomeCat );
-
-  int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), viewTab );
-
-  int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), viewTab );
-
-  int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), viewTab );
-
-  int supervGroup = pref->addPreference( tr( "PREF_GROUP_SUPERV" ), viewTab );
-
-  pref->setItemProperty( "columns", 2, occGroup );
-  pref->setItemProperty( "columns", 1, vtkGroup );
-  pref->setItemProperty( "columns", 2, plot2dGroup );
-
-  // OCC Viewer
-  int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup,
-                                  LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
+  // ... "MRU" preferences group <<start>>
+  int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
+  pref->setItemProperty( "columns", 4, mruGroup );
+  // number of MRU items
+  int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin,
+                                         "MRU", "visible_count" );
+  pref->setItemProperty( "min", 0,   mruVisCount );
+  pref->setItemProperty( "max", 100, mruVisCount );
+  // MRU links type
+  int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector,
+                                         "MRU", "link_type" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL");
+  anIndicesList << 0                        << 1                         << 2                       ;
+  pref->setItemProperty( "strings", aValuesList,   mruLinkType );
+  pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
+  // ... "MRU" preferences group <<end>>
+  // .. "General" preferences tab <<end>>
+
+  // .. "OCC viewer" group <<start>>
+  int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), salomeCat );
+
+  // ... "Trihedron" group <<start>>
+  int occTriGroup = pref->addPreference( tr( "PREF_TRIHEDRON" ), occGroup );
+  pref->setItemProperty( "columns", 2, occTriGroup );
+  // .... -> trihedron size
+  int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occTriGroup,
+                                   LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
   pref->setItemProperty( "min", 1.0E-06, occTS );
   pref->setItemProperty( "max", 1000, occTS );
-
-
-  int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup,
-                                 LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
+  // .... -> relative size of trihedron
+  pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), occTriGroup, LightApp_Preferences::Bool, "OCCViewer", "relative_size" );
+  // .... -> show static trihedron
+  pref->addPreference( tr( "PREF_SHOW_STATIC_TRIHEDRON" ), occTriGroup, LightApp_Preferences::Bool, "OCCViewer", "show_static_trihedron" );
+  // ... "Trihedron" group <<end>>
+
+  // ... "Iso-lines" group <<start>>
+  int isoGroup = pref->addPreference( tr( "PREF_ISOS" ), occGroup );
+  pref->setItemProperty( "columns", 2, isoGroup );
+  // .... -> nb isos U
+  int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), isoGroup,
+                                  LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
   pref->setItemProperty( "min", 0, isoU );
   pref->setItemProperty( "max", 100000, isoU );
-
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
-                      LightApp_Preferences::Color, "OCCViewer", "background" );
-
-  int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), occGroup,
-                                 LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
+  // .... -> nb isos V
+  int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), isoGroup,
+                                  LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
   pref->setItemProperty( "min", 0, isoV );
   pref->setItemProperty( "max", 100000, isoV );
+  // ... "Iso-lines" group <<end>>
 
-  // VTK Viewer
-  int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
-  pref->setItemProperty( "columns", 2, vtkGen );
-
-  int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
-                                        LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
-  QStringList aProjModeList;
-  aProjModeList.append( tr("PREF_ORTHOGRAPHIC") );
-  aProjModeList.append( tr("PREF_PERSPECTIVE") );
-
-  QList<QVariant> aModeIndexesList;
-  aModeIndexesList.append(0);
-  aModeIndexesList.append(1);
-
-  pref->setItemProperty( "strings", aProjModeList, vtkProjMode );
-  pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode );
-
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
-                      LightApp_Preferences::Color, "VTKViewer", "background" );
-
-  int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGen,
-                                  LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
-
-  pref->setItemProperty( "min", 1.0E-06, vtkTS );
-  pref->setItemProperty( "max", 150, vtkTS );
+  // ... "Background" group <<start>>
+  int bgGroup = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup );
+  //  pref->setItemProperty( "columns", 2, bgGroup );
+  aValuesList.clear();
+  anIndicesList.clear();
+  txtList.clear();
+  QString formats = OCCViewer_Viewer::backgroundData( aValuesList, idList, txtList );
+  foreach( int gid, idList ) anIndicesList << gid;
+  // .... -> 3D viewer background
+  int bgId = pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), bgGroup,
+                                 LightApp_Preferences::Background, "OCCViewer", "background" );
+  pref->setItemProperty( "gradient_names", aValuesList, bgId );
+  pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+  pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+  pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+  pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+  pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+  pref->setItemProperty( "custom_enabled", false, bgId );
+  pref->setItemProperty( "image_formats", formats, bgId );
+  // .... -> XZ viewer background
+  bgId = pref->addPreference( tr( "PREF_XZVIEWER_BACKGROUND" ), bgGroup,
+                             LightApp_Preferences::Background, "OCCViewer", "xz_background" );
+  pref->setItemProperty( "gradient_names", aValuesList, bgId );
+  pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+  pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+  pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+  pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+  pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+  pref->setItemProperty( "custom_enabled", false, bgId );
+  pref->setItemProperty( "image_formats", formats, bgId );
+  // .... -> YZ viewer background
+  bgId = pref->addPreference( tr( "PREF_YZVIEWER_BACKGROUND" ), bgGroup,
+                             LightApp_Preferences::Background, "OCCViewer", "yz_background" );
+  pref->setItemProperty( "gradient_names", aValuesList, bgId );
+  pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+  pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+  pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+  pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+  pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+  pref->setItemProperty( "custom_enabled", false, bgId );
+  pref->setItemProperty( "image_formats", formats, bgId );
+  // .... -> XY viewer background
+  bgId = pref->addPreference( tr( "PREF_XYVIEWER_BACKGROUND" ), bgGroup,
+                             LightApp_Preferences::Background, "OCCViewer", "xy_background" );
+  pref->setItemProperty( "gradient_names", aValuesList, bgId );
+  pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+  pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+  pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+  pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+  pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+  pref->setItemProperty( "custom_enabled", false, bgId );
+  pref->setItemProperty( "image_formats", formats, bgId );
+  // ... "Background" group <<end>>
+
+  // ... -> empty frame (for layout) <<start>>
+  int occGen = pref->addPreference( "", occGroup, LightApp_Preferences::Frame );
+  pref->setItemProperty( "margin",  0, occGen );
+  pref->setItemProperty( "columns", 2, occGen );
+  // .... -> navigation mode
+  int occStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), occGen,
+                                          LightApp_Preferences::Selector, "OCCViewer", "navigation_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_STANDARD_STYLE") << tr("PREF_KEYFREE_STYLE");
+  anIndicesList << 0                         << 1;
+  pref->setItemProperty( "strings", aValuesList,   occStyleMode );
+  pref->setItemProperty( "indexes", anIndicesList, occStyleMode );
+  // .... -> zooming mode
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+  int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), occGen,
+                                                 LightApp_Preferences::Selector, "OCCViewer", "zooming_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
+  anIndicesList << 0                            << 1;
+  pref->setItemProperty( "strings", aValuesList,   occZoomingStyleMode );
+  pref->setItemProperty( "indexes", anIndicesList, occZoomingStyleMode );
+#endif
+  // ... -> empty frame (for layout) <<end>>
+  // .. "OCC viewer" group <<end>>
 
-  pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+  // .. "VTK viewer" group <<start>>
+  int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), salomeCat ); //viewTab
 
+  // ... -> empty frame (for layout) <<start>>
+  int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
+  //pref->setItemProperty( "columns", 2, vtkGen );
+  // .... -> projection mode
+  int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
+                                         LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ORTHOGRAPHIC") << tr("PREF_PERSPECTIVE");
+  anIndicesList << 0                       << 1;
+  pref->setItemProperty( "strings", aValuesList,   vtkProjMode );
+  pref->setItemProperty( "indexes", anIndicesList, vtkProjMode );
+  // .... -> background
+  aValuesList.clear();
+  anIndicesList.clear();
+  txtList.clear();
+  formats = SVTK_Viewer::backgroundData( aValuesList, idList, txtList );
+  foreach( int gid, idList ) anIndicesList << gid;
+  bgId = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
+                             LightApp_Preferences::Background, "VTKViewer", "background" );
+  pref->setItemProperty( "gradient_names", aValuesList, bgId );
+  pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+  pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+  pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+  pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+  pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+  pref->setItemProperty( "custom_enabled", false, bgId );
+  pref->setItemProperty( "image_formats", formats, bgId );
+  // .... -> navigation mode
   int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen,
-                                         LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
-  QStringList aStyleModeList;
-  aStyleModeList.append( tr("PREF_STANDARD_STYLE") );
-  aStyleModeList.append( tr("PREF_KEYFREE_STYLE") );
-
-  pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
-  pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
-
-  pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
-
+                                          LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_STANDARD_STYLE") << tr("PREF_KEYFREE_STYLE");
+  anIndicesList << 0                         << 1;
+  pref->setItemProperty( "strings", aValuesList,   vtkStyleMode );
+  pref->setItemProperty( "indexes", anIndicesList, vtkStyleMode );
+  // .... -> zooming mode
+  int vtkZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), vtkGen,
+                                                 LightApp_Preferences::Selector, "VTKViewer", "zooming_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
+  anIndicesList << 0                            << 1;
+  pref->setItemProperty( "strings", aValuesList,   vtkZoomingStyleMode );
+  pref->setItemProperty( "indexes", anIndicesList, vtkZoomingStyleMode );
+  // .... -> speed increment
   int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
-                                     LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
-
+                                      LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
   pref->setItemProperty( "min", 1, vtkSpeed );
   pref->setItemProperty( "max", 1000, vtkSpeed );
-
+  // .... -> speed mode
   int vtkSpeedMode = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED_MODE" ), vtkGen,
-                                         LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
-  QStringList aSpeedModeList;
-  aSpeedModeList.append( tr("PREF_ARITHMETIC") );
-  aSpeedModeList.append( tr("PREF_GEOMETRICAL") );
-
-  pref->setItemProperty( "strings", aSpeedModeList, vtkSpeedMode );
-  pref->setItemProperty( "indexes", aModeIndexesList, vtkSpeedMode );
+                                          LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ARITHMETIC") << tr("PREF_GEOMETRICAL");
+  anIndicesList << 0                     << 1;
+  pref->setItemProperty( "strings", aValuesList,   vtkSpeedMode );
+  pref->setItemProperty( "indexes", anIndicesList, vtkSpeedMode );
+  // .... -> dynamic pre-selection
+  pref->addPreference( tr( "PREF_DYNAMIC_PRESELECTION" ),  vtkGen, LightApp_Preferences::Bool, "VTKViewer", "dynamic_preselection" );
+  // ... -> empty frame (for layout) <<end>>
+
+  // ... "Trihedron" group <<start>>
+  int vtkTriGroup = pref->addPreference( tr( "PREF_TRIHEDRON" ), vtkGroup );
+  pref->setItemProperty( "columns", 2, vtkTriGroup );
+  // .... -> trihedron size
+  int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkTriGroup,
+                                   LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
+  pref->setItemProperty( "min", 1.0E-06, vtkTS );
+  pref->setItemProperty( "max", 150, vtkTS );
+  // .... -> relative size of trihedron
+  pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkTriGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+  // .... -> static trihedron
+  pref->addPreference( tr( "PREF_SHOW_STATIC_TRIHEDRON" ), vtkTriGroup, LightApp_Preferences::Bool, "VTKViewer", "show_static_trihedron" );
+  // ... "Trihedron" group <<end>>
 
+  // ... space mouse sub-group <<start>>
   int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox );
-  pref->setItemProperty( "columns", 2, vtkSM );
+  //pref->setItemProperty( "columns", 2, vtkSM );
+  // .... -> decrease speed increment
   int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM,
-                                            LightApp_Preferences::Selector, "VTKViewer",
-                                            "spacemouse_func1_btn" ); //decrease_speed_increment
+                                             LightApp_Preferences::Selector, "VTKViewer",
+                                             "spacemouse_func1_btn" );
+  // .... -> increase speed increment
   int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM,
-                                            LightApp_Preferences::Selector, "VTKViewer",
-                                            "spacemouse_func2_btn" ); //increase_speed_increment
+                                             LightApp_Preferences::Selector, "VTKViewer",
+                                             "spacemouse_func2_btn" );
+  // .... -> dominant / combined switch  
   int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM,
-                                            LightApp_Preferences::Selector, "VTKViewer",
-                                            "spacemouse_func5_btn" ); //dominant_combined_switch
-
-  QStringList values;
-  values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_2" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_3" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_4" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_5" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_6" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_7" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_8" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_*" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_10" ) );
-  values.append( tr( "PREF_SPACEMOUSE_BTN_11" ) );
-  QList<QVariant> indices;
-  indices.append( 1 );
-  indices.append( 2 );
-  indices.append( 3 );
-  indices.append( 4 );
-  indices.append( 5 );
-  indices.append( 6 );
-  indices.append( 7 );
-  indices.append( 8 );
-  indices.append( 9 ); // == button_*
-  indices.append( 10 );
-  indices.append( 11 );
-  pref->setItemProperty( "strings", values, spacemousePref1 );
-  pref->setItemProperty( "indexes", indices, spacemousePref1 );
-  pref->setItemProperty( "strings", values, spacemousePref2 );
-  pref->setItemProperty( "indexes", indices, spacemousePref2 );
-  pref->setItemProperty( "strings", values, spacemousePref3 );
-  pref->setItemProperty( "indexes", indices, spacemousePref3 );
-
+                                             LightApp_Preferences::Selector, "VTKViewer",
+                                             "spacemouse_func5_btn" ); //
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList << tr( "PREF_SPACEMOUSE_BTN_1" )  << tr( "PREF_SPACEMOUSE_BTN_2" ) << tr( "PREF_SPACEMOUSE_BTN_3" );
+  aValuesList << tr( "PREF_SPACEMOUSE_BTN_4" )  << tr( "PREF_SPACEMOUSE_BTN_5" ) << tr( "PREF_SPACEMOUSE_BTN_6" );
+  aValuesList << tr( "PREF_SPACEMOUSE_BTN_7" )  << tr( "PREF_SPACEMOUSE_BTN_8" ) << tr( "PREF_SPACEMOUSE_BTN_*" );
+  aValuesList << tr( "PREF_SPACEMOUSE_BTN_10" ) << tr( "PREF_SPACEMOUSE_BTN_11" );
+  anIndicesList << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11;
+  pref->setItemProperty( "strings", aValuesList,   spacemousePref1 );
+  pref->setItemProperty( "indexes", anIndicesList, spacemousePref1 );
+  pref->setItemProperty( "strings", aValuesList,   spacemousePref2 );
+  pref->setItemProperty( "indexes", anIndicesList, spacemousePref2 );
+  pref->setItemProperty( "strings", aValuesList,   spacemousePref3 );
+  pref->setItemProperty( "indexes", anIndicesList, spacemousePref3 );
+  // ... space mouse sub-group <<end>>
+
+  // ... avi recording sub-group <<start>>
   int vtkRec = pref->addPreference( tr( "PREF_FRAME_RECORDING" ), vtkGroup, LightApp_Preferences::GroupBox );
   pref->setItemProperty( "columns", 2, vtkRec );
-
+  // .... -> recording mode
   int modePref = pref->addPreference( tr( "PREF_RECORDING_MODE" ), vtkRec,
-                                     LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" );
-  values.clear();
-  values.append( tr( "PREF_SKIPPED_FRAMES" ) );
-  values.append( tr( "PREF_ALL_DISLPAYED_FRAMES" ) );
-  indices.clear();
-  indices.append( 0 );
-  indices.append( 1 );
-  pref->setItemProperty( "strings", values, modePref );
-  pref->setItemProperty( "indexes", indices, modePref );
-
+                                      LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr( "PREF_SKIPPED_FRAMES" ) << tr( "PREF_ALL_DISLPAYED_FRAMES" );
+  anIndicesList << 0                           << 1;
+  pref->setItemProperty( "strings", aValuesList,   modePref );
+  pref->setItemProperty( "indexes", anIndicesList, modePref );
+  // .... -> fps
   int fpsPref = pref->addPreference( tr( "PREF_FPS" ), vtkRec,
-                                    LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" );
+                                     LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" );
   pref->setItemProperty( "min", 0.1, fpsPref );
   pref->setItemProperty( "max", 100, fpsPref );
-
+  // .... -> quality
   int qualityPref = pref->addPreference( tr( "PREF_QUALITY" ), vtkRec,
-                                        LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" );
+                                         LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" );
   pref->setItemProperty( "min", 1, qualityPref );
   pref->setItemProperty( "max", 100, qualityPref );
-
+  // .... -> progressive mode
   pref->addPreference( tr( "PREF_PROGRESSIVE" ), vtkRec,
-                      LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" );
-
-  // Plot2d
+                       LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" );
+  // ... avi recording sub-group <<end>>
+
+  // ... group names sub-group <<start>>
+  int vtkGN = pref->addPreference( tr( "PREF_FRAME_GROUP_NAMES" ), vtkGroup,
+                                   LightApp_Preferences::GroupBox, "VTKViewer", "show_group_names" );
+  pref->setItemProperty( "columns", 2, vtkGN );
+  // .... -> text color
+  pref->addPreference( tr(  "PREF_GROUP_NAMES_TEXT_COLOR" ), vtkGN,
+                       LightApp_Preferences::Color, "VTKViewer", "group_names_text_color" );
+  // .... -> transparency
+  int transPref = pref->addPreference( tr( "PREF_GROUP_NAMES_TRANSPARENCY" ), vtkGN,
+                                       LightApp_Preferences::DblSpin, "VTKViewer", "group_names_transparency" );
+  pref->setItemProperty( "min", 0.0, transPref );
+  pref->setItemProperty( "max", 1.0, transPref );
+  pref->setItemProperty( "step", 0.1, transPref );
+  // ... -> group names sub-group <<end>>
+  // .. "VTK viewer" group <<end>>
+
+  // .. "Plot2d viewer" group <<start>>
+  int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), salomeCat ); //viewTab
+  //pref->setItemProperty( "columns", 2, plot2dGroup );
+
+  // ... -> show legend
   pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup,
-                      LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
-
+                       LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
+  // ... -> legend position
   int legendPosition = pref->addPreference( tr( "PREF_LEGEND_POSITION" ), plot2dGroup,
-                                           LightApp_Preferences::Selector, "Plot2d", "LegendPos" );
+                                            LightApp_Preferences::Selector, "Plot2d", "LegendPos" );
   aValuesList.clear();
   anIndicesList.clear();
   aValuesList   << tr("PREF_LEFT") << tr("PREF_RIGHT") << tr("PREF_TOP") << tr("PREF_BOTTOM");
   anIndicesList << 0               << 1                << 2              << 3                ;
-
   pref->setItemProperty( "strings", aValuesList,   legendPosition );
   pref->setItemProperty( "indexes", anIndicesList, legendPosition );
-
+  // ... -> legend font
+  pref->addPreference( tr( "PREF_LEGEND_FONT" ), plot2dGroup, LightApp_Preferences::Font, "Plot2d", "LegendFont" );
+  // ... -> curve type
   int curveType = pref->addPreference( tr( "PREF_CURVE_TYPE" ), plot2dGroup,
-                                      LightApp_Preferences::Selector, "Plot2d", "CurveType" );
+                                       LightApp_Preferences::Selector, "Plot2d", "CurveType" );
   aValuesList.clear();
   anIndicesList.clear();
   aValuesList   << tr("PREF_POINTS") << tr("PREF_LINES") << tr("PREF_SPLINE");
   anIndicesList << 0                 << 1                << 2                ;
-
   pref->setItemProperty( "strings", aValuesList,   curveType );
   pref->setItemProperty( "indexes", anIndicesList, curveType );
-
+  // ... -> marker size
   int markerSize = pref->addPreference( tr( "PREF_MARKER_SIZE" ), plot2dGroup,
-                                       LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" );
-
+                                        LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" );
   pref->setItemProperty( "min", 0, markerSize );
   pref->setItemProperty( "max", 100, markerSize );
-
+  // ... -> horizontal scaling mode
+  int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup,
+                                      LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" );
   aValuesList.clear();
   anIndicesList.clear();
   aValuesList   << tr("PREF_LINEAR") << tr("PREF_LOGARITHMIC");
   anIndicesList << 0                 << 1                     ;
-
-  int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup,
-                                     LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" );
-
   pref->setItemProperty( "strings", aValuesList,   horScale );
   pref->setItemProperty( "indexes", anIndicesList, horScale );
-
+  // ... -> vertical scaling mode
   int verScale = pref->addPreference( tr( "PREF_VERT_AXIS_SCALE" ), plot2dGroup,
-                                     LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" );
-
+                                      LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" );
   pref->setItemProperty( "strings", aValuesList,   verScale );
   pref->setItemProperty( "indexes", anIndicesList, verScale );
-
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), plot2dGroup,
-                      LightApp_Preferences::Color, "Plot2d", "Background" );
-
+  // ... -> background
+  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND_COLOR" ), plot2dGroup,
+                       LightApp_Preferences::Color, "Plot2d", "Background" );
+  // ... -> font color
+  pref->addPreference( tr( "PREF_FONT_COLOR" ), plot2dGroup, LightApp_Preferences::Color, "Plot2d", "LegendFontColor" );
+  // ... -> selection font color
+  pref->addPreference( tr( "PREF_SELECTED_FONT_COLOR" ), plot2dGroup, LightApp_Preferences::Color, "Plot2d", "SelectedLegendFontColor" );
+  // ... -> selection color
+  pref->addPreference( tr( "PREF_VIEWER_SELECTION" ), plot2dGroup,
+                       LightApp_Preferences::Color, "Plot2d", "SelectionColor" );
+  // ... -> errors/deviation colot
+  pref->addPreference( tr( "PREF_DEVIATION_COLOR" ), plot2dGroup,
+                       LightApp_Preferences::Color, "Plot2d", "DeviationMarkerColor" );
+  // ... -> deviation markers line size
+  int deviationMarkerLw = pref->addPreference( tr( "PREF_DEVIATION_MARKER_LW" ), plot2dGroup,
+                                        LightApp_Preferences::IntSpin, "Plot2d", "DeviationMarkerLineWidth" );
+  pref->setItemProperty( "min", 1, deviationMarkerLw );
+  pref->setItemProperty( "max", 5, deviationMarkerLw );
+  // ... -> deviation markers tick mark size
+  int deviationMarkerTs = pref->addPreference( tr( "PREF_DEVIATION_MARKER_TS" ), plot2dGroup,
+                                        LightApp_Preferences::IntSpin, "Plot2d", "DeviationMarkerTickSize" );
+  pref->setItemProperty( "min", 1, deviationMarkerTs );
+  pref->setItemProperty( "max", 5, deviationMarkerTs );
+  // .. "Plot2d viewer" group <<end>>
+
+  // .. "Directories" preferences tab <<start>>
   int dirTab = pref->addPreference( tr( "PREF_TAB_DIRECTORIES" ), salomeCat );
+  // ... --> quick directories list
   int dirGroup = pref->addPreference( tr( "PREF_GROUP_DIRECTORIES" ), dirTab );
   pref->addPreference( tr( "" ), dirGroup,
-                      LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
-
-  pref->setItemProperty( "columns", 4, supervGroup );
-  pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), supervGroup,
-                      LightApp_Preferences::Color, "SUPERVGraph", "Background" );
-  pref->addPreference( tr( "PREF_SUPERV_TITLE_COLOR" ), supervGroup,
-                      LightApp_Preferences::Color, "SUPERVGraph", "Title" );
-//  pref->addPreference( tr( "PREF_SUPERV_CTRL_COLOR" ), supervGroup,
-//                    LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" );
+                       LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
+  // .. "Directories" preferences tab <<end>>
 
+  // .. "Object browser" preferences tab <<start>>
   int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
+
+  // ... "Search tool" group <<start>>
   int stGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SEARCH_TOOL" ), obTab );
+  // .... --> auto-hide
   pref->addPreference( tr( "PREF_AUTO_HIDE_SEARCH_TOOL" ), stGroup, LightApp_Preferences::Bool,
-                      "ObjectBrowser", "auto_hide_search_tool" );
+                       "ObjectBrowser", "auto_hide_search_tool" );
+  // ... "Search tool" group <<end>>
 
-  int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
+  // ... "Object browser settings" group <<start>>
+  int objSetGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), obTab );
   pref->setItemProperty( "columns", 2, objSetGroup );
+  // .... -> auto size first column
   pref->addPreference( tr( "PREF_AUTO_SIZE_FIRST" ), objSetGroup, LightApp_Preferences::Bool,
-                      "ObjectBrowser", "auto_size_first" );
+                       "ObjectBrowser", "auto_size_first" );
+  // .... -> auto size other columns
   pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool,
-                      "ObjectBrowser", "auto_size" );
+                       "ObjectBrowser", "auto_size" );
+  // .... -> resize columns on expand item
   pref->addPreference( tr( "PREF_RESIZE_ON_EXPAND_ITEM" ), objSetGroup, LightApp_Preferences::Bool,
-                      "ObjectBrowser", "resize_on_expand_item" );
-
-  // MRU preferences
-  int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
-  pref->setItemProperty( "columns", 4, mruGroup );
-  int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin,
-                                        "MRU", "visible_count" );
-  pref->setItemProperty( "min", 0,   mruVisCount );
-  pref->setItemProperty( "max", 100, mruVisCount );
-  int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector,
-                                        "MRU", "link_type" );
+                       "ObjectBrowser", "resize_on_expand_item" );
+  // .... -> browse to published object
+  int browsePublished = pref->addPreference( tr( "PREF_BROWSE_TO_THE_PUBLISHED_OBJECT" ), objSetGroup, LightApp_Preferences::Selector,
+                                             "ObjectBrowser", "browse_published_object" );
   aValuesList.clear();
   anIndicesList.clear();
-  aValuesList   << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL");
-  anIndicesList << 0                        << 1                         << 2                       ;
-  pref->setItemProperty( "strings", aValuesList,   mruLinkType );
-  pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
+  aValuesList << tr( "PREF_BROWSE_NEVER" ) << tr( "PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY" ) << tr( "PREF_BROWSE_ALWAYS" );
+  anIndicesList << BP_Never << BP_ApplyAndClose << BP_Always;
+  pref->setItemProperty( "strings", aValuesList,   browsePublished );
+  pref->setItemProperty( "indexes", anIndicesList, browsePublished );
+  // ... "Object browser settings" group <<end>>
+  // .. "Object browser" preferences tab <<end>>
+
+  // .. "Shortcuts" preferences tab <<start>>
+  int shortcutTab = pref->addPreference( tr( "PREF_TAB_SHORTCUTS" ), salomeCat );
+  // ... "Shortcuts settings" group <<start>>
+  int shortcutGroup = pref->addPreference( tr( "PREF_GROUP_SHORTCUTS" ), shortcutTab );
+  pref->addPreference( tr( "" ), shortcutGroup,
+                       LightApp_Preferences::ShortcutTree, "shortcuts" );
+  // ... "Shortcuts settings" group <<end>>
+  // .. "Shortcuts" preferences tab <<end>>
+  // . Top-level "SALOME" preferences group <<end>>
 
   pref->retrieve();
 }
@@ -2094,10 +2489,22 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   if ( !resMgr )
     return;
 
+  if ( sec == "viewers" && param == "drop_down_buttons" )
+  {
+    ViewManagerList vmlist = viewManagers();
+    foreach( SUIT_ViewManager* vm, vmlist )
+    {
+      QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+      foreach( SUIT_ViewWindow* vw, vwlist )
+        if ( vw ) vw->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+    }
+  }
+
 #ifndef DISABLE_OCCVIEWER
-  if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
+  if ( sec == QString( "OCCViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )))
   {
-    double sz = resMgr->doubleValue( sec, param, -1 );
+    double sz = resMgr->doubleValue( sec, "trihedron_size", -1 );
+    bool relative = resMgr->booleanValue( sec, "relative_size", true );
     QList<SUIT_ViewManager*> lst;
     viewManagers( OCCViewer_Viewer::Type(), lst );
     QListIterator<SUIT_ViewManager*> it( lst );
@@ -2105,15 +2512,75 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
-       continue;
+        continue;
 
       OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
-      occVM->setTrihedronSize( sz );
+      occVM->setTrihedronSize( sz, relative );
       occVM->getAISContext()->UpdateCurrentViewer();
     }
   }
 #endif
 
+#ifndef DISABLE_OCCVIEWER
+  if ( sec == QString( "OCCViewer" ) && param == QString( "show_static_trihedron" ) )
+  {
+    bool isVisible = resMgr->booleanValue( "OCCViewer", "show_static_trihedron", true );
+    QList<SUIT_ViewManager*> lst;
+    viewManagers( OCCViewer_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+        continue;
+
+      OCCViewer_Viewer* occVM = dynamic_cast<OCCViewer_Viewer*>( vm );
+      if( occVM )
+      {
+        occVM->setStaticTrihedronDisplayed( isVisible );
+      }
+    }
+  }
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+  if ( sec == QString( "OCCViewer" ) && param == QString( "navigation_mode" ) )
+  {
+    int mode = resMgr->integerValue( "OCCViewer", "navigation_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+    viewManagers( OCCViewer_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+        continue;
+
+      OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
+      occVM->setInteractionStyle( mode );
+    }
+  }
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+  if ( sec == QString( "OCCViewer" ) && param == QString( "zooming_mode" ) )
+  {
+    int mode = resMgr->integerValue( "OCCViewer", "zooming_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+    viewManagers( OCCViewer_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+        continue;
+
+      OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
+      occVM->setZoomingStyle( mode );
+    }
+  }
+#endif
+
 #ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) )
   {
@@ -2127,13 +2594,13 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
-       continue;
+        continue;
 
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM )
       {
-       vtkVM->setTrihedronSize( sz, isRelative );
-       vtkVM->Repaint();
+        vtkVM->setTrihedronSize( sz, isRelative );
+        vtkVM->Repaint();
       }
     }
 #endif
@@ -2153,7 +2620,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
-       continue;
+        continue;
 
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM ) vtkVM->setIncrementalSpeed( speed, mode );
@@ -2174,7 +2641,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
-       continue;
+        continue;
 
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM ) vtkVM->setProjectionMode( mode );
@@ -2195,7 +2662,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
-       continue;
+        continue;
 
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM ) vtkVM->setInteractionStyle( mode );
@@ -2204,10 +2671,77 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   }
 #endif
 
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "zooming_mode" ) )
+  {
+    int mode = resMgr->integerValue( "VTKViewer", "zooming_mode", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+        continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setZoomingStyle( mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "dynamic_preselection" ) )
+  {
+    bool mode = resMgr->booleanValue( "VTKViewer", "dynamic_preselection", true );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+        continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setDynamicPreSelection( mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "show_static_trihedron" ) )
+  {
+    bool isVisible = resMgr->booleanValue( "VTKViewer", "show_static_trihedron", true );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+        continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM )
+      {
+        vtkVM->setStaticTrihedronVisible( isVisible );
+        vtkVM->Repaint();
+      }
+    }
+#endif
+  }
+#endif
+
 #ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) ||
-                                        param == QString( "spacemouse_func2_btn" ) ||
-                                        param == QString( "spacemouse_func5_btn" ) ) )
+                                         param == QString( "spacemouse_func2_btn" ) ||
+                                         param == QString( "spacemouse_func5_btn" ) ) )
   {
     int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 );
     int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 );
@@ -2220,7 +2754,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       SUIT_ViewModel* vm = it.next()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
-       continue;
+        continue;
 
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM ) vtkVM->setSpacemouseButtons( btn1, btn2, btn3 );
@@ -2241,7 +2775,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     {
       OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.next() );
       if( mgr && mgr->getOCCViewer() )
-       mgr->getOCCViewer()->setIsos( u, v );
+        mgr->getOCCViewer()->setIsos( u, v );
     }
   }
 #endif
@@ -2257,13 +2791,13 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
       bool autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
       ob->setAutoSizeFirstColumn( autoSizeFirst );
       if ( autoSizeFirst )
-       ob->adjustFirstColumnWidth();
+        ob->adjustFirstColumnWidth();
     }
     else if ( param=="auto_size" ) {
       bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
       ob->setAutoSizeColumns(autoSize);
       if ( autoSize )
-       ob->adjustColumnsWidth();
+        ob->adjustColumnsWidth();
     }
     else if ( param=="resize_on_expand_item" ) {
       bool resizeOnExpandItem = resMgr->booleanValue( "ObjectBrowser", "resize_on_expand_item", false );
@@ -2278,14 +2812,22 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   {
     if( param=="store_positions" )
       updateWindows();
+    if( param=="auto_save_interval" ) {
+      myAutoSaveTimer->stop();
+      int autoSaveInterval = resMgr->integerValue( "Study", "auto_save_interval", 0 );
+      if ( activeStudy() && autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+    }
   }
 
 #ifndef DISABLE_PYCONSOLE
-  if( sec=="PyConsole" )
+  if( sec=="PyConsole" && pythonConsole() )
   {
-    if( param=="font" )
-      if( pythonConsole() )
-       pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
+    if ( param=="font" ) {
+      pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
+    }
+    else if ( param=="show_banner" ) {
+      pythonConsole()->setIsShowBanner( resMgr->booleanValue( "PyConsole", "show_banner", true ) );
+    }
   }
 #endif
 
@@ -2294,19 +2836,54 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
     QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
     if ( mru ) {
       if ( param == "visible_count" )
-       mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) );    // 5 MRU items by default
+        mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) );    // 5 MRU items by default
       else if ( param == "max_count" )
-       mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) );       // unlimited history by default
+        mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) );       // unlimited history by default
       else if ( param == "insert_mode" )
-       mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) );        // QtxMRUAction::MoveFirst by default
+        mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) );        // QtxMRUAction::MoveFirst by default
       else if ( param == "link_type" )
-       mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) );            // QtxMRUAction::LinkAuto by default
+        mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) );            // QtxMRUAction::LinkAuto by default
       else if ( param == "show_clear" )
-       mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) );  // do not show "Clear" item by default
+        mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) );  // do not show "Clear" item by default
       else if ( param == "show_mru" )
-       mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) );          // do not show MRU menu item by default
+        mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) );          // do not show MRU menu item by default
+    }
+  }
+  if ( sec == "language" && param == "language" )
+  {
+    SUIT_MessageBox::information( desktop(), tr( "WRN_WARNING" ), tr( "LANG_CHANGED" ) );
+  }
+  if ( sec == "desktop" && param == "opaque_resize" ) {
+    bool opaqueResize = resMgr->booleanValue( "desktop", "opaque_resize", false );
+    QMainWindow::DockOptions dopts = desktop()->dockOptions();
+    if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+    else                dopts &= ~QMainWindow::AnimatedDocks;
+    desktop()->setDockOptions( dopts );
+    desktop()->setOpaqueResize( opaqueResize );
+    if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
+      dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
+  }
+
+  if ( sec == "ExternalBrowser" && param == "use_external_browser" ) {
+    if ( resMgr->booleanValue("ExternalBrowser", "use_external_browser", false ) )
+      {
+        if(QtxWebBrowser::webBrowser())
+          QtxWebBrowser::webBrowser()->close();
+      }
+  }
+
+#ifndef DISABLE_PLOT2DVIEWER
+  if ( sec == "Plot2d" ) {
+    if( param == "SelectionColor" ) {
+      QColor c = resMgr->colorValue( sec, param );
+      Plot2d_Object::setSelectionColor(c);
+    }
+    else if (param == "SelectedLegendFontColor") {
+      QColor c = resMgr->colorValue( sec, param );      
+      Plot2d_Object::setHighlightedLegendTextColor(c);
     }
   }
+#endif
 }
 
 /*!
@@ -2355,8 +2932,17 @@ void LightApp_Application::loadPreferences()
       myWinVis.insert( *itr, arr );
   }
 
-  if ( desktop() )
+  if ( desktop() ) {
     desktop()->retrieveGeometry( aResMgr->stringValue( "desktop", "geometry" ) );
+    bool opaqueResize = aResMgr->booleanValue( "desktop", "opaque_resize", false );
+    QMainWindow::DockOptions dopts = desktop()->dockOptions();
+    if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+    else                dopts &= ~QMainWindow::AnimatedDocks;
+    desktop()->setDockOptions( dopts );
+    desktop()->setOpaqueResize( opaqueResize );
+    if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
+      dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
+  }
 }
 
 /*!
@@ -2469,8 +3055,17 @@ void LightApp_Application::afterCloseDoc()
 void LightApp_Application::updateModuleActions()
 {
   QString modName;
-  if ( activeModule() )
+  if ( activeModule() ) {
     modName = activeModule()->moduleName();
+    if ( !isModuleAccessible( modName ) ) {
+      QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+      foreach( SUIT_Application* app, apps ) {
+        LightApp_Application* lapp = dynamic_cast<LightApp_Application*>( app );
+        if ( lapp && lapp != this )
+          lapp->removeModuleAction( modName );
+      }
+    }
+  }
 
   LightApp_ModuleAction* moduleAction =
     qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
@@ -2478,6 +3073,14 @@ void LightApp_Application::updateModuleActions()
     moduleAction->setActiveModule( modName );
 }
 
+void LightApp_Application::removeModuleAction( const QString& modName )
+{
+  LightApp_ModuleAction* moduleAction =
+    qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+  if ( moduleAction )
+    moduleAction->removeModule( modName );
+}
+
 /*!
   Gets current windows.
   \param winMap - output current windows map.
@@ -2523,7 +3126,7 @@ void LightApp_Application::updateWindows()
     for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
     {
       if ( !dockWindow( it.key() ) )
-       getWindow( it.key() );
+        getWindow( it.key() );
     }
   }
 
@@ -2748,15 +3351,42 @@ void LightApp_Application::moduleIconNames( QMap<QString, QString>& iconMap ) co
 */
 void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
 {
-  CAM_Application::contextMenuPopup( type, thePopup, title );
+  //Add "Rename" item
+  LightApp_SelectionMgr* selMgr = LightApp_Application::selectionMgr();
+  bool cacheIsOn = selMgr->isSelectionCacheEnabled();
+  selMgr->setSelectionCacheEnabled( true );
 
   SUIT_DataBrowser* ob = objectBrowser();
+
+  CAM_Application::contextMenuPopup( type, thePopup, title );
+
   if ( ob && type == ob->popupClientType() ) {
     thePopup->addSeparator();
     QAction* a = thePopup->addAction( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
-    if ( ob->updateKey() )
-      a->setShortcut( ob->updateKey() );
+    if ( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) )
+      a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) );
+  }
+
+  if ( selMgr && ob ) {
+    SALOME_ListIO selected;
+    selMgr->selectedObjects( selected );
+    if(selected.Extent() == 1){
+      Handle(SALOME_InteractiveObject) anIObject = selected.First();
+      SUIT_DataObject* obj = findObject(anIObject->getEntry());
+      if(obj && obj->renameAllowed()) {
+        QAction* a = new QAction(tr("MEN_RENAME_OBJ"), thePopup);
+        connect( a, SIGNAL( triggered(bool) ), ob, SLOT( onStartEditing() ) );
+        if ( ob->shortcutKey(SUIT_DataBrowser::RenameShortcut) )
+          a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::RenameShortcut) );
+
+        QList<QAction*> acts = thePopup->actions();
+        QAction* firstAction = acts.count() > 0 ? acts.first() : 0;
+        thePopup->insertAction(firstAction,a);
+      }
+    }
   }
+
+  selMgr->setSelectionCacheEnabled( cacheIsOn );
 }
 
 /*!
@@ -2768,6 +3398,23 @@ void LightApp_Application::createEmptyStudy()
 
   if ( objectBrowser() )
     objectBrowser()->updateTree();
+
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  if ( aResMgr && activeStudy() ) {
+    int autoSaveInterval = aResMgr->integerValue( "Study", "auto_save_interval", 0 );
+    if ( autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+  }
+}
+
+/*!Set desktop:*/
+void LightApp_Application::setDesktop( SUIT_Desktop* desk )
+{
+  CAM_Application::setDesktop( desk );
+
+  if ( desk ) {
+    connect( desk, SIGNAL( message( const QString& ) ),
+             this, SLOT( onDesktopMessage( const QString& ) ), Qt::UniqueConnection );
+  }
 }
 
 /*!
@@ -2824,6 +3471,15 @@ void LightApp_Application::onStylePreferences()
   resourceMgr()->setValue( "Style", "use_salome_style", Style_Salome::isActive() );
 }
 
+void LightApp_Application::onFullScreen(){
+  if(myScreenHelper) {
+    if(desktop()->isFullScreen())
+      myScreenHelper->switchToNormalScreen();
+    else
+      myScreenHelper->switchToFullScreen();
+  }
+}
+
 /*!
   Connects just added view manager
 */
@@ -2841,8 +3497,15 @@ void LightApp_Application::removeViewManager( SUIT_ViewManager* vm )
 {
   disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
            this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+  if (aStudy )
+    aStudy->removeViewMgr(vm->getGlobalId());
+
   STD_Application::removeViewManager( vm );
-  delete vm;
+
+  // IPAL22894: Crash on closing OCC view
+  //delete vm;
+  vm->deleteLater();
 }
 
 /*!
@@ -2923,6 +3586,7 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
 
   //abd: changed libSalomePyQtGUI to SalomePyQtGUI for WIN32
   bool isPythonModule = lib.contains("SalomePyQtGUI");
+  bool isPythonLightModule = lib.contains("libSalomePyQtGUILight");
 
   QStringList paths;
 #ifdef WIN32
@@ -2939,8 +3603,8 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
 
     if( inf.exists() )
       {
-       isLibFound = true;
-       break;
+        isLibFound = true;
+        break;
       }
   }
 
@@ -2951,10 +3615,10 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
           << "*    Module " << moduleTitle.toLatin1().constData() << " will not be available in GUI mode" << std::endl
           << "****************************************************************" << std::endl );
     }
-  else if ( !isPythonModule )
+  else if ( !isPythonModule && !isPythonLightModule)
     return true;
 
-  if ( isPythonModule )
+  if ( isPythonModule || isPythonLightModule)
     {
       QString pylib = moduleName( moduleTitle ) + QString(".py");
       QString pylibgui = moduleName( moduleTitle ) + QString("GUI.py");
@@ -2968,26 +3632,27 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const
       bool isPyLib = false, isPyGuiLib = false;
       QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
       for( ; anIt!=aLast; anIt++ )
-       {
-         QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
-         QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
+        {
+          QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
+          QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
 
-         if( !isPyLib && inf.exists() )
-           isPyLib = true;
+          if(!isPythonLightModule)
+            if( !isPyLib && inf.exists() )
+              isPyLib = true;
 
-         if( !isPyGuiLib && infgui.exists() )
-           isPyGuiLib = true;
+          if( !isPyGuiLib && infgui.exists() )
+            isPyGuiLib = true;
 
-         if ( isPyLib && isPyGuiLib && isLibFound)
-           return true;
-       }
+          if ((isPyLib || isPythonLightModule ) && isPyGuiLib && isLibFound)
+            return true;
+        }
 
       printf( "****************************************************************\n" );
       printf( "*    Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() );
       if (!isPyLib)
-       printf( "*    No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
+        printf( "*    No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
       if (!isPyGuiLib)
-       printf( "*    No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
+        printf( "*    No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
       printf( "****************************************************************\n" );
       return true;
   }
@@ -3021,9 +3686,9 @@ bool LightApp_Application::event( QEvent* e )
     SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e;
     QString* d = ( QString* )ce->data();
     if( SUIT_MessageBox::question(0, tr("WRN_WARNING"),
-                                 d ? *d : "",
-                                 SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                 SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+                                  d ? *d : "",
+                                  SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                  SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
       showPreferences( tr( "PREF_APP" ) );
     if( d )
       delete d;
@@ -3037,9 +3702,9 @@ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj)
 {
   if (theObj)
     {
-      bool isSuitable =        !theObj->entry().isEmpty() &&
-                       !theObj->componentDataType().isEmpty() &&
-                       !theObj->name().isEmpty();
+      bool isSuitable = !theObj->entry().isEmpty() &&
+                        !theObj->componentDataType().isEmpty() &&
+                        !theObj->name().isEmpty();
       return isSuitable;
     }
 
@@ -3054,7 +3719,7 @@ int LightApp_Application::openChoice( const QString& aName )
   {
     // Do you want to reload it?
     if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYOPEN" ).arg( aName ),
-                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes )
+                                    SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes )
       choice = OpenReload;
   }
 
@@ -3073,20 +3738,20 @@ bool LightApp_Application::openAction( const int choice, const QString& aName )
       QList<SUIT_Application*> appList = session->applications();
       for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !app; ++it )
       {
-       if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
-         app = ::qobject_cast<STD_Application*>( *it );
+        if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+          app = ::qobject_cast<STD_Application*>( *it );
       }
 
       if ( app )
       {
-       app->onCloseDoc( false );
-       appList = session->applications();
-       STD_Application* other = 0;
-       for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !other; ++it )
-         other = ::qobject_cast<STD_Application*>( *it );
-
-       if ( other )
-         res = other->onOpenDoc( aName );
+        app->onCloseDoc( false );
+        appList = session->applications();
+        STD_Application* other = 0;
+        for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !other; ++it )
+          other = ::qobject_cast<STD_Application*>( *it );
+
+        if ( other )
+          res = other->onOpenDoc( aName );
       }
     }
     break;
@@ -3097,3 +3762,234 @@ bool LightApp_Application::openAction( const int choice, const QString& aName )
 
   return res;
 }
+
+QStringList LightApp_Application::viewManagersTypes() const
+{
+  QStringList aTypesList;
+  aTypesList += myUserWmTypes;
+#ifndef DISABLE_GLVIEWER
+  aTypesList<<GLViewer_Viewer::Type();
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+  aTypesList<<Plot2d_Viewer::Type();
+#endif
+#ifndef DISABLE_QXGRAPHVIEWER
+  aTypesList<<QxScene_Viewer::Type();
+#endif
+#ifndef DISABLE_OCCVIEWER
+  aTypesList<<OCCViewer_Viewer::Type();
+#endif
+#ifndef DISABLE_VTKVIEWER
+ #ifndef DISABLE_SALOMEOBJECT
+  aTypesList<<SVTK_Viewer::Type();
+ #else
+  aTypesList<<VTKViewer_Viewer::Type();
+ #endif
+#endif
+  return aTypesList;
+}
+/*!
+ * Removes all view managers of known types
+ * Other view managers are ignored
+ */
+void LightApp_Application::clearKnownViewManagers()
+{
+  QStringList aTypesList = viewManagersTypes();
+  QList<SUIT_ViewManager*> aMgrList;
+  viewManagers( aMgrList );
+  foreach (SUIT_ViewManager* aMgr, aMgrList) {
+    if (aTypesList.contains(aMgr->getType()))
+      removeViewManager(aMgr);
+  }
+}
+
+/*!
+  Copy of current selection
+ */
+void LightApp_Application::onCopy()
+{
+  LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+  if( m )
+    m->copy();
+}
+
+/*!
+  Paste of current data in clipboard
+ */
+void LightApp_Application::onPaste()
+{
+  LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+  if( m )
+    m->paste();
+}
+
+/*!
+  Browse (i.e. set focus on) the published objects
+  \param theIsApplyAndClose - flag indicating that the dialog for creating objects
+                              has been accepted by Ok (or Apply & Close) button
+  \param theIsOptimizedBrowsing - flag switching to optimized browsing mode
+                                  (to select the first published object only)
+  \return entry of the selected object
+ */
+QString LightApp_Application::browseObjects( const QStringList& theEntryList,
+                                             const bool theIsApplyAndClose,
+                                             const bool theIsOptimizedBrowsing )
+{
+  QString aResult;
+  if( SUIT_ResourceMgr* aResourceMgr = resourceMgr() )
+  {
+    int aBrowsePolicy = aResourceMgr->integerValue( "ObjectBrowser", "browse_published_object", (int)BP_Never );
+    switch( aBrowsePolicy )
+    {
+      case BP_Never:
+        return aResult;
+      case BP_ApplyAndClose:
+        if( !theIsApplyAndClose )
+          return aResult;
+      case BP_Always:
+      default:
+        break;
+    }
+  }
+
+  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( activeStudy() );
+  if( !aStudy )
+    return aResult;
+
+  SUIT_DataBrowser* anOB = objectBrowser();
+  if( !anOB )
+    return aResult;
+
+  SUIT_AbstractModel* aModel = dynamic_cast<SUIT_AbstractModel*>( anOB->model() );
+  if( !aModel )
+    return aResult;
+
+  QStringListIterator anIter( theEntryList );
+  if( theIsOptimizedBrowsing )
+  {
+    // go to the last entry
+    anIter.toBack();
+    if( anIter.hasPrevious() )
+      anIter.previous();
+  }
+
+  // scroll to each entry in the list
+  // (in optimized mode - to the last entry only)
+  QString anEntry;
+  LightApp_DataObject* anObject;
+  while( anIter.hasNext() )
+  {
+    anEntry = anIter.next();
+    if( !anEntry.isEmpty() )
+    {
+      anObject = aStudy->findObjectByEntry( anEntry );
+      if( anObject )
+      {
+        QModelIndex anIndex = aModel->index( anObject );
+        anOB->treeView()->scrollTo( anIndex );
+      }
+    }
+  }
+
+  // always select the last object
+  if( anObject && !anEntry.isEmpty() )
+  {
+    QList<SUIT_Selector*> aSelectorList;
+    selectionMgr()->selectors( "ObjectBrowser", aSelectorList );
+    if( !aSelectorList.isEmpty() )
+    {
+      if( LightApp_OBSelector* aSelector = dynamic_cast<LightApp_OBSelector*>( aSelectorList.first() ) )
+      {
+        bool anIsAutoBlock = aSelector->autoBlock();
+
+        // temporarily disable auto block, to emit LightApp_SelectionMgr::currentSelectionChanged() signal
+        aSelector->setAutoBlock( false );
+
+        SUIT_DataOwnerPtrList aList;
+#ifndef DISABLE_SALOMEOBJECT
+        Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
+          ( anObject->entry().toLatin1().constData(),
+            anObject->componentDataType().toLatin1().constData(),
+            anObject->name().toLatin1().constData() );
+        LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj  );
+#else
+        LightApp_DataOwner* owner = new LightApp_DataOwner( anEntry );
+#endif
+
+        aList.append( owner );
+        selectionMgr()->setSelected( aList );
+        aResult = anEntry;
+
+        // restore auto block flag
+        aSelector->setAutoBlock( anIsAutoBlock );
+      }
+    }
+  }
+
+  return aResult;
+}
+
+SUIT_DataObject* LightApp_Application::findObject( const QString& id ) const
+{
+  LightApp_Study* study = dynamic_cast<LightApp_Study*>( activeStudy() );
+  return study ? study->findObjectByEntry( id ) : 0;
+}
+
+/*!
+  Checks that an object can be renamed.
+  \param entry entry of the object
+  \brief Return \c true if object can be renamed
+*/
+bool LightApp_Application::renameAllowed( const QString& /*entry*/) const {
+  return false;
+}
+
+/*!
+  Rename object by entry.
+  \param entry entry of the object
+  \param name new name of the object
+  \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_Application::renameObject( const QString& entry, const QString& ) {
+  return false;
+}
+
+/*! Process standard messages from desktop */
+void LightApp_Application::onDesktopMessage( const QString& message )
+{
+  const QString sectionSeparator = "/";
+
+  if ( message.toLower() == "updateobjectbrowser" ||
+       message.toLower() == "updateobjbrowser" ) {
+    // update object browser
+    updateObjectBrowser();
+  }
+  else {
+    QStringList data = message.split( sectionSeparator );
+    if ( data.count() > 1 ) {
+      QString msgType = data[0].trimmed();
+      LightApp_Module* sMod = 0;
+      CAM_Module* mod = module( msgType );
+      if ( !mod )
+       mod = module( moduleTitle( msgType ) );
+      if ( mod && mod->inherits( "LightApp_Module" ) )
+       sMod = (LightApp_Module*)mod;
+
+      if ( msgType.toLower() == "preferences" ) {
+       // requested preferences change: should be given as "preferences/<section>/<name>/<value>"
+       // for example "preferences/Study/multi_file_dump/true"
+       if ( data.count() > 3 ) {
+         QString section = data[1].trimmed();
+         QString param   = data[2].trimmed();
+         QString value   = QStringList( data.mid(3) ).join( sectionSeparator );
+         resourceMgr()->setValue( section, param, value );
+       }
+      }
+      else if ( sMod ) {
+       // received message for the module
+       QString msg = QStringList( data.mid(1) ).join( sectionSeparator );
+       sMod->message( msg );
+      }
+    }
+  }
+}
index 7f17879092ff70efc975cf05008fd2bc8c3ccaa9..f872518670e7ba27938e1e2c1bb0495cad228a84 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #ifndef LIGHTAPP_APPLICATION_H
 #define LIGHTAPP_APPLICATION_H
 
 #endif // _MSC_VER > 1000
 
 #include "LightApp.h"
+#include <SUIT_TreeModel.h>
 #include <CAM_Application.h>
 
 #include <QPointer>
+#include <QStringList>
 
 class LogWindow;
 #ifndef DISABLE_PYCONSOLE
@@ -42,6 +45,7 @@ class PyConsole_Console;
 class LightApp_WidgetContainer;
 class LightApp_Preferences;
 class LightApp_SelectionMgr;
+class LightApp_FullScreenHelper;
 class LightApp_DataObject;
 class SUIT_DataBrowser;
 class SUIT_Study;
@@ -52,6 +56,7 @@ class QString;
 class QWidget;
 class QStringList;
 class QDockWidget;
+class QTimer;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -61,7 +66,7 @@ class QDockWidget;
   Description : Application containing only LightApp module
 */
 
-class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application
+class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application, public SUIT_DataSearcher
 {
   Q_OBJECT
 
@@ -77,15 +82,17 @@ public:
   enum { MenuWindowId = 6 };
 
   enum { RenameId = CAM_Application::UserID,
-        CloseId, CloseAllId, GroupAllId,
-        PreferencesId, MRUId, ModulesListId,
+         CloseId, CloseAllId, GroupAllId,
+         PreferencesId, MRUId, ModulesListId,
          NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId,
-        NewQxSceneViewId, StyleId,
-        UserID };
+         NewQxSceneViewId = NewQxGraphViewId, StyleId, FullScreenId,
+         UserID };
 
 protected:
   enum { NewStudyId = 1, OpenStudyId };
 
+  enum BrowsePolicy { BP_Never = 0, BP_ApplyAndClose, BP_Always };
+
 public:
   LightApp_Application();
   virtual ~LightApp_Application();
@@ -111,10 +118,10 @@ public:
   virtual QString                     getFileFilter() const;
 
   virtual QString                     getFileName( bool open, const QString& initial, const QString& filters,
-                                                  const QString& caption, QWidget* parent );
+                                                   const QString& caption, QWidget* parent );
   virtual QString                     getDirectory( const QString& initial, const QString& caption, QWidget* parent );
   virtual QStringList                 getOpenFileNames( const QString& initial, const QString& filters,
-                                                       const QString& caption, QWidget* parent );
+                                                        const QString& caption, QWidget* parent );
 
   void                                updateActions();
 
@@ -122,6 +129,7 @@ public:
   virtual void                        addViewManager( SUIT_ViewManager* );
   virtual void                        removeViewManager( SUIT_ViewManager* );
   virtual SUIT_ViewManager*           createViewManager( const QString& vmType );
+  virtual SUIT_ViewManager*           createViewManager( const QString& vmType, QWidget* w );
 
   QWidget*                            getWindow( const int, const int = -1 );
   QWidget*                            dockWindow( const int ) const;
@@ -135,6 +143,8 @@ public:
 
   virtual void                        createEmptyStudy();
 
+  virtual void                        setDesktop( SUIT_Desktop* );
+
   SUIT_Accel*                         accel() const;
 
   void                                setDefaultStudyName( const QString& theName );
@@ -147,6 +157,21 @@ public:
 
   virtual void                        updateDesktopTitle();
 
+  //! Returns list of view manager types which are supported by this application
+  QStringList                          viewManagersTypes() const;
+
+  //! Removes ViewManagers only of known type
+  virtual void                        clearKnownViewManagers();
+
+  virtual QString                     browseObjects( const QStringList& theEntryList,
+                                                     const bool theIsApplyAndClose = true,
+                                                     const bool theIsOptimizedBrowsing = false );
+
+  virtual SUIT_DataObject*            findObject( const QString& ) const;
+
+  virtual bool                        renameAllowed( const QString& ) const;
+  virtual bool                        renameObject( const QString&, const QString& );
+
 signals:
   void                                studyOpened();
   void                                studySaved();
@@ -160,6 +185,9 @@ public slots:
   virtual void                        onOpenDoc();
   virtual void                        onHelpAbout();
   virtual bool                        onOpenDoc( const QString& );
+  virtual void                        onCopy();
+  virtual void                        onPaste();
+  virtual void                        onSelectionChanged();
 
 protected:
   virtual void                        createActions();
@@ -174,7 +202,6 @@ protected:
 
   virtual void                        setActiveStudy( SUIT_Study* );
   virtual void                        updateCommandsStatus();
-  virtual void                        onSelectionChanged();
 
   virtual void                        beforeCloseDoc( SUIT_Study* );
   virtual void                        afterCloseDoc();
@@ -208,10 +235,14 @@ protected slots:
   void                                onMRUActivated( const QString& );
 
   void                                onStylePreferences();
+  void                                onFullScreen();
+
+  virtual void                        onDesktopMessage( const QString& );
 
 private slots:
   void                                onSelection();
   void                                onRefresh();
+  void                                onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
   void                                onPreferences();
   void                                onPreferenceChanged( QString&, QString&, QString& );
   void                                onRenameWindow();
@@ -223,12 +254,14 @@ protected:
   void                                updateWindows();
   void                                updateViewManagers();
   void                                updateModuleActions();
+  void                                removeModuleAction( const QString& );
 
   void                                loadDockWindowsState();
   void                                saveDockWindowsState();
 
   virtual void                        studyOpened( SUIT_Study* );
   virtual void                        studyCreated( SUIT_Study* );
+  virtual void                        studySaved( SUIT_Study* );
 
   void                                updatePreference( const QString&, const QString&, const QString& );
 
@@ -263,15 +296,19 @@ protected:
   LightApp_Preferences*               myPrefs;
   LightApp_SelectionMgr*              mySelMgr;
 
+  LightApp_FullScreenHelper*          myScreenHelper;
+
   WinMap                              myWin;
   WinVis                              myWinVis;
   WinGeom                             myWinGeom;
 
   SUIT_Accel*                         myAccel;
+  QTimer*                             myAutoSaveTimer;
 
   static LightApp_Preferences*        _prefs_;
 
   static int                          lastStudyId;
+  QStringList                         myUserWmTypes;
 };
 
 #ifdef WIN32
index 653256f95f5bfa7257e0785fe88ef897ac348d5b..dce8cbe3355a0b135ce13e56f531963982984b9f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
@@ -41,7 +42,7 @@ LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
 {
   myGroupId = 0;
   if( module() )
-       myGroupId = qHash( module()->name() );
+        myGroupId = qHash( module()->name() );
 }
 
 /*!
@@ -78,6 +79,15 @@ bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& )
   return true;
 }
 
+/*!
+  Does nothing by default. Should be redefined in light modules
+  that want to participate in "Dump study" operation.
+*/
+bool LightApp_DataModel::dumpPython( const QString&, CAM_Study*, bool, QStringList& )
+{
+  return true;
+}
+
 /*!
   Emit closed()
 */
@@ -109,7 +119,10 @@ void LightApp_DataModel::updateWidgets()
 */
 void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
 {
-  LightApp_ModuleObject* modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+  // san: Previously modelRoot was casted to LightApp_ModuleObject*,
+  // BUT this is incorrect: in full SALOME the model root has different type.
+  // Hopefully LightApp_DataObject* is sufficient here.
+  LightApp_DataObject* modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
   DataObjectList ch;
   QMap<SUIT_DataObject*,int> aMap;
   if( modelRoot )
@@ -122,7 +135,7 @@ void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
 
   build();
 
-  modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+  modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
   if( modelRoot )
   {
     DataObjectList new_ch = modelRoot->children();
@@ -206,5 +219,27 @@ void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QStr
 {
   SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
   if( m )
-       m->unregisterColumn( groupId(), name );
+    m->unregisterColumn( groupId(), name );
+}
+
+/*!
+  Creates the data model's root (module object) using the study services.
+  This is important because different study classes use different moduel object classes.
+  Therefore creation of the module object cannot be done at the data model level
+  where the type of the current study instance should not be known.
+  The module object returned by this method should be then passed to the model's setRoot().
+  \return the module object instance corresponding to the study type
+  \sa CAM_DataModel class
+*/
+CAM_ModuleObject* LightApp_DataModel::createModuleObject( SUIT_DataObject* theRoot ) const
+{
+  LightApp_RootObject* aStudyRoot = dynamic_cast<LightApp_RootObject*>( theRoot );
+  if ( !aStudyRoot )
+    return 0;
+
+  LightApp_Study* aStudy = aStudyRoot->study();
+  if ( aStudy )
+    return aStudy->createModuleObject( const_cast<LightApp_DataModel*>( this ), 
+                                      theRoot );
+  return 0;
 }
index e7c0f40a641af4954948bb55db41c34b91e235e6..e5e08c9bd09d8d3987f98b77ba2002f6719693c5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
@@ -37,6 +38,7 @@ class LightApp_Module;
 class LightApp_Study;
 class LightApp_DataObject;
 class SUIT_DataBrowser;
+class CAM_ModuleObject;
 
 /*!
   Description : Base class of data model
@@ -53,6 +55,10 @@ public:
   virtual bool                        save( QStringList& );
   virtual bool                        saveAs( const QString&, CAM_Study*, QStringList& );
   virtual bool                        close();
+  virtual bool                        dumpPython( const QString&,
+                                                 CAM_Study*,
+                                                 bool,
+                                                 QStringList& );
 
   virtual void                        update( LightApp_DataObject* = 0, LightApp_Study* = 0 );
 
@@ -74,6 +80,7 @@ protected:
   LightApp_Study*                     getStudy() const;
   virtual void                        build();
   virtual void                        updateWidgets();
+  virtual CAM_ModuleObject*           createModuleObject( SUIT_DataObject* theRoot ) const;
 
 private:
   int myGroupId;
index 504ae52f342658a9735a419b9713728100450a5a..b840feae12c6d7d6b7861769f348a5f903705f79 100644 (file)
@@ -1,36 +1,41 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_DataObject.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #include "LightApp_DataObject.h"
 #include "LightApp_Study.h"
 #include "LightApp_DataModel.h"
+#include "LightApp_Module.h"
+#include "LightApp_Application.h"
 
 #include <CAM_Module.h>
 #include <SUIT_DataObjectKey.h>
 
 #include <QVariant>
 
+#include <iostream>
+
 /*!
   \class LightApp_DataObject::Key
   \brief Represents unique data object key for the LightApp_DataObject
@@ -100,12 +105,12 @@ bool LightApp_DataObject::Key::isEqual( const SUIT_DataObjectKey* other ) const
 */
 
 /*!
-  \brief Constructor. 
+  \brief Constructor.
   \param parent parent data object
 */
 LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent )
-: CAM_DataObject( parent ), 
-  myCompObject( 0 ), 
+: CAM_DataObject( parent ),
+  myCompObject( 0 ),
   myCompDataType( "" )
 {
 }
@@ -123,6 +128,110 @@ int LightApp_DataObject::groupId() const
   return m ? m->groupId() : CAM_DataObject::groupId();
 }
 
+/*!
+  \brief return custom data for data object
+*/
+QVariant LightApp_DataObject::customData(Qtx::CustomDataType type) {
+  switch(type) {
+  case Qtx::IdType:
+    return EntryId;
+    break;
+  default:
+    return QVariant();
+    break;
+  }
+}
+
+/*!
+  \brief Check if the object is visible.
+  \return \c true if this object is displayable or \c false otherwise
+*/
+bool LightApp_DataObject::isVisible() const
+{
+  LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+  return r && r->study() && componentDataType() != r->study()->getVisualComponentName();
+}
+
+/*!
+  \brief Check if the object is draggable.
+
+  This method can be re-implemented in the subclasses.
+
+  \return \c true if it is possible to drag this object
+*/
+bool LightApp_DataObject::isDraggable() const
+{
+  LightApp_Module* aModule = dynamic_cast<LightApp_Module*>(module());
+  if (aModule) {
+    return aModule->isDraggable(this);
+  }
+  return false;
+}
+
+/*!
+  \brief Check if the drop operation fo this object is possible.
+
+  This method can be re-implemented in the subclasses.
+
+  \param obj object being dropped
+  \return \c true if it is possible to drop an object \c obj
+          to this object
+*/
+bool LightApp_DataObject::isDropAccepted() const
+{
+  LightApp_Module* aModule = dynamic_cast<LightApp_Module*>(module());
+  if (aModule) {
+    return aModule->isDropAccepted(this);
+  }
+  return false;
+}
+
+/*!
+  \brief Check if this object is can't be renamed in place
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false (all objects can not be renamed).
+
+  \param id column id
+  \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
+*/
+bool LightApp_DataObject::renameAllowed( const int id ) const
+{
+  if ( id == NameId ) {
+    LightApp_Module* m = dynamic_cast<LightApp_Module*>( module() );
+    LightApp_Application* app = 0;
+    LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+    if(r && r->study())
+      app  = dynamic_cast<LightApp_Application*>(r->study()->application());
+
+    return ( m && m->renameAllowed( entry() ) ) ||
+      ( app && app->renameAllowed( entry() ) );
+  }
+  return CAM_DataObject::renameAllowed( id );
+}
+
+
+/*!
+  \brief Set name of the this object.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false.
+
+  \return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_DataObject::setName(const QString& name)
+{
+    LightApp_Module* m = dynamic_cast<LightApp_Module*>( module() );
+    LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+    LightApp_Application* app =
+      (r && r->study()) ? dynamic_cast<LightApp_Application*>(r->study()->application()) : 0;
+
+    return ( m && m->renameObject( entry(), name ) ) ||
+           ( app && app->renameObject( entry(), name ) );
+  return CAM_DataObject::setName(name);
+}
+
+
 /*!
   \brief Get object string identifier.
 
@@ -136,6 +245,31 @@ QString LightApp_DataObject::entry() const
   return QString();
 }
 
+/*!
+  \brief Returns the string identifier of the data objects referenced by this one.
+
+  This method should be reimplemented in the subclasses.
+  Default implementation returns null string.
+
+  \return ID string of the referenced data object
+*/
+QString LightApp_DataObject::refEntry() const
+{
+  return QString();
+}
+
+/*!
+  \brief Tells if this data objects is a reference to some other or not.
+
+  The base implementation retuns true, if refEntry() returns non-empty string.
+
+  \return true if refEntry() is a non-empty string.
+*/
+bool LightApp_DataObject::isReference() const
+{
+  return !refEntry().isEmpty();
+}
+
 /*!
   \brief Get the data object unique key.
   \return data object key
@@ -149,17 +283,88 @@ SUIT_DataObjectKey* LightApp_DataObject::key() const
 /*!
   \brief Get object text data for the specified column.
 
-  Column with \a id = 0 (NameId) is supposed to be used
+  Column with \a id == NameId is supposed to be used
   to get the object name.
-  Column with \a id = 1 (EntryId) is supposed to be used
+  Column with \a id == EntryId is supposed to be used
   to get the object entry.
+  Column with \a id == RefEntryId is supposed to be used
+  to show the entry of the object referenced by this one.
 
   \param id column id
   \return object text data
 */
 QString LightApp_DataObject::text( const int id ) const
 {
-  return id == EntryId ? entry() : CAM_DataObject::text( id );
+  QString txt;
+  
+  switch ( id )
+  {
+  case EntryId:
+    txt = entry();
+    break;
+  case RefEntryId:
+    // Issue 21379: reference support at LightApp level
+    if ( isReference() )
+      txt = refEntry();
+    break;
+  default:
+    // Issue 21379: Note that we cannot return some specially decorated
+    // name string (like "* ref_obj_name") when isReference() returns true, 
+    // since there is no generic way at LightApp level
+    // to query the object name using refEntry() up to now.
+    // TODO: Think how to make reference name generation
+    // more generic at move it here from SalomeApp level...
+    txt = CAM_DataObject::text( id );
+    break;
+  }
+
+  return txt;
+}
+
+/*!
+  \brief Get data object color for the specified column.
+  \param role color role
+  \param id column id (not used)
+  \return object color for the specified column
+*/
+QColor LightApp_DataObject::color( const ColorRole role, const int id) const
+{
+  QColor c;
+
+  // Issue 21379: reference support at LightApp level
+  // Centralized way for choosing text/background color for references.
+  // Colors for "normal" objects should be chosen by sub-classes.
+  switch ( role )
+  {
+  case Text:
+  case Foreground:
+    // text color (not selected item)
+    // TODO: think how to detect invalid references...
+    if ( isReference() )
+      c = QColor( 255, 0, 0 );      // valid reference (red)
+    break;
+
+  case Highlight:
+    // background color for the highlighted item
+    // TODO: think how to detect invalid references...
+    if ( isReference() ) 
+      c = QColor( 255, 0, 0 );      // valid reference (red)
+    break;
+
+  case HighlightedText:
+    // text color for the highlighted item
+    if ( isReference() )
+      c = QColor( 255, 255, 255 );   // white
+    break;
+
+  default:
+    break;
+  }
+
+  if ( !c.isValid() )
+    c = CAM_DataObject::color( role, id );
+
+  return c;
 }
 
 /*!
@@ -237,31 +442,31 @@ bool LightApp_DataObject::compare( const QVariant& left, const QVariant& right,
       bool result = true;
       bool calculated = false;
       for ( int i = 0; i < idsLeft.count() || i < idsRight.count(); i++ ) {
-       bool okLeft = true, okRight = true;
-       int lid = 0, rid = 0;
-       if ( i < idsLeft.count() )
-         lid = idsLeft[i].toInt( &okLeft );
-       if ( i < idsRight.count() )
-         rid = idsRight[i].toInt( &okRight );
-       if ( okLeft && okRight ) {
-         // both seem to be correct integer ID
-         return lid < rid;
-       }
-       else if ( okLeft || okRight ) {
-         // objects with correct (int) ID have higher priority
-         return okLeft;
-       }
-       else {
-         // both not integer ID
-         int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] ); 
-         if ( !calculated && r != 0 ) {
-           result = r < 0;
-           calculated = true;
-         }
-       }
+        bool okLeft = true, okRight = true;
+        int lid = 0, rid = 0;
+        if ( i < idsLeft.count() )
+          lid = idsLeft[i].toInt( &okLeft );
+        if ( i < idsRight.count() )
+          rid = idsRight[i].toInt( &okRight );
+        if ( okLeft && okRight ) {
+          // both seem to be correct integer ID
+          return lid < rid;
+        }
+        else if ( okLeft || okRight ) {
+          // objects with correct (int) ID have higher priority
+          return okLeft;
+        }
+        else {
+          // both not integer ID
+          int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] );
+          if ( !calculated && r != 0 ) {
+            result = r < 0;
+            calculated = true;
+          }
+        }
       }
       // we should reach this if the entries are exactly equal
-      return result; 
+      return result;
     }
     return QString::localeAwareCompare( leftStr, rightStr ) < 0;
   }
@@ -335,9 +540,9 @@ QString LightApp_ModuleObject::toolTip( const int id ) const
 
 /*!
   \brief Insert new child object to the children list at specified position.
-  
+
   Adds component in the study for this module object if it is not done yet.
-  
+
   \param obj object to be inserted
   \param pos position at which data object should be inserted
 */
@@ -369,8 +574,8 @@ void LightApp_ModuleObject::insertChild( SUIT_DataObject* obj, int pos )
 */
 LightApp_RootObject::LightApp_RootObject( LightApp_Study* study )
 : CAM_DataObject( 0 ),
-  LightApp_DataObject( 0 ), 
-  myStudy( study ) 
+  LightApp_DataObject( 0 ),
+  myStudy( study )
 {
 }
 
@@ -386,8 +591,8 @@ LightApp_RootObject::~LightApp_RootObject()
   \param study pointer to the study
 */
 void LightApp_RootObject::setStudy( LightApp_Study* study )
-{ 
-  myStudy = study; 
+{
+  myStudy = study;
 }
 
 /*
@@ -395,6 +600,6 @@ void LightApp_RootObject::setStudy( LightApp_Study* study )
   \return pointer to the study
 */
 LightApp_Study* LightApp_RootObject::study() const
-{ 
-  return myStudy;  
-} 
+{
+  return myStudy;
+}
index 94b4b838bbe7e9a77be92b974c87fa82773203f9..89ecc2e0942936404d43a7aaa325ceace3b162fa 100644 (file)
@@ -1,27 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_DataObject.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef LIGHTAPP_DATAOBJECT_H
 #define LIGHTAPP_DATAOBJECT_H
 
@@ -38,7 +39,8 @@ class LIGHTAPP_EXPORT LightApp_DataObject : public virtual CAM_DataObject
 public:
   //! Column id
   enum { 
-    EntryId = NameId + 1    //!< entry column
+    EntryId = VisibilityId + 1,    //!< entry column
+    RefEntryId                     //!< reference entry column
   };
 
 public:
@@ -48,7 +50,11 @@ public:
   virtual SUIT_DataObjectKey*     key() const;
   virtual QString                 entry() const;
 
+  virtual QString                 refEntry() const;
+  virtual bool                    isReference() const;
+
   virtual QString                 text( const int = NameId ) const;
+  virtual QColor                  color( const ColorRole, const int = NameId ) const;
 
   virtual SUIT_DataObject*        componentObject() const;
   virtual QString                 componentDataType() const;
@@ -56,6 +62,13 @@ public:
   virtual bool                    customSorting( const int = NameId ) const;
   virtual bool                    compare( const QVariant&, const QVariant&, const int = NameId ) const;
   virtual int                     groupId() const;
+  virtual QVariant                customData(Qtx::CustomDataType type);
+
+  virtual bool                    isVisible() const;
+  virtual bool                    isDraggable() const;
+  virtual bool                    isDropAccepted() const;
+  virtual bool                    renameAllowed( const int = NameId ) const;
+  virtual bool                    setName( const QString& );
 
 protected:
   QString                         myCompDataType;
@@ -84,10 +97,10 @@ public:
   LightApp_RootObject( LightApp_Study* );
 
   virtual ~LightApp_RootObject();
-    
+
   void                   setStudy( LightApp_Study* );
   LightApp_Study*        study() const;
-  
+
 private:
   LightApp_Study*        myStudy;
 };
index be594b0557473553fb348e3c8337726fdefee8c9..3200f7ffdc048676a75957fef5fb7d4c7315d80f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_DataOwner.h"
 
 /*!Constructor. Initialize by \a theEntry.*/
index c04f1823017cc333f599415a8847ce2dca2618f0..fdfaa1d7fedfd4ab4ff459cbafd02e5135e094fd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_DATAOWNER_H
 #define LIGHTAPP_DATAOWNER_H
 
index 8f8a71bf74c7e58c604454f948d9684b2b4fddfa..583f5a883c241d57cebc46041298192b1023003e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_DataSubOwner.h"
 
 /*!Constructor.Initialize by \a entry and \a index*/
index 6753d8c0f608dd58b6b414c3c9fac9543c5e7cc0..cdc6cd99af0ebf716d942bb84b8c14742910e39b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_DATASUBOWNER_H
 #define LIGHTAPP_DATASUBOWNER_H
 
index 3aed9fe5d6cdeee4a6987e23fc3ff7343cd2d18c..c55f37a0b325b66b4312dd7cfc67d692e34a728c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_Dialog.cxx
 // Author:    Alexander SOLOVYOV
 //
@@ -148,7 +149,7 @@ bool LightApp_Dialog::isObjectShown( const int id ) const
 {
   return myObjects.contains( id ) &&
          ( myObjects[ id ].myEdit->isVisible() ||
-          myObjects[ id ].myEdit->isVisibleTo( myObjects[ id ].myEdit->parentWidget() ) );
+           myObjects[ id ].myEdit->isVisibleTo( myObjects[ id ].myEdit->parentWidget() ) );
 }
 
 /*!
@@ -203,7 +204,7 @@ void LightApp_Dialog::selectObject( const QString& name, const int type, const Q
 void LightApp_Dialog::selectObject( const QStringList& _names,
                                      const TypesList& _types,
                                      const QStringList& _ids,
-                                    const bool update )
+                                     const bool update )
 {
   ObjectMap::iterator anIt = myObjects.begin(),
                       aLast = myObjects.end();
@@ -563,6 +564,7 @@ void LightApp_Dialog::onToggled( bool on )
       id = anIt.key();
 
   if( id!=-1 )
+  {
     if( on )
     {
       updateButtons( id );
@@ -570,6 +572,7 @@ void LightApp_Dialog::onToggled( bool on )
     }
     else
       emit objectDeactivated( id );
+  }
 }
 
 /*!
index e7bd0db0d08fb90db21c9ec7d7f86f3d57f11b93..088253673f31953b1c3896a7cbc63e6341699ac9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_Dialog.h
 // Author:    Alexander SOLOVYOV
 //
index c050811d1ebf4b85e96cf79d881bb30f6fe81f08..1eea9d4255c512296c56c4787303d0168412ece0 100644 (file)
@@ -1,27 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_Displayer.h"
 #include "LightApp_Application.h"
 #include "LightApp_Module.h"
+#include "LightApp_Study.h"
 
 #include <CAM_Study.h>
 
@@ -31,6 +33,7 @@
 #include <SUIT_ViewModel.h>
 #include <SUIT_ViewWindow.h>
 
+#include <QStringList>
 #include <QString>
 #ifndef DISABLE_SALOMEOBJECT
   #include "SALOME_InteractiveObject.hxx"
@@ -56,23 +59,45 @@ LightApp_Displayer::~LightApp_Displayer()
   \param updateViewer - is it necessary to update viewer
   \param theViewFrame - view
 */
-void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame )
+void LightApp_Displayer::Display( const QString& entry, const bool updateViewer,
+                                  SALOME_View* theViewFrame )
+{
+  QStringList aList;
+  aList.append( entry );
+  Display( aList, updateViewer, theViewFrame );
+}
+
+/*!
+  Displays object in view
+  \param list - object entries
+  \param updateViewer - is it necessary to update viewer
+  \param theViewFrame - view
+*/
+void LightApp_Displayer::Display( const QStringList& list, const bool updateViewer,
+                                  SALOME_View* theViewFrame )
 {
-  SALOME_Prs* prs = buildPresentation( entry, theViewFrame );
-  if ( prs )
+  SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
+  QStringList::const_iterator it = list.constBegin();
+  for ( ; it != list.constEnd(); ++it)
   {
-    SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
-    if ( vf )
+    SALOME_Prs* prs = buildPresentation( *it, vf );
+    if ( prs )
     {
-      vf->BeforeDisplay( this );
-      vf->Display( prs );
-      vf->AfterDisplay( this );
 
-      if ( updateViewer )
-        vf->Repaint();
+      if ( vf )
+      {
+       myLastEntry = *it;
+        vf->BeforeDisplay( this, prs );
+        vf->Display( prs );
+        vf->AfterDisplay( this, prs );
 
+        if ( updateViewer )
+          vf->Repaint();
+      }
       delete prs;  // delete presentation because displayer is its owner
+      setVisibilityState(*it, Qtx::ShownState);
     }
+
   }
 }
 
@@ -98,13 +123,13 @@ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewe
 
       SUIT_ViewModel* vmodel = vman->getViewModel();
       if( !vmodel )
-       continue;
-       
+        continue;
+        
       SALOME_View* view = dynamic_cast<SALOME_View*>(vmodel);
       if( view && ( IsDisplayed( entry, view ) || view == GetActiveView() ) )
       {
-       Erase( entry, true, false, view );
-       Display( entry, updateViewer, view );
+        Erase( entry, true, false, view );
+        Display( entry, updateViewer, view );
       }
     }
   }
@@ -118,17 +143,43 @@ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewe
   \param theViewFrame - view
 */
 void LightApp_Displayer::Erase( const QString& entry, const bool forced,
-                                const bool updateViewer, SALOME_View* theViewFrame )
+                                const bool updateViewer,
+                                SALOME_View* theViewFrame )
+{
+  QStringList aList;
+  aList.append( entry );
+  Erase( aList, forced, updateViewer, theViewFrame );
+}
+
+/*!
+  Erases object in view
+  \param list - object entries
+  \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 QStringList& list, const bool forced,
+                                const bool updateViewer,
+                                SALOME_View* theViewFrame )
 {
   SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
 
-  if ( vf ) {
-    SALOME_Prs* prs = vf->CreatePrs( entry.toLatin1() );
+  if ( !vf )
+    return;
+
+  QStringList::const_iterator it = list.constBegin();
+  for ( ; it != list.constEnd(); ++it)
+  {
+    SALOME_Prs* prs = vf->CreatePrs( (*it).toLatin1().data() );
     if ( prs ) {
+      myLastEntry = *it;
+      vf->BeforeErase( this, prs );
       vf->Erase( prs, forced );
+      vf->AfterErase( this, prs );
       if ( updateViewer )
-       vf->Repaint();
+        vf->Repaint();
       delete prs;  // delete presentation because displayer is its owner
+      setVisibilityState(*it,Qtx::HiddenState);
     }
   }
 }
@@ -148,6 +199,11 @@ void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, S
     if ( updateViewer )
       vf->Repaint();
   }
+
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+  LightApp_Study* study = app ? dynamic_cast<LightApp_Study*>( app->activeStudy() ) : 0;  
+  if(study)
+    study->setVisibilityStateForAll(Qtx::HiddenState);
 }
 
 /*!
@@ -207,8 +263,8 @@ SALOME_View* LightApp_Displayer::GetActiveView()
   if (  SUIT_Application* app = session->activeApplication() ) {
     if ( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) ) {
       if( SUIT_ViewManager* vman = sApp->activeViewManager() ) {
-       if ( SUIT_ViewModel* vmod = vman->getViewModel() )
-         return dynamic_cast<SALOME_View*>( vmod );
+        if ( SUIT_ViewModel* vmod = vman->getViewModel() )
+          return dynamic_cast<SALOME_View*>( vmod );
       }
     }
   }
@@ -236,8 +292,8 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const
   if(  SUIT_Application* app = session->activeApplication() )
     if( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) )
       if( SUIT_ViewManager* vman = sApp->activeViewManager() )
-       if( SUIT_ViewModel* vmod = vman->getViewModel() )
-         viewerType = vmod->getType();
+        if( SUIT_ViewModel* vmod = vman->getViewModel() )
+          viewerType = vmod->getType();
   return canBeDisplayed( entry, viewerType );
 }
 
@@ -255,21 +311,34 @@ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name,
     return 0;
 
   LightApp_Module* m = dynamic_cast<LightApp_Module*>( app ? app->module( mod_name ) : 0 );
+  bool wasLoaded = false;
   if( !m && load )
   {
     m = dynamic_cast<LightApp_Module*>( app->loadModule( mod_name, false ) );
-    if( m )
+       if( m ) {
       app->addModule( m );
+         wasLoaded = true;
+       }
   }
 
   if( m )
   {
     m->connectToStudy( dynamic_cast<CAM_Study*>( app->activeStudy() ) );
-    if( m!=app->activeModule() && load )
-    {
-      m->setMenuShown( false );
-      m->setToolShown( false );
-    }
+       if( wasLoaded ) 
+               m->updateModuleVisibilityState();
   }
   return m ? m->displayer() : 0;
 }
+
+/*!
+  Find the active study and set the 'visibility state' property of the object
+  \param mod_name - name of module
+  \param load - is module has to be forced loaded
+*/
+void LightApp_Displayer::setVisibilityState( const QString& theEntry, Qtx::VisibilityState theState) const {
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+  LightApp_Study* study = app ? dynamic_cast<LightApp_Study*>( app->activeStudy() ) : 0;
+  
+  if(study)
+    study->setVisibilityState( theEntry, theState);
+}
index 4e3544f2a6fceb1bb042946d02115ec170c2659b..18784c3066369093b66c21079a58ed5e63cf2c81 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_DISPLAYER_HEADER
 #define LIGHTAPP_DISPLAYER_HEADER
 
@@ -26,6 +27,8 @@
 
 #include <SALOME_Prs.h>
 
+#include <Qtx.h>
+
 class QString;
 
 /*!
@@ -40,10 +43,17 @@ public:
   virtual ~LightApp_Displayer();
 
   void Display( const QString&, const bool = true, SALOME_View* = 0 );
+  void Display( const QStringList&, const bool = true,
+                SALOME_View* = 0 );
+
   void Redisplay( const QString&, const bool = true );
+
+  void Erase( const QStringList&, const bool forced = false,
+              const bool updateViewer = true, SALOME_View* = 0);
   void Erase( const QString&, const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 );
   void EraseAll( const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 ) const;
-  bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
+
+  virtual bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
   void UpdateViewer() const;
 
   static SALOME_View*        GetActiveView();
@@ -51,9 +61,13 @@ public:
 
   virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
           bool canBeDisplayed( const QString& /*entry*/ ) const;
+         
+         void setVisibilityState (const QString& entry, Qtx::VisibilityState) const;
 
 protected:
   virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
+protected:
+  QString myLastEntry; 
 };
 
 #endif
index e856607781ed9e41fdb6c171af2700379650cb6d..b272f8547ca11f3495ebe90ff469af6b4f83fec7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_Driver.h"
 
 #include <TCollection_AsciiString.hxx> 
@@ -47,8 +48,6 @@ LightApp_Driver::~LightApp_Driver()
 {
 }
 
-using namespace std;
-
 /*!
   Save in file 'theFileName' datas from this driver
 */
index 5148426c5cc4d55dd65ed24f570def3711832672..a975640816bd4c76fe11c3907c0fd1d24ae18205 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_DRIVER_H
 #define LIGHTAPP_DRIVER_H
 
index b452b018b09c4d5fe69b3038372b40c6a97a6bd5..fe15105a3fefaee36cb40c0b2d6e093c7d5c757c 100644 (file)
@@ -1,30 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_EventFilter.h"
 
 #include <SUIT_Desktop.h>
 
 #include <QApplication>
 
+#include <SALOME_Event.h>
+
 LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL;
 
 /*!Constructor.*/
@@ -52,19 +55,36 @@ bool LightApp_EventFilter::eventFilter( QObject* o, QEvent* e )
       SUIT_Desktop* aDesktop = 0;
       
       while( parent )
-       {
-         if ( aDesktop = dynamic_cast<SUIT_Desktop*>(parent) )
-           break;
-         parent = parent->parentWidget();
-       }
+        {
+          aDesktop = dynamic_cast<SUIT_Desktop*>(parent);
+          if ( aDesktop )
+            break;
+          parent = parent->parentWidget();
+        }
       
       if ( aDesktop )
-       aDesktop->emitActivated();
+        aDesktop->emitActivated();
+    }
+
+  else if(e->type() == SALOME_EVENT)
+    {
+      SALOME_Event* aSE = (SALOME_Event*)((SALOME_CustomEvent*)e)->data();
+      processEvent(aSE);
+      ((SALOME_CustomEvent*)e)->setData( 0 );
+      return true;
     }
   
   return QObject::eventFilter( o, e );
 }
 
+/*!Process event.*/
+void LightApp_EventFilter::processEvent( SALOME_Event* theEvent )
+{
+  if(theEvent)
+    theEvent->ExecutePostedEvent();
+}
+
+
 /*!Create new instance of LightApp_EventFilter*/
 void LightApp_EventFilter::Init()
 {
index 3b98fbc58fb64acefe5ba04a59656006b1d24dea..a553839feadb98a9ccdb27943d8f5c006c800432 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_EVENTFILTER_H
 #define LIGHTAPP_EVENTFILTER_H
 
@@ -30,6 +31,9 @@
 #pragma warning( disable: 4251 )
 #endif
 
+
+class SALOME_Event;
+
 /*!
   Class provide event filter.
 */
@@ -46,6 +50,7 @@ protected:
 private:
   /*! global event filter for qapplication */
   virtual bool eventFilter( QObject* o, QEvent* e );
+  void processEvent( SALOME_Event* );
 
 private:
   static LightApp_EventFilter* myFilter;
index 15a2dab9042cad5b9f307c0d381da6f8bf980347..d5fcc807bb769e7109d11c8c698c2729f7472ab9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_GLSelector.h"
 
 #include "LightApp_DataOwner.h"
index 45260e314de6fc4b8cb886f77c23e9c0d95b0e48..907b5c6ec864646f3e943fc7909b6d88bc0f38c2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_GLSELECTOR_H
 #define LIGHTAPP_GLSELECTOR_H
 
index 168f18013bbd19a20549aa1a6fe0b0117309f5a9..3703300bfe36f2067a3e3ff88ee0fb05e46e9ee5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_HDFDriver.h"
 
 #include "HDFOI.hxx"
@@ -36,8 +37,6 @@ LightApp_HDFDriver::~LightApp_HDFDriver()
 {
 }
 
-using namespace std;
-
 /*!
   Saves in file 'theFileName' datas from this driver
 */
index 2a7fd3c9c423fbe914745251bc087a01c5875d90..1087ef5dd63f38e12a5c4356142852248f6342b9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_HDFDRIVER_H
 #define LIGHTAPP_HDFDRIVER_H
 
index 8bd88c4ea3f0a00d9836ec0a9ca3d85610d6ffd7..5aa863e6ab493f3362bca8f7b76d765855ca62c0 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #include "LightApp_Module.h"
 
 #include "CAM_Application.h"
@@ -45,6 +46,7 @@
 #include <SUIT_Operation.h>
 #include <SUIT_ViewManager.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_ShortcutMgr.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_TreeModel.h>
 
@@ -91,6 +93,7 @@
 #include <QString>
 #include <QStringList>
 
+#include <iostream>
 
 /*!Constructor.*/
 LightApp_Module::LightApp_Module( const QString& name )
@@ -136,6 +139,7 @@ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QStr
 {
   LightApp_Selection* sel = createSelection();
   sel->init( client, getApp()->selectionMgr() );
+
   popupMgr()->setSelection( sel );
   popupMgr()->setMenu( menu );
   popupMgr()->updateMenu();
@@ -145,7 +149,7 @@ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QStr
  * For updating model or whole object browser use update() method can be used.
 */
 void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, 
-                                       SUIT_DataObject* theDataObject )
+                                        SUIT_DataObject* theDataObject )
 {
   bool upd = getApp()->objectBrowser()->autoUpdate();
   getApp()->objectBrowser()->setAutoUpdate( false );
@@ -153,12 +157,12 @@ void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
   if( theIsUpdateDataModel ){
     if( CAM_DataModel* aDataModel = dataModel() ){
       if ( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) ) {
-       SUIT_DataObject* aParent = NULL;
-       if(theDataObject && theDataObject != aDataModel->root())
-         aParent = theDataObject->parent();
+        //SUIT_DataObject* aParent = NULL;
+        //if(theDataObject && theDataObject != aDataModel->root())
+        //  aParent = theDataObject->parent();
 
-       LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
-       LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
+        LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
+        LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
         aModel->update( anObject, aStudy );
       }
     }
@@ -219,6 +223,17 @@ bool LightApp_Module::activateModule( SUIT_Study* study )
   if ( mySwitchOp == 0 )
     mySwitchOp = new LightApp_SwitchOp( this );
 
+  // Enable Display and Erase actions
+  if ( action(myDisplay) )
+    action(myDisplay)->setEnabled(true);
+  if ( action(myErase) )
+    action(myErase)->setEnabled(true);
+
+  application()->shortcutMgr()->setSectionEnabled( moduleName() );
+
+  /*  BUG 0020498 : The Entry column is always shown at module activation
+      The registration of column is moved into LightApp_Application
+
   QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
   LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
   if( m )
@@ -226,7 +241,7 @@ bool LightApp_Module::activateModule( SUIT_Study* study )
     SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
     m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
     treeModel->setAppropriate( EntryCol, Qtx::Toggled );
-  }
+  }*/
   return res;
 }
 
@@ -237,9 +252,9 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study )
   mySwitchOp = 0;
 
   disconnect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
-             this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
+              this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
   disconnect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
-             this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+              this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
 
   // abort all operations
   MapOfOperation::const_iterator anIt;
@@ -247,6 +262,15 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study )
     anIt.value()->abort();
   }
 
+  // Disable Display and Erase action
+  if ( action(myDisplay) )
+    action(myDisplay)->setEnabled(false);
+  if ( action(myErase) )
+    action(myErase)->setEnabled(false);
+
+  application()->shortcutMgr()->setSectionEnabled( moduleName(), false );
+  
+  /*  BUG 0020498 : The Entry column is always shown at module activation
   QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
   LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
   if( m )
@@ -256,6 +280,7 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study )
     treeModel->setAppropriate( EntryCol, Qtx::Shown );
     m->unregisterColumn( getApp()->objectBrowser(), EntryCol );
   }
+  */
   return CAM_Module::deactivateModule( study );
 }
 
@@ -274,6 +299,11 @@ void LightApp_Module::preferencesChanged( const QString&, const QString& )
 {
 }
 
+/*!NOT IMPLEMENTED*/
+void LightApp_Module::message( const QString& )
+{
+}
+
 /*!Gets application.*/
 LightApp_Application* LightApp_Module::getApp() const
 {
@@ -380,13 +410,13 @@ QtxPopupMgr* LightApp_Module::popupMgr()
     
     QAction 
       *disp = createAction( -1, tr( "TOP_SHOW" ), p, tr( "MEN_SHOW" ), tr( "STB_SHOW" ),
-                           0, d, false, this, SLOT( onShowHide() ) ),
+                            0, d, false, this, SLOT( onShowHide() ), QString("General:Show object(s)") ),
       *erase = createAction( -1, tr( "TOP_HIDE" ), p, tr( "MEN_HIDE" ), tr( "STB_HIDE" ),
-                            0, d, false, this, SLOT( onShowHide() ) ),
+                             0, d, false, this, SLOT( onShowHide() ) , QString("General:Hide object(s)") ),
       *dispOnly = createAction( -1, tr( "TOP_DISPLAY_ONLY" ), p, tr( "MEN_DISPLAY_ONLY" ), tr( "STB_DISPLAY_ONLY" ),
-                               0, d, false, this, SLOT( onShowHide() ) ),
+                                0, d, false, this, SLOT( onShowHide() ) ),
       *eraseAll = createAction( -1, tr( "TOP_ERASE_ALL" ), p, tr( "MEN_ERASE_ALL" ), tr( "STB_ERASE_ALL" ),
-                               0, d, false, this, SLOT( onShowHide() ) );
+                                0, d, false, this, SLOT( onShowHide() ) );
     myDisplay     = actionId( disp );
     myErase       = actionId( erase );
     myDisplayOnly = actionId( dispOnly );
@@ -505,7 +535,7 @@ void LightApp_Module::setPreferenceProperty( const int id, const QString& prop,
 void LightApp_Module::startOperation( const int id )
 {
   LightApp_Operation* op = 0;
-  if( myOperations.contains( id ) )
+  if( myOperations.contains( id ) && reusableOperation( id ) )
     op = myOperations[ id ];
   else
   {
@@ -636,3 +666,119 @@ LightApp_Operation* LightApp_Module::operation( const int id ) const
 {
   return myOperations.contains( id ) ? myOperations[id] : 0;
 }
+
+/*!
+  virtual method called to manage the same operations
+*/
+bool LightApp_Module::reusableOperation( const int id )
+{
+ return true;
+} 
+
+/*!
+  virtual method
+  \return true if module can copy the current selection
+*/
+bool LightApp_Module::canCopy() const
+{
+  return false;
+}
+
+/*!
+  virtual method
+  \return true if module can paste previously copied data
+*/
+bool LightApp_Module::canPaste() const
+{
+  return false;
+}
+
+/*!
+  virtual method
+  \brief Copies the current selection into clipboard
+*/
+void LightApp_Module::copy()
+{
+}
+
+/*!
+  virtual method
+  \brief Pastes the current data in the clipboard
+*/
+void LightApp_Module::paste()
+{
+}
+
+/*!
+  virtual method
+  \return true if module allows dragging the given object
+*/
+bool LightApp_Module::isDraggable( const SUIT_DataObject* /*what*/ ) const
+{
+  return false;
+}
+
+/*!
+  virtual method
+  \return true if module allows dropping one or more objects (currently selected) on the object \c where
+*/
+bool LightApp_Module::isDropAccepted( const SUIT_DataObject* /*where*/ ) const
+{
+  return false;
+}
+
+/*!
+  virtual method
+  Complete drag-n-drop operation by processing objects \a what being dragged, dropped to the line \a row
+  within the object \a where. The drop action being performed is specified by \a action.
+*/
+void LightApp_Module::dropObjects( const DataObjectList& /*what*/, SUIT_DataObject* /*where*/,
+                                   const int /*row*/, Qt::DropAction /*action*/ )
+{
+}
+
+/*!
+  \brief Return \c true if object can be renamed
+*/
+bool LightApp_Module::renameAllowed( const QString& /*entry*/ ) const
+{
+  return false;
+}
+
+/*!
+  Rename object by entry.
+  \param entry entry of the object
+  \param name new name of the object
+  \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*name*/ )
+{
+  return false;
+}
+
+
+
+int LightApp_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
+{
+  return CAM_Module::createMenu( subMenu, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
+{
+  return CAM_Module::createMenu( subMenu, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( const int id, const int menu, const int group, const int idx )
+{
+  return CAM_Module::createMenu( id, menu, group, idx );
+}
+int LightApp_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
+{
+  return CAM_Module::createMenu( id, menu, group, idx );
+}
+int LightApp_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
+{
+  return CAM_Module::createMenu( a, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
+{
+  return CAM_Module::createMenu( a, menu, id, group, idx );
+}
index 88ed1b44e119006c037ef546a8049677cc2415c9..e52dd7d171d04998ee8369613c71d9aaf9e96d34 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #ifndef LIGHTAPP_MODULE_H
 #define LIGHTAPP_MODULE_H
 
@@ -30,6 +31,8 @@
 #include "LightApp_Preferences.h"
 #include <CAM_Module.h>
 
+#include <SUIT_DataObject.h>
+
 class LightApp_Application;
 class LightApp_Selection;
 class LightApp_Operation;
@@ -38,7 +41,7 @@ class LightApp_Displayer;
 class LightApp_SelectionMgr;
 
 class SUIT_Study;
-class SUIT_DataObject;
+//class SUIT_DataObject;
 class SUIT_Operation;
 class SUIT_ViewManager;
 class CAM_Application;
@@ -77,21 +80,39 @@ public:
 
   virtual void                        update( const int );
   // Update viewer or/and object browser etc. in accordance with update flags
-  // ( see SalomeApp_UpdateFlags enumeration ). Derived modules can redefine this method
+  // (see SalomeApp_UpdateFlags enumeration). Derived modules can redefine this method
   // for their own purposes
 
   virtual void                        updateObjBrowser( bool = true, SUIT_DataObject* = 0 );
-  // Update object bropwser ( for updating model or whole object browser use update() method
-  // can be used )
+  // Update object browser (for updating model or whole object browser use update() method)
 
   virtual void                        selectionChanged();
   virtual void                        preferencesChanged( const QString&, const QString& );
+  virtual void                        message( const QString& );
 
   virtual void                        studyActivated() {};
 
   virtual LightApp_Displayer*         displayer();
   virtual LightApp_Selection*         createSelection() const;
 
+  virtual bool                        canCopy() const;
+  virtual bool                        canPaste() const;
+  virtual bool                        isDraggable( const SUIT_DataObject* ) const;
+  virtual bool                        isDropAccepted( const SUIT_DataObject* ) const;
+  virtual void                        dropObjects( const DataObjectList&, SUIT_DataObject*,
+                                                  const int, Qt::DropAction );
+  virtual void                        copy();
+  virtual void                        paste();
+  virtual bool                        renameAllowed( const QString& ) const;
+  virtual bool                        renameObject( const QString&, const QString& );
+
+  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 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 );
+  int                    createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
+
 public slots:
   virtual bool                        activateModule( SUIT_Study* );
   virtual bool                        deactivateModule( SUIT_Study* );
@@ -115,10 +136,13 @@ protected:
 
   virtual CAM_DataModel*              createDataModel();
 
+  virtual bool                        reusableOperation( const int id );
+
   int                                 addPreference( const QString& label );
-  int                                 addPreference( const QString& label, const int pId, const int = LightApp_Preferences::Auto,
-                                                    const QString& section = QString(),
-                                                    const QString& param = QString() );
+  int                                 addPreference( const QString& label, const int pId,
+                                                     const int type = LightApp_Preferences::Auto,
+                                                     const QString& section = QString(),
+                                                     const QString& param = QString() );
   QVariant                            preferenceProperty( const int, const QString& ) const;
   void                                setPreferenceProperty( const int, const QString&, const QVariant& );
 
index 36c6fa77bb5d7352fb3463871a3daf16b410e045..76fe69750cf1f7bd89de3055fa08e927c8cbd6c9 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_ModuleAction.cxx
 // Author : Sergey TELKOV, Vadim SANDLER
 //
@@ -27,6 +25,8 @@
 #include <QtxComboBox.h>
 #include <QtxActionSet.h>
 #include <QVBoxLayout>
+#include <QApplication>
+#include <QEvent>
 
 /*!
   \class LightApp_ModuleAction::ActionSet
@@ -183,6 +183,23 @@ QWidget* LightApp_ModuleAction::ComboAction::createWidget( QWidget* parent )
   \param item identifier
 */
 
+/*!
+  \class LightApp_ModuleAction::ActivateEvent
+  \brief Internal class to represent custom event for transfer the activation item id.
+  \internal
+*/
+class LightApp_ModuleAction::ActivateEvent : public QEvent
+{
+public:
+  ActivateEvent( QEvent::Type type, int id ) : QEvent( type ), myId( id ) {};
+  ~ActivateEvent() {};
+
+  int     id() const { return myId; }
+
+private:
+  int     myId;
+};
+
 /*!
   \class LightApp_ModuleAction
   \brief An action, representing the list of modules to be inserted to the
@@ -308,7 +325,7 @@ void LightApp_ModuleAction::insertModule( const QString& name, const QIcon& ico,
                                           const int idx )
 {
   QtxAction* a = new QtxAction( name, ico, name, 0, this, true );
-  a->setStatusTip( tr( "Activate/deactivate %1 module" ).arg( name ) );
+  a->setStatusTip( tr( "ACTIVATE_MODULE_TOP" ).arg( name ) );
 
   mySet->insertAction( a, -1, idx );
   update();
@@ -415,6 +432,20 @@ void LightApp_ModuleAction::removedFrom( QWidget* w )
   w->removeAction( mySet );
 }
 
+/*!
+  \brief Perform delayed activation with specified id.
+  \param e custom event
+  \return \c true if the event was processed successfully and \c false otherwise.
+*/
+bool LightApp_ModuleAction::event( QEvent* e )
+{
+  if ( e->type() == QEvent::MaxUser ) {
+    activate( ((ActivateEvent*)e)->id(), false );
+    return true;
+  }
+  return QtxAction::event( e );
+}
+
 /*!
   \fn void LightApp_ModuleAction::moduleActivated( const QString& name );
   \brief Emitted when the module is activated
@@ -462,6 +493,7 @@ void LightApp_ModuleAction::update( QtxComboBox* cb )
   if ( !cb )
     return;
 
+  bool blocked = cb->blockSignals( true );
   int curId = mySet->moduleId( active() );
   QList<QAction*> alist = mySet->actions();
   cb->clear();
@@ -478,6 +510,7 @@ void LightApp_ModuleAction::update( QtxComboBox* cb )
   }
 
   cb->setCurrentId( curId );
+  cb->blockSignals( blocked );
 }
 
 /*!
@@ -568,5 +601,5 @@ void LightApp_ModuleAction::onChanged()
 */
 void LightApp_ModuleAction::onComboActivated( int id )
 {
-  activate( id, false );
+  QApplication::postEvent( this, new ActivateEvent( QEvent::MaxUser, id ) );
 } 
index 4be268decea3c76a6eacf5e047bf9b03bd1986d6..c52e04f24b10970a918806c3f7d273b789be9f70 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_ModuleAction.h
 // Author : Sergey TELKOV, Vadim SANDLER
 //
@@ -42,6 +40,7 @@ class LIGHTAPP_EXPORT LightApp_ModuleAction : public QtxAction
 private:
   class ActionSet;
   class ComboAction;
+  class ActivateEvent;
 
 public:
   enum { None = 0x00, Buttons = 0x01, ComboItem = 0x02, All = Buttons | ComboItem };
@@ -69,6 +68,8 @@ protected:
   virtual void     addedTo( QWidget* );
   virtual void     removedFrom( QWidget* );
 
+  virtual bool     event( QEvent* );
+
 signals:
   void             moduleActivated( const QString& );
 
@@ -101,11 +102,11 @@ public:
 
   QList<QtxComboBox*> widgets() const;
 
-protected:
-  virtual QWidget*    createWidget( QWidget* );
-
 signals:
   void                activatedId( int );
+
+protected:
+  virtual QWidget*    createWidget( QWidget* );
 };
 
 #endif // LIGHTAPP_MODULEACTION_H
index a675d7a8b3b860157192fdb031ed793866ec57cc..5275d5a88734b5b4e5ed7b361e21452d7cbfe0e8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_ModuleDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -148,8 +149,8 @@ static const char* const default_icon[] = {
   \param icon module icon
 */
 LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget*       parent, 
-                                       const QString& component, 
-                                       const QPixmap& icon )
+                                        const QString& component, 
+                                        const QPixmap& icon )
 : QDialog ( parent )
 {
   setModal( true );
@@ -178,6 +179,8 @@ LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget*       parent,
 
   // <Cancel>
   QPushButton* cancelBtn = new QPushButton( tr( "CANCEL" ), this );
+  cancelBtn->setAutoDefault( true );
+
   myButtonLayout->addSpacing( 70 );
   myButtonLayout->addStretch();
   myButtonLayout->addWidget( cancelBtn );
@@ -223,8 +226,12 @@ int LightApp_ModuleDlg::addButton( const QString& button, const int id )
   }
 
   QPushButton* newButton = new QPushButton( button, this );
+  newButton->setAutoDefault( true );
 
-  if ( myButtons.empty() ) newButton->setDefault( true );
+  if ( myButtons.empty() ) {
+       newButton->setDefault( true );
+       newButton->setFocus();
+  }
 
   myButtons.insert( newButton, bid );
   myButtonLayout->insertWidget( myButtonLayout->count()-3, newButton );
@@ -242,7 +249,7 @@ QPushButton* LightApp_ModuleDlg::findButton( const int id ) const
 {
   QPushButton* btn = 0;
   for ( ButtonMap::ConstIterator it = myButtons.begin(); 
-       it != myButtons.end() && !btn; ++it ) {
+        it != myButtons.end() && !btn; ++it ) {
     if ( it.value() == id )
       btn = it.key();
   }
index 90211f5313972dfd83f1ecaa6e82b78b15985305..3cec7f09fa369ca5404e236e21355d72f66bb270 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_ModuleDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index b6ead7cdc7e3a4ae26925520b0bbda85b6ed9611..78ce18d027ac1a3fa2263fcc0f66a8b543d6a664 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_NameDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 
-#ifndef WIN32
-using namespace std;
-#endif
-
 /*!
   Constructor
 */
index 7a6262d574229413110e0fa63381752ae3bbcf16..b4973f380169c5af71710d029402c92de5c52be3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_NameDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index 20c347ecde2c181213e720f6d20acf63970867b9..cb21adf4d74ac5fa198db0173772a67eab6afec2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_OBFilter.h"
 
 #include "LightApp_SelectionMgr.h" 
index 8788919f5745fa86d1cfe567a6b6f7cfb99f4d97..ae62bf264db98a624c856884383a85b42427a0ff 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_OBFILTER_H
 #define LIGHTAPP_OBFILTER_H
 
index ede0e004c088ba36e5e91609b5dddbe20326069c..0406793531fd3ab87cd55eac00c7cb1a4f77769b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_OBSelector.cxx
 // Author :
 //
@@ -130,8 +131,8 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
 #ifndef DISABLE_SALOMEOBJECT
         Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
           ( obj->entry().toLatin1().constData(),
-           obj->componentDataType().toLatin1().constData(),
-           obj->name().toLatin1().constData() );
+            obj->componentDataType().toLatin1().constData(),
+            obj->name().toLatin1().constData() );
         LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj  );
 #else
         LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
@@ -152,12 +153,12 @@ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
   if ( !myBrowser )
     return;
 
-  if( myEntries.count() == 0 ||        myModifiedTime < myBrowser->getModifiedTime() )
+  if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() )
     fillEntries( myEntries );
 
   DataObjectList objList;
   for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); 
-       it != theList.end(); ++it ) {
+        it != theList.end(); ++it ) {
     const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
     if ( owner && myEntries.contains( owner->entry() ) )
       objList.append( myEntries[owner->entry()] );
index 7426335656d0da67e8fb396641ebfa93193010e0..234bc7556f984d4d8665024f292161a7008cf3dd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : LightApp_OBSelector.h
 // Author :
 //
index 1ccbeecbc8af7822497891e7f87a691e3811f2ea..595ac88fe1103801351e7831e0feb4d2ff471b4b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_DataOwner.h"
 #include "LightApp_OCCSelector.h"
 
index d266c7f5045443dfe3ccd320b41359babfac2ada..52c6291217e34e72cb4e09439cfd57c17e9f213a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_OCCSELECTOR_H
 #define LIGHTAPP_OCCSELECTOR_H
 
@@ -66,7 +67,7 @@ protected:
   virtual void      setSelection( const SUIT_DataOwnerPtrList& );
 
 #ifndef DISABLE_OCCVIEWER
-  QString           entry( const Handle_AIS_InteractiveObject& ) const;
+  virtual QString   entry( const Handle_AIS_InteractiveObject& ) const;
 #endif
 
   SUIT_DataOwnerPtrList mySelectedExternals;
index a80d54bf736a3e3887b2cd7b25a3d3207fbfb7ba..03a87ac76f4402fe1820cf6fa2e5a24720f208e6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : LightApp_Operation.h
 //  Author : Sergey LITONIN
 //  Module : LightApp
index c48787502dfe65e8bf51242d03ad6f19ad0725e9..cc71d5916fd1952401a0a5050079b988d394dd60 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : LightApp_Operation.h
 //  Author : Sergey LITONIN
 //  Module : LIGHT
index 9efc836b0d9e76d7c69f9bdb671aa44550184465..20a91c23ec862bc717d11d94e26615c3f9d09cb9 100755 (executable)
@@ -1,38 +1,43 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_Plot2dSelector.h"
 
 #include "LightApp_DataOwner.h"
 #include "LightApp_DataObject.h"
 #include "LightApp_Application.h"
+#include "SUIT_SelectionMgr.h"
+
+#include <SPlot2d_ViewModel.h>
+
+#include <SALOME_ListIO.hxx>
 
 /*!
   Constructor
 */
-LightApp_Plot2dSelector::LightApp_Plot2dSelector( SPlot2d_Viewer* v, SUIT_SelectionMgr* mgr )
-: SUIT_Selector( mgr, v )
+LightApp_Plot2dSelector::LightApp_Plot2dSelector( Plot2d_Viewer* v, SUIT_SelectionMgr* mgr )
+  : SUIT_Selector( mgr, v ),
+    myViewer(v)
 {
   if ( v )
     connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) );
+    connect( v, SIGNAL( clearSelected() ), this, SLOT( onClearSelected( ) ) );
 }
 
 /*!
@@ -48,16 +53,27 @@ LightApp_Plot2dSelector::~LightApp_Plot2dSelector()
 void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
 {
   if( !myCurEntry.isNull() )
-    theList.append( new LightApp_DataOwner( myCurEntry ) );
+    theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) );
 }
 
 /*!Sets selection.*/
 void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
 {
-  /*  if( theList.count()>0 )
-    myCurEntry = theList.first()->getEntry();
-  else*/
-  myCurEntry = QString::null;
+  SALOME_ListIO anIOList;
+  for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it ) {
+    const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
+    if ( owner  ) {
+      if( !owner->IO().IsNull() ) {
+       anIOList.Append(owner->IO());
+      } else if ( !owner->entry().isEmpty() ) {
+       anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
+      }      
+    }
+  }
+  SPlot2d_Viewer* v = dynamic_cast<SPlot2d_Viewer*>(myViewer);
+
+  if(v)
+    v->setObjectsSelected(anIOList);
 }
 
 /*!On selection changed.*/
@@ -65,4 +81,11 @@ void LightApp_Plot2dSelector::onSelectionChanged( const QString& entry )
 {
   myCurEntry = entry;
   selectionChanged();
+  myCurEntry = QString();
+}
+
+/*!On clear selected.*/
+void LightApp_Plot2dSelector::onClearSelected( ) 
+{
+       selectionMgr()->clearSelected();
 }
index b9ba299a3d260b950f0ec603baf6b151d5698e0e..8b5af62aba1cd4d5ea7536029ecdbaa9d56de80a 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_PLOT2DSELECTOR_H
 #define LIGHTAPP_PLOT2DSELECTOR_H
 
@@ -26,7 +24,7 @@
 
 #include <SUIT_Selector.h>
 #include <SUIT_DataOwner.h>
-#include <SPlot2d_ViewModel.h>
+#include <Plot2d_ViewModel.h>
 
 class LightApp_DataObject;
 
@@ -39,7 +37,7 @@ class LIGHTAPP_EXPORT LightApp_Plot2dSelector : public QObject, public SUIT_Sele
   Q_OBJECT
 
 public:
-  LightApp_Plot2dSelector( SPlot2d_Viewer*, SUIT_SelectionMgr* );
+  LightApp_Plot2dSelector( Plot2d_Viewer*, SUIT_SelectionMgr* );
   virtual ~LightApp_Plot2dSelector();
 
   /*!Return "ObjectBrowser"*/
@@ -47,13 +45,15 @@ public:
 
 private slots:
   void         onSelectionChanged( const QString& );
+  void         onClearSelected();
 
 protected:
   virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
   virtual void setSelection( const SUIT_DataOwnerPtrList& );
 
 private:
-  QString myCurEntry;
+  QString             myCurEntry;
+  Plot2d_Viewer*      myViewer;
 };
 
 #endif
index c97e2d6de68d2cc5d5c35fb90ac11304bfdd8309..cf93a4004f74e6be640d3ff082d0b417baf43be8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_Preferences.cxx
 // Author:    Sergey TELKOV
 //
@@ -97,7 +98,7 @@ void LightApp_Preferences::onApply()
 void LightApp_Preferences::changedResources( const ResourceMap& map )
 {
   for ( ResourceMap::ConstIterator it = map.begin(); 
-       it != map.end(); ++it )
+        it != map.end(); ++it )
   {
     QString sec, param;
     it.key()->resource( sec, param );
index 8ab8fbd82a0c58c9dd5274e4d961329d316abe25..ae93bf3f7a91edeba0b7803aa7d0f193cbb027e4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_Preferences.h
 // Author:    Sergey TELKOV
 //
index 748d42b54bbf60b000aa6ca35d5fcdb7f3feedaa..f49b36d41da9c6ba47b77d08b55039b04577d67f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_PreferencesDlg.cxx
 // Author:    Sergey TELKOV
 //
@@ -132,16 +133,16 @@ void LightApp_PreferencesDlg::onApply()
 void LightApp_PreferencesDlg::onDefault()
 {
   if( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ),
-                                                       SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
-                                                       SUIT_MessageBox::Ok ) )
+                                                        SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
+                                                        SUIT_MessageBox::Ok ) )
     {
       if ( myPrefs && myPrefs->resourceMgr() )
-       {
+        {
           QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->workingMode();
-         myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
-         myPrefs->retrieve();
+          myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
+          myPrefs->retrieve();
           myPrefs->resourceMgr()->setWorkingMode( prev );
-       }
+        }
     }
 }
 
index 64299c97210927ed1ea2bee21ae784a4a941308e..2df94527faebedeb9ce032f3042262d8d418749f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      LightApp_PreferencesDlg.h
 // Author:    Sergey TELKOV
 //
index 09fab94d7b1f69f99ea10dbddd34eb319a0fafa1..9b3aab8c82ad0c271a107c25f1336da83f791c89 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_Selection.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_DataOwner.h"
@@ -34,6 +35,8 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_Selector.h"
 
+#include <QtCore/QSet>
+
 /*!
   Constructor
 */
@@ -54,12 +57,12 @@ LightApp_Selection::~LightApp_Selection()
 */
 void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr)
 {
-  myPopupClient = client;
-  
-  if( mgr )
-  {
-    if( mgr->application() )
+  myContext = client;
+
+  if ( mgr ) {
+    if ( mgr->application() )
       myStudy = dynamic_cast<LightApp_Study*>( mgr->application()->activeStudy() );
+
     if( !myStudy )
       return;
 
@@ -74,37 +77,47 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
     while ( it.hasNext() )
     {
       SUIT_Selector* selector = it.next();
-      if( selector->type() != client && selector->isEnabled() )
-      {
-       //mgr->selected( cur_sel, selector->type() );
+      if ( selector->type() != client && selector->isEnabled() ) {
         selector->selected( cur_sel );
-       SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(), aLLast = cur_sel.end();
-       for( ; aLIt!=aLLast; aLIt++ )
-         sel.append( *aLIt ); //check entry and don't append if such entry is in list already
+
+        for ( SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(); aLIt != cur_sel.end(); ++aLIt )
+          sel.append( *aLIt ); //check entry and don't append if such entry is in list already
       }
     }
 
     //3) to analyse owner and fill internal data structures
-    SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(), aLast = sel.end();
-    QMap<QString,int> entries;
-    QString entry;
-    int num=0;
-    for( ; anIt!=aLast; anIt++ )
+
+    int num = 0;
+    QSet<QString> entries;
+    myObjects.resize( sel.size() );
+    myObjects.fill( ObjectInfo() );
+    for ( SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(); anIt != sel.end(); anIt++ )
     {
       LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>( (*anIt ).get() );
-      if( sowner )
+      if ( sowner )
       {
-        entry = referencedToEntry( sowner->entry() );
-       if( entries.contains( entry ) )
-         continue;
-
-       entries.insert( entry, 0 );
-        myEntries.insert( num, entry );
-       myIsReferences.insert( num, sowner->entry() != entry );
-        processOwner( sowner );
-       num++;
+        QString entry = referencedToEntry( sowner->entry() );
+        if ( entries.contains( entry ) )
+          continue;
+
+        entries.insert( entry );
+
+       setObjectInfo( num, OI_Entry, entry );
+       setObjectInfo( num, OI_Reference, sowner->entry() != entry );
+
+        if ( processOwner( sowner ) )
+          num++;
+        else
+          entries.remove( entry );
       }
     }
+
+    myObjects.resize( num );
+    /*
+    myContextParams.clear();
+    myObjectsParams.resize( num );
+    myObjectsParams.fill( ParameterMap() );
+    */
   }
 }
 
@@ -118,96 +131,138 @@ QString LightApp_Selection::referencedToEntry( const QString& entry ) const
 */
 int LightApp_Selection::count() const
 {
-  return myEntries.count();
+  return myObjects.size();
 }
 
 /*!
-  Gets QVariant();
+  Gets global parameters.
 */
-QVariant LightApp_Selection::parameter( const int ind, const QString& p ) const
+/*
+QVariant LightApp_Selection::parameter( const QString& p ) const
 {
-  LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy ? myStudy->application() : 0 );
-  if( !( ind>=0 && ind<count() ) || !app )
-    return QVariant();
-
-  if( p=="isVisible" )
-  {
-    QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
-    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
-
-    bool vis = false;
-    if( d )
-      vis = d->IsDisplayed( myEntries[ ind ] );
-    else
-    {
-      LightApp_Displayer local_d;
-      vis = local_d.IsDisplayed( myEntries[ ind ] );
-    }
-    return QVariant( vis );
-  }
-
-  else if( p=="component" )
-  {
-    return myStudy->componentDataType( myEntries[ ind ] );
-  }
-  
-  else if( p=="isComponent" )
-  {
-    return QVariant( myStudy->isComponent( myEntries[ ind ] ) );
+  QVariant v;
+  if ( myContextParams.contains( p ) )
+    v = myContextParams[p];
+  else
+    v = contextParameter( p );
+    if ( !v.isValid() )
+      v = QtxPopupSelection::parameter( p );
+    LightApp_Selection* that = (LightApp_Selection*)this;
+    that->myContextParams.insert( p, v );
   }
+  return v;
+}
+*/
 
-  else if( p=="isReference" )
-    return QVariant( isReference( ind ) );
-
-  else if( p=="displayer" )
-    return parameter( ind, "component" );
-
-  else if( p=="canBeDisplayed" )
-  {
-    QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
-    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
-
-    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
+/*!
+  Gets the object parameter.
+*/
+ /*
+QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const
+{
+  QVariant v;
+  if ( 0 <= idx && idx < myObjectsParams.size() ) {
+    if ( myObjectsParams[idx].contains( p ) )
+      v = myObjectsParams[idx][p];
+    else {
+      v = objectParameter( idx, p );
+      LightApp_Selection* that = (LightApp_Selection*)this;
+      that->myObjectsParams[idx].insert( p, v );
+    }
   }
-
-  return QVariant();
+  return v;
 }
-
+ */
 /*!
   Gets global parameters. client, isActiveView, activeView etc.
 */
+  //QVariant LightApp_Selection::contextParameter( const QString& p ) const
 QVariant LightApp_Selection::parameter( const QString& p ) const
 {
-  if      ( p == "client" )        return QVariant( myPopupClient );
-  else if ( p == "activeModule" )
-  {
+  QVariant v;
+
+  if ( p == "client" )
+    v = myContext;
+  else if ( p == "activeModule" ) {
     LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy->application() );
     QString mod_name = app ? QString( app->activeModule()->name() ) : QString();
-    //cout << "activeModule : " << mod_name.latin1() << endl;
-    if( !mod_name.isEmpty() )
-      return mod_name;
-    else
-      return QVariant();
+    if ( !mod_name.isEmpty() )
+      v = mod_name;
+  }
+  else if ( p == "isActiveView" )
+    v = activeVW() != 0;
+  else if ( p == "activeView" )
+    v = activeViewType();
+  else
+    v = QtxPopupSelection::parameter( p );
+
+  return v;
+}
+
+/*!
+  Gets the object parameter.
+*/
+//QVariant LightApp_Selection::objectParameter( const int idx, const QString& p ) const
+QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const
+{
+  LightApp_Application* app = 0;
+  if ( myStudy )
+    app = dynamic_cast<LightApp_Application*>( myStudy->application() );
+
+  QVariant v;
+  if ( app ) {
+    QString e = entry( idx );
+    if ( !e.isEmpty() ) {
+      if ( p == "isVisible" ) {
+       QString mod_name = app->moduleTitle( myStudy->componentDataType( e ) );
+       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
+
+       bool vis = false;
+       if ( d )
+         vis = d->IsDisplayed( e );
+       else
+         vis = LightApp_Displayer().IsDisplayed( e );
+       v = vis;
+      }
+      else if ( p == "component" || p == "displayer" )
+       v = myStudy->componentDataType( e );
+      else if ( p == "isComponent" )
+       v = myStudy->isComponent( e );
+      else if ( p == "isReference" )
+       v = isReference( idx );
+      else if ( p == "canBeDisplayed" ) {
+       QString mod_name = app->moduleTitle( myStudy->componentDataType( e ) );
+       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
+
+       if ( d )
+         v = d->canBeDisplayed( e );
+       else if ( e.startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) ) // object is a Save Point object
+         v = false;
+       else
+         v = 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
+      }
+    }
   }
-  else if ( p == "isActiveView" )  return QVariant( (bool)activeVW() );
-  else if ( p == "activeView" )    return QVariant( activeViewType() );
-  else                             return QtxPopupSelection::parameter( p );
+
+  return v;
 }
 
 /*!
-  Do nothing. To be redefined by successors
+  Perform additional processing of the selected item (to be redefined by successors if necessary).
+  Returns \c true by default.
+  Note: if this method returns \c false, the item will be removed from the items list and
+  not taken into account when showing popup menu.
+
+  \param owner a data owner being processed
+  \return \c true if the owner should be collected and \c false otherwise
 */
-void LightApp_Selection::processOwner( const LightApp_DataOwner* )
+bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ )
 {
+  return true;
 }
 
 /*!
@@ -215,9 +270,8 @@ void LightApp_Selection::processOwner( const LightApp_DataOwner* )
 */
 QString LightApp_Selection::entry( const int index ) const
 {
-  if ( index >= 0 && index < count() )
-    return myEntries[ index ];
-  return QString();
+  QVariant v = objectInfo( index, OI_Entry );
+  return v.canConvert( QVariant::String ) ? v.toString() : QString();
 }
 
 /*!
@@ -225,10 +279,8 @@ QString LightApp_Selection::entry( const int index ) const
 */
 bool LightApp_Selection::isReference( const int index ) const
 {
-  if( index >= 0 && index < count() )
-    return myIsReferences[ index ];
-  else
-    return false;
+  QVariant v = objectInfo( index, OI_Reference );
+  return v.canConvert( QVariant::Bool ) ? v.toBool() : false;
 }
 
 /*!
@@ -255,9 +307,31 @@ SUIT_ViewWindow* LightApp_Selection::activeVW() const
     SUIT_Application* app = session->activeApplication();
     if ( app ) {
       SUIT_Desktop* desk = app->desktop();
-      if ( desk ) 
-       return desk->activeWindow();
+      if ( desk )
+        return desk->activeWindow();
     }
   }
   return 0;
 }
+
+/*!
+  Gets specified information about object with index idx.
+*/
+QVariant LightApp_Selection::objectInfo( const int idx, const int inf ) const
+{
+  QVariant res;
+  if ( 0 <= idx && idx < myObjects.size() ) {
+    if ( myObjects[idx].contains( inf ) )
+      res = myObjects[idx][inf];
+  }
+  return res;
+}
+
+/*!
+  Sets specified information about object with index idx.
+*/
+void LightApp_Selection::setObjectInfo( const int idx, const int inf, const QVariant& val )
+{
+  if ( 0 <= idx && idx < myObjects.size() )
+    myObjects[idx].insert( inf, val );
+}
index 4642a87935d363bf48dd5c44eb84cba25b591416..f1bf609bcd2dbc99abe71567014ada35b329ed9c 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  LightApp_Selection
 //  File   : LightApp_Selection.h
 //  Author : Alexander SOLOVYOV
-//  Module : GUI
-//  $Header$
-//
+
 #ifndef LIGHTAPP_SELECTION_HeaderFile
 #define LIGHTAPP_SELECTION_HeaderFile
 
@@ -45,32 +44,53 @@ class SUIT_ViewWindow;
 */
 class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
 {
+protected:
+  typedef enum { OI_Entry, OI_Reference, OI_User } ObjectInformation;
+
 public:
   LightApp_Selection();
   virtual ~LightApp_Selection();
 
-  virtual void                   init( const QString&, LightApp_SelectionMgr* );
-  virtual void                   processOwner( const LightApp_DataOwner* );
+  virtual void                    init( const QString&, LightApp_SelectionMgr* );
+  virtual bool                    processOwner( const LightApp_DataOwner* );
 
-  virtual int                    count() const;
-  virtual QVariant               parameter( const int, const QString& ) const;
-  virtual QVariant               parameter( const QString& ) const;
-  void                           setModuleName( const QString );
+  virtual int                     count() const;
+  virtual QVariant                parameter( const QString& ) const;
+  virtual QVariant                parameter( const int, const QString& ) const;
+  void                            setModuleName( const QString );
 
 protected:
-  QString                        entry( const int ) const;
-  bool                           isReference( const int ) const;
+  //  virtual QVariant                contextParameter( const QString& ) const;
+  //  virtual QVariant                objectParameter( const int, const QString& ) const;
+
+  QString                         entry( const int ) const;
+  bool                            isReference( const int ) const;
+
   /*!Gets study.*/
-  LightApp_Study*                study() const { return myStudy; }
-  QString                        activeViewType() const;
-  SUIT_ViewWindow*               activeVW() const;
-  virtual QString                referencedToEntry( const QString& ) const;
+  LightApp_Study*                 study() const { return myStudy; }
+  QString                         activeViewType() const;
+  SUIT_ViewWindow*                activeVW() const;
+  virtual QString                 referencedToEntry( const QString& ) const;
 
+  QVariant                        objectInfo( const int, const int ) const;
+  void                            setObjectInfo( const int, const int, const QVariant& );
+
+private:
+  typedef QMap<int, QVariant>     ObjectInfo;
+  typedef QVector<ObjectInfo>     ObjectInfoVector;
+  /*
+  typedef QMap<QString, QVariant> ParameterMap;
+  typedef QVector<ParameterMap>   ObjectParamVector;
+  */
 private:
-  QString                        myPopupClient;
-  QMap<int,QString>              myEntries; // entries of selected objects
-  QMap<int,bool>                 myIsReferences; // whether i-th selected object was a reference
-  LightApp_Study*                myStudy;
+  LightApp_Study*                 myStudy;
+  QString                         myContext;
+  ObjectInfoVector                myObjects;
+  /*
+  ParameterMap                    myContextParams;
+  ObjectParamVector               myObjectsParams;
+  */
 };
 
 #endif
index 1c389db587140e717e61193094b40908e9a6ca5c..23e2c63528bcae74dc8deae9a40a7b0da3e3a023 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_SelectionMgr.h"
 
 #include "LightApp_Study.h"
@@ -27,6 +28,7 @@
 #include "LightApp_Application.h"
 
 #include <SUIT_Session.h>
+#include <SUIT_Selector.h>
 
 #ifndef DISABLE_SALOMEOBJECT
   #include <SALOME_ListIO.hxx>
   #include <TCollection_AsciiString.hxx>
 #endif
 
+#include <QtCore/QSet>
+
 /*!
   Constructor.
 */
 LightApp_SelectionMgr::LightApp_SelectionMgr( LightApp_Application* app, const bool fb )
 : SUIT_SelectionMgr( fb ),
-myApp( app )
+  myApp( app ),
+  myTimeStamp( QTime::currentTime() ),
+  myCacheState( false )
 {
 }
 
@@ -63,6 +69,13 @@ LightApp_Application* LightApp_SelectionMgr::application() const
   return myApp;
 }
 
+void LightApp_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append )
+{
+  SUIT_SelectionMgr::setSelected( lst, append );
+
+  myTimeStamp = QTime::currentTime();
+}
+
 #ifndef DISABLE_SALOMEOBJECT
 /*!
   Get all selected objects from selection manager
@@ -70,47 +83,78 @@ LightApp_Application* LightApp_SelectionMgr::application() const
 void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QString& theType,
                                              const bool convertReferences ) const
 {
+  LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
+  if ( !study )
+    return;
+  
   theList.Clear();
 
-  SUIT_DataOwnerPtrList aList;
-  selected( aList, theType );
+  QList<Handle(SALOME_InteractiveObject)> selList;
 
-  QMap<QString,int> entryMap;
+  if ( isActualSelectionCache( theType ) ) {
+    selList = selectionCache( theType );
+  }
+  else {
+    QStringList types;
+    if ( !theType.isEmpty() )
+      types.append( theType );
+    else
+      types = selectorTypes();
+
+    QSet<QString> aSet;
+    for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+      SUIT_DataOwnerPtrList aList;
+      selected( aList, *it );
+
+      QList<Handle(SALOME_InteractiveObject)> typeSelList;
+
+      for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) {
+       const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+       if ( !owner )
+         continue;
+
+       if ( !aSet.contains( owner->entry() ) ) {
+         selList.append( owner->IO() );
+         aSet.insert( owner->entry() );
+       }
 
-  QString entry, checkEntry;
-  for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
-  {
-    const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
-    if( !owner )
-      continue;
+       typeSelList.append( owner->IO() );
+      }
 
-    LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
-    if ( !study )
-      return;
+      if ( isSelectionCacheEnabled() ) {
+       LightApp_SelectionMgr* that = (LightApp_SelectionMgr*)this;
+       that->myCacheSelection.insert( *it, typeSelList );
+       that->myCacheTimes.insert( *it, QTime::currentTime() );
+      }
+    }
+  }
 
-    entry = owner->entry();
+  QSet<QString> entrySet;
+  for ( QList<Handle(SALOME_InteractiveObject)>::const_iterator itr = selList.begin(); itr != selList.end(); ++itr )
+  {
+    Handle(SALOME_InteractiveObject) io = *itr;
+    QString entry( io->getEntry() );
     // Entry to check object uniqueness.
     // It is selected owner entry in the case, when we do not convert references,
     // and entry of a real object, when we convert references.
-    checkEntry = entry;
     if ( convertReferences ) {
       QString refEntry = study->referencedToEntry( entry );
-      checkEntry = refEntry;
-      if ( !entryMap.contains( checkEntry ) ) {
+      if ( !entrySet.contains( refEntry ) ) {
         if ( refEntry != entry ) {
-          QString component = study->componentDataType( refEntry );
-          theList.Append( new SALOME_InteractiveObject( refEntry.toLatin1().constData(), component.toLatin1().constData(), ""/*refobj->Name().c_str()*/ ) );
+         entry = refEntry;
+          QString component = study->componentDataType( entry );
+          theList.Append( new SALOME_InteractiveObject( (const char*)entry.toLatin1(),
+                                                       (const char*)component.toLatin1(),
+                                                       ""/*refobj->Name().c_str()*/ ) );
         }
-        else if( !owner->IO().IsNull() )
-          theList.Append( owner->IO() );
+        else if ( !io.IsNull() )
+          theList.Append( io );
       }
     }
-    else {
-      if( !entryMap.contains( entry ) && !owner->IO().IsNull() )
-       theList.Append( owner->IO() );
-    }
+    else if ( !entrySet.contains( entry ) && !io.IsNull() )
+      theList.Append( io );
 
-    entryMap.insert(checkEntry, 1);
+    entrySet.insert( entry );
   }
 }
 
@@ -136,26 +180,52 @@ void LightApp_SelectionMgr::setSelectedObjects( const SALOME_ListIO& lst, const
 void LightApp_SelectionMgr::selectedObjects( QStringList& theList, const QString& theType,
                                              const bool convertReferences ) const
 {
+  LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
+  if ( !study )
+    return;
+
   theList.clear();
 
-  SUIT_DataOwnerPtrList aList;
-  selected( aList, theType );
+  QStringList selList;
 
-  QString entry;
-  for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
-  {
-    const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
-    if( !owner )
-      continue;
+  if ( isActualSelectionCache( theType ) )
+    selList = selectionCache( theType );
+  else {
+    QStringList types;
+    if ( !theType.isEmpty() )
+      types.append( theType );
+    else
+      types = selectorTypes();
+
+    QSet<QString> aSet;
+    for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+      SUIT_DataOwnerPtrList aList;
+      selected( aList, *it );
 
-    LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
-    if ( !study )
-      return;
+      QStringList typeSelList;
+
+      for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) {
+       const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+       if ( !owner )
+         continue;
+
+       if ( !aSet.contains( owner->entry() ) ) {
+         selList.append( owner->entry() );
+         aSet.insert( owner->entry() );
+       }
 
-    entry = owner->entry();
-    if( !theList.contains( entry ) )
-      theList.append( entry );
+       typeSelList.append( owner->entry() );
+      }
+
+      if ( isSelectionCacheEnabled() ) {
+       LightApp_SelectionMgr* that = (LightApp_SelectionMgr*)this;
+       that->myCacheSelection.insert( *it, typeSelList );
+       that->myCacheTimes.insert( *it, QTime::currentTime() );
+      }
+    }
   }
+
+  theList = selList;
 }
 
 #endif
@@ -167,6 +237,8 @@ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel )
 {
   SUIT_SelectionMgr::selectionChanged( theSel );
 
+  myTimeStamp = QTime::currentTime();
+
   emit currentSelectionChanged();
 }
 
@@ -175,7 +247,7 @@ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel )
 /*!
   get map of indexes for the given SALOME_InteractiveObject
 */
-void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, 
+void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
                                         TColStd_IndexedMapOfInteger& theIndex)
 {
   theIndex.Clear();
@@ -185,12 +257,10 @@ void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)&
 
   for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
   {
-    const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
-    if ( subOwner )
-      if ( subOwner->entry() == QString(IObject->getEntry()) )
-       theIndex.Add( subOwner->index() );
+    LightApp_DataSubOwner* subOwner = dynamic_cast<LightApp_DataSubOwner*>( (*itr).operator->() );
+    if ( subOwner && subOwner->entry() == QString(IObject->getEntry()) )
+      theIndex.Add( subOwner->index() );
   }
-  
 }
 
 /*!
@@ -208,7 +278,7 @@ void LightApp_SelectionMgr::GetIndexes( const QString& theEntry, TColStd_Indexed
     const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
     if ( subOwner )
       if ( subOwner->entry() == theEntry )
-       theIndex.Add( subOwner->index() );
+        theIndex.Add( subOwner->index() );
   }
 
 }
@@ -222,26 +292,26 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
                                               bool modeShift)
 {
   SUIT_DataOwnerPtrList remainsOwners;
-  
+
   SUIT_DataOwnerPtrList aList;
   selected( aList );
-  
+
   QString ioEntry (IObject->getEntry());
-  
+
   if ( !modeShift ) {
     for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
     {
       const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
       if ( owner )
       {
-       if ( owner->entry() != ioEntry )
-       {
-         const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( owner );
-         if ( subOwner )
-           remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) );
-         else
-           remainsOwners.append( new LightApp_DataOwner( owner->entry() ) );
-       }
+        if ( owner->entry() != ioEntry )
+        {
+          const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( owner );
+          if ( subOwner )
+            remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) );
+          else
+            remainsOwners.append( new LightApp_DataOwner( owner->entry() ) );
+        }
       }
     }
   }
@@ -252,7 +322,7 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
   It.Initialize(theIndexes);
   for(;It.More();It.Next())
     remainsOwners.append( new LightApp_DataSubOwner( ioEntry, It.Key() ) );
-  
+
   bool append = false;
   setSelected( remainsOwners, append );
 
@@ -267,8 +337,8 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
 /*!
   select 'subobjects' with given indexes
 */
-void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject, 
-                                           TColStd_IndexedMapOfInteger theIndex, bool append )
+void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
+                                            TColStd_IndexedMapOfInteger theIndex, bool append )
 {
   SUIT_DataOwnerPtrList aList;
 
@@ -278,11 +348,10 @@ void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject
     {
       int i;
       for ( i = 1; i <= theIndex.Extent(); i++ )
-       aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) );
+        aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) );
     }
 
   setSelected( aList, append );
-
 }
 
 /*!
@@ -293,20 +362,19 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap
   SUIT_DataOwnerPtrList aList;
 
   MapIOOfMapOfInteger::Iterator it(theMapIO);
-  for ( ; it.More(); it.Next() ) 
+  for ( ; it.More(); it.Next() )
     {
       if ( it.Value().IsEmpty() )
-       aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
+        aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
       else
-       {
-         int i;
-         for ( i = 1; i <= it.Value().Extent(); i++ )
-           aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
-       }
+        {
+          int i;
+          for ( i = 1; i <= it.Value().Extent(); i++ )
+            aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
+        }
     }
-  
-  setSelected( aList, append );
 
+  setSelected( aList, append );
 }
 
 /*!
@@ -325,16 +393,16 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
   {
     const LightApp_DataSubOwner* subOwner =
       dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
-    if ( subOwner ) 
+    if ( subOwner )
     {
-#ifndef WNT
+//#ifndef WNT
       if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) )
-#else
-      if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
-#endif
+//#else
+//      if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
+//#endif
       {
-       anIndexes.Clear();
-       //Bug 17269: GetIndexes( subOwner->entry(), anIndexes );
+        anIndexes.Clear();
+        //Bug 17269: GetIndexes( subOwner->entry(), anIndexes );
         //Bug 17269: To avoid multiple calling of selected(aList)
         for ( SUIT_DataOwnerPtrList::const_iterator itr2 = itr; itr2 != aList.end(); ++itr2 )
         {
@@ -345,10 +413,116 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
               anIndexes.Add( subOwner2->index() );
         }
         //
-       theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
+        theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
       }
     }
   }
 }
 
 #endif
+
+void LightApp_SelectionMgr::clearSelectionCache()
+{
+  myCacheTimes.clear();
+  myCacheSelection.clear();
+}
+
+bool LightApp_SelectionMgr::isSelectionCacheEnabled() const
+{
+  return myCacheState;
+}
+
+void LightApp_SelectionMgr::setSelectionCacheEnabled( bool on )
+{
+  if ( myCacheState == on )
+    return;
+
+  myCacheState = on;
+
+  if ( !myCacheState )
+    clearSelectionCache();
+}
+
+#ifndef DISABLE_SALOMEOBJECT
+
+QList<Handle_SALOME_InteractiveObject> LightApp_SelectionMgr::selectionCache( const QString& type ) const
+{
+  QList<Handle_SALOME_InteractiveObject> res;
+
+  QStringList types;
+  if ( !type.isEmpty() )
+    types.append( type );
+  else
+    types = selectorTypes();
+
+  QSet<QString> set;
+  for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+    if ( myCacheSelection.contains( *it ) ) {
+      const SelList& lst = myCacheSelection[*it];
+      for ( SelList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr ) {
+       if ( !(*itr).IsNull() && !set.contains( (*itr)->getEntry() ) ) {
+         res.append( *itr );
+         set.insert( (*itr)->getEntry() );
+       }
+      }
+    }
+  }
+  return res;
+}
+
+#else
+
+QStringList LightApp_SelectionMgr::selectionCache( const QString& type ) const
+{
+  QStringList res;
+
+  QStringList types;
+  if ( !type.isEmpty() )
+    types.append( type );
+  else
+    types = selectorTypes();
+
+  QSet<QString> set;
+  for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+    if ( myCacheSelection.contains( *it ) ) {
+      const SelList& lst = myCacheSelection[*it];
+      for ( SelList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr ) {
+       if ( !set.contains( *itr ) ) {
+         res.append( *itr );
+         set.insert( *itr );
+       }
+      }
+    }
+  }
+  return res;
+}
+
+#endif
+
+bool LightApp_SelectionMgr::isActualSelectionCache( const QString& type ) const
+{
+  bool ok = true;
+
+  QStringList types;
+  if ( !type.isEmpty() )
+    types.append( type );
+  else
+    types = selectorTypes();
+
+  for ( QStringList::iterator it = types.begin(); it != types.end() && ok; ++it )
+    ok = myCacheTimes.contains( *it ) && myCacheTimes[*it].isValid() && myCacheTimes[*it] >= myTimeStamp;
+
+  return ok;
+}
+
+QStringList LightApp_SelectionMgr::selectorTypes() const
+{
+  QStringList types;
+  QList<SUIT_Selector*> selectorList;
+  selectors( selectorList );
+  for ( QList<SUIT_Selector*>::const_iterator it = selectorList.begin(); it != selectorList.end(); ++it ) {
+    if ( (*it)->isEnabled() )
+      types.append( (*it)->type() );
+  }
+  return types;
+}
index 57a4efbe79654d96932fe80f6171d543f9b44cab..57d9a5e617a14a4bf14947d2ec89c9e7e7f403ac 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_SELECTIONMGR_H
 #define LIGHTAPP_SELECTIONMGR_H
 
@@ -26,6 +27,8 @@
 
 #include <SUIT_SelectionMgr.h>
 
+#include <QtCore/QTime>
+
 #ifndef DISABLE_SALOMEOBJECT
   #include <SALOME_InteractiveObject.hxx>
   #include <QMap>
@@ -55,6 +58,8 @@ public:
 
   LightApp_Application* application() const;
 
+  virtual void           setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
+
 #ifndef DISABLE_SALOMEOBJECT
   typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
   typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
@@ -63,17 +68,17 @@ public:
   void                   setSelectedObjects( const SALOME_ListIO&, const bool = false );
 
   void                   GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, 
-                                    TColStd_IndexedMapOfInteger& theIndex );
+                                     TColStd_IndexedMapOfInteger& theIndex );
   void                   GetIndexes( const QString& theEntry, 
-                                    TColStd_IndexedMapOfInteger& theIndex );
+                                     TColStd_IndexedMapOfInteger& theIndex );
 
   //bool                   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, 
   void                   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, 
-                                          const TColStd_MapOfInteger& theIndices, 
-                                          bool modeShift );
+                                           const TColStd_MapOfInteger& theIndices, 
+                                           bool modeShift );
 
   void                   selectObjects( const Handle(SALOME_InteractiveObject)& IObject, 
-                                       TColStd_IndexedMapOfInteger theIndex, bool append );
+                                        TColStd_IndexedMapOfInteger theIndex, bool append );
   void                   selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
 
   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
@@ -81,14 +86,43 @@ public:
   void                   selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
 #endif
 
+  void                   clearSelectionCache();
+  bool                   isSelectionCacheEnabled() const;
+  void                   setSelectionCacheEnabled( bool );
+
 signals:
   void                   currentSelectionChanged();
 
 private:
   virtual void           selectionChanged( SUIT_Selector* );
 
+#ifndef DISABLE_SALOMEOBJECT
+  QList<Handle_SALOME_InteractiveObject> selectionCache( const QString& = QString() ) const;
+#else
+  QStringList                            selectionCache( const QString& = QString() ) const;
+#endif
+  bool                   isActualSelectionCache( const QString& = QString() ) const;
+
+  QStringList            selectorTypes() const;
+
+private:
+#ifndef DISABLE_SALOMEOBJECT
+  typedef Handle_SALOME_InteractiveObject SelObject;
+#else
+  typedef QString                         SelObject;
+#endif
+  typedef QList<SelObject>             SelList;
+  typedef QMap<QString, QTime>         TimeMap;
+  typedef QMap<QString, SelList>       CacheMap;
+
 private:
   LightApp_Application* myApp;
+
+  QTime                 myTimeStamp;
+
+  bool                  myCacheState;
+  TimeMap               myCacheTimes;
+  CacheMap              myCacheSelection;
 };
 
 #endif
index e6cefd5c01bc2c85172685669a80a40091634b05..ba427c713f403b4ae04559a6130d3936212f49e9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_ShowHideOp.h"
 #include "LightApp_Application.h"
 #include "LightApp_Module.h"
@@ -104,7 +105,7 @@ void LightApp_ShowHideOp::startOperation()
     {
       LightApp_Displayer* disp = LightApp_Displayer::FindDisplayer( app->moduleTitle( *anIt ), true );
       if( disp )
-       disp->EraseAll( false, false, 0 );
+        disp->EraseAll( false, false, 0 );
     }
     if( myActionType==ERASE_ALL )
     {
@@ -142,14 +143,20 @@ void LightApp_ShowHideOp::startOperation()
         entries.append( entry );
     }
 
-  for( QStringList::const_iterator it = entries.begin(), last = entries.end(); it!=last; it++ )
-  {
-    QString e = study->referencedToEntry( *it );
-    if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY )
-      d->Display( e, false, 0 );
-    else if( myActionType==ERASE )
-      d->Erase( e, false, false, 0 );
+  // be sure to use real obejct entries
+  QStringList objEntries;
+  QStringList::const_iterator it = entries.begin(), last = entries.end();
+  for ( ; it!=last; ++it )
+    objEntries.append( study->referencedToEntry( *it ) ); 
+  
+  if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY ) {
+    d->Display( objEntries, false, 0 );
+    mgr->setSelectedObjects(selObjs);
+  }
+  else if( myActionType==ERASE ) {
+    d->Erase( objEntries, false, false, 0 );
   }
+  
   d->UpdateViewer();
   commit();
 }
index 3e4958115628216232a0cee0997ac43e050cc80b..ed0f0904faab8e888d044fe64dde7a2629a76c1f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
 #define LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
 
index e0356bcf83becda5914da2d56ad362c1ce6b092d..2119ebc658bd8a955a19d28d0634070c7c5dfda8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_Study.h"
 
 #include "CAM_DataModel.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_DataObjectIterator.h"
+#include "SUIT_DataBrowser.h"
+#include "SUIT_TreeModel.h"
 
 #include <set>
-#include <QString>
 
 /*!
   Constructor.
@@ -446,6 +448,44 @@ void LightApp_Study::RemoveTemporaryFiles (const char* theModuleName, const bool
   myDriver->RemoveTemporaryFiles(theModuleName, isDirDeleted);
 }
 
+/*!
+  Virtual method that creates the root object (module object) for the given data model.
+  The type of the created object depends on the study class, therefore data model classes
+  should not create their module objects directly and should instead use 
+  LightApp_DataModel::createModuleObject() that in its turn relies on this method.
+
+  \param theDataModel - data model instance to create a module object for
+  \param theParent - the module object's parent (normally it's the study root)
+  \return the module object instance
+  \sa LightApp_DataModel class, SalomeApp_Study class, LightApp_ModuleObject class
+*/
+CAM_ModuleObject* LightApp_Study::createModuleObject( LightApp_DataModel* theDataModel, 
+                                                     SUIT_DataObject* theParent ) const
+{
+  // Calling addComponent() for symmetry with SalomeApp_Study
+  // Currently it has empty implementation, but maybe in the future things will change...
+  LightApp_Study* that = const_cast<LightApp_Study*>( this );
+  that->addComponent( theDataModel );
+
+  // Avoid creating multiple module objects for the same module
+  CAM_ModuleObject* res = 0;
+
+  DataObjectList children = root()->children();
+  DataObjectList::const_iterator anIt = children.begin(), aLast = children.end();
+  for( ; !res && anIt!=aLast; anIt++ )
+  {
+    LightApp_ModuleObject* obj = dynamic_cast<LightApp_ModuleObject*>( *anIt );
+    if ( obj && obj->name() == theDataModel->module()->moduleName() )
+      res = obj;
+  }
+
+  if ( !res ){
+    res = new LightApp_ModuleObject( theDataModel, theParent );
+  }
+
+  return res;
+}
+
 /*!
   Fills list with components names
   \param comp - list to be filled
@@ -457,7 +497,264 @@ void LightApp_Study::components( QStringList& comp ) const
   for( ; anIt!=aLast; anIt++ )
   {
     LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( *anIt );
-    if( obj && obj->entry()!="Interface Applicative" )
+    if ( obj && obj->entry() != getVisualComponentName() )
       comp.append( obj->entry() );
   }
 }
+
+/*!
+  Get the entry for the given module
+  \param comp - list to be filled
+  \return module root's entry
+*/
+QString LightApp_Study::centry( const QString& comp ) const
+{
+  QString e;
+  ModelList dmlist;
+  dataModels( dmlist );
+  QListIterator<CAM_DataModel*> it( dmlist );
+  while ( it.hasNext() && e.isEmpty() ) {
+    CAM_DataModel* dm = it.next();
+    if ( dm->module() && dm->module()->name() == comp ) {
+      LightApp_DataObject* r = dynamic_cast<LightApp_DataObject*>( dm->root() );
+      if ( r ) e = r->entry();
+    }
+  }
+  return e;
+}
+
+/*!
+  \return a name of the component where visual parameters are stored
+*/
+QString LightApp_Study::getVisualComponentName() const
+{
+  return "Interface Applicative";
+}
+
+
+
+
+
+/*!
+  Set a visual property of the object
+  \param theViewId - Id of the viewer namager
+  \param theEntry - Entry of the object
+  \param thePropName - the name of the visual property
+  \param theValue - the value of the visual property
+*/
+void LightApp_Study::setObjectProperty(int theViewId, QString theEntry, QString thePropName, QVariant theValue) {
+  
+  //Try to find viewer manager in the map
+  ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewId);
+  if(v_it == myViewMgrMap.end()) {
+
+    //1) Create property map
+    PropMap aPropMap;
+    aPropMap.insert(thePropName, theValue);
+    
+    //2) Create object map
+    ObjMap anObjMap;
+    anObjMap.insert(theEntry,aPropMap);
+
+    //3) Insert in the view manager map
+    myViewMgrMap.insert(theViewId, anObjMap);
+    
+  } else {
+    ObjMap& anObjMap = v_it.value();
+    ObjMap::Iterator o_it = anObjMap.find(theEntry);
+    if(o_it == anObjMap.end()) {
+      //1) Create property map
+      PropMap aPropMap;
+      aPropMap.insert(thePropName, theValue);
+      
+      //2) Insert in the object map
+      anObjMap.insert(theEntry, aPropMap);
+    } else {
+      PropMap& aPropMap = o_it.value();
+      aPropMap.insert(thePropName, theValue);
+    }
+  }
+}
+
+/*!
+  Get a visual property of the object identified by theViewMgrId, theEntry and thePropName.
+  \param theViewMgrId - Id of the viewer manager.
+  \param theEntry - Entry of the object.
+  \param thePropName - the name of the visual property.
+  \param theDefValue - the default value of the visual property.
+  \return value of the visual propetry. If value is't found then return theDefValue.
+*/
+QVariant LightApp_Study::getObjectProperty(int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue) const {
+  QVariant& aResult = theDefValue;
+  ViewMgrMap::ConstIterator v_it = myViewMgrMap.find(theViewMgrId);
+  if(v_it != myViewMgrMap.end()){
+    const ObjMap& anObjectMap = v_it.value();
+    ObjMap::ConstIterator o_it = anObjectMap.find(theEntry);
+    if(o_it != anObjectMap.end()) {
+      const PropMap& aPropMap = o_it.value();
+      PropMap::ConstIterator p_it = aPropMap.find(thePropName);
+      if(p_it != aPropMap.end()) {
+       aResult = p_it.value();
+      }
+    }
+  }
+  return aResult;
+}
+
+/*!
+  Remove view manager with all objects.
+  \param theViewMgrId - Id of the viewer manager.
+*/
+void LightApp_Study::removeViewMgr( int theViewMgrId ) { 
+  myViewMgrMap.remove(theViewMgrId);
+}
+
+
+/*!
+  Get a map of the properties of the object identified by theViewMgrId and theEntry.
+  \param theViewMgrId - Id of the viewer manager.
+  \param theEntry - Entry of the object.
+  \return a map of the properties of the object.
+*/
+const PropMap& LightApp_Study::getObjectPropMap(int theViewMgrId, QString theEntry) {
+  ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+  if (v_it != myViewMgrMap.end()) {
+    ObjMap& anObjectMap = v_it.value();
+    ObjMap::Iterator o_it = anObjectMap.find(theEntry);
+    if(o_it != anObjectMap.end()) {
+      return o_it.value();
+    } else {
+      PropMap aPropMap;
+      anObjectMap.insert(theEntry, aPropMap);
+      return anObjectMap.find(theEntry).value();
+    }
+  } else {
+    PropMap aPropMap;
+    ObjMap anObjMap;
+    anObjMap.insert(theEntry,aPropMap);
+    myViewMgrMap.insert(theViewMgrId, anObjMap);
+
+    ObjMap& anObjectMap = myViewMgrMap.find(theViewMgrId).value();
+    return anObjectMap.find(theEntry).value();
+  }
+}
+
+/*!
+  Set a map of the properties of the object identified by theViewMgrId and theEntry.
+  \param theViewMgrId - Id of the viewer manager.
+  \param theEntry - Entry of the object.
+*/
+void LightApp_Study::setObjectPropMap(int theViewMgrId, QString theEntry, PropMap thePropMap) {
+  //Try to find viewer manager in the map
+  ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+  if(v_it == myViewMgrMap.end()) {
+    
+    //1) Create object map
+    ObjMap anObjMap;
+    anObjMap.insert(theEntry,thePropMap);
+
+    //3) Insert in the view manager map
+    myViewMgrMap.insert(theViewMgrId, anObjMap);
+  } else {
+    ObjMap& anObjMap = v_it.value();
+    anObjMap.insert(theEntry,thePropMap);
+  }
+}
+
+/*!
+   Remove object's properties from all view managers.
+  \param theEntry - Entry of the object.
+*/
+void LightApp_Study::removeObjectFromAll( QString theEntry ) {
+  ViewMgrMap::Iterator v_it = myViewMgrMap.begin();
+  for( ;v_it != myViewMgrMap.end(); v_it++ ) {
+    v_it.value().remove(theEntry);
+  }
+}
+
+/*!
+  Get all objects and it's properties from view manager identified by theViewMgrId.
+  \param theEntry - Entry of the object.
+*/
+const ObjMap& LightApp_Study::getObjectMap ( int theViewMgrId ) {
+  ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+  if( v_it == myViewMgrMap.end() ) {
+    ObjMap anObjMap;
+    myViewMgrMap.insert(theViewMgrId , anObjMap);
+    return myViewMgrMap.find(theViewMgrId).value();
+  }
+  return v_it.value();
+}
+
+/*!
+  Set 'visibility state' property of the object.
+  \param theEntry - Entry of the object.
+  \param theState - visibility status
+*/
+void LightApp_Study::setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState) {
+  LightApp_Application* app = (LightApp_Application*)application();
+  if(!app)
+    return;
+  SUIT_DataBrowser* db = app->objectBrowser();
+  if(!db)
+    return;
+
+  SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+  
+  if(treeModel)
+    treeModel->setVisibilityState(theEntry,theState);
+}
+
+/*!
+  Set 'visibility state' property for all object.
+  \param theEntry - Entry of the object.
+*/
+void LightApp_Study::setVisibilityStateForAll(Qtx::VisibilityState theState) {
+  
+  LightApp_Application* app = (LightApp_Application*)application();
+  if(!app)
+    return;
+  SUIT_DataBrowser* db = app->objectBrowser();
+  if(!db)
+    return;
+
+  SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+  
+  if(treeModel)
+    treeModel->setVisibilityStateForAll(theState);
+}
+
+/*!
+  Get 'visibility state' property of the object.
+  \param theEntry - Entry of the object.
+  \return 'visibility state' property of the object.
+*/
+Qtx::VisibilityState LightApp_Study::visibilityState(const QString& theEntry) const {
+  LightApp_Application* app = (LightApp_Application*)application();
+  if(app) {
+    
+    SUIT_DataBrowser* db = app->objectBrowser();
+    if(db) {
+      SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+      if(treeModel)
+       return treeModel->visibilityState(theEntry);
+    }
+  }
+  return Qtx::UnpresentableState;
+}
+
+/*!
+  Find a data object by the specified entry.
+  \param theEntry - Entry of the object.
+  \return data object.
+*/
+LightApp_DataObject* LightApp_Study::findObjectByEntry( const QString& theEntry )
+{
+  LightApp_DataObject* aCurObj;
+  for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
+    aCurObj = dynamic_cast<LightApp_DataObject*>( it.current() );
+    if ( aCurObj && aCurObj->entry() == theEntry )
+      return aCurObj;
+  }
+  return NULL;
+}
index d47e7c0549a93db1274ce95b5ee0a529b2dda1b7..b30ee6919b521366ae22e75fc58f4d0171ed9715 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_STUDY_H
 #define LIGHTAPP_STUDY_H
 
 
 #include "string"
 #include "vector"
+#include <Qtx.h>
+
+#include <QMap>
+#include <QVariant>
 
 class SUIT_Study;
 class SUIT_Application;
 class CAM_DataModel;
+class CAM_ModuleObject;
+class LightApp_DataObject;
+class LightApp_DataModel;
+
+//Map to store visual property of the object.
+//Key:   Name of the visual property of the object.
+//Value: value of the visual property.
+typedef QMap<QString, QVariant> PropMap;
+
+//Map to store objects with it's visual properties.
+//Key:   Entry of the object.
+//Value: Map of the visual properties of the object.
+typedef QMap<QString, PropMap> ObjMap;
+
+//Map to store view managers and all objects which displayed in views of the view managers.
+//Key:   Id of the viewer.
+//Value: Map of the objects with it's visual properties.
+typedef QMap<int, ObjMap> ViewMgrMap;
+
 
 /*!
   Custom study, using for open/close of documents HDF format.
@@ -68,6 +92,24 @@ public:
   virtual bool        isComponent( const QString& ) const;
   virtual void        children( const QString&, QStringList& ) const;
   virtual void        components( QStringList& ) const;
+  virtual QString     centry( const QString& ) const;
+
+  virtual QString     getVisualComponentName() const;
+
+  virtual void              setObjectProperty  ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theValue );
+  virtual QVariant          getObjectProperty  ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue ) const;
+  virtual void              removeViewMgr      ( int theViewMgrId );
+  virtual void              setObjectPropMap   ( int theViewMgrId, QString theEntry, PropMap thePropMap );
+  virtual const PropMap&    getObjectPropMap   ( int theViewMgrId, QString theEntry ) ;
+  virtual void              removeObjectFromAll( QString theEntry );
+  virtual const ObjMap&     getObjectMap       ( int theViewMgrId );
+  virtual const ViewMgrMap& getViewMgrMap      ( int theViewMgrId ) { return myViewMgrMap; };
+
+  virtual void                  setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState);
+  virtual Qtx::VisibilityState  visibilityState(const QString& theEntry) const;
+  virtual void                  setVisibilityStateForAll(Qtx::VisibilityState theState);
+
+  virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
 
 protected:
   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
@@ -83,6 +125,8 @@ protected:
 
 protected:
   virtual bool        openDataModel  ( const QString&, CAM_DataModel* );
+  virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, 
+                                               SUIT_DataObject* theParent ) const;
 
 signals:
   void                saved  ( SUIT_Study* );
@@ -93,8 +137,10 @@ signals:
 
 private:
   LightApp_Driver*    myDriver;
+  ViewMgrMap          myViewMgrMap;
 
   friend class LightApp_Application;
+  friend class LightApp_DataModel;
 };
 
 #endif 
index 69fcb3282fb62ec5b1b8439d50c6ca5d324f64a8..065e3d2f23956787ec3f9f095e8d5c68b7670545 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_SwitchOp.h"
 #include "LightApp_Module.h"
 #include "LightApp_Operation.h"
@@ -102,7 +103,7 @@ LightApp_Operation* LightApp_SwitchOp::operation( QWidget* theWg ) const
       SUIT_Operation* anOp = anIter.next();
           
       if ( anOp &&
-          anOp->inherits( "LightApp_Operation" ) &&
+           anOp->inherits( "LightApp_Operation" ) &&
            ((LightApp_Operation*)anOp)->dlg() == aDlg )
         return ((LightApp_Operation*)anOp);
     }
index 004831d597f5ce14eef9af52d2d8f86b74278882..79483143784a5dc4ed38072b4741577689236c7d 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LightApp_SwitchOp_H
 #define LightApp_SwitchOp_H
 
index d42e103811933bae4bcd9871cf4439873565ee87..4510ca2df46abfd8d079e9a470888ac0b1636a4c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : LightApp_UpdateFlags.h
 //  Author : Sergey LITONIN
 //  Module : LIGHT
index 3556c08123ee997fd3384aa3f41b5fc2b992c05b..019a959ec0e5900ed6833eb814a921f3dd8eb4cc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "LightApp_VTKSelector.h"
 #include "LightApp_DataOwner.h"
 
@@ -47,7 +48,7 @@
   Constructor.
 */
 LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
-                                                                 SUIT_Desktop* theDesktop )
+                                                                  SUIT_Desktop* theDesktop )
 : LightApp_DataOwner( theIO ),
 myDesktop( theDesktop )
 {
@@ -113,7 +114,8 @@ LightApp_SVTKDataOwner
 {
   if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){
     using namespace SVTK;
-    return Find<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),TIsSameIObject<SALOME_Actor>(IO()));
+    VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
+    return Find<SALOME_Actor>(aCopy.GetActors(),TIsSameIObject<SALOME_Actor>(IO()));
   }
 
   return NULL;
@@ -136,7 +138,7 @@ LightApp_SVTKDataOwner::~LightApp_SVTKDataOwner()
 */
 LightApp_VTKSelector
 ::LightApp_VTKSelector( SVTK_ViewModelBase* viewer, 
-                       SUIT_SelectionMgr* mgr ): 
+                        SUIT_SelectionMgr* mgr ): 
   SUIT_Selector( mgr, viewer ),
   myViewer( viewer )
 {
@@ -187,17 +189,17 @@ LightApp_VTKSelector
   if(myViewer){
     if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){
       if(SVTK_ViewManager* aViewMgr = dynamic_cast<SVTK_ViewManager*>(aViewManager)){
-       if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(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()));
-           }
-         }
-       }
+        if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(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()));
+            }
+          }
+        }
       }
     }
   }
@@ -213,45 +215,45 @@ LightApp_VTKSelector
   if(myViewer){
     if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){
       if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
-       if(SVTK_Selector* aSelector = aView->GetSelector()){
-         SALOME_ListIO anAppendList;
-         const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();
-         SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();
-         for(; anIter != theList.end(); ++anIter){
-           const SUIT_DataOwner* aDataOwner = (*anIter).get();
-           if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){
-             aSelector->SetSelectionMode(anOwner->GetMode());
-             Handle(SALOME_InteractiveObject) anIO = anOwner->IO();
+        if(SVTK_Selector* aSelector = aView->GetSelector()){
+          SALOME_ListIO anAppendList;
+          const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();
+          SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();
+          for(; anIter != theList.end(); ++anIter){
+            const SUIT_DataOwner* aDataOwner = (*anIter).get();
+            if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){
+              aSelector->SetSelectionMode(anOwner->GetMode());
+              Handle(SALOME_InteractiveObject) anIO = anOwner->IO();
 
-             aSelector->AddIObject(anIO);
+              aSelector->AddIObject(anIO);
 
-             anAppendList.Append(anIO);
-             aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
-           }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
-             Handle(SALOME_InteractiveObject) anIO = 
-               new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
-             aSelector->AddIObject(anIO);
-             anAppendList.Append(anIO);
-           }
-         }
-         // To remove IOs, which is not selected.
-         QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
-         SALOME_ListIteratorOfListIO anIt( aStoredList );
-         for( ; anIt.More(); anIt.Next() )
-           if( !anIt.Value().IsNull() )
-             toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
+              anAppendList.Append(anIO);
+              aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
+            }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
+              Handle(SALOME_InteractiveObject) anIO = 
+                new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
+              aSelector->AddIObject(anIO);
+              anAppendList.Append(anIO);
+            }
+          }
+          // To remove IOs, which is not selected.
+          QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
+          SALOME_ListIteratorOfListIO anIt( aStoredList );
+          for( ; anIt.More(); anIt.Next() )
+            if( !anIt.Value().IsNull() )
+              toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
 
-         anIt = SALOME_ListIteratorOfListIO(anAppendList);
-         for( ; anIt.More(); anIt.Next() )
-           toRemove.remove( anIt.Value()->getEntry() );
+          anIt = SALOME_ListIteratorOfListIO(anAppendList);
+          for( ; anIt.More(); anIt.Next() )
+            toRemove.remove( anIt.Value()->getEntry() );
 
-         QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
-                                                                            REnd = toRemove.end();
-         for( ; RIt!=REnd; RIt++ )
-           aSelector->RemoveIObject( RIt.value() );
-         
-         aView->onSelectionChanged();
-       }
+          QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
+                                                                             REnd = toRemove.end();
+          for( ; RIt!=REnd; RIt++ )
+            aSelector->RemoveIObject( RIt.value() );
+          
+          aView->onSelectionChanged();
+        }
       }
     }
   }
index a9cc2b47591371218faef4fe2a17e4893be9fe54..42c3f9aab5b3e7f121c25c31251a5b411726c0ad 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef LIGHTAPP_VTKSELECTOR_H
 #define LIGHTAPP_VTKSELECTOR_H
 
index 1d3892a19e73753b3c610880385cde91cc42d172..9c3029a9ca6489c3abb7c6ba1261799e6913e4e8 100755 (executable)
@@ -1,31 +1,36 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : OCC team (OCN)
 #  Module : LightApp
 #  $Header$
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+EXTRA_DIST += images
+
+QRC_FILES = qrc_LightApp.cxx
+
 lib_LTLIBRARIES = libLightApp.la
 
 salomeinclude_HEADERS =                        \
@@ -54,7 +59,13 @@ salomeinclude_HEADERS =                      \
        LightApp_SwitchOp.h             \
        LightApp_Preferences.h          \
        LightApp_PreferencesDlg.h       \
-       LightApp_UpdateFlags.h
+       LightApp_UpdateFlags.h          \
+       LightApp_WgViewModel.h          \
+       LightApp_FullScreenHelper.h
+
+if ENABLE_PYCONSOLE
+  salomeinclude_HEADERS += LightApp_PyInterp.h
+endif
 
 #      LightApp_OBFilter.h
 
@@ -97,7 +108,13 @@ dist_libLightApp_la_SOURCES =               \
        LightApp_Study.cxx              \
        LightApp_SwitchOp.cxx           \
        LightApp_Preferences.cxx        \
-       LightApp_PreferencesDlg.cxx
+       LightApp_PreferencesDlg.cxx     \
+       LightApp_WgViewModel.cxx        \
+       LightApp_FullScreenHelper.cxx
+
+if ENABLE_PYCONSOLE
+  dist_libLightApp_la_SOURCES += LightApp_PyInterp.cxx
+endif
 
 #      LightApp_OBFilter.cxx
 
@@ -132,7 +149,8 @@ MOC_FILES =                         \
        LightApp_Study_moc.cxx          \
        LightApp_SwitchOp_moc.cxx       \
        LightApp_Preferences_moc.cxx    \
-       LightApp_PreferencesDlg_moc.cxx
+       LightApp_PreferencesDlg_moc.cxx \
+       LightApp_WgViewModel_moc.cxx
 
 if ENABLE_VTKVIEWER
 if ENABLE_SALOMEOBJECT
@@ -148,8 +166,7 @@ endif
 if ENABLE_PLOT2DVIEWER
   MOC_FILES += LightApp_Plot2dSelector_moc.cxx
 endif
-nodist_libLightApp_la_SOURCES = $(MOC_FILES)
-
+nodist_libLightApp_la_SOURCES = $(MOC_FILES) $(QRC_FILES)
 dist_salomeres_DATA =                  \
        resources/icon_about.png        \
        resources/icon_applogo.png      \
@@ -162,12 +179,15 @@ dist_salomeres_DATA =                     \
 
 nodist_salomeres_DATA =                \
        LightApp_images.qm      \
-       LightApp_msg_en.qm
+       LightApp_msg_en.qm      \
+       LightApp_msg_fr.qm
 
 libLightApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS)            \
        $(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD       \
        -I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow           \
-       -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style
+       -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style \
+       -I$(srcdir)/../CASCatch
+
 libLightApp_la_LDFLAGS = $(QT_MT_LIBS)
 
 if ENABLE_VTKVIEWER
@@ -180,15 +200,14 @@ if ENABLE_PLOT2DVIEWER
 else
   libLightApp_la_CPPFLAGS += -DDISABLE_PLOT2DVIEWER
 endif
-libLightApp_la_CPPFLAGS+= -I$(srcdir)/../QxScene
-
 if ENABLE_OCCVIEWER
   libLightApp_la_CPPFLAGS += -I$(srcdir)/../OCCViewer
 else !ENABLE_OCCVIEWER
   libLightApp_la_CPPFLAGS += -DDISABLE_OCCVIEWER
 endif
 if ENABLE_PYCONSOLE
-  libLightApp_la_CPPFLAGS += $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp
+  libLightApp_la_CPPFLAGS += $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp \
+                            -I$(srcdir)/../SUITApp
   libLightApp_la_LDFLAGS += $(PYTHON_LIBS)
 else !ENABLE_PYCONSOLE
   libLightApp_la_CPPFLAGS += -DDISABLE_PYCONSOLE
@@ -203,8 +222,10 @@ if ENABLE_SUPERVGRAPHVIEWER
 else !ENABLE_SUPERVGRAPHVIEWER
   libLightApp_la_CPPFLAGS += -DDISABLE_SUPERVGRAPHVIEWER
 endif
+###VSR: QxGraph has been replaced by QxScene
+###libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxGraph
 if ENABLE_QXGRAPHVIEWER
-  libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxGraph
+  libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxScene
 else !ENABLE_QXGRAPHVIEWER
   libLightApp_la_CPPFLAGS += -DDISABLE_QXGRAPHVIEWER
 endif
@@ -223,7 +244,7 @@ if ENABLE_VTKVIEWER
 endif
 else !ENABLE_SALOMEOBJECT
   libLightApp_la_CPPFLAGS += -DDISABLE_SALOMEOBJECT
-  
+
 endif
 
 libLightApp_la_LIBADD = ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la                   \
@@ -256,13 +277,17 @@ if ENABLE_SALOMEOBJECT
   libLightApp_la_LIBADD += ../SPlot2d/libSPlot2d.la
 endif
 endif
+
 if ENABLE_PYCONSOLE
-  libLightApp_la_LIBADD += ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
+  libLightApp_la_LIBADD += ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la \
+                          ../SUITApp/libSUITApp.la
 endif
+
 if ENABLE_SUPERVGRAPHVIEWER
   libLightApp_la_LIBADD += ../SUPERVGraph/libSUPERVGraph.la
 endif
+###VSR: QxGraph has been replaced by QxScene
+###libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
 if ENABLE_QXGRAPHVIEWER
-  libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
-endif
   libLightApp_la_LIBADD+= ../QxScene/libQxScene.la
+endif
index d88c794097b4136222d93a12c0f2922b23e47e07..4507e977a47431332b1e8c5fb02aedb26391377d 100755 (executable)
@@ -1,3 +1,25 @@
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 # The resources mapping file for LightApp application
 
 [language]
index d4e62d9efe68af55e147d1ff74b110f6b9d58164..9761976c0722fb1cfbf9e97438e865b64e8ff935 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
     <parameter name="file"       value="no"/>
     <parameter name="key"        value="no"/>
     <parameter name="interp"     value="no"/>
-    <parameter name="modules"    value="LIGHT"/>
+    <parameter name="modules"    value="LIGHT,PYLIGHT"/>
   </section>
   <section name="language">
     <!-- Language settings (resource manager)-->
+    <parameter name="languages"   value="en,fr"/>
     <parameter name="language"    value="en"/>
     <parameter name="translators" value="%P_msg_%L.qm|%P_icons.qm|%P_images.qm"/>
   </section>
     <!-- Splash screen settings -->
     <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
     <parameter name="constant_info"     value="%A [ %V ]" />
-    <parameter name="text_colors"       value="#eeeeff|#555555" />
+    <parameter name="text_colors"       value="#ffffff|#777777" />
     <parameter name="hide_on_click"     value="no" />
     <parameter name="show_progress"     value="yes" />
     <parameter name="show_message"      value="yes" />
     <parameter name="show_percents"     value="yes" />
-    <parameter name="margin"            value="40" />
+    <parameter name="margin"            value="50" />
     <parameter name="progress_width"    value="20" />
     <parameter name="progress_flags"    value="bottom,left_to_right" />
-    <parameter name="opacity"           value="0.70" />
+    <parameter name="opacity"           value="0.85" />
     <parameter name="font"              value="Tahoma,12,normal" />
     <parameter name="alignment"         value="top,left" />
-    <parameter name="progress_colors"   value="#3b3e5d|#d14949|v" />
+    <parameter name="progress_colors"   value="#929ca7|#aebac7|v" />
   </section>
   <section name="resources">
     <!-- Resource directories (resource manager)-->
+    <parameter name="Qtx"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="Style"        value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SUIT"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="STD"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="ViewerTools"  value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="Plot2d"       value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SPlot2d"      value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="GLViewer"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="CAM"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="LightApp"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="SVTK"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="SUPERVGraph"  value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="QxGraph"      value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
     <parameter name="ToolsGUI"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+    <parameter name="LogWindow"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
   </section>
   <section name="desktop" >
     <!-- Default GUI desktop state, position, size -->
-    <parameter name="geometry"  value="80%x80%+10%+10%"/>
+    <parameter name="geometry"      value="80%%x80%%+10%%+10%%"/>
+    <parameter name="opaque_resize" value="false"/>
   </section>
   <section name="PyConsole">
     <!-- Python console preferences -->
+    <parameter name="show_banner"         value="true" />
     <parameter name="font"                value="Helvetic,12" />
     <parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
   </section>
   <section name="ObjectBrowser" >
     <!-- Object Browser preferences -->
     <parameter name="auto_hide_search_tool" value="true" />
+    <parameter name="auto_size"             value="false" />
+    <parameter name="auto_size_first"       value="true"  />
+    <parameter name="resize_on_expand_item" value="false"  />
+    <parameter name="browse_published_object" value="1"  />
   </section>
   <section name="FileDlg">
     <!-- "Open/Save File" dialog box preferences-->
     <parameter name="QuickDirList" value=""/>
+    <parameter name="ShowCurDirInitial" value="true" />
   </section>
   <section name="MRU" >
     <!-- Show "Most recently used" studies-->
   </section>
   <section name="Study">
     <!-- General study settings -->
-    <parameter name="store_positions" value="true" />
+    <parameter name="store_positions"    value="true" />
+    <parameter name="auto_save_interval" value="0" />
+  </section>
+  <section name="viewers" >
+    <!-- common viewers preferences -->
+    <parameter name="drop_down_buttons"     value="true" />
   </section>
   <section name="OCCViewer" >
     <!-- OCC viewer preferences -->
-    <parameter name="background"     value="35, 136, 145" />
+    <parameter name="xz_background"     value="35, 136, 145" />
+    <parameter name="yz_background"     value="35, 136, 145" />
+    <parameter name="xy_background"     value="35, 136, 145" />
+    <parameter name="background"        value="35, 136, 145" />
     <parameter name="iso_number_u"   value="1" />
     <parameter name="iso_number_v"   value="1" />
     <parameter name="trihedron_size" value="100" />
+    <parameter name="navigation_mode" value="0" />
+    <parameter name="zooming_mode"   value="0" />
+    <parameter name="show_static_trihedron" value="true"/>
+    <parameter name="relative_size"                    value="true"/>    
  </section>
  <section name="VTKViewer" >
     <!-- VTK viewer preferences -->
-    <parameter name="background"     value="0, 0, 0"/>
-    <parameter name="projection_mode" value="0" />
-    <parameter name="trihedron_size" value="100" />
-    <parameter name="relative_size"  value="true" />
-    <parameter name="use_advanced_selection_algorithm" value="true" />
-    <parameter name="navigation_mode" value="0" />
-    <parameter name="speed_value" value="10" />
-    <parameter name="speed_mode" value="0" />
-    <parameter name="spacemouse_func1_btn" value="1" />
-    <parameter name="spacemouse_func2_btn" value="2" />
-    <parameter name="spacemouse_func5_btn" value="9" />
+    <parameter name="background"                       value="0, 0, 0"/>
+    <parameter name="projection_mode"                  value="0"/>
+    <parameter name="trihedron_size"                   value="105"/>
+    <parameter name="relative_size"                    value="true"/>
+    <parameter name="dynamic_preselection"             value="true"/>
+    <parameter name="navigation_mode"                  value="0"/>
+    <parameter name="zooming_mode"                     value="0"/>
+    <parameter name="speed_value"                      value="10"/>
+    <parameter name="speed_mode"                       value="0"/>
+    <parameter name="show_static_trihedron"            value="true"/>
+    <parameter name="spacemouse_func1_btn"             value="1"/>
+    <parameter name="spacemouse_func2_btn"             value="2"/>
+    <parameter name="spacemouse_func5_btn"             value="5"/>
+    <parameter name="show_group_names"                 value="true"/>
+    <parameter name="group_names_text_color"           value="255, 255, 255"/>
+    <parameter name="group_names_transparency"         value="0.5"/>
+    <parameter name="recorder_mode"                    value="1"/>
+    <parameter name="recorder_fps"                     value="17.3"/>
+    <parameter name="recorder_quality"                 value="100" />
+    <parameter name="recorder_progressive"             value="true"/>
  </section>
  <section name="Plot2d" >
     <!-- Plot2d viewer preferences -->
     <parameter name="Background"   value="255, 255, 255" />
+    <parameter name="SelectionColor"   value="80, 80, 80" />
+    <parameter name="DeviationMarkerColor"   value="255, 0, 0" />
+    <parameter name="DeviationMarkerLineWidth" value="1" />
+    <parameter name="DeviationMarkerTickSize" value="2" />
     <parameter name="CurveType"    value="1" />
     <parameter name="HorScaleMode" value="0" />
     <parameter name="LegendPos"    value="1" />
+    <parameter name="LegendFont"   value="Helvetic,12" />
+    <parameter name="LegendFontColor"  value="0, 0, 0" />
+    <parameter name="SelectedLegendFontColor"  value="255, 255, 255" />
     <parameter name="MarkerSize"   value="9" />
     <parameter name="ShowLegend"   value="true" />
     <parameter name="VerScaleMode" value="0" />
+    <parameter name="VerNormLMinMode" value="false"/>
+    <parameter name="VerNormLMaxMode" value="false"/>
+    <parameter name="VerNormRMinMode" value="false"/>
+    <parameter name="VerNormRMaxMode" value="false"/>
   </section>
-  <section name="SUPERVGraph" >
-    <!-- Supervision viewer preferences -->
+  <section name="QxGraph" >
+    <!-- QxGraph viewer preferences -->
     <parameter name="Background" value="144, 208, 211" />
     <parameter name="Title"      value="63, 213, 255"  />
+    <parameter name="NodeBody"   value="255, 249, 147" />
   </section>
   <section name="QxSceneViewer" >
     <!-- QxGraph viewer preferences -->
     <parameter name="Title"      value="63, 213, 255"  />
     <parameter name="NodeBody"   value="255, 249, 147" />
   </section>
+  <section name="GUI" >
+    <parameter name="documentation"     value="gui_help"/>
+  </section>
+  <section name="KERNEL" >
+    <parameter name="documentation"     value="kernel_help"/>
+  </section>
+  <section name="gui_help" >
+    <parameter name="sub_menu"          value="%1 module"/>
+    <parameter name="User's Guide"      value="${GUI_ROOT_DIR}/share/doc/salome/gui/GUI/index.html"/>
+    <parameter name="Developer's Guide" value="${GUI_ROOT_DIR}/share/doc/salome/tui/GUI/index.html"/>
+  </section>
+  <section name="kernel_help" >
+    <parameter name="sub_menu"          value="%1 module"/>
+    <parameter name="User's Guide"      value="${KERNEL_ROOT_DIR}/share/doc/salome/gui/KERNEL/index.html"/>
+    <parameter name="Developer's Guide" value="${KERNEL_ROOT_DIR}/share/doc/salome/tui/KERNEL/index.html"/>
+  </section>
+  <!--Salome shortcut settings-->
+  <section name="shortcuts_settings">
+    <parameter name="general_sections" value="General;Viewers"/>
+  </section>
+  <section name="shortcuts:General">
+    <parameter name="Show object(s)" value="Ctrl+Alt+S"/>
+    <parameter name="Hide object(s)" value="Ctrl+Alt+H"/>
+  </section>
+  <section name="shortcuts:Viewers">
+    <parameter name="Front view" value="Ctrl+Alt+F"/>
+    <parameter name="Back view" value="Ctrl+Alt+B"/>
+    <parameter name="Top view" value="Ctrl+Alt+T"/>
+    <parameter name="Bottom view" value="Ctrl+Alt+O"/>
+    <parameter name="Left view" value="Ctrl+Alt+K"/>
+    <parameter name="Right view" value="Ctrl+Alt+R"/>
+    <parameter name="Reset view" value="Ctrl+Alt+E"/>
+  </section>
+  <section name="shortcuts:Geometry">
+    <parameter name="Increase number of isolines" value="Meta+I"/>
+    <parameter name="Decrease number of isolines" value="Meta+D"/>
+    <parameter name="Increase transparency" value="Meta+Y"/>
+    <parameter name="Decrease transparency" value="Meta+T"/>
+  </section>
+  <section name="ExternalBrowser" >
+    <!-- External HELP browser settings -->
+    <parameter value="C:\Program Files\Internet Explorer\iexplore.exe" name="winapplication" />
+    <parameter value="false" name="use_external_browser" />
+    <parameter value="/usr/bin/mozilla" name="application" />
+  </section>
 </document>
diff --git a/src/LightApp/resources/LightApp_images.po b/src/LightApp/resources/LightApp_images.po
deleted file mode 100644 (file)
index 950e1c6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      LightApp_images.po
-#  Created:   May, 2005
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ABOUT"
-msgstr "icon_about.png"
-
-msgid "ABOUT_SPLASH"
-msgstr "icon_about.png"
-
-msgid "APP_DEFAULT_ICO"
-msgstr "icon_default.png"
-
-msgid "APP_MODULE_ICO"
-msgstr "icon_module.png"
-
-msgid "APP_MODULE_BIG_ICO"
-msgstr "icon_module_big.png"
-
-msgid "ICON_SELECT"
-msgstr "icon_select.png"
-
-msgid "APP_BASE_LOGO"
-msgstr "icon_applogo.png"
index ef5664006ad7e14155284542e90d2fba87a1a1aa..dae481992c9b814a6d48f654a49ef55d725e0faf 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>APP_MODULE_ICO</source>
         <translation>icon_module.png</translation>
     </message>
+    <message>
+        <source>BROWSER_ICON</source>
+        <translation>icon_default.png</translation>
+    </message>    
+    <message>
+        <source>BROWSER_CLOSE_ICON</source>
+        <translation>close.png</translation>
+    </message>    
 </context>
 </TS>
diff --git a/src/LightApp/resources/LightApp_msg_en.po b/src/LightApp/resources/LightApp_msg_en.po
deleted file mode 100644 (file)
index c4a0aea..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-//=======================================================================================
-
-msgid "APP_NAME"
-msgstr "SALOME"
-
-msgid "ABOUT_CAPTION"
-msgstr "About %1"
-
-msgid "ABOUT_VERSION"
-msgstr "Version %1"
-
-msgid "ABOUT_COPYRIGHT"
-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"
-
-//=======================================================================================
-
-msgid "LightApp_Application::ACTIVATING_MODULE"
-msgstr "Trying to activate module \"%1\""
-
-msgid "LightApp_Application::TOT_RENAME"
-msgstr "Rename"
-
-msgid "LightApp_Application::MEN_DESK_RENAME"
-msgstr "&Rename"
-
-msgid "LightApp_Application::PRP_RENAME"
-msgstr "Rename active window"
-
-msgid "LightApp_Application::TOT_DESK_PREFERENCES"
-msgstr "Preferences"
-
-msgid "LightApp_Application::MEN_DESK_PREFERENCES"
-msgstr "Pre&ferences..."
-
-msgid "LightApp_Application::TOT_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "LightApp_Application::MEN_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "LightApp_Application::PRP_DESK_PREFERENCES"
-msgstr "Allow to change the preferences"
-
-msgid "LightApp_Application::INF_TOOLBAR_MODULES"
-msgstr "Modules"
-
-msgid "LightApp_Application::PRP_APP_MODULE"
-msgstr "Switch to SALOME platform neutral point"
-
-msgid "LightApp_Application::PRP_MODULE"
-msgstr "Switch to the module \"%1\""
-
-msgid "LightApp_Application::NEW_WINDOW_0"
-msgstr "&GL View"
-
-msgid "LightApp_Application::NEW_WINDOW_1"
-msgstr "&Plot2d View"
-
-msgid "LightApp_Application::NEW_WINDOW_2"
-msgstr "&OCC View"
-
-msgid "LightApp_Application::NEW_WINDOW_3"
-msgstr "VT&K View"
-
-msgid "LightApp_Application::NEW_WINDOW_4"
-msgstr "&QxGraph View"
-
-msgid "LightApp_Application::NEW_WINDOW_5"
-msgstr "Qx&Scene View"
-
-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\". Do you want to change it in preferences?"
-
-msgid "LightApp_Application::DEFINE_EXTERNAL_BROWSER"
-msgstr "External browser is not found. Do you want to define it in preferences?"
-
-msgid "LightApp_Application::DATA_MODELS"
-msgstr "Data models"
-
-msgid "LightApp_Application::OBJECT_BROWSER"
-msgstr "Object Browser"
-
-msgid "LightApp_Application::OBJ_BROWSER_NAME"
-msgstr "Object"
-
-msgid "LightApp_Application::LOG_WINDOW"
-msgstr "Message Window"
-
-//=======================================================================================
-
-msgid "LightApp_Application::MEN_DESK_MODULE_HELP"
-msgstr "Module Help"
-
-//=======================================================================================
-
-msgid "LightApp_Application::PREFERENCES_NOT_LOADED"
-msgstr "Preferences for module \"<b>%1</b>\" will be available when the module will be loaded"
-
-msgid "LightApp_Application::PREF_CATEGORY_SALOME"
-msgstr "SALOME"
-
-msgid "LightApp_Application::PREF_TAB_GENERAL"
-msgstr "General"
-
-msgid "LightApp_Application::PREF_GROUP_STUDY"
-msgstr "Study properties"
-
-msgid "LightApp_Application::PREF_MULTI_FILE"
-msgstr "Multi file save"
-
-msgid "LightApp_Application::PREF_ASCII_FILE"
-msgstr "ASCII save"
-
-msgid "LightApp_Application::PREF_STORE_POS"
-msgstr "Store positions of windows"
-
-msgid "LightApp_Application::PREF_GROUP_EXT_BROWSER"
-msgstr "External browser"
-
-msgid "LightApp_Application::PREF_APP"
-msgstr "Application"
-
-msgid "LightApp_Application::PREF_PARAM"
-msgstr "Parameters"
-
-msgid "LightApp_Application::PREF_GROUP_PY_CONSOLE"
-msgstr "Python console properties"
-
-msgid "LightApp_Application::PREF_FONT"
-msgstr "Font"
-
-msgid "LightApp_Application::PREF_GROUP_STYLE"
-msgstr "Salome style"
-
-msgid "LightApp_Application::PREF_USE_SALOME_STYLE"
-msgstr "Use Salome style"
-
-msgid "LightApp_Application::PREF_TAB_OBJBROWSER"
-msgstr "Object browser"
-
-msgid "LightApp_Application::PREF_OBJ_BROWSER_SETTINGS"
-msgstr "Object browser settings"
-
-msgid "LightApp_Application::PREF_GROUP_DEF_COLUMNS"
-msgstr "Default columns"
-
-msgid "LightApp_Application::PREF_TAB_VIEWERS"
-msgstr "Viewers"
-
-msgid "LightApp_Application::PREF_GROUP_OCCVIEWER"
-msgstr "OCC Viewer 3d"
-
-msgid "LightApp_Application::PREF_GROUP_VTKVIEWER"
-msgstr "VTK Viewer 3d"
-
-msgid "LightApp_Application::PREF_VIEWER_BACKGROUND"
-msgstr "Background color"
-
-msgid "LightApp_Application::PREF_TRIHEDRON_SIZE"
-msgstr "Trihedron size"
-
-msgid "LightApp_Application::PREF_RELATIVE_SIZE"
-msgstr "Relative size"
-
-msgid "LightApp_Application::PREF_ISOS_U"
-msgstr "Number of isolines along U"
-msgid "LightApp_Application::PREF_ISOS_V"
-msgstr "Number of isolines along V"
-
-msgid "LightApp_Application::PREF_TRIHEDRON_SHOW"
-msgstr "Show trihedron"
-
-msgid "LightApp_Application::PREF_GROUP_PLOT2DVIEWER"
-msgstr "Plot2d Viewer"
-
-msgid "LightApp_Application::PREF_SHOW_LEGEND"
-msgstr "Show legend"
-
-msgid "LightApp_Application::PREF_LEGEND_POSITION"
-msgstr "Legend position:"
-
-msgid "LightApp_Application::PREF_LEFT"
-msgstr "Left"
-
-msgid "LightApp_Application::PREF_RIGHT"
-msgstr "Right"
-
-msgid "LightApp_Application::PREF_TOP"
-msgstr "Top"
-
-msgid "LightApp_Application::PREF_BOTTOM"
-msgstr "Bottom"
-
-msgid "LightApp_Application::PREF_CURVE_TYPE"
-msgstr "Curve type:"
-
-msgid "LightApp_Application::PREF_POINTS"
-msgstr "Points"
-
-msgid "LightApp_Application::PREF_LINES"
-msgstr "Lines"
-
-msgid "LightApp_Application::PREF_SPLINE"
-msgstr "Spline"
-
-msgid "LightApp_Application::PREF_MARKER_SIZE"
-msgstr "Marker size:"
-
-msgid "LightApp_Application::PREF_LINEAR"
-msgstr "Linear"
-
-msgid "LightApp_Application::PREF_LOGARITHMIC"
-msgstr "Logarithmic"
-
-msgid "LightApp_Application::PREF_HOR_AXIS_SCALE"
-msgstr "Horizontal axis scale:"
-
-msgid "LightApp_Application::PREF_VERT_AXIS_SCALE"
-msgstr "Vertical axis scale:"
-
-msgid "LightApp_Application::PREF_TAB_DIRECTORIES"
-msgstr "Directories"
-
-msgid "LightApp_Application::PREF_GROUP_DIRECTORIES"
-msgstr "Quick directory list"
-
-msgid "LightApp_Application::MEN_REFRESH"
-msgstr "Refresh"
-
-msgid "LightApp_Application::PREF_GROUP_SUPERV"
-msgstr "Graph Supervisor"
-
-msgid "LightApp_Application::PREF_SUPERV_TITLE_COLOR"
-msgstr "Title color"
-
-msgid "LightApp_Application::PREF_SUPERV_CTRL_COLOR"
-msgstr "Ctrl color"
-
-msgid "LightApp_Application::PREF_AUTO_SIZE"
-msgstr "Auto size for other columns"
-
-msgid "LightApp_Application::PREF_AUTO_SIZE_FIRST"
-msgstr "Auto size for first column"
-
-//=======================================================================================
-
-msgid "LightApp_PreferencesDlg::CAPTION"
-msgstr "Preferences"
-
-msgid "LightApp_PreferencesDlg::DEFAULT_BTN_TEXT"
-msgstr "Defaults"
-
-msgid "LightApp_PreferencesDlg::WARNING"
-msgstr "Warning"
-
-msgid "LightApp_PreferencesDlg::DEFAULT_QUESTION"
-msgstr "Do you want to retrieve default preferences?"
-
-msgid "LightApp_PreferencesDlg::IMPORT_PREFERENCES"
-msgstr "Import preferences"
-
-msgid "LightApp_PreferencesDlg::IMPORT_BTN_TEXT"
-msgstr "Import"
-
-//=======================================================================================
-
-msgid "LightApp_Module::TOP_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::MEN_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::STB_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::TOP_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::MEN_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::STB_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::TOP_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::MEN_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::STB_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::TOP_ERASE_ALL"
-msgstr "Erase all"
-
-msgid "LightApp_Module::MEN_ERASE_ALL"
-msgstr "Erase all"
-
-msgid "LightApp_Module::STB_ERASE_ALL"
-msgstr "Erase all"
-//=======================================================================================
-
-
-msgid "LightApp_ModuleDlg::CAPTION"
-msgstr "Activate module"
-
-msgid "LightApp_ModuleDlg::NEW"
-msgstr "&New"
-
-msgid "LightApp_ModuleDlg::OPEN"
-msgstr "&Open"
-
-msgid "LightApp_ModuleDlg::LOAD"
-msgstr "&Load"
-
-msgid "LightApp_ModuleDlg::CANCEL"
-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: "
-
index b91990d146a43db8356dca026db33599ab95a03c..d68711fdc2d0272dc7dad091554105311326a71b 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
@@ -30,7 +9,7 @@
     </message>
     <message>
         <source>ABOUT_COPYRIGHT</source>
-        <translation>Copyright (C) 2007-2008 CEA/DEN, EDF R&amp;D, OPEN CASCADE
+        <translation>Copyright (C) 2007-2012 CEA/DEN, EDF R&amp;D, OPEN CASCADE
 
 Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6,
 CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translation>
@@ -39,6 +18,22 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>ABOUT_CAPTION</source>
         <translation>About %1</translation>
     </message>
+    <message>
+        <source>ABOUT_BASE</source>
+        <translation>Base information</translation>
+    </message>
+    <message>
+        <source>ABOUT_MODULE_INFOS</source>
+        <translation>Modules information</translation>
+    </message>
+    <message>
+        <source>ABOUT_UNKNOWN_VERSION</source>
+        <translation>Unknown</translation>
+    </message>
+    <message>
+        <source>ABOUT_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>    
     <message>
         <source>APP_NAME</source>
         <translation>SALOME</translation>
@@ -55,9 +50,50 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>ENTRY_COLUMN</source>
         <translation>Entry</translation>
     </message>
+    <message>
+        <source>BROWSER_TITLE</source>
+        <translation>SALOME Help Browser</translation>
+    </message>    
+    <message>
+        <source>BROWSER_TOOLBAR_TITLE</source>
+        <translation>Navigation</translation>
+    </message>    
+    <message>
+        <source>BROWSER_FILEMENU</source>
+        <translation>&amp;File</translation>
+    </message>    
+    <message>
+        <source>BROWSER_CLOSE</source>
+        <translation>&amp;Close</translation>
+    </message>    
+    <message>
+        <source>BROWSER_BACK</source>
+        <translation>Go Back</translation>
+    </message>    
+    <message>
+        <source>BROWSER_FORWARD</source>
+        <translation>Go Forward</translation>
+    </message>    
+    <message>
+        <source>BROWSER_FIND</source>
+        <translation>&amp;Find...</translation>
+    </message>    
+    <message>
+        <source>BROWSER_FINDNEXT</source>
+        <translation>Find &amp;next</translation>
+    </message>    
+    <message>
+        <source>BROWSER_FINDPREV</source>
+        <translation>Find &amp;previous</translation>
+    </message>    
 </context>
 <context>
     <name>LightApp_Application</name>
+    <message>
+        <source>LANG_CHANGED</source>
+        <translation>Application language has been changed.
+The changes will be applied on the next application session.</translation>
+    </message>
     <message>
         <source>MEN_DESK_THEME</source>
         <translation>Theme</translation>
@@ -70,6 +106,18 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PRP_THEME</source>
         <translation>Change style properties</translation>
     </message>
+    <message>
+        <source>TOT_FULLSCREEN</source>
+        <translation>Full screen</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FULLSCREEN</source>
+        <translation>Full screen</translation>
+    </message>
+    <message>
+        <source>PRP_FULLSCREEN</source>
+        <translation>Switch to full screen mode</translation>
+    </message>
     <message>
         <source>INF_TOOLBAR_MODULES</source>
         <translation>Modules</translation>
@@ -94,9 +142,13 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_TRIHEDRON_SHOW</source>
         <translation>Show trihedron</translation>
     </message>
+    <message>
+        <source>PREF_TRIHEDRON</source>
+        <translation>Trihedron</translation>
+    </message>
     <message>
         <source>PREF_TRIHEDRON_SIZE</source>
-        <translation>Trihedron size</translation>
+        <translation>Size</translation>
     </message>
     <message>
         <source>OBJECT_BROWSER</source>
@@ -112,12 +164,20 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_GROUP_VTKVIEWER</source>
-        <translation>VTK Viewer 3d</translation>
+        <translation>VTK 3D Viewer</translation>
     </message>
     <message>
         <source>PREF_STORE_POS</source>
         <translation>Store positions of windows</translation>
     </message>
+    <message>
+        <source>PREF_AUTO_SAVE</source>
+        <translation>Auto-save interval (min)</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SAVE_DISABLED</source>
+        <translation>Disabled</translation>
+    </message>
     <message>
         <source>PREF_PROJECTION_MODE</source>
         <translation>Projection mode:</translation>
@@ -132,7 +192,7 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_NAVIGATION</source>
-        <translation>Navigation:</translation>
+        <translation>Navigation style</translation>
     </message>
     <message>
         <source>PREF_STANDARD_STYLE</source>
@@ -142,6 +202,18 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_KEYFREE_STYLE</source>
         <translation>Keyboard free style</translation>
     </message>
+    <message>
+        <source>PREF_ZOOMING</source>
+        <translation>Zooming style</translation>
+    </message>
+    <message>
+        <source>PREF_ZOOMING_AT_CENTER</source>
+        <translation>Relative to the view&apos;s center</translation>
+    </message>
+    <message>
+        <source>PREF_ZOOMING_AT_CURSOR</source>
+        <translation>Relative to the cursor</translation>
+    </message>
     <message>
         <source>PREF_INCREMENTAL_SPEED</source>
         <translation>Speed increment:</translation>
@@ -162,6 +234,10 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_FRAME_SPACEMOUSE</source>
         <translation>Spacemouse</translation>
     </message>
+    <message>
+        <source>PREF_SHOW_STATIC_TRIHEDRON</source>
+        <translation>Show static trihedron</translation>
+    </message>
     <message>
         <source>PREF_SPACEMOUSE_FUNC_1</source>
         <translation>Decrease speed increment</translation>
@@ -250,6 +326,18 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_SKIPPED_FRAMES</source>
         <translation>Recording at a given FPS</translation>
     </message>
+    <message>
+        <source>PREF_FRAME_GROUP_NAMES</source>
+        <translation>Names of groups</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_NAMES_TEXT_COLOR</source>
+        <translation>Text color</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_NAMES_TRANSPARENCY</source>
+        <translation>Transparency</translation>
+    </message>
     <message>
         <source>PREF_BOTTOM</source>
         <translation>Bottom</translation>
@@ -258,13 +346,17 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_CURVE_TYPE</source>
         <translation>Curve type:</translation>
     </message>
+    <message>
+        <source>PREF_ISOS</source>
+        <translation>Number of isolines</translation>
+    </message>
     <message>
         <source>PREF_ISOS_U</source>
-        <translation>Number of isolines along U</translation>
+        <translation>Along U</translation>
     </message>
     <message>
         <source>PREF_ISOS_V</source>
-        <translation>Number of isolines along V</translation>
+        <translation>Along V</translation>
     </message>
     <message>
         <source>PREF_POINTS</source>
@@ -298,6 +390,10 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>TOT_RENAME</source>
         <translation>Rename</translation>
     </message>
+    <message>
+        <source>MEN_RENAME_OBJ</source>
+        <translation>Rename</translation>
+    </message>         
     <message>
         <source>LOG_WINDOW</source>
         <translation>Message Window</translation>
@@ -324,7 +420,11 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_GROUP_PY_CONSOLE</source>
-        <translation>Python console properties</translation>
+        <translation>Python console</translation>
+    </message>
+    <message>
+        <source>PREF_SHOW_BANNER</source>
+        <translation>Show banner</translation>
     </message>
     <message>
         <source>PREF_GROUP_STYLE</source>
@@ -356,12 +456,28 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_AUTO_SIZE_FIRST</source>
-        <translation>Auto size for first column</translation>
+        <translation>Auto size for "Name" column</translation>
     </message>
     <message>
         <source>PREF_RESIZE_ON_EXPAND_ITEM</source>
         <translation>Resize columns on expand item</translation>
     </message>
+    <message>
+        <source>PREF_BROWSE_TO_THE_PUBLISHED_OBJECT</source>
+        <translation>Browse to the published object</translation>
+    </message>
+    <message>
+        <source>PREF_BROWSE_NEVER</source>
+        <translation>Never</translation>
+    </message>
+    <message>
+        <source>PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY</source>
+        <translation>After Apply &amp; Close only</translation>
+    </message>
+    <message>
+        <source>PREF_BROWSE_ALWAYS</source>
+        <translation>Always</translation>
+    </message>
     <message>
         <source>PREF_GROUP_SUPERV</source>
         <translation>Graph Supervisor</translation>
@@ -376,27 +492,31 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>NEW_WINDOW_0</source>
-        <translation>&amp;GL view</translation>
+        <translation>&amp;GL 2D view</translation>
     </message>
     <message>
         <source>NEW_WINDOW_1</source>
-        <translation>&amp;Plot2d view</translation>
+        <translation>&amp;Plot 2D view</translation>
     </message>
     <message>
         <source>NEW_WINDOW_2</source>
-        <translation>&amp;OCC view</translation>
+        <translation>&amp;OCC 3D view</translation>
     </message>
     <message>
         <source>NEW_WINDOW_3</source>
-        <translation>VT&amp;K view</translation>
+        <translation>VT&amp;K 3D view</translation>
     </message>
     <message>
         <source>NEW_WINDOW_4</source>
-        <translation>&amp;QxGraph view</translation>
+        <translation>&amp;QxGraph 2D view</translation>
     </message>
     <message>
         <source>NEW_WINDOW_5</source>
-        <translation>Qx&amp;Scene view</translation>
+        <translation>Qx&amp;Scene 2D view</translation>
+    </message>
+    <message>
+        <source>CREATING_NEW_WINDOW</source>
+        <translation>Create new %1</translation>
     </message>
     <message>
         <source>OBJ_BROWSER_NAME</source>
@@ -408,16 +528,52 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_RELATIVE_SIZE</source>
-        <translation>Relative size</translation>
+        <translation>Relative</translation>
     </message>
     <message>
         <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Background</translation>
+    </message>
+    <message>
+        <source>PREF_VIEWER_BACKGROUND_COLOR</source>
         <translation>Background color</translation>
     </message>
+    <message>
+        <source>PREF_VIEWER_SELECTION</source>
+        <translation>Selection color</translation>
+    </message>    
+    <message>
+        <source>PREF_XYVIEWER_BACKGROUND</source>
+        <translation>XY View</translation>
+    </message>
+    <message>
+        <source>PREF_XZVIEWER_BACKGROUND</source>
+        <translation>XZ View</translation>
+    </message>
+    <message>
+        <source>PREF_YZVIEWER_BACKGROUND</source>
+        <translation>YZ View</translation>
+    </message>
+    <message>
+        <source>PREF_3DVIEWER_BACKGROUND</source>
+        <translation>3D View</translation>
+    </message>
     <message>
         <source>PREF_FONT</source>
         <translation>Font</translation>
     </message>
+    <message>
+        <source>PREF_LEGEND_FONT</source>
+        <translation>Legend font</translation>
+    </message>
+    <message>
+        <source>PREF_FONT_COLOR</source>
+        <translation>Legend font color</translation>
+    </message>
+    <message>
+        <source>PREF_SELECTED_FONT_COLOR</source>
+        <translation>Highlighted legend font color</translation>
+    </message>                         
     <message>
         <source>PREF_LEFT</source>
         <translation>Left</translation>
@@ -438,6 +594,22 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_HOR_AXIS_SCALE</source>
         <translation>Horizontal axis scale:</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_LANGUAGE</source>
+        <translation>Language</translation>
+    </message>
+    <message>
+        <source>PREF_CURRENT_LANGUAGE</source>
+        <translation>Current language</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_LOOK_AND_FEEL</source>
+        <translation>Look and feel</translation>
+    </message>
+    <message>
+        <source>PREF_OPAQUE_RESIZE</source>
+        <translation>Opaque resize</translation>
+    </message>
     <message>
         <source>PREF_GROUP_STUDY</source>
         <translation>Study properties</translation>
@@ -446,9 +618,17 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <source>PREF_CATEGORY_SALOME</source>
         <translation>SALOME</translation>
     </message>
+    <message>
+        <source>PREF_DROP_DOWN_BUTTONS</source>
+        <translation>Drop-down buttons in toolbars for action groups</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_COMMON</source>
+        <translation>Common</translation>
+    </message>
     <message>
         <source>PREF_GROUP_OCCVIEWER</source>
-        <translation>OCC Viewer 3d</translation>
+        <translation>OCC 3D Viewer</translation>
     </message>
     <message>
         <source>PREF_LOGARITHMIC</source>
@@ -492,7 +672,19 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
         <source>PREF_GROUP_PLOT2DVIEWER</source>
-        <translation>Plot2d Viewer</translation>
+        <translation>Plot 2D Viewer</translation>
+    </message>
+    <message>
+        <source>PREF_DEVIATION_COLOR</source>
+        <translation>Deviation marker color</translation>
+    </message>
+    <message>
+        <source>PREF_DEVIATION_MARKER_LW</source>
+        <translation>Deviation marker line width</translation>
+    </message>
+    <message>
+        <source>PREF_DEVIATION_MARKER_TS</source>
+        <translation>Deviation marker tick size</translation>
     </message>
     <message>
         <source>MEN_DESK_MRU</source>
@@ -527,8 +719,8 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <translation>Python Console</translation>
     </message>
     <message>
-        <source>PREF_USE_ADVANCED_SELECTION_ALGORITHM</source>
-        <translation>Use Advanced Selection Algorithm</translation>
+        <source>PREF_DYNAMIC_PRESELECTION</source>
+        <translation>Dynamic pre-selection</translation>
     </message>
     <message>
         <source>TOT_CLOSE</source>
@@ -617,7 +809,15 @@ File does not exist</translation>
     </message>
     <message>
         <source>PREFERENCES_NOT_SUPPORTED</source>
-        <translation>Preferences for module "%1" not supported</translation>
+        <translation>Preferences for module &quot;%1&quot; not supported</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_SHORTCUTS</source>
+        <translation>Shortcuts</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_SHORTCUTS</source>
+        <translation>Shortcuts settings</translation>
     </message>
 </context>
 <context>
@@ -675,7 +875,7 @@ File does not exist</translation>
     <name>LightApp_ModuleDlg</name>
     <message>
         <source>DESCRIPTION</source>
-        <translation>You're activating module
+        <translation>You&apos;re activating module
        &lt;b&gt;%1&lt;/b&gt;.&lt;br&gt;Please, select required action by pressing the corresponding button below.</translation>
     </message>
     <message>
@@ -725,4 +925,11 @@ File does not exist</translation>
         <translation>Defaults</translation>
     </message>
 </context>
+<context>
+    <name>LightApp_ModuleAction</name>
+    <message>
+        <source>ACTIVATE_MODULE_TOP</source>
+        <translation>Activate/deactivate %1 module</translation>
+    </message>
+</context>
 </TS>
index bbbc7a931919d52bf27c6f563daefb1ad2349237..fd6640bda76027cc00ef489ac39842148ef6d642 100755 (executable)
Binary files a/src/LightApp/resources/icon_about.png and b/src/LightApp/resources/icon_about.png differ
index 9c6470b1bbe5e80428c1a263f1d731bf8ab999c5..26887cf254e9d08836119cf9cc648b4b2440992a 100755 (executable)
Binary files a/src/LightApp/resources/icon_applogo.png and b/src/LightApp/resources/icon_applogo.png differ
index 4a15cdaba3f49693ec8e9ce2ca4a3b18c0fddaae..148290040ee02032e626c2e191a38cd3fe92d781 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  KERNEL SALOME_Event : Define event posting mechanism
 // File   : LogWindow.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
index cdcb86da3728d1a7d83529ad167831482ff606f1..eef953a1b625cfde8e7c3a6deda2d5d774760361 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  KERNEL SALOME_Event : Define event posting mechanism
 // File   : LogWindow.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@ -27,7 +28,7 @@
 #define LOGWINDOW_H
 
 #if defined WIN32
-#  if defined LOGWINDOW_EXPORTS
+#  if defined LOGWINDOW_EXPORTS || defined LogWindow_EXPORTS
 #    define LOGWINDOW_EXPORT __declspec( dllexport )
 #  else
 #    define LOGWINDOW_EXPORT __declspec( dllimport )
diff --git a/src/LogWindow/LogWindow.pro b/src/LogWindow/LogWindow.pro
deleted file mode 100644 (file)
index 69eacdb..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = LogWindow
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += LOGWINDOW_EXPORTS
-
-HEADERS = LogWindow.h
-
-SOURCES = LogWindow.cxx
-
-TRANSLATIONS = resources/LogWindow_msg_en.ts
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 391b5cd1153ac9f0b9f9f18753d4e6faaa6ee964..f0c0ee556908ab08b9278bc88e7d96bb52325e33 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : LogWindow
@@ -36,7 +37,8 @@ MOC_FILES = LogWindow_moc.cxx
 nodist_libLogWindow_la_SOURCES = $(MOC_FILES)
 
 nodist_salomeres_DATA = \
-       LogWindow_msg_en.qm
+       LogWindow_msg_en.qm \
+       LogWindow_msg_fr.qm
 
 libLogWindow_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 libLogWindow_la_LDFLAGS  = $(QT_MT_LIBS)
index 1154409e55a5ba42f2b7444de67d7ba438e83b1a..a7421d8375c0dea27b001b797e0236341e45a819 100644 (file)
@@ -1,27 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
--->
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>LogWindow</name>
     <message>
index e49a83136d84a6c3a1c7053116fdf0f39cbca20a..a0f768d8b382d822fa695a3b53a9375e51a2eb92 100755 (executable)
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#  File   : Makefile.in
+
+#  File   : Makefile.am
 #  Author : Patrick GOLDBRONN (CEA)
-#  Module : SALOME
-# $Header$
-#
-SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event
 
+##
+# Common packages
+##
+SUBDIRS_COMMON = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils GUI_PY
+
+##
+# SALOME object
+##
 if ENABLE_SALOMEOBJECT
-  SUBDIRS += OBJECT
+  SUBDIRS_OBJECT = OBJECT
 endif
 
+##
+# GL viewer
+##
 if ENABLE_GLVIEWER
-  SUBDIRS += GLViewer
+  SUBDIRS_GLVIEWER = GLViewer
 endif
 
+##
+# VTK viewer
+##
 if ENABLE_VTKVIEWER
-  SUBDIRS += VTKViewer
+  SUBDIRS_VTKVIEWER = VTKViewer
 if ENABLE_SALOMEOBJECT
-    SUBDIRS += SVTK
+    SUBDIRS_VTKVIEWER += SVTK
+    SUBDIRS_VIEWERTOOLS = ViewerTools
 endif
 endif
+
+##
+# OCC viewer
+##
 if ENABLE_OCCVIEWER
-  SUBDIRS += OCCViewer
+  SUBDIRS_OCCVIEWER = OCCViewer
+  SUBDIRS_VIEWERTOOLS = ViewerTools
 if ENABLE_SALOMEOBJECT
-    SUBDIRS += SOCC
+    SUBDIRS_OCCVIEWER += SOCC
 endif
 endif
-if ENABLE_PYCONSOLE
-  SUBDIRS += PyInterp PyConsole
-endif
+
+##
+# Plot2d viewer
+##
 if ENABLE_PLOT2DVIEWER
-  SUBDIRS += Plot2d
+  SUBDIRS_PLOT2DVIEWER = Plot2d
 if ENABLE_SALOMEOBJECT
-    SUBDIRS += SPlot2d
+    SUBDIRS_PLOT2DVIEWER += SPlot2d
 endif
 endif
+
+##
+# SUPERV graph viewer
+##
 if ENABLE_SUPERVGRAPHVIEWER
-  SUBDIRS += SUPERVGraph
+  SUBDIRS_SUPERVGRAPHVIEWER = SUPERVGraph
 endif
+
+##
+# Qx scene viewer
+##
+###VSR: QxGraph has been replaced by QxScene
+###SUBDIRS_QXGRAPHVIEWER = QxGraph
 if ENABLE_QXGRAPHVIEWER
-  SUBDIRS += QxGraph
+  SUBDIRS_QXGRAPHVIEWER = QxScene
 endif
-SUBDIRS += QxScene LightApp ResExporter
 
+##
+# Python console (base)
+##
+if ENABLE_PYCONSOLE
+  SUBDIRS_PYCONSOLE = PyInterp PyConsole
+endif
+
+##
+# Light SALOME packages
+##
+SUBDIRS_LIGHT = LightApp ResExporter
+
+##
+# Full (CORBA) SALOME packages
+##
 if GUI_ENABLE_CORBA
-  SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
+  SUBDIRS_CORBA = TOOLSGUI Session SalomeApp GuiHelpers TreeData
 endif
 
-DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event \
-               OBJECT GLViewer VTKViewer SVTK OCCViewer SOCC PyInterp PyConsole Plot2d SPlot2d SUPERVGraph \
-               QxGraph QxScene LightApp ResExporter TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
+
+##
+# Extra Python packages
+##
+if ENABLE_PYCONSOLE
+  SUBDIRS_PY_LIGHT = SALOME_SWIG SALOME_PY SALOME_PYQT
+endif
+
+SUBDIRS = $(SUBDIRS_COMMON) $(SUBDIRS_OBJECT) $(SUBDIRS_VIEWERTOOLS) $(SUBDIRS_GLVIEWER) $(SUBDIRS_VTKVIEWER) \
+          $(SUBDIRS_OCCVIEWER) $(SUBDIRS_PLOT2DVIEWER) $(SUBDIRS_SUPERVGRAPHVIEWER) $(SUBDIRS_QXGRAPHVIEWER) \
+          $(SUBDIRS_PYCONSOLE) $(SUBDIRS_LIGHT) $(SUBDIRS_CORBA) $(SUBDIRS_PY_LIGHT)
+
+DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils \
+               OBJECT ViewerTools GLViewer VTKViewer SVTK OCCViewer SOCC Plot2d SPlot2d SUPERVGraph QxGraph QxScene \
+               PyInterp PyConsole LightApp ResExporter TOOLSGUI Session SalomeApp GuiHelpers TreeData \
+               SALOME_SWIG SALOME_PY SALOME_PYQT GUI_PY
index 916806879f1b6333dc517382553c2bf660123c68..48cc0783b5d2142c0cee11f0e2585b8808f17878 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_AISObject.hxx
 //  Module : SALOME
index a7e434013454dd270e25e17ec7aabfc1f79188e2..9691f06b332c3a9d1a301d45a46d3226a8b25f7b 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_AISShape.hxx
 //  Module : SALOME
 #include <Standard.hxx>
 #endif
 
-#ifndef _Handle_AIS_Shape_HeaderFile
-#include <Handle_AIS_Shape.hxx>
+// #ifndef _Handle_AIS_Shape_HeaderFile
+// #include <Handle_AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
 #endif
 
 class Standard_Transient;
@@ -43,7 +47,8 @@ class Handle_Standard_Type;
   \class Handle(AIS_Shape)
   Smart pointer (handle) to AIS_Shape
 */
-class Handle(AIS_Shape);
+// class Handle(AIS_Shape);
+class Handle(AIS_TexturedShape);
 class SALOME_AISShape;
 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOME_AISShape);
 
@@ -51,7 +56,7 @@ Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOME_AISShape);
   \class Handle(SALOME_AISShape)
   Smart pointer (handle) to SALOME_AISShape
 */
-class Handle(SALOME_AISShape) : public Handle(AIS_Shape) {
+class Handle(SALOME_AISShape) : public Handle(AIS_TexturedShape) {
   public:
     inline void* operator new(size_t,void* anAddress) 
       {
@@ -69,12 +74,12 @@ class Handle(SALOME_AISShape) : public Handle(AIS_Shape) {
 //      { 
 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
 //      }
-    Handle(SALOME_AISShape)():Handle(AIS_Shape)() {} 
-    Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_Shape)(aHandle) 
+    Handle(SALOME_AISShape)():Handle(AIS_TexturedShape)() {} 
+    Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_TexturedShape)(aHandle) 
      {
      }
 
-    Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_Shape)((AIS_Shape *)anItem) 
+    Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_TexturedShape)((AIS_TexturedShape *)anItem) 
      {
      }
 
index 30b5d05979e2a70fcea1744039264484e9200c18..128d7e1f05f68203b0c562ac8e97647ffcfccdc7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
index bb2345d08d2a19f959c0b475539c8e4cbb41419d..8b77aa99d42bc8ed8ed058c55ea7a957e61c068a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_Filter.hxx
 //  Module : SALOME
index 07423d80adf18ee2fad48ab5f2f70a9ff03180c8..6fcc95bb5681bfbd70b1a2e94eec85b53aa48fe7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : Handle_SALOME_InteractiveObject.hxx
 //  Module : SALOME
index 5d1533399a5d72c76ca48f4b12db9fd53425851b..e4fde95f17805903407059778072869219fe086a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_ListNodeOfListIO.hxx
 //  Module : SALOME
index 464e4c51d5a7d922745a32aee7b9997f44874a4e..d8e2b7d93d693b319e80572853f1d21b00907995 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : Handle_SALOME_TypeFilter.hxx
 //  Module : SALOME
index b553128dd2db24236967a735063a2f523a1a56c7..575bc88d69107926d436bdce7698294f577916ff 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomeObject.la
@@ -57,7 +58,7 @@ dist_libSalomeObject_la_SOURCES =                             \
        SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx       \
        SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
 
-libSalomeObject_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS)
+libSalomeObject_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@
 libSalomeObject_la_LDFLAGS  = $(QT_LIBS) $(CAS_LDPATH) -lTKV3d
 
 # internal (non-distributed) headers
diff --git a/src/OBJECT/OBJECT.pro b/src/OBJECT/OBJECT.pro
deleted file mode 100644 (file)
index 4f3f219..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SalomeObject
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_LDPATH = -L$${CASROOT}/Linux/lib -lTKV3d
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
-LIBS += $${CAS_LDPATH}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = SALOME_InteractiveObject.hxx
-HEADERS += Handle_SALOME_InteractiveObject.hxx
-HEADERS += SALOME_AISShape.hxx
-HEADERS += Handle_SALOME_AISShape.hxx
-HEADERS += SALOME_AISObject.hxx
-HEADERS += Handle_SALOME_AISObject.hxx
-HEADERS += SALOME_ListIO.hxx
-HEADERS += SALOME_ListIteratorOfListIO.hxx
-HEADERS += Handle_SALOME_ListNodeOfListIO.hxx
-HEADERS += SALOME_ListNodeOfListIO.hxx
-HEADERS += Handle_SALOME_Filter.hxx
-HEADERS += SALOME_Filter.hxx
-HEADERS += Handle_SALOME_TypeFilter.hxx
-HEADERS += SALOME_TypeFilter.hxx
-HEADERS += SALOME_DataMapOfIOMapOfInteger.hxx
-HEADERS += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
-HEADERS += Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
-HEADERS += SALOME_Selection.h
-HEADERS += SALOME_AISObject.ixx
-HEADERS += SALOME_AISObject.jxx
-HEADERS += SALOME_AISShape.ixx
-HEADERS += SALOME_AISShape.jxx
-HEADERS += SALOME_Filter.ixx
-HEADERS += SALOME_Filter.jxx
-HEADERS += SALOME_InteractiveObject.ixx
-HEADERS += SALOME_InteractiveObject.jxx
-HEADERS += SALOME_TypeFilter.ixx
-HEADERS += SALOME_TypeFilter.jxx
-HEADERS += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
-
-SOURCES  = SALOME_InteractiveObject.cxx
-SOURCES += SALOME_AISShape.cxx
-SOURCES += SALOME_AISObject.cxx
-SOURCES += SALOME_ListIO_0.cxx
-SOURCES += SALOME_ListIteratorOfListIO_0.cxx
-SOURCES += SALOME_ListNodeOfListIO_0.cxx
-SOURCES += SALOME_Filter.cxx
-SOURCES += SALOME_TypeFilter.cxx
-SOURCES += SALOME_DataMapOfIOMapOfInteger_0.cxx
-SOURCES += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
-SOURCES += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index d7a0d9b04088b4f0b6839c2900c29ea004eb0db9..319ee455325cba9c15eee94c152badb9012d06ff 100755 (executable)
@@ -1,29 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.hxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//using namespace std;
-//
+
 #include "SALOME_AISObject.ixx"
index 56455d7adefd9c6df2a2c1a7dc50b261fb14ecfb..0e52e30da00a900802ec51c80bbe58feabc49fc7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.hxx
 //  Module : SALOME
@@ -83,7 +84,7 @@ Standard_EXPORT ~SALOME_AISObject();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_AISObject_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index df38078059118445d3b3e78b5570c32f4f87caaa..be6891be706ed6debf788d3e986b70b1e090632e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.ixx
 //  Module : SALOME
@@ -50,10 +51,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_AISObject_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISObject",
-                                                        sizeof(SALOME_AISObject),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_AISObject),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 2284b4acd3a40f38b292a606cff52cef22c93e35..0b3498fd9a352f0c786f8fc3dd7b5dadb7affe14 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISObject.jxx
 //  Module : SALOME
index 3fa0c47b5c43f69479442a271b59bdc279c51f9e..b88ad0c55b004554b34999584f5bc008c357a075 100755 (executable)
@@ -1,31 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
-//  File   : SALOME_AISShape.hxx
+//  File   : SALOME_AISShape.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//using namespace std;
-//
+
 #include "SALOME_AISShape.ixx"
 
 /*!
@@ -33,7 +31,7 @@
   \param shape - TopoDS shape 
 */
 SALOME_AISShape::SALOME_AISShape(const TopoDS_Shape& shape)
-: AIS_Shape(shape)
+: AIS_TexturedShape(shape)
 {
 }
 
index ae878704b6b736242a9303c8d57c9a20a5ca6f08..f986ae74618d1d83cc7aa25aa3a59a32dea20590 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.hxx
 //  Module : SALOME
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
 #include <Handle_SALOME_InteractiveObject.hxx>
 #endif
-#ifndef _AIS_Shape_HeaderFile
-#include <AIS_Shape.hxx>
+// #ifndef _AIS_Shape_HeaderFile
+// #include <AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
 #endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
+
 class SALOME_InteractiveObject;
 class TopoDS_Shape;
 class TColStd_IndexedMapOfInteger;
 
 
-class SALOME_AISShape : public AIS_Shape {
+class SALOME_AISShape : public AIS_TexturedShape {
 
 public:
 
@@ -75,6 +80,10 @@ public:
 Standard_EXPORT SALOME_AISShape(const TopoDS_Shape& shape);
 Standard_EXPORT virtual  Handle_SALOME_InteractiveObject getIO() = 0;
 Standard_EXPORT virtual  Standard_Boolean hasIO() = 0;
+Standard_EXPORT virtual  Standard_Boolean isTopLevel() = 0;
+Standard_EXPORT virtual  Standard_Boolean switchTopLevel() = 0;
+Standard_EXPORT virtual  Standard_Boolean toActivate() = 0;
+Standard_EXPORT virtual  void setTopLevel(Standard_Boolean) = 0;
 Standard_EXPORT virtual  Standard_CString getName() = 0;
 Standard_EXPORT virtual  void setName(const Standard_CString aName) = 0;
 Standard_EXPORT virtual  void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ) = 0;
@@ -87,7 +96,7 @@ Standard_EXPORT ~SALOME_AISShape();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_AISShape_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
@@ -106,7 +115,7 @@ private:
 
  // Fields PRIVATE
  //
-
+  
 
 };
 
index e67417c06793faf0fe4fc1ce622bd6c5547049ec..5ace4ce0e57ceebca6f539a0a8cc6c4758feb231 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.ixx
 //  Module : SALOME
@@ -36,8 +37,8 @@ SALOME_AISShape::~SALOME_AISShape() {}
 Standard_EXPORT Handle_Standard_Type& SALOME_AISShape_Type_()
 {
 
-    static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_Shape);
-  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_Shape);
+  static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_TexturedShape);
+  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_TexturedShape);
   static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_InteractiveObject);
   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_InteractiveObject);
   static Handle_Standard_Type aType3 = STANDARD_TYPE(SelectMgr_SelectableObject);
@@ -52,10 +53,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_AISShape_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISShape",
-                                                        sizeof(SALOME_AISShape),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_AISShape),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 546cc63778f04beda038107c6b270782654389a7..b60ddafdaa48f2b1575c7bbfe2d9f79e56431627 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_AISShape.jxx
 //  Module : SALOME
index 85441bfa3a0cdda834aa5d8c26baff46617a3fd0..5547659f205e98548a7e7fab0e1211102d210e9f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
index 57f6c3c6827c5ee61592a27a0097ceea99135ee0..4b65fe1563b48b499aac778977638121b240f40f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
@@ -43,8 +44,6 @@
 #ifndef _SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
 #include "SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
 #endif
-using namespace std;
-
 
 #define TheKey Handle_SALOME_InteractiveObject
 #define TheKey_hxx "SALOME_InteractiveObject.hxx"
index 4a97001888bbe3dfb32d0f1b89d67f239d2cf5bc..2cf7ba305fcf1ca966758b6131233a3d04ccec30 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
@@ -86,7 +87,7 @@ Standard_EXPORT ~SALOME_DataMapNodeOfDataMapOfIOMapOfInteger();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index 68dc7cad665caea2bc23d9bada83c0195798bf42..41cf76a2a74c1f5968e183f4d608ca6a81b4665f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
@@ -44,7 +45,6 @@
 #ifndef _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
 #include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
 #endif
-using namespace std;
 
 /*!
   Destructor
@@ -69,10 +69,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_DataMapNodeOfDataMapOfIOMapOfIntege
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_DataMapNodeOfDataMapOfIOMapOfInteger",
-                                                        sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 74e65e737d9900fc8356f72e65dc5a26780e92ef..3d68c2f4575bb0ddcf151f555391e2409a05f8db 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapOfIOMapOfInteger.hxx
 //  Module : SALOME
-//
+
 #ifndef _SALOME_DataMapOfIOMapOfInteger_HeaderFile
 #define _SALOME_DataMapOfIOMapOfInteger_HeaderFile
 
@@ -41,6 +42,7 @@
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
+
 class Standard_DomainError;
 class Standard_NoSuchObject;
 class SALOME_InteractiveObject;
@@ -49,7 +51,6 @@ class TColStd_MapTransientHasher;
 class SALOME_DataMapNodeOfDataMapOfIOMapOfInteger;
 class SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger;
 
-
 #ifndef _Standard_HeaderFile
 #include <Standard.hxx>
 #endif
@@ -57,6 +58,8 @@ class SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger;
 #include <Standard_Macro.hxx>
 #endif
 
+#include <Basics_OCCTVersion.hxx>
+
 class SALOME_DataMapOfIOMapOfInteger  : public TCollection_BasicMap {
 
 public:
@@ -73,10 +76,7 @@ public:
       { 
         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
       }
-//    inline void  operator delete(void *anAddress, size_t size) 
-//      { 
-//        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
-//      }
+
  // Methods PUBLIC
  // 
 Standard_EXPORT SALOME_DataMapOfIOMapOfInteger(const Standard_Integer NbBuckets = 1);
@@ -108,40 +108,16 @@ Standard_EXPORT   TColStd_IndexedMapOfInteger& ChangeFind(const Handle(SALOME_In
   return ChangeFind(K);
 }
 
-
-
-
-
-
-protected:
-
- // Methods PROTECTED
- // 
-
-
- // Fields PROTECTED
- //
-
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+Standard_EXPORT   Standard_Address Find1 (const Handle(SALOME_InteractiveObject)& K) const;
+Standard_EXPORT   Standard_Address ChangeFind1 (const Handle(SALOME_InteractiveObject)& K);
+#endif
 
 private: 
-
- // Methods PRIVATE
- // 
 Standard_EXPORT SALOME_DataMapOfIOMapOfInteger(const SALOME_DataMapOfIOMapOfInteger& Other);
-
-
- // Fields PRIVATE
- //
-
-
 };
 
-
-
-
-
 // other inline functions and methods (like "C++: function call" methods)
 //
 
-
 #endif
index e07f3c2ae1ac4e501ff9fea47c4180e072157ee0..ba080cf65372ca466498bf3c7d704c78bd5736c1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_DataMapOfIOMapOfInteger_0.cxx
 //  Module : SALOME
@@ -46,8 +47,6 @@
 #ifndef _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
 #include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
 #endif
-using namespace std;
-
 
 #define TheKey Handle_SALOME_InteractiveObject
 #define TheKey_hxx "SALOME_InteractiveObject.hxx"
index 78626c23ae09d7dd2aedcac807c26f5a5f21f036..c2ff11a6bd996ee34b99be27a65fb74acd6e8029 100644 (file)
@@ -1,30 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SALOME_Filter.ixx"
-using namespace std;
 
index 29735f5da0b25854cc788a82bba251a6b72f0d8d..06be9dc5fe7a68906dae16f0f067741a329ed066 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.hxx
 //  Module : SALOME
@@ -75,7 +76,7 @@ Standard_EXPORT ~SALOME_Filter();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_Filter_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean            IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index 1745ba8c43866467474d512532af83dd28e384e0..faea1aa62911c3ecf1c42fabbe6710c8f75314ac 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.ixx
 //  Module : SALOME
@@ -44,10 +45,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_Filter_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_Filter",
-                                                        sizeof(SALOME_Filter),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_Filter),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 21f56047da0e1db44cc586b73679df7c93d9eca7..ce3db4b9fa0f5564dfeb6b7722c2bdefc254e262 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Filter.jxx
 //  Module : SALOME
index e65c01f6ba1d93ac0055d214deaaf69ee6ac845e..494aac775f4ffbca02367ea9aab245e49479135b 100755 (executable)
@@ -1,31 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//using namespace std;
-//
+
 /*!
   \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
   \brief ...
@@ -51,8 +49,8 @@ SALOME_InteractiveObject::SALOME_InteractiveObject()
   \param aName - name of object
 */
 SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry, 
-                                                  const char* aComponentDataType,
-                                                  const char* aName):
+                                                   const char* aComponentDataType,
+                                                   const char* aName):
   myEntry(anEntry), 
   myName(aName), 
   myComponentDataType(aComponentDataType), 
index fb2ff43001ab7cae30b928f0941dbd06023e2f36..8f8abdbe61bcd2aa7737c46a70e120dcb73aa544 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.hxx
 //  Module : SALOME
 #define _SALOME_InteractiveObject_HeaderFile
 
 #ifndef _Standard_HeaderFile
+// E.A. : Standard.hxx defines PACKAGE and VERSION --> Pb in Werror mode
+// E.A. : --> Add the undef of PACKAGE and VERSION (really ugly !)
+#ifdef PACKAGE
+#undef PACKAGE
+#endif
+#ifdef VERSION
+#undef VERSION
+#endif
+#ifdef HAVE_FINITE
+#undef HAVE_FINITE
+#endif
 #include <Standard.hxx>
 #endif
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
@@ -65,8 +77,8 @@ public:
  // 
 Standard_EXPORT   SALOME_InteractiveObject();
 Standard_EXPORT   SALOME_InteractiveObject(const char* anEntry, 
-                                          const char* aComponentDataType,
-                                          const char* aName = "");
+                                           const char* aComponentDataType,
+                                           const char* aName = "");
 Standard_EXPORT   void setEntry(const char* anEntry) ;
 Standard_EXPORT   const char* getEntry() ;
 Standard_EXPORT   void setName(const char* aName) ;
@@ -97,7 +109,7 @@ friend Standard_Boolean IsEqual(const Handle(SALOME_InteractiveObject)& anIO1,
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_InteractiveObject_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index 31b640c7d62221283006836e6e14cb640c4d2bee..897576315172e47f8dc9d66ed5d285f5bee26789 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.ixx
 //  Module : SALOME
@@ -44,10 +45,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_InteractiveObject_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_InteractiveObject",
-                                                        sizeof(SALOME_InteractiveObject),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_InteractiveObject),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 215d3d2f48c4f9618579f7743d2b4ea9a2a0ecbc..178bdde5a72202ca196122b9bc411b610c86937f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_InteractiveObject.jxx
 //  Module : SALOME
index 4b2e81255d7f4ab5ffa6916b78ed38f66a38749d..84137703a59c136543a8b0eca74207723836226d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIO.hxx
 //  Module : SALOME
index 97af181b5430869105ab157c577a5c807db1c57c..155c22289d65a5f6a8cfa4b36b7dc39759debc74 100644 (file)
@@ -1,28 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIO_0.cxx
-//  Module : SALOME
-//
+
 #include "SALOME_ListIO.hxx"
 
 #ifndef _Standard_NoSuchObject_HeaderFile
@@ -37,8 +37,6 @@
 #ifndef _SALOME_ListNodeOfListIO_HeaderFile
 #include "SALOME_ListNodeOfListIO.hxx"
 #endif
-using namespace std;
-
 
 #define Item Handle_SALOME_InteractiveObject
 #define Item_hxx "SALOME_InteractiveObject.hxx"
index eb355c7f99e411bdc27e000a0b88721583c96466..92303cbec1f547f4d568a012f2022bc14520f917 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIteratorOfListIO.hxx
 //  Module : SALOME
index 54dc233bd7f626bac714743cfc6ff0703adf5f3b..2297f48137aac7ebb9d53c4ac037812827e06fbb 100644 (file)
@@ -1,28 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListIteratorOfListIO_0.cxx
-//  Module : SALOME
-//
+
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #ifndef _Standard_NoMoreObject_HeaderFile
@@ -40,8 +40,7 @@
 #ifndef _SALOME_ListNodeOfListIO_HeaderFile
 #include "SALOME_ListNodeOfListIO.hxx"
 #endif
-using namespace std;
+
 
 #define Item Handle_SALOME_InteractiveObject
 #define Item_hxx "SALOME_InteractiveObject.hxx"
index e3579c28ead25a07994731bfec9f050a958da878..51bd58ebfd131146c7a25c4542a42138ca1e2830 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListNodeOfListIO.hxx
 //  Module : SALOME
@@ -79,7 +80,7 @@ Standard_EXPORT ~SALOME_ListNodeOfListIO();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_ListNodeOfListIO_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index f69e501e7efcf5a5fd26fa4e7531c5ec82d661fa..ed7dcd924d8de2407270deb7f96b80a3ca313bb8 100644 (file)
@@ -1,28 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_ListNodeOfListIO_0.cxx
-//  Module : SALOME
-//
+
 #include "SALOME_ListNodeOfListIO.hxx"
 
 #ifndef _Standard_TypeMismatch_HeaderFile
@@ -38,7 +38,6 @@
 #ifndef _SALOME_ListIteratorOfListIO_HeaderFile
 #include "SALOME_ListIteratorOfListIO.hxx"
 #endif
-using namespace std;
 
 /*!
   Destructor
@@ -62,10 +61,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_ListNodeOfListIO_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_ListNodeOfListIO",
-                                                        sizeof(SALOME_ListNodeOfListIO),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_ListNodeOfListIO),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 0e5fb270596b6d242cfc7218a3d218a8c9f94826..43af8ad87dfef03de0aab379c4d1b62fc8227f3a 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Selection : description of enumeration Selection_Mode
 //  File   : SALOME_Selection.h
 //  Author :
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SALOME_SELECTION_H
 #define SALOME_SELECTION_H
 
index 62db81b46c67ed16a80dde05e04d9f567fe27328..d7a623b2521c9cca2e55026f2491d4e9bec35542 100644 (file)
@@ -1,33 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SALOME_TypeFilter.ixx"
 #include "SALOME_InteractiveObject.hxx"
-using namespace std;
 
 /*!
   Constructor
index 178618c30322a6fa49d97da86d9cba0df4d24062..9e6c032157b47ce9e3baa2723d2be04d29a5c4d9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.hxx
 //  Module : SALOME
@@ -79,7 +80,7 @@ Standard_EXPORT ~SALOME_TypeFilter();
  //
  Standard_EXPORT friend Handle_Standard_Type& SALOME_TypeFilter_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index 6e2350a0d7759eba4d788183e61486e2c6f59907..5b2d736d7dbb3ca12bf250034ac8eb0e9dd7b698 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.ixx
 //  Module : SALOME
@@ -46,10 +47,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_TypeFilter_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("SALOME_TypeFilter",
-                                                        sizeof(SALOME_TypeFilter),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(SALOME_TypeFilter),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 58d9312fcca86c7b5de6f384b8c07b4fd4fb82d3..249780fc85fcff014ae76e0e1b3c9e6ca54979a3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_TypeFilter.jxx
 //  Module : SALOME
index 7e77377e21edd18ade767dbbccecd39a8b4bbeda..14c993ba4aaabdd883c0ac52a8e51a81b6694db9 100755 (executable)
@@ -1,29 +1,31 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : OCCViewer
 #  $Header$
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libOCCViewer.la
@@ -42,7 +44,11 @@ salomeinclude_HEADERS =                              \
        OCCViewer_ClippingDlg.h                 \
        OCCViewer_AxialScaleDlg.h               \
        OCCViewer_SetRotationPointDlg.h         \
-       OCCViewer_Trihedron.h
+       OCCViewer_Trihedron.h                   \
+       OCCViewer_FontWidget.h                  \
+       OCCViewer_CubeAxesDlg.h                 \
+       OCCViewer_ToolTip.h                     \
+       OCCViewer_ViewFrame.h
 
 dist_libOCCViewer_la_SOURCES =                 \
        OCCViewer_AISSelector.cxx               \
@@ -58,7 +64,10 @@ dist_libOCCViewer_la_SOURCES =                       \
        OCCViewer_ClippingDlg.cxx               \
        OCCViewer_AxialScaleDlg.cxx             \
        OCCViewer_Trihedron.cxx                 \
-       OCCViewer_ToolTip.cxx
+       OCCViewer_FontWidget.cxx                \
+       OCCViewer_CubeAxesDlg.cxx               \
+       OCCViewer_ToolTip.cxx                   \
+       OCCViewer_ViewFrame.cxx
 
 MOC_FILES =                                    \
        OCCViewer_AISSelector_moc.cxx           \
@@ -72,11 +81,16 @@ MOC_FILES =                                 \
        OCCViewer_SetRotationPointDlg_moc.cxx   \
        OCCViewer_ClippingDlg_moc.cxx           \
        OCCViewer_AxialScaleDlg_moc.cxx         \
-       OCCViewer_ToolTip_moc.cxx
-       
+       OCCViewer_FontWidget_moc.cxx            \
+       OCCViewer_CubeAxesDlg_moc.cxx           \
+       OCCViewer_ToolTip_moc.cxx               \
+       OCCViewer_ViewFrame_moc.cxx
+
 nodist_libOCCViewer_la_SOURCES = $(MOC_FILES)
 
 dist_salomeres_DATA =                          \
+       resources/occ_view_anticlockwise.png    \
+       resources/occ_view_clockwise.png        \
        resources/occ_view_back.png             \
        resources/occ_view_bottom.png           \
        resources/occ_view_camera_dump.png      \
@@ -84,6 +98,8 @@ dist_salomeres_DATA =                         \
        resources/occ_view_clipping.png         \
        resources/occ_view_clipping_pressed.png \
        resources/occ_view_scaling.png          \
+       resources/occ_view_graduated_axes.png   \
+       resources/occ_view_ambient.png          \
        resources/occ_view_fitall.png           \
        resources/occ_view_fitarea.png          \
        resources/occ_view_front.png            \
@@ -98,14 +114,23 @@ dist_salomeres_DATA =                              \
        resources/occ_view_top.png              \
        resources/occ_view_triedre.png          \
        resources/occ_view_zoom.png             \
-       resources/occ_view_rotation_point.png
+       resources/occ_view_rotation_point.png   \
+       resources/occ_view_style_switch.png     \
+       resources/occ_view_zooming_style_switch.png \
+       resources/occ_view_maximized.png        \
+       resources/occ_view_minimized.png        \
+       resources/occ_view_sync.png
 
 nodist_salomeres_DATA =                \
        OCCViewer_images.qm     \
-       OCCViewer_msg_en.qm 
+       OCCViewer_msg_en.qm     \
+       OCCViewer_msg_fr.qm 
 
-libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) \
-       -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@ \
+       -I$(srcdir)/../SUIT -I$(srcdir)/../ViewerTools -I$(srcdir)/../Qtx \
+       -I$(srcdir)/../OpenGLUtils -I$(srcdir)/../CASCatch
 
 libOCCViewer_la_LDFLAGS  = $(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER)
-libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la
+
+libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la \
+       ../ViewerTools/libViewerTools.la ../OpenGLUtils/libOpenGLUtils.la
index 6f2948d8e7cbd43aeaba905b15324ff5c17d680f..8d271737fda6446ef118253d3645368f1dd97206 100755 (executable)
@@ -1,26 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifdef WIN32
-#ifdef OCCVIEWER_EXPORTS
+#if defined OCCVIEWER_EXPORTS || defined OCCViewer_EXPORTS
 #define OCCVIEWER_EXPORT __declspec(dllexport)
 #else
 #define OCCVIEWER_EXPORT __declspec(dllimport)
diff --git a/src/OCCViewer/OCCViewer.pro b/src/OCCViewer/OCCViewer.pro
deleted file mode 100644 (file)
index b5560bb..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = OCCViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-OGL_INCLUDES = 
-
-OGL_LIBS = -lGL -L/usr/X11R6/lib -lGLU
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-CAS_VIEWER = -L$${CASROOT}/Linux/lib -lTKV3d -lTKService
-
-INCLUDEPATH += ../../include $${OGL_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${OGL_LIBS} $${CAS_KERNEL} $${CAS_VIEWER}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += OCCVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = OCCViewer_AISSelector.h
-HEADERS += OCCViewer_ViewManager.h
-HEADERS += OCCViewer_ViewModel.h
-HEADERS += OCCViewer_ViewPort3d.h
-HEADERS += OCCViewer_ViewPort.h
-HEADERS += OCCViewer_ViewWindow.h
-HEADERS += OCCViewer_VService.h
-HEADERS += OCCViewer_CreateRestoreViewDlg.h
-HEADERS += OCCViewer.h
-HEADERS += OCCViewer_ClippingDlg.h
-HEADERS += OCCViewer_SetRotationPointDlg.h
-
-SOURCES  = OCCViewer_AISSelector.cxx
-SOURCES += OCCViewer_ViewManager.cxx
-SOURCES += OCCViewer_ViewModel.cxx
-SOURCES += OCCViewer_ViewPort3d.cxx
-SOURCES += OCCViewer_ViewPort.cxx
-SOURCES += OCCViewer_ViewWindow.cxx
-SOURCES += OCCViewer_VService.cxx
-SOURCES += OCCViewer_CreateRestoreViewDlg.cxx
-SOURCES += OCCViewer_SetRotationPointDlg.cxx
-SOURCES += OCCViewer_ClippingDlg.cxx
-
-TRANSLATIONS = resources/OCCViewer_images.ts \
-               resources/OCCViewer_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 44b55e471281af7c3102f216b12c5a3e0094b1f6..89b8531ee48163ea0a28d0e2770f8f368b01342e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_AISSelector.h"
 
 /*!
index a311b47d41605ce5e84ff1b52760005b39e7627c..bad33212645ef8b2d00a53e4c29e897dcf1c16d2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #if !defined( OCCVIEWER_AISSELECTOR_H )
 #define OCCVIEWER_AISSELECTOR_H
 
index d670db0fe3c54d358c57ad1759942e92740ac451..75442651546c2d2e85bbd0d728b50371ac855f4b 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_AxialScaleDlg.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewPort3d.h"
@@ -41,8 +39,8 @@
   \param view - view window
   \param parent - parent widget
 */
-OCCViewer_AxialScaleDlg::OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* view, QWidget* parent )
-  : QDialog( parent ),
+OCCViewer_AxialScaleDlg::OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* view )
+  : QDialog( view ),
     myView( view )
 {
   setWindowTitle( tr( "DLG_SCALING" ) );
@@ -143,7 +141,7 @@ void OCCViewer_AxialScaleDlg::Update()
 {
   // Get values from the OCC view
   double aScaleFactor[3];
-  myView->getViewPort()->getView()->AxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+  myView->getViewPort()->getAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
   m_sbXcoeff->setValue( aScaleFactor[0] );
   m_sbYcoeff->setValue( aScaleFactor[1] );
   m_sbZcoeff->setValue( aScaleFactor[2] );
@@ -164,7 +162,7 @@ void OCCViewer_AxialScaleDlg::accept()
 bool OCCViewer_AxialScaleDlg::apply()
 {
   double aScaleFactor[3] = { m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value() };
-  myView->getViewPort()->getView()->SetAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+  myView->getViewPort()->setAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
   return true;
 }
 
index 5bb70804c0bacdc278c4af81689cdb4b05cc4682..7b2489ba6f40bd1c7b8a77de80deec7c6f83a763 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_AXIALSCALEDLG_H
 #define OCCVIEWER_AXIALSCALEDLG_H
 
@@ -35,7 +33,7 @@ class OCCVIEWER_EXPORT OCCViewer_AxialScaleDlg : public QDialog
   Q_OBJECT
 
 public:
-  OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow*, QWidget* = 0 );
+  OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* );
   ~OCCViewer_AxialScaleDlg();
 
   void Update();
index 11213fd3898dab5d2ef9af9049d13ab652c42ed8..e11642888130939b0eebfcd40d84d6b2c8405742 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_ClippingDlg.h"
 
 #include <QtxDoubleSpinBox.h>
@@ -61,8 +62,8 @@
   \param modal - is this dialog modal
   \param fl - flags
 */
-OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
-: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
   myView( view )
 {
   setObjectName( "OCCViewer_ClippingDlg" );
@@ -86,7 +87,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   const double min = -1e+7;
   const double max =  1e+7;
   const double step = 5;
-  const int precision = 3;
+  const int precision = -7;
 
   TextLabelX = new QLabel( GroupPoint );
   TextLabelX->setObjectName( "TextLabelX" );
@@ -95,7 +96,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   
   SpinBox_X = new QtxDoubleSpinBox( min, max, step, GroupPoint );
   SpinBox_X->setObjectName("SpinBox_X" );
-  SpinBox_X->setDecimals( precision );
+  SpinBox_X->setPrecision( precision );
   GroupPointLayout->addWidget( SpinBox_X, 0, 1 );
 
   TextLabelY = new QLabel( GroupPoint );
@@ -105,7 +106,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
 
   SpinBox_Y = new QtxDoubleSpinBox( min, max, step, GroupPoint );
   SpinBox_Y->setObjectName("SpinBox_Y" );
-  SpinBox_Y->setDecimals( precision );
+  SpinBox_Y->setPrecision( precision );
   GroupPointLayout->addWidget( SpinBox_Y, 0, 3 );
 
   TextLabelZ = new QLabel( GroupPoint );
@@ -115,7 +116,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
 
   SpinBox_Z = new QtxDoubleSpinBox( min, max, step, GroupPoint );
   SpinBox_Z->setObjectName("SpinBox_Z" );
-  SpinBox_Z->setDecimals( precision );
+  SpinBox_Z->setPrecision( precision );
   GroupPointLayout->addWidget( SpinBox_Z, 0, 5 );
 
   resetButton  = new QPushButton( GroupPoint );
@@ -140,7 +141,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   
   SpinBox_Dx = new QtxDoubleSpinBox( min, max, step, GroupDirection );
   SpinBox_Dx->setObjectName("SpinBox_Dx" );
-  SpinBox_Dx->setDecimals( precision );
+  SpinBox_Dx->setPrecision( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dx, 0, 1 );
 
   TextLabelDy = new QLabel( GroupDirection );
@@ -150,7 +151,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   
   SpinBox_Dy = new QtxDoubleSpinBox( min, max, step, GroupDirection );
   SpinBox_Dy->setObjectName("SpinBox_Dy" );
-  SpinBox_Dy->setDecimals( precision );
+  SpinBox_Dy->setPrecision( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dy, 0, 3 );
 
   TextLabelDz = new QLabel( GroupDirection );
@@ -160,7 +161,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidge
   
   SpinBox_Dz = new QtxDoubleSpinBox( min, max, step, GroupDirection );
   SpinBox_Dz->setObjectName("SpinBox_Dz" );
-  SpinBox_Dz->setDecimals( precision );
+  SpinBox_Dz->setPrecision( precision );
   GroupDirectionLayout->addWidget( SpinBox_Dz, 0, 5 );
 
   invertButton  = new QPushButton( GroupDirection );
@@ -265,9 +266,9 @@ void OCCViewer_ClippingDlg::closeEvent( QCloseEvent* e )
   erasePreview();
   
   // Set the clipping plane back
-  Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+  /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
   if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
-    aView3d->SetPlaneOn( myClippingPlane );
+  aView3d->SetPlaneOn( myClippingPlane );*/
   
   myAction->setChecked( false );
   
@@ -280,7 +281,7 @@ void OCCViewer_ClippingDlg::closeEvent( QCloseEvent* e )
 */
 void OCCViewer_ClippingDlg::showEvent( QShowEvent* e )
 {
-  ReserveClippingPlane();
+  //ReserveClippingPlane();
   
   QDialog::showEvent( e );
   onPreview( PreviewChB->isChecked() );
@@ -305,10 +306,10 @@ void OCCViewer_ClippingDlg::ClickOnClose()
   erasePreview();
 
   // Set the clipping plane back
-  Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+  /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
   if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
     aView3d->SetPlaneOn( myClippingPlane );
-
+  */
   myAction->setChecked( false );
   
   reject();
@@ -325,13 +326,13 @@ void OCCViewer_ClippingDlg::ClickOnApply()
   qApp->processEvents();
   
   myView->setCuttingPlane( true, SpinBox_X->value() , SpinBox_Y->value() , SpinBox_Z->value(),
-                                SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() );
+                                 SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() );
   
   QApplication::restoreOverrideCursor(); 
   
   erasePreview();
   
-  ReserveClippingPlane();
+  //ReserveClippingPlane();
 }
 
 /*!
@@ -496,14 +497,15 @@ void OCCViewer_ClippingDlg::displayPreview()
       
       intersector.Perform( gp_Lin( aCenter, aNormal), gp_Pln( aBasePnt, aNormal), Precision::Confusion() );
       if ( intersector.IsDone() && intersector.NbPoints() == 1 )
-       aBasePnt = intersector.Point( 1 );
+        aBasePnt = intersector.Point( 1 );
     }
   
   myPreviewPlane = new AIS_Plane( new Geom_Plane( aBasePnt, aNormal ) );
   myPreviewPlane->SetSize( aSize, aSize );
   
   // Deactivate clipping planes
-  myView->getViewPort()->getView()->SetPlaneOff();
+  //myView->getViewPort()->getView()->SetPlaneOff();
+  //myView->setPlaneOff();
 
   ic->Display( myPreviewPlane, 1, -1, false );
   ic->SetWidth( myPreviewPlane, 10, false );
@@ -574,13 +576,13 @@ bool OCCViewer_ClippingDlg::isValid()
 */
 void OCCViewer_ClippingDlg::ReserveClippingPlane()
 {
-  Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+  /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
   if ( !aView3d.IsNull() )
     {
       aView3d->InitActivePlanes();
       if ( aView3d->MoreActivePlanes() )
-       myClippingPlane = aView3d->ActivePlane();
-    }
+        myClippingPlane = aView3d->ActivePlane();
+        }*/
 }
 
 void OCCViewer_ClippingDlg::onViewShow()
index 760115595f0dec99efb7ac1f117ca0b090c288ea..b979ff5d293aa7bfa4ad8015971f37b62c2f8a95 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_CLIPPINGDLG_H
 #define OCCVIEWER_CLIPPINGDLG_H
 
@@ -49,7 +50,7 @@ class OCCViewer_ClippingDlg : public QDialog
     Q_OBJECT
     
     public:
-    OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+    OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
     ~OCCViewer_ClippingDlg();
 
     void SetAction( QtxAction* theAction ) { myAction = theAction; }
@@ -93,7 +94,7 @@ private :
     OCCViewer_ViewWindow* myView;
 
     Handle(AIS_Plane) myPreviewPlane;
-    Handle(V3d_Plane) myClippingPlane;
+    //Handle(V3d_Plane) myClippingPlane;
     
     bool myBusy;
 
index f1980d61d2411958800b55b2ed173a48e1cc9d21..f451209c1a4b92f70c35fb19f163c5b62318c42c 100755 (executable)
@@ -1,26 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_CreateRestoreViewDlg.h"
-#include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewPort3d.h"
 
 #include <QPushButton>
 /*!
   Constructor
 */
-OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, OCCViewer_Viewer* curModel )
+OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, OCCViewer_ViewWindow* theViewWindow )
 : QDialog( aWin )
 {
   setWindowTitle( tr( "CAPTION" ) );
 
-  myParametersMap = curModel->getViewAspects();
+  myParametersMap = theViewWindow->getViewAspects();
 
   myKeyFlag = 0;
 
   int aQuantityOfItems = myParametersMap.count();
-       
+        
   setFixedSize( 400, 300 );
 
   QGridLayout* aGrid = new QGridLayout( this );
@@ -52,17 +52,17 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O
 
   QWidget* aWidget1 = new QWidget( this );
   QWidget* aWidget2 = new QWidget( this );
-       
+        
   QHBoxLayout* aLayout = new QHBoxLayout( aWidget1 );
-       
+        
   myListBox = new QListWidget( aWidget1 );
   myListBox->installEventFilter( this );
 
-  myCurViewPort = new OCCViewer_ViewPort3d( aWidget1, curModel->getViewer3d(), V3d_ORTHOGRAPHIC );
+  myCurViewPort = new OCCViewer_ViewPort3d( aWidget1, theViewWindow->getViewPort()->getViewer(), V3d_ORTHOGRAPHIC );
   myCurViewPort->getView()->SetBackgroundColor( Quantity_NOC_BLACK );
 
   myListBox->setEditTriggers( QAbstractItemView::DoubleClicked );
-       
+        
   if ( aQuantityOfItems )
   {
     myListBox->clear();
@@ -81,7 +81,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O
 
   connect( myListBox, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( changeImage( QListWidgetItem* ) ) );
   connect( myListBox, SIGNAL( itemChanged( QListWidgetItem* ) ), this, SLOT( editItemText( QListWidgetItem* ) ) );
-       
+        
   aLayout->addWidget( myListBox );
   aLayout->addWidget( myCurViewPort, 30 );
 
@@ -90,8 +90,8 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O
   aButtonLayout->setSpacing( 5 );
 
   QPushButton* theOk     = new QPushButton( tr( "Ok" ), aWidget2 );            theOk->setAutoDefault( false );
-  QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 );                 theCancel->setAutoDefault( false );
-  QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 );                 theDelete->setAutoDefault( false );
+  QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 );          theCancel->setAutoDefault( false );
+  QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 );          theDelete->setAutoDefault( false );
   QPushButton* theClearAll = new QPushButton( tr( "Clear List" ), aWidget2 );  theClearAll->setAutoDefault( false );
 
   aButtonLayout->addWidget( theOk );
@@ -101,7 +101,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O
 
   aGrid->addWidget( aWidget1, 0, 0 );
   aGrid->addWidget( aWidget2, 1, 0 );
-       
+        
   connect( theOk, SIGNAL( clicked() ), this, SLOT( OKpressed() ) );
   connect( theCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( theDelete, SIGNAL( clicked() ), this, SLOT( deleteSelectedItems() ) );
@@ -130,25 +130,25 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem )
     {
       for( int i = 0; i < (int)myListBox->count(); i++ )
       {
-       if( myListBox->item( i )->isSelected() && i != index )
-       {
-         myListBox->clearSelection();
-         if( i > index )
-         {
-           lowLevel  = index;
-           highLevel = i;
-         }
-         else
-         {
-           lowLevel  = i;
-           highLevel = index;
-         }
-         for( int j = lowLevel; j <= highLevel; j++ )
-           myListBox->item( j )->setSelected( TRUE );
-         break;
-       }
-       if( myListBox->item( i )->isSelected() && i == index )
-         myListBox->item( i )->setSelected( TRUE );
+        if( myListBox->item( i )->isSelected() && i != index )
+        {
+          myListBox->clearSelection();
+          if( i > index )
+          {
+            lowLevel  = index;
+            highLevel = i;
+          }
+          else
+          {
+            lowLevel  = i;
+            highLevel = index;
+          }
+          for( int j = lowLevel; j <= highLevel; j++ )
+            myListBox->item( j )->setSelected( TRUE );
+          break;
+        }
+        if( myListBox->item( i )->isSelected() && i == index )
+          myListBox->item( i )->setSelected( TRUE );
       }
     }
     
@@ -180,25 +180,38 @@ viewAspect OCCViewer_CreateRestoreViewDlg::currentItem() const
 */
 void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
 {
-  if( myListBox->count() )
+  QList<QListWidgetItem*> selectedItems = myListBox->selectedItems();
+  if( myListBox->count() && selectedItems.count())
   {
     int curIndex = -1;
-    for( int i = 0; i < (int)myListBox->count(); i++ )
-      if( myListBox->item( i )->isSelected() && ( myListBox->item( i )->flags() & Qt::ItemIsEditable ) )
+    // Iterate by all selected items
+    for(int i = 0; i < selectedItems.count(); i++) 
+    {
+      QListWidgetItem* item =  selectedItems.at(i);
+      // get position of the selected item in the list
+      int position = myListBox->row(item);
+
+      //Calculate current index in case if "item" is last selected item.
+      if(i == selectedItems.count() - 1)
       {
-       QListWidgetItem* anItemToDelete = myListBox->takeItem( i );
-       delete anItemToDelete;
-       for( int j = i; j < (int)myParametersMap.count(); j++ )
-         if( j != myParametersMap.count() - 1 )
-           myParametersMap[ j ] = myParametersMap[ j + 1 ];
-         else
-           myParametersMap.removeAt( j );
-       if( i != myListBox->count() )
-         curIndex = i;
+       if(position != myListBox->count() - 1)
+         curIndex = position;
+       else 
+         curIndex = position - 1;
+      }
+
+      //Delete item
+      delete item;
+
+      //Shift parameters in the map
+      for( int j = position; j < (int)myParametersMap.count(); j++ )
+      {
+       if( j != myParametersMap.count() - 1 )
+         myParametersMap[ j ] = myParametersMap[ j + 1 ];
        else
-         curIndex = i - 1;
-       i--;
+         myParametersMap.removeAt( j );
       }
+    }
     if( curIndex >= 0 )
     {
       myListBox->setCurrentItem( myListBox->item( curIndex ) );
@@ -207,8 +220,7 @@ void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
   }
   if( !myListBox->count() )
   {
-    myListBox->clear();
-    myListBox->insertItem( 0, "No Items" );
+    clearList();
   }
 }
 
@@ -219,8 +231,10 @@ void OCCViewer_CreateRestoreViewDlg::clearList()
 {
   myListBox->clear();
   myListBox->insertItem( 0, "No Items" );
-  
   myParametersMap.clear();
+       
+  //Clear view
+  myCurViewPort->reset();
 }
 
 /*!
@@ -252,12 +266,12 @@ bool OCCViewer_CreateRestoreViewDlg::eventFilter( QObject* anObj, QEvent* anEv )
     if( aKeyEv->key() == Qt::Key_Control )
     {
       myKeyFlag = 1;
-      myListBox->setSelectionMode( QAbstractItemView::MultiSelection );        
+      myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); 
     }
     else if( aKeyEv->key() == Qt::Key_Shift )
     {
       myKeyFlag = 2;
-      myListBox->setSelectionMode( QAbstractItemView::MultiSelection );        
+      myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); 
     }
     else
       myListBox->setSelectionMode( QAbstractItemView::SingleSelection );
index 1a08d04eaaa96b1b185d922e0c3476c2413530c2..13378b04097f61e5696363cdea795c1606f42ad9 100755 (executable)
@@ -1,30 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_CREATERESTOREVIEWDLG_H
 #define OCCVIEWER_CREATERESTOREVIEWDLG_H
 
 #include "OCCViewer.h"
 
-#include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewWindow.h"
 
 #include <QtxDialog.h>
@@ -43,32 +43,32 @@ class QListWidgetItem;
 
 class OCCVIEWER_EXPORT OCCViewer_CreateRestoreViewDlg : public QDialog
 {
-       Q_OBJECT
+        Q_OBJECT
 
 public:
-       OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_Viewer* );
-       virtual ~OCCViewer_CreateRestoreViewDlg();
+        OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_ViewWindow* );
+        virtual ~OCCViewer_CreateRestoreViewDlg();
 
-       const viewAspectList&         parameters() const;
-       viewAspect                    currentItem() const;
-       virtual bool                  eventFilter( QObject*, QEvent* );
+        const viewAspectList&         parameters() const;
+        viewAspect                    currentItem() const;
+        virtual bool                  eventFilter( QObject*, QEvent* );
 
 public slots:
-       void                          OKpressed();
-       void                          clearList();
-       void                          editItemText( QListWidgetItem* );
-       void                          changeImage( QListWidgetItem* );
-       void                          deleteSelectedItems();
+        void                          OKpressed();
+        void                          clearList();
+        void                          editItemText( QListWidgetItem* );
+        void                          changeImage( QListWidgetItem* );
+        void                          deleteSelectedItems();
 
 signals:
-       void                          dlgOk();
+        void                          dlgOk();
 
 private:
-       int                           myKeyFlag;
-       QListWidget*                  myListBox;
-       OCCViewer_ViewPort3d*         myCurViewPort;
-       viewAspect                    myCurrentItem;
-       viewAspectList                myParametersMap;
+        int                           myKeyFlag;
+        QListWidget*                  myListBox;
+        OCCViewer_ViewPort3d*         myCurViewPort;
+        viewAspect                    myCurrentItem;
+        viewAspectList                myParametersMap;
 };
 
 #ifdef WIN32
index 8d8b6b6966bab59ef641c4093bac9df844f7dee5..faea13588e2e2246a82b82ae5a821c96435b62f0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_SetRotationPointDlg.h"
 
 #include <QtxAction.h>
@@ -42,8 +43,8 @@
   \param modal - is this dialog modal
   \param fl - flags
 */
-OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
-: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
   myView( view )
 {
   setObjectName( "OCCViewer_SetRotationPointDlg" );
@@ -208,8 +209,8 @@ OCCViewer_SetRotationPointDlg
   }
   else
     myView->activateSetRotationSelected(myX->text().toDouble(), 
-                                       myY->text().toDouble(), 
-                                       myZ->text().toDouble());
+                                        myY->text().toDouble(), 
+                                        myZ->text().toDouble());
 }
 
 void
@@ -220,8 +221,8 @@ OCCViewer_SetRotationPointDlg
     mySelectPoint->toggle();
   setCoords();
   myView->activateSetRotationSelected(myX->text().toDouble(), 
-                                     myY->text().toDouble(), 
-                                     myZ->text().toDouble());
+                                      myY->text().toDouble(), 
+                                      myZ->text().toDouble());
 }
 
 void
@@ -241,12 +242,12 @@ OCCViewer_SetRotationPointDlg
   if ( !myIsBBCenter->isChecked() )
   {
     if ( mySelectPoint->isChecked()
-        &&
-        ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+         &&
+         ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
       mySelectPoint->toggle();
     myView->activateSetRotationSelected(myX->text().toDouble(), 
-                                       myY->text().toDouble(), 
-                                       myZ->text().toDouble());
+                                        myY->text().toDouble(), 
+                                        myZ->text().toDouble());
   }
 }
 
index 03651d66c9ee174ad4366ead8ddc47a5b4569f7d..0b2f255c6838124ad38926712740a51e6ad79305 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_SETROTATIONPOINTDLG_H
 #define OCCVIEWER_SETROTATIONPOINTDLG_H
 
@@ -40,8 +41,8 @@ class OCCVIEWER_EXPORT OCCViewer_SetRotationPointDlg : public QDialog
   Q_OBJECT
 
 public:
-  OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, 
-                               const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+  OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , 
+                                const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
   ~OCCViewer_SetRotationPointDlg();
 
   void SetAction( QtxAction* theAction ) { myAction = theAction; }
index 3efef8d2ba67123aabd2ec73c7c3a8d81fc1253b..f74a6296a3757518f06137313b26f064d4adcf76 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      OCCViewer_ToolTip.cxx
 // Author:    Alexandre SOLOVYOV
 //
@@ -41,7 +39,7 @@ OCCViewer_ToolTip::OCCViewer_ToolTip( OCCViewer_ViewWindow* wnd )
   myWnd( wnd )
 {
   connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
-          this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+           this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
 }
 
 /*!
index 5ff60c81ce693ed0611dbd2ae8d9b30b392c8b0b..7ee433afb767f1edf6547035aa32d309a6238fa5 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_TOOLTIP_H
 #define OCCVIEWER_TOOLTIP_H
 
index e875d9af92a968f010799a27533a57cb46674426..8e32ea1b4b8be8c124d71ca745b4869d975bf452 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifdef WIN32
 #include <windows.h>
 #endif
@@ -88,8 +86,8 @@ void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
  * Redefined method. Calculates the object presentation.
  */
 void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )&,
-                                  const Handle( Prs3d_Presentation )& aPrs,
-                                  const Standard_Integer aMode )
+                                   const Handle( Prs3d_Presentation )& aPrs,
+                                   const Standard_Integer aMode )
 {
   if( aPrs.IsNull() )
     return;
@@ -102,7 +100,7 @@ void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )&
  * Redefined method. Does nothing.
  */
 void OCCViewer_Trihedron::ComputeSelection( const Handle( SelectMgr_Selection )& theSelection,
-                                           const Standard_Integer theMode )
+                                            const Standard_Integer theMode )
 {
 }
 
index 549e592e095ebca336009cc9f236c00bc628c6ce..d805f8229ce4fe559be2246e0852d890b552ea59 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_TRIHEDRON_H
 #define OCCVIEWER_TRIHEDRON_H
 
@@ -39,11 +37,11 @@ public:
   virtual ~OCCViewer_Trihedron();
 
   virtual void           Compute( const Handle(PrsMgr_PresentationManager3d)&,
-                                 const Handle(Prs3d_Presentation)&,
-                                 const Standard_Integer );
+                                  const Handle(Prs3d_Presentation)&,
+                                  const Standard_Integer );
 
   virtual void           ComputeSelection( const Handle( SelectMgr_Selection )&,
-                                          const Standard_Integer );
+                                           const Standard_Integer );
 
   virtual void           bounds( Graphic3d_CBounds& ) const;
 
index e7ba5ea8fffc3417f39a95e16e0db77b9920e1ab..5614fa63b666266b2a327f33f054a4f4d4221452 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_VService.h"
 #include <V3d_Viewer.hxx>
 #include <V3d_View.hxx>
@@ -32,7 +33,6 @@
 #include <WNT_Window.hxx>
 #include <Graphic3d_WNTGraphicDevice.hxx>
 #include <WNT_GraphicDevice.hxx>
-#include <WNT_GraphicDevice.hxx>
 #include <WNT_WDriver.hxx>
 #include <InterfaceGraphic_WNT.hxx>
 #else
@@ -82,36 +82,45 @@ return XServiceImageDevice;
 #endif // WNT
 
 /*!
-    Maps CasCade view to the window [ static ]
+    Create native view window for CasCade view [ static ]
 */
-void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
-                                 const Standard_Integer hiwin,
-                                 const Standard_Integer lowin,
-                                 const Xw_WindowQuality quality )
+Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& view,
+                                                        const Standard_Integer hiwin,
+                                                        const Standard_Integer lowin,
+                                                        const Xw_WindowQuality quality )
 {
 #ifdef WNT
-  Handle(WNT_Window) w =
-      new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
-  // Prevent flicker
-  w->SetFlags( WDF_NOERASEBKGRND );
+  Handle(WNT_Window) viewWindow = new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
+  // Prevent flickering
+  viewWindow->SetFlags( WDF_NOERASEBKGRND );
 #else
-  Handle(Xw_Window) w =
-      new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
+  Handle(Xw_Window) viewWindow = new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
 #endif
-  view->SetWindow( w );
+  return viewWindow;
+}
+
+/*!
+    Maps CasCade view to the window [ static ]
+*/
+void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
+                                    const Standard_Integer hiwin,
+                                    const Standard_Integer lowin,
+                                    const Xw_WindowQuality quality )
+{
+  view->SetWindow( OCCViewer_VService::CreateWindow( view, hiwin, lowin, quality ) );
 }
 
 /*!
     Magnifies 'view' based on previous view [ static ]
 */
 void OCCViewer_VService::SetMagnify( const Handle(V3d_View)& view,
-                                  const Standard_Integer hiwin,
-                                  const Standard_Integer lowin,
-                                  const Handle(V3d_View)& prevView,
-                                  const Standard_Integer x1,
-                                  const Standard_Integer y1,
-                                  const Standard_Integer x2,
-                                  const Standard_Integer y2,
+                                   const Standard_Integer hiwin,
+                                   const Standard_Integer lowin,
+                                   const Handle(V3d_View)& prevView,
+                                   const Standard_Integer x1,
+                                   const Standard_Integer y1,
+                                   const Standard_Integer x2,
+                                   const Standard_Integer y2,
                                const Xw_WindowQuality aQuality )
 {
 #ifdef WNT
@@ -156,11 +165,11 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay
     Creates view 2D and maps it to the window [ static ]
 */
 /*Handle(V2d_View) OCCViewer_VService::View2d( const Handle(V2d_Viewer)& aViewer,
-                                                          const Standard_Integer hiwin,
-                                                          const Standard_Integer lowin,
-                                                          const Xw_WindowQuality aQuality,
-                                                          const Standard_Boolean Update,
-                                                          const Quantity_NameOfColor BackColor )
+                                                           const Standard_Integer hiwin,
+                                                           const Standard_Integer lowin,
+                                                           const Xw_WindowQuality aQuality,
+                                                           const Standard_Boolean Update,
+                                                           const Quantity_NameOfColor BackColor )
 {
 #ifdef WNT
     Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
@@ -181,11 +190,11 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay
     Creates view 2D and maps it to the window [ static ]
 */
 /*Handle(V2d_View) OCCViewer_VService::dpsView2d( const Handle(V2d_Viewer)& aViewer,
-                                                             const Standard_Integer hiwin,
-                                                             const Standard_Integer lowin,
-                                                             const Xw_WindowQuality aQuality,
-                                                             const Standard_Boolean Update,
-                                                             const Quantity_NameOfColor BackColor )
+                                                              const Standard_Integer hiwin,
+                                                              const Standard_Integer lowin,
+                                                              const Xw_WindowQuality aQuality,
+                                                              const Standard_Boolean Update,
+                                                              const Quantity_NameOfColor BackColor )
 {
 #ifdef WNT
     Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
@@ -207,8 +216,8 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay
     Creates viewer 2D [ static ]
 */
 /*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
-                                                          const Standard_ExtString aName,
-                                                          const Standard_CString aDomain )
+                                                           const Standard_ExtString aName,
+                                                           const Standard_CString aDomain )
 {
 #ifdef WNT
     if ( XServiceDefault2dDevice.IsNull() )
@@ -224,9 +233,9 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay
     Creates viewer 2D [ static ]
 */
 /*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
-                                                          const Handle(Graphic2d_View)& aView,
-                                                          const Standard_ExtString aName,
-                                                          const Standard_CString aDomain )
+                                                           const Handle(Graphic2d_View)& aView,
+                                                           const Standard_ExtString aName,
+                                                           const Standard_CString aDomain )
 {
 #ifdef WNT
     if ( XServiceDefault2dDevice.IsNull() )
index 43298b1f366850d2d18b94c34b497abd4717f043..06af9e043ee9ea7d0ba0cfb51aee35d2a278e27b 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VSERVICE_H
 #define OCCVIEWER_VSERVICE_H
 
@@ -58,6 +59,9 @@
 #ifndef _Handle_Aspect_WindowDriver_HeaderFile
 #include <Handle_Aspect_WindowDriver.hxx>
 #endif
+#ifndef _Handle_Aspect_Window_HeaderFile
+#include <Handle_Aspect_Window.hxx>
+#endif
 
 class V3d_View;
 class V2d_View;
@@ -90,6 +94,12 @@ public:
     }
 
     // STATIC METHODS
+    static Handle(Aspect_Window) 
+                    CreateWindow( const Handle(V3d_View)& view,
+                                  const Standard_Integer hiwin,
+                                  const Standard_Integer lowin,
+                                  const Xw_WindowQuality quality );
+
     static void     SetWindow( const Handle(  V3d_View )& view,
                                const Standard_Integer hiwin,
                                const Standard_Integer lowin,
index 52a8813f08a1a8a4e505e2c7a102a9deef874aec..5808b32f539797423ba889d15d8dcc23520ff519 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_ViewManager.h"
 #include "OCCViewer_ViewWindow.h"
 #include "SUIT_Desktop.h"
@@ -27,8 +28,8 @@
   Constructor
 */
 OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
-: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron, false ) )
-{
+: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) )
+{  
   setTitle( tr( "OCC_VIEW_TITLE" ) );
 }
 
index ba44d017e87a9d30bb7a1ed836871bd75fb9821b..bae965d8497618b95952a3ae1b46f92d352bf04f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWMANAGER_H
 #define OCCVIEWER_VIEWMANAGER_H
 
index 8f8e8fabf1e8d3f5ea70004a16f920f3f31dc7b5..a4f2bb86d3b361ce5b14b26e0d8ca79c05696dce 100755 (executable)
@@ -1,26 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewFrame.h"
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewPort3d.h"
 
 #include "SUIT_ViewManager.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
 
 #include "QtxActionToolMgr.h"
+#include "QtxBackgroundTool.h"
 
 #include <QPainter>
 #include <QApplication>
 #include <QColorDialog>
+#include <QFileDialog>
 #include <QPalette>
+#include <QKeyEvent>
 #include <QMenu>
 #include <QMouseEvent>
 #include <QToolBar>
 #include <Prs3d_AngleAspect.hxx>
 #include <Prs3d_TextAspect.hxx>
 
+#include <Visual3d_View.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+// VSR: Uncomment below line to allow texture background support in OCC viewer
+#define OCC_ENABLE_TEXTURED_BACKGROUND
+
+/*!
+  Get data for supported background modes: gradient types, identifiers and supported image formats
+*/
+QString OCCViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+  gradList << tr("GT_HORIZONTALGRADIENT")    << tr("GT_VERTICALGRADIENT")       <<
+              tr("GT_FIRSTDIAGONALGRADIENT") << tr("GT_SECONDDIAGONALGRADIENT") <<
+              tr("GT_FIRSTCORNERGRADIENT")   << tr("GT_SECONDCORNERGRADIENT")   <<
+              tr("GT_THIRDCORNERGRADIENT")   << tr("GT_FORTHCORNERGRADIENT");
+  idList   << HorizontalGradient             << VerticalGradient  <<
+              Diagonal1Gradient              << Diagonal2Gradient <<
+              Corner1Gradient                << Corner2Gradient   <<
+              Corner3Gradient                << Corner4Gradient;
+#if OCC_VERSION_LARGE > 0x06050200 // enabled since OCCT 6.5.3, since in previous version this functionality is buggy
+#ifdef OCC_ENABLE_TEXTURED_BACKGROUND
+  txtList  << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+#endif
+  return tr("BG_IMAGE_FILES");
+}
+
 /*!
   Constructor
   \param DisplayTrihedron - is trihedron displayed
 */
-OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron )
+OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
 : SUIT_ViewModel(),
-  myBgColor( Qt::black ),
-  myShowStaticTrihedron( DisplayStaticTrihedron )
+  myBackgrounds(4, Qtx::BackgroundData( Qt::black )),
+  myIsRelative(true),
+  myTopLayerId( 0 ),
+  myTrihedronSize(100)
 {
   // init CasCade viewers
   myV3dViewer = OCCViewer_VService::Viewer3d( "", (short*) "Viewer3d", "", 1000.,
@@ -89,8 +125,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTri
   drawer->AngleAspect()->SetTextAspect(ta);
   drawer->LengthAspect()->SetTextAspect(ta);
   
-  clearViewAspects();
-
   /* create trihedron */
   if( DisplayTrihedron )
   {
@@ -112,11 +146,22 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTri
 
     myAISContext->Display(myTrihedron);
     myAISContext->Deactivate(myTrihedron);
-  }
+    }
+
+  // set interaction style to standard
+  myInteractionStyle = 0;
+
+  // set zooming style to standard
+  myZoomingStyle = 0;
 
   // selection
   mySelectionEnabled = true;
   myMultiSelectionEnabled = true;
+  
+  
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if(resMgr)
+    myShowStaticTrihedron = resMgr->booleanValue( "OCCViewer", "show_static_trihedron", true );
 }
 
 /*!
@@ -127,21 +172,38 @@ OCCViewer_Viewer::~OCCViewer_Viewer()
 }
 
 /*!
+  [obsolete]
   \return background color of viewer
 */
 QColor OCCViewer_Viewer::backgroundColor() const
 {
-  return myBgColor;
+  return backgroundColor(0);
+}
+
+/*!
+  \return background data of viewer
+*/
+Qtx::BackgroundData OCCViewer_Viewer::background() const
+{
+  return background(0);
 }
 
 /*!
-  Sets background color
+  Sets background color [obsolete]
   \param c - new background color
 */
 void OCCViewer_Viewer::setBackgroundColor( const QColor& c )
 {
-  if ( c.isValid() )
-    myBgColor = c;
+  setBackgroundColor( 0, c );
+}
+
+/*!
+  Sets background data
+  \param d - new background data
+*/
+void OCCViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+  setBackground( 0, theBackground );
 }
 
 /*!
@@ -153,10 +215,14 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
   if ( view ) {
     view->initLayout();
     view->initSketchers();
+    view->setInteractionStyle( interactionStyle() );
+    view->setZoomingStyle( zoomingStyle() );
     
     OCCViewer_ViewPort3d* vp3d = view->getViewPort();
     if ( vp3d )
-      vp3d->setBackgroundColor( myBgColor );
+    {
+      vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
+    }
   }
 }
 
@@ -166,8 +232,14 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
 */
 SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop )
 {
-  OCCViewer_ViewWindow* view = new OCCViewer_ViewWindow(theDesktop, this);
-  initView( view );
+  // create view frame
+  OCCViewer_ViewFrame* view = new OCCViewer_ViewFrame(theDesktop, this);
+  // get main view window (created by view frame)
+  OCCViewer_ViewWindow* vw = view->getView(OCCViewer_ViewFrame::MAIN_VIEW);
+  // initialize main view window
+  initView( vw );
+  // set default background for view window
+  vw->setBackground( background(0) ); // 0 means MAIN_VIEW (other views are not yet created here)
   return view;
 }
 
@@ -180,13 +252,16 @@ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
   SUIT_ViewModel::setViewManager(theViewManager);
   if (theViewManager) {
     connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), 
-           this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
+            this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
 
     connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), 
             this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
 
     connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)), 
             this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+
+    connect(theViewManager, SIGNAL(keyPress(SUIT_ViewWindow*, QKeyEvent*)), 
+            this, SLOT(onKeyPress(SUIT_ViewWindow*, QKeyEvent*)));
   }
 }
 
@@ -209,12 +284,16 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE
   OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
 
   if ( isSelectionEnabled() ) {
-    if (aView->getViewPort()->isBusy()) return; // Check that the ViewPort initialization completed
+    if (aView->getViewPort()->isBusy()) {
+      QCoreApplication::processEvents();
+      return; // Check that the ViewPort initialization completed
                                                 // To Prevent call move event if the View port is not initialized
                                                 // IPAL 20883
+    }
     Handle(V3d_View) aView3d = aView->getViewPort()->getView();
-    if ( !aView3d.IsNull() )
+    if ( !aView3d.IsNull() ) {
       myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
+    }
   }
 }
 
@@ -228,9 +307,11 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
   if (theEvent->button() != Qt::LeftButton) return;
   if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
 
+  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
+  if (!aView || aView->interactionStyle() != SUIT_ViewModel::STANDARD)
+    return;
 
   myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y());
-  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
   bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
   
   if (!aHasShift) emit deselection();
@@ -270,6 +351,90 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t
   emit selectionChanged();
 }
 
+/*!
+  SLOT: called on key press, processes selection in "key free" interaction style
+*/
+void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEvent)
+{
+  if (!mySelectionEnabled) return;
+  if (theEvent->key() != Qt::Key_S) return;
+  if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
+
+  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
+  if (!aView || aView->interactionStyle() != SUIT_ViewModel::KEY_FREE)
+    return;
+
+  emit deselection();
+  myAISContext->Select();
+
+  emit selectionChanged();
+}
+
+int OCCViewer_Viewer::getTopLayerId()
+{
+#if OCC_VERSION_LARGE > 0x06050200
+  if ( myTopLayerId == 0 && !myAISContext->CurrentViewer().IsNull() )    
+    myAISContext->CurrentViewer()->AddZLayer( myTopLayerId );
+#endif
+
+  return myTopLayerId;
+}
+
+/*!
+  \return interaction style
+*/
+int OCCViewer_Viewer::interactionStyle() const
+{
+  return myInteractionStyle;
+}
+
+/*!
+  Sets interaction style: 0 - standard, 1 - keyboard free interaction
+  \param theStyle - new interaction style
+*/
+void OCCViewer_Viewer::setInteractionStyle( const int theStyle )
+{
+  myInteractionStyle = theStyle;
+  //!! To be done for view windows
+  if ( !myViewManager )
+    return;
+
+  QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+  for ( int i = 0; i < (int)wins.count(); i++ )
+  {
+    OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+    if ( win )
+      win->setInteractionStyle( theStyle );
+  }
+}
+
+/*!
+  \return zooming style
+*/
+int OCCViewer_Viewer::zoomingStyle() const
+{
+  return myZoomingStyle;
+}
+
+/*!
+  Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+  \param theStyle - new zooming style
+*/
+void OCCViewer_Viewer::setZoomingStyle( const int theStyle )
+{
+  myZoomingStyle = theStyle;
+  //!! To be done for view windows
+  if ( !myViewManager )
+    return;
+
+  QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+  for ( int i = 0; i < (int)wins.count(); i++ )
+  {
+    OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+    if ( win )
+      win->setZoomingStyle( theStyle );
+  }
+}
 
 /*!
   Sets selection enabled status
@@ -317,7 +482,7 @@ void OCCViewer_Viewer::enableMultiselection(bool isEnable)
 void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup)
 {
   thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
 
   thePopup->addSeparator();
 
@@ -326,8 +491,10 @@ void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup)
   //Support of several toolbars in the popup menu
   QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
   QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
-  for( ; it!=last; it++ )
-    thePopup->addAction( (*it)->toggleViewAction() );
+  for ( ; it!=last; it++ ) {
+    if ( (*it)->parentWidget()->isVisible() )
+      thePopup->addAction( (*it)->toggleViewAction() );
+  }
 }
 
 /*!
@@ -343,19 +510,32 @@ void OCCViewer_Viewer::onDumpView()
 /*!
   SLOT: called if background color is to be changed changed, passes new color to view port
 */
-void OCCViewer_Viewer::onChangeBgColor()
+void OCCViewer_Viewer::onChangeBackground()
 {
-  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
-  if( !aView )
-    return;
-  OCCViewer_ViewPort3d* aViewPort3d = aView->getViewPort();
-  if( !aViewPort3d )
+  OCCViewer_ViewWindow* aView = dynamic_cast<OCCViewer_ViewWindow*>(myViewManager->getActiveView());
+  if ( !aView )
     return;
-  QColor aColorActive = aViewPort3d->backgroundColor();
 
-  QColor selColor = QColorDialog::getColor( aColorActive, aView);
-  if ( selColor.isValid() )
-    aViewPort3d->setBackgroundColor(selColor);
+  // get supported gradient types
+  QStringList gradList;
+  QIntList    idList, txtList;
+  QString     formats = backgroundData( gradList, idList, txtList );
+
+  // invoke dialog box
+  Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(),  // initial background
+                                                                  aView,                // parent for dialog box
+                                                                  txtList,              // allowed texture modes
+                                                                  true,                 // enable solid color mode
+                                                                  true,                 // enable gradient mode
+                                                                  false,                // disable custom gradient mode
+                                                                  !txtList.isEmpty(),   // enable/disable texture mode
+                                                                  gradList,             // gradient names
+                                                                  idList,               // gradient identifiers
+                                                                  formats );            // image formats
+
+  // set chosen background data to the viewer
+  if ( bgData.isValid() )
+    aView->setBackground( bgData );
 }
 
 /*!
@@ -402,48 +582,6 @@ void OCCViewer_Viewer::performSelectionChanged()
     emit selectionChanged();
 }
 
-/*!
-  SLOT, clears view aspects
-*/
-void OCCViewer_Viewer::onClearViewAspects()
-{
-    clearViewAspects();
-}
-
-/*!
-  Clears view aspects
-*/
-void OCCViewer_Viewer::clearViewAspects()
-{
-       myViewAspects.clear();
-}
-
-/*!
-  \return const reference to list of view aspects
-*/
-const viewAspectList& OCCViewer_Viewer::getViewAspects()
-{
-       return myViewAspects;
-}
-
-/*!
-  Appends new view aspect
-  \param aParams - new view aspects
-*/
-void OCCViewer_Viewer::appendViewAspect( const viewAspect& aParams )
-{
-       myViewAspects.append( aParams );
-}
-
-/*!
-  Replaces old view aspects by new ones
-  \param aViewList - list of new view aspects
-*/
-void OCCViewer_Viewer::updateViewAspects( const viewAspectList& aViewList )
-{
-       myViewAspects = aViewList;
-}
-
 /*!
   Hilights/unhilights object in viewer
   \param obj - object to be updated
@@ -616,10 +754,13 @@ double OCCViewer_Viewer::trihedronSize() const
   Changes trihedron size
   \param sz - new size
 */
-void OCCViewer_Viewer::setTrihedronSize( const double sz )
+void OCCViewer_Viewer::setTrihedronSize( const double sz, bool isRelative )
 {
-  if ( !myTrihedron.IsNull() )
-    myTrihedron->SetSize( sz );
+  if ( myTrihedronSize != sz || isRelative != myIsRelative) {
+    myTrihedronSize = sz; 
+    myIsRelative = isRelative;
+    updateTrihedron();
+  }
 }
 
 /*!
@@ -651,3 +792,119 @@ void OCCViewer_Viewer::isos( int& u, int& v ) const
     v = ic->IsoNumber( AIS_TOI_IsoV );
   }
 }
+
+/* 
+ * Returns a new OCCViewer_ViewWindow instance which will be placed as a sub window in ViewFrame
+ */
+OCCViewer_ViewWindow* OCCViewer_Viewer::createSubWindow()
+{
+  return new OCCViewer_ViewWindow( 0,  this);
+}
+
+// obsolete  
+QColor OCCViewer_Viewer::backgroundColor( int theViewId ) const
+{
+  return background( theViewId ).color();
+}
+
+Qtx::BackgroundData OCCViewer_Viewer::background( int theViewId ) const
+{
+  return ( theViewId >= 0 && theViewId < myBackgrounds.count() ) ? myBackgrounds[theViewId] : Qtx::BackgroundData();
+}
+
+// obsolete
+void OCCViewer_Viewer::setBackgroundColor( int theViewId, const QColor& theColor )
+{
+  if ( theColor.isValid() ) {
+    Qtx::BackgroundData bg = background( theViewId );
+    bg.setColor( theColor );
+    setBackground( theViewId, bg );
+  }
+}
+
+void OCCViewer_Viewer::setBackground( int theViewId, const Qtx::BackgroundData& theBackground )
+{
+  if ( theBackground.isValid() && theViewId >= 0 && theViewId < myBackgrounds.count() )
+    myBackgrounds[theViewId] = theBackground;    
+}
+
+
+/*!
+  Set the show static trihedron flag
+*/
+void OCCViewer_Viewer::setStaticTrihedronDisplayed(const bool on) {
+  if(myShowStaticTrihedron != on) {
+    OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
+    if(!aView)
+      return;
+
+    OCCViewer_ViewPort3d* vp3d = aView->getViewPort();
+    if(vp3d) {
+      myShowStaticTrihedron = on;
+      vp3d->updateStaticTriedronVisibility();
+    }
+  }
+}
+
+/*!
+  Get new and current trihedron size corresponding to the current model size
+*/
+bool OCCViewer_Viewer::computeTrihedronSize( double& theNewSize, double& theSize )
+{
+  theNewSize = 100;
+  theSize = 100;
+
+  //SRN: BUG IPAL8996, a usage of method ActiveView without an initialization
+  Handle(V3d_Viewer) viewer = getViewer3d();
+  viewer->InitActiveViews();
+  if(!viewer->MoreActiveViews()) return false;
+
+  Handle(V3d_View) view3d = viewer->ActiveView();
+  //SRN: END of fix
+
+  if ( view3d.IsNull() )
+    return false;
+
+  double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
+  double aMaxSide;
+
+  view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
+
+  if ( Xmin == RealFirst() || Ymin == RealFirst() || Zmin == RealFirst() ||
+       Xmax == RealLast()  || Ymax == RealLast()  || Zmax == RealLast() )
+    return false;
+
+  aMaxSide = Xmax - Xmin;
+  if ( aMaxSide < Ymax -Ymin ) aMaxSide = Ymax -Ymin;
+  if ( aMaxSide < Zmax -Zmin ) aMaxSide = Zmax -Zmin;
+
+  // IPAL21687
+  // The boundary box of the view may be initialized but nullified
+  // (case of infinite objects)
+  if ( aMaxSide < Precision::Confusion() )
+    return false;
+
+  float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("OCCViewer","trihedron_size", 100.);
+
+  static float EPS = 5.0E-3;
+  theSize = getTrihedron()->Size();
+  theNewSize = aMaxSide*aSizeInPercents / 100.0;
+
+  return fabs( theNewSize - theSize ) > theSize * EPS ||
+         fabs( theNewSize - theSize) > theNewSize * EPS;
+}
+
+/*! 
+ * Update the size of the trihedron
+ */
+void OCCViewer_Viewer::updateTrihedron() {
+  if(myIsRelative){
+    double newSz, oldSz;
+    
+    if(computeTrihedronSize(newSz, oldSz))
+      myTrihedron->SetSize(newSz);
+    
+  } else if(myTrihedron->Size() != myTrihedronSize) {
+    myTrihedron->SetSize(myTrihedronSize);
+  }
+}
index dbddfa2391307b6d3fc63e97dfa5f5b83bd066fb..90f128c23ab7a15b786cb5f3f333f92a9b17e3e1 100755 (executable)
@@ -1,38 +1,42 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWMODEL_H
 #define OCCVIEWER_VIEWMODEL_H
 
 #include <QColor>
 #include <QPoint>
+#include <QVector>
 
 #include "OCCViewer.h"
 
+#include "Qtx.h"
 #include "SUIT_ViewModel.h"
 
 #include <V3d_View.hxx>
 #include <AIS_Trihedron.hxx>
 #include <AIS_InteractiveContext.hxx>
 
+class QKeyEvent;
 class QMouseEvent;
 
 class SUIT_ViewWindow;
@@ -41,32 +45,6 @@ class OCCViewer_ViewWindow;
 
 class AIS_ListOfInteractive;
 
-struct viewAspect
-{
-public:
-       double    scale;
-       double  centerX;
-       double  centerY;
-       double    projX;
-       double    projY;
-       double    projZ;
-       double    twist;
-       double      atX;
-       double      atY;
-       double      atZ;
-       double     eyeX;
-       double     eyeY;
-       double     eyeZ;
-        double   scaleX;
-        double   scaleY;
-        double   scaleZ;
-       QString    name;
-       bool     isVisible;
-       double   size;
-};
-
-typedef QList<viewAspect> viewAspectList;
-
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
@@ -76,9 +54,19 @@ class OCCVIEWER_EXPORT OCCViewer_Viewer: public SUIT_ViewModel
   Q_OBJECT
 
 public:
-  static QString Type() { return "OCCViewer"; }
+  /*! supported gradient types */
+  enum { 
+    HorizontalGradient, VerticalGradient,
+    Diagonal1Gradient,  Diagonal2Gradient,
+    Corner1Gradient,    Corner2Gradient,
+    Corner3Gradient,    Corner4Gradient,
+    LastGradient = Corner4Gradient
+  };
+  
+  static QString           Type() { return "OCCViewer"; }
+  static QString           backgroundData( QStringList&, QIntList&, QIntList& );
 
-  OCCViewer_Viewer( bool DisplayTrihedron = true, bool DisplayStaticTrihedron = true );
+  OCCViewer_Viewer( bool DisplayTrihedron = true);
   virtual ~OCCViewer_Viewer();
 
   void update();
@@ -97,13 +85,15 @@ public:
   void                            performSelectionChanged();
   // emit signal selectionChanged
 
-  virtual const viewAspectList&   getViewAspects();
-  virtual void                    appendViewAspect( const viewAspect& );
-  virtual void                    updateViewAspects( const viewAspectList& );
-  virtual void                    clearViewAspects();
+  QColor                          backgroundColor() const;                              // obsolete
+  void                            setBackgroundColor( const QColor& );                  // obsolete
+  Qtx::BackgroundData             background() const;
+  void                            setBackground( const Qtx::BackgroundData& );
 
-  QColor                          backgroundColor() const;
-  void                            setBackgroundColor( const QColor& );
+  QColor                          backgroundColor(int theViewId) const;                 // obsolete
+  void                            setBackgroundColor( int theViewId, const QColor& );   // obsolete
+  Qtx::BackgroundData             background(int theViewId) const;
+  void                            setBackground( int theViewId, const Qtx::BackgroundData& );
 
   //! returns true if 3d Trihedron in viewer was created
   bool                            trihedronActivated() const { return !myTrihedron.IsNull(); }
@@ -113,17 +103,32 @@ public:
   virtual void                    setTrihedronShown( const bool );
 
   double                          trihedronSize() const;
-  virtual void                    setTrihedronSize( const double );
+  virtual void                    setTrihedronSize( const double , bool isRelative = true);
+  
+  bool                            trihedronRelative() const {return myIsRelative; }
+
+  // a utility function, used by SALOME_View_s methods
+  bool                            computeTrihedronSize( double& theNewSize, double& theSize );
+
+  void                            updateTrihedron();
+  
+
+  virtual OCCViewer_ViewWindow*   createSubWindow();
 
-public slots:
-  void                            onClearViewAspects();
 public:
   Handle(V3d_Viewer)              getViewer3d()    const { return myV3dViewer;}
   Handle(V3d_Viewer)              getCollector3d() const { return myV3dCollector; }
   Handle(AIS_InteractiveContext)  getAISContext()  const { return myAISContext; }
   Handle(AIS_Trihedron)           getTrihedron()   const { return myTrihedron; }
 
+  int                             getTopLayerId();
+
+  int                             interactionStyle() const;
+  void                            setInteractionStyle( const int );
+
+  int                             zoomingStyle() const;
+  void                            setZoomingStyle( const int );
+
   void                            enableSelection(bool isEnabled);
   bool                            isSelectionEnabled() const { return mySelectionEnabled; }
 
@@ -131,11 +136,13 @@ public:
   bool                            isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
 
   int                             getSelectionCount() const { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
+
   bool                            isStaticTrihedronDisplayed() { return myShowStaticTrihedron; }
+  void                            setStaticTrihedronDisplayed(const bool on);
 
   /* Selection management */
   bool    highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true );
-  bool   unHighlightAll( bool=true ); 
+  bool    unHighlightAll( bool=true ); 
   bool    isInViewer( const Handle(AIS_InteractiveObject)&, bool=false );
   bool    isVisible( const Handle(AIS_InteractiveObject)& );
 
@@ -145,37 +152,45 @@ public:
   void    setIsos( const int u, const int v ); // number of isolines
   void    isos( int& u, int& v ) const;
 
+  void    initView( OCCViewer_ViewWindow* view );
+
 signals:
   void selectionChanged();
   void deselection();
 
-protected:
-  void initView( OCCViewer_ViewWindow* view );
-
 protected slots:
-  void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+  virtual void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
+  virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
+  virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+  virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
 
   void onDumpView();
-  void onChangeBgColor();
+  void onChangeBackground();
 
-private:
+protected:
   Handle(V3d_Viewer)              myV3dViewer;
   Handle(V3d_Viewer)              myV3dCollector;
 
   Handle(AIS_Trihedron)           myTrihedron;
-  Handle(AIS_InteractiveContext)  myAISContext;
+  Handle(AIS_InteractiveContext)  myAISContext;  
 
-  viewAspectList                  myViewAspects;
+  int                             myInteractionStyle;
+  int                             myZoomingStyle;
 
   bool                            mySelectionEnabled;
   bool                            myMultiSelectionEnabled;
+  bool                            myIsRelative;
+
+  int                             myTopLayerId;
 
-  QColor                          myBgColor;
+  //QColor                          myBgColor;
   QPoint                          myStartPnt, myEndPnt;
 
   bool                            myShowStaticTrihedron;
+
+  double                          myTrihedronSize;
+
+  QVector<Qtx::BackgroundData>    myBackgrounds;
 };
 
 #ifdef WIN32
index a975fe049a0c651d32b558e906e76dc4833fa8a9..4c6dd5d2d56c2f46b464ebb383c76a0eec31f7d7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #if !defined WNT
 #define QT_CLEAN_NAMESPACE         /* avoid definition of INT32 and INT8 */
 #endif
 
 struct CMapEntry
 {
-       CMapEntry();
-       ~CMapEntry();
-       Colormap          cmap;
-       bool              alloc;
-       XStandardColormap scmap;
+  CMapEntry();
+  ~CMapEntry();
+  Colormap          cmap;
+  bool              alloc;
+  XStandardColormap scmap;
 };
 
 /*!
@@ -64,9 +65,9 @@ struct CMapEntry
 */
 CMapEntry::CMapEntry()
 {
-       cmap = 0;
-       alloc = false;
-       scmap.colormap = 0;
+  cmap = 0;
+  alloc = false;
+  scmap.colormap = 0;
 }
 
 /*!
@@ -74,8 +75,8 @@ CMapEntry::CMapEntry()
 */
 CMapEntry::~CMapEntry()
 {
-       if ( alloc )
-         XFreeColormap( QX11Info::display(), cmap );
+  if ( alloc )
+    XFreeColormap( QX11Info::display(), cmap );
 }
 
 static QMultiHash<int,CMapEntry> *cmap_dict = 0;
@@ -83,13 +84,13 @@ static bool mesa_gl = false;
 
 static void cleanup_cmaps()
 {
-       if ( !cmap_dict )
-               return;
-       //while (!cmap_dict->isEmpty())
-       //  cmap_dict->erase(cmap_dict->begin());
-       cmap_dict->clear();
-       delete cmap_dict;
-       cmap_dict = 0;
+  if ( !cmap_dict )
+    return;
+  //while (!cmap_dict->isEmpty())
+  //  cmap_dict->erase(cmap_dict->begin());
+  cmap_dict->clear();
+  delete cmap_dict;
+  cmap_dict = 0;
 }
 
 static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
@@ -118,7 +119,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
   if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
   {
 #ifdef DEBUG
-    cout << "Using x11AppColormap" << endl;
+//    cout << "Using x11AppColormap" << endl;
 #endif
     return QX11Info::appColormap();
   }
@@ -130,17 +131,17 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
     {
       if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) )
       {
-       i = 0;
-       while ( i < n && x.cmap == 0 )
-       {
-         if ( c[i].visualid == vi->visual->visualid )
-         {
-           x.cmap = c[i].colormap;
-           x.scmap = c[i];
-         }
-         i++;
-       }
-       XFree( (char*)c );
+        i = 0;
+        while ( i < n && x.cmap == 0 )
+        {
+          if ( c[i].visualid == vi->visual->visualid )
+          {
+            x.cmap = c[i].colormap;
+            x.scmap = c[i];
+          }
+          i++;
+        }
+        XFree( (char*)c );
       }
     }
   }
@@ -151,17 +152,17 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
     {
       if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) )
       {
-       i = 0;
-       while ( i < n && x.cmap == 0 )
-       {
-         if ( c[i].visualid == vi->visualid )
-         {
-           x.cmap = c[i].colormap;
-           x.scmap = c[i];
-         }
-         i++;
-       }
-       XFree( (char *)c );
+        i = 0;
+        while ( i < n && x.cmap == 0 )
+        {
+          if ( c[i].visualid == vi->visualid )
+          {
+            x.cmap = c[i].colormap;
+            x.scmap = c[i];
+          }
+          i++;
+        }
+        XFree( (char *)c );
       }
     }
   }
@@ -185,7 +186,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
 OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent )
 : QWidget( parent )
 {
-       initialize();
+  initialize();
 }
 
 /*!
@@ -193,7 +194,7 @@ OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent )
 */
 OCCViewer_ViewPort::~OCCViewer_ViewPort()
 {
-       cleanup();
+  cleanup();
 }
 
 /*!
@@ -226,97 +227,98 @@ void OCCViewer_ViewPort::cleanup()
 void OCCViewer_ViewPort::selectVisualId()
 {
 #if !defined WNT
-       XVisualInfo* pVisualInfo;
-       if ( QX11Info::display() )
-       {
-               /* Initialization with the default VisualID */
-               Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
-               int visualID = XVisualIDFromVisual( v );
+  XVisualInfo* pVisualInfo;
+  if ( QX11Info::display() )
+  {
+    /* Initialization with the default VisualID */
+    Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+    /*int visualID = */XVisualIDFromVisual( v );
+    
+    /*  Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
+    int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
+                          GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
+    
+    pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
+    
+    if ( isVisible() )
+      hide();
+    
+    XSetWindowAttributes a;
+    
+    a.colormap = choose_cmap( QX11Info::display(), pVisualInfo );       /* find best colormap */
+    a.background_pixel = QColormap::instance().pixel( backgroundColor() );
+    a.border_pixel = QColormap::instance().pixel( Qt::black );
+    Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+    if ( parentWidget() )
+      p = parentWidget()->winId();
+    
+    Window w;
+    /*
+    if ( type == Type2D )  // creating simple X window for 2d
+    {
+      unsigned long xbackground =
+          BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+      unsigned long xforeground =
+          WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
 
-               /*  Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
-               int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
-                                                        GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
+      w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
+                                height(), 0, xforeground, xbackground );
+    }
+    else if ( type == Type3D )
+    {
+      w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
+                          0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
+                          CWBackPixel | CWBorderPixel | CWColormap, &a );
+    }
+    else
+      return;
+    */
+    w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
+                      0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
+                      CWBackPixel | CWBorderPixel | CWColormap, &a );
+  
+    Window *cmw;
+    Window *cmwret;
+    int count;
+    if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
+    {
+      cmw = new Window[count+1];
+      memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
+      XFree( (char*)cmwret );
+      int i;
 
-               pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
+      for ( i = 0; i < count; i++ )
+      {
+        if ( cmw[i] == winId() ) /* replace old window */
+        {
+          cmw[i] = w;
+          break;
+        }
+      }
 
-               if ( isVisible() )
-                 hide();
+      if ( i >= count )                        /* append new window */
+        cmw[count++] = w;
+    }
+    else
+    {
+      count = 1;
+      cmw = new Window[count];
+      cmw[0] = w;
+    }
 
-               XSetWindowAttributes a;
+    /* Creating new window (with good VisualID) for this widget */
+    create(w);
+    XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
+    delete[] cmw;
 
-               a.colormap = choose_cmap( QX11Info::display(), pVisualInfo );       /* find best colormap */
-               a.background_pixel = QColormap::instance().pixel( backgroundColor() );
-               a.border_pixel = QColormap::instance().pixel( Qt::black );
-               Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
-               if ( parentWidget() )
-                 p = parentWidget()->winId();
+    if ( isVisible() )
+      show();
 
-               Window w;
-       /*        if ( type == Type2D )  // creating simple X window for 2d
-        {
-            unsigned long xbackground =
-                BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
-            unsigned long xforeground =
-                WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+    if ( pVisualInfo )
+      XFree( (char *)pVisualInfo );
 
-            w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
-                                      height(), 0, xforeground, xbackground );
-        }
-        else if ( type == Type3D )
-        {
-                   w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
-                               0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
-                               CWBackPixel | CWBorderPixel | CWColormap, &a );
-               }
-               else
-               return;*/
-       w = XCreateWindow( QX11Info::display(), p,  x(), y(), width(), height(),
-                          0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
-                          CWBackPixel | CWBorderPixel | CWColormap, &a );
-       
-               Window *cmw;
-               Window *cmwret;
-               int count;
-               if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
-               {
-                       cmw = new Window[count+1];
-                       memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
-                       XFree( (char*)cmwret );
-            int i;
-
-                       for ( i = 0; i < count; i++ )
-                       {
-                               if ( cmw[i] == winId() ) /* replace old window */
-                               {
-                                       cmw[i] = w;
-                                       break;
-                               }
-                       }
-
-                       if ( i >= count )                        /* append new window */
-                               cmw[count++] = w;
-               }
-               else
-               {
-                       count = 1;
-                       cmw = new Window[count];
-                       cmw[0] = w;
-               }
-
-               /* Creating new window (with good VisualID) for this widget */
-               create(w);
-               XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
-               delete[] cmw;
-
-               if ( isVisible() )
-            show();
-
-               if ( pVisualInfo )
-        {
-                       XFree( (char *)pVisualInfo );
-               }
-               XFlush( QX11Info::display() );
-       }
+    XFlush( QX11Info::display() );
+  }
 #endif
 }
 
@@ -325,11 +327,11 @@ void OCCViewer_ViewPort::selectVisualId()
 */
 void OCCViewer_ViewPort::setBackgroundColor( const QColor& color )
 {
-    QPalette pal = palette();
-    pal.setColor( QPalette::Background, color );
-    setPalette( pal );
-    repaint();
-    emit vpChangeBGColor( color );
+  QPalette pal = palette();
+  pal.setColor( QPalette::Background, color );
+  setPalette( pal );
+  repaint();
+  emit vpChangeBGColor( color );
 }
 
 /*!
@@ -337,7 +339,7 @@ void OCCViewer_ViewPort::setBackgroundColor( const QColor& color )
 */
 QColor OCCViewer_ViewPort::backgroundColor() const
 {
-    return palette().color( QPalette::Active, QPalette::Background );
+  return palette().color( QPalette::Active, QPalette::Background );
 }
 
 /*!
@@ -345,7 +347,7 @@ QColor OCCViewer_ViewPort::backgroundColor() const
 */
 bool OCCViewer_ViewPort::isSketchingEnabled() const
 {
-    return myEnableSketching;
+  return myEnableSketching;
 }
 
 /*!
@@ -353,7 +355,7 @@ bool OCCViewer_ViewPort::isSketchingEnabled() const
 */
 void OCCViewer_ViewPort::setSketchingEnabled( bool enable )
 {
-       myEnableSketching = enable;
+  myEnableSketching = enable;
 }
 
 /*!
@@ -362,7 +364,7 @@ void OCCViewer_ViewPort::setSketchingEnabled( bool enable )
 */
 bool OCCViewer_ViewPort::isTransformEnabled() const
 {
-    return myEnableTransform;
+  return myEnableTransform;
 }
 
 /*!
@@ -370,7 +372,7 @@ bool OCCViewer_ViewPort::isTransformEnabled() const
 */
 void OCCViewer_ViewPort::setTransformEnabled( bool enable )
 {
-       myEnableTransform = enable;
+  myEnableTransform = enable;
 }
 
 /*!
@@ -386,7 +388,7 @@ void OCCViewer_ViewPort::mousePressEvent( QMouseEvent *e )
 */
 void OCCViewer_ViewPort::mouseMoveEvent( QMouseEvent* e )
 {
-    emit vpMouseEvent( e );
+  emit vpMouseEvent( e );
 }
 
 /*!
@@ -394,7 +396,7 @@ void OCCViewer_ViewPort::mouseMoveEvent( QMouseEvent* e )
 */
 void OCCViewer_ViewPort::mouseReleaseEvent( QMouseEvent *e )
 {
-    emit vpMouseEvent( e );
+  emit vpMouseEvent( e );
 }
 
 /*!
@@ -402,7 +404,7 @@ void OCCViewer_ViewPort::mouseReleaseEvent( QMouseEvent *e )
 */
 void OCCViewer_ViewPort::mouseDoubleClickEvent( QMouseEvent *e )
 {
-    emit vpMouseEvent( e );
+  emit vpMouseEvent( e );
 }
 
 /*!
@@ -410,7 +412,7 @@ void OCCViewer_ViewPort::mouseDoubleClickEvent( QMouseEvent *e )
 */
 void OCCViewer_ViewPort::keyPressEvent( QKeyEvent *e )
 {
-    emit vpKeyEvent( e );
+  emit vpKeyEvent( e );
 }
 
 /*!
@@ -418,7 +420,7 @@ void OCCViewer_ViewPort::keyPressEvent( QKeyEvent *e )
 */
 void OCCViewer_ViewPort::keyReleaseEvent( QKeyEvent *e )
 {
-    emit vpKeyEvent( e );
+  emit vpKeyEvent( e );
 }
 
 /*!
@@ -426,12 +428,12 @@ void OCCViewer_ViewPort::keyReleaseEvent( QKeyEvent *e )
 */
 void OCCViewer_ViewPort::paintEvent( QPaintEvent* )
 {
-       if ( myPaintersRedrawing )
-       {
-               QPainter p( this );
-               emit vpDrawExternal( &p );
-               myPaintersRedrawing = false;
-       }
+  if ( myPaintersRedrawing )
+  {
+    QPainter p( this );
+    emit vpDrawExternal( &p );
+    myPaintersRedrawing = false;
+  }
 }
 
 /*!
@@ -439,8 +441,8 @@ void OCCViewer_ViewPort::paintEvent( QPaintEvent* )
 */
 void OCCViewer_ViewPort::redrawPainters()
 {
-       myPaintersRedrawing = true;
-       repaint();
+  myPaintersRedrawing = true;
+  repaint();
 }
 
 /*!
@@ -450,19 +452,27 @@ void OCCViewer_ViewPort::onUpdate()
 {
 }
 
+/*!
+  Get paint engine for the OpenGL viewer. [ virtual public ]
+*/
+QPaintEngine* OCCViewer_ViewPort::paintEngine() const
+{
+  return 0;
+}
+
 /*!
     Creates the popup. [ virtual protected ]
 */
 /*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup )
 {
-       if ( popup )
-       {
-               QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
-        a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
-               connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
-               myPopupActions.append( a );
-               a->addTo( popup );
-       }
+  if ( popup )
+  {
+    QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
+    a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
+    connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
+    myPopupActions.append( a );
+    a->addTo( popup );
+  }
 }*/
 
 /*!
@@ -470,22 +480,32 @@ void OCCViewer_ViewPort::onUpdate()
 */
 /*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup )
 {
-       if ( popup )
-       {
-               for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
-                       a->removeFrom( popup );
-               //while (!myPopupActions.isEmpty())
-               //  delete myPopupActions.takeFirst();
-               myPopupActions.clear();
-       }
+  if ( popup )
+  {
+    for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
+      a->removeFrom( popup );
+    //while (!myPopupActions.isEmpty())
+    //  delete myPopupActions.takeFirst();
+    myPopupActions.clear();
+  }
 }*/
 
+/*!
+  Performs synchronization of view parameters with the specified view.
+  Returns \c true if synchronization is done successfully or \c false otherwise.
+  Default implementation does nothing (return \c false)
+*/
+bool OCCViewer_ViewPort::synchronize( OCCViewer_ViewPort* )
+{
+  return false;
+}
+
 /*!
     Sets the background color with color selection dialog. [ virtual protected slot ]
 */
-void OCCViewer_ViewPort::onChangeBgColor()
+void OCCViewer_ViewPort::onChangeBackground()
 {
-    QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
-    if ( selColor.isValid() )
-        setBackgroundColor( selColor );
+  QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
+  if ( selColor.isValid() )
+    setBackgroundColor( selColor );
 }
index 48e4dccb0033f1ae317093d7d4694a2e7fbbe95e..e003e3069252b5631e5620278a596a485b493df3 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWPORT_H
 #define OCCVIEWER_VIEWPORT_H
 
@@ -55,65 +56,71 @@ public:
   virtual ~OCCViewer_ViewPort();
 
 public:
-  void                          setSketchingEnabled( bool );
+  void                           setSketchingEnabled( bool );
   bool                           isSketchingEnabled() const;
-  void                          setTransformEnabled( bool );
+  void                           setTransformEnabled( bool );
   bool                           isTransformEnabled() const;
 
   virtual QColor                 backgroundColor() const;
   virtual void                   setBackgroundColor( const QColor& );
 
-  void                          redrawPainters();
+  void                           redrawPainters();
 
   virtual void                   onUpdate();
 
+  virtual QPaintEngine*          paintEngine() const;
+
 protected:
-//     enum ViewType { Type2D, Type3D };
-  void                          selectVisualId();
+//      enum ViewType { Type2D, Type3D };
+  void                           selectVisualId();
 
 // EVENTS
   virtual void                   paintEvent( QPaintEvent *);
-  virtual void                  mouseMoveEvent( QMouseEvent *);
-  virtual void                  mouseReleaseEvent( QMouseEvent *);
-  virtual void                  mousePressEvent( QMouseEvent *);
-  virtual void                  mouseDoubleClickEvent( QMouseEvent *);
+  virtual void                   mouseMoveEvent( QMouseEvent *);
+  virtual void                   mouseReleaseEvent( QMouseEvent *);
+  virtual void                   mousePressEvent( QMouseEvent *);
+  virtual void                   mouseDoubleClickEvent( QMouseEvent *);
   virtual void                   keyPressEvent( QKeyEvent *);
   virtual void                   keyReleaseEvent( QKeyEvent *);
 
 // TO BE REDEFINED
-  virtual void                  reset() = 0;
-  virtual void                  pan( int, int ) = 0;
-  virtual void                  setCenter( int, int ) = 0;
-  virtual void                  fitRect( const QRect& ) = 0;
-  virtual void                  zoom( int, int, int, int ) = 0;
-  virtual void                  fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
+  virtual void                   reset() = 0;
+  virtual void                   pan( int, int ) = 0;
+  virtual void                   setCenter( int, int ) = 0;
+  virtual void                   fitRect( const QRect& ) = 0;
+  virtual void                   zoom( int, int, int, int ) = 0;
+  virtual void                   fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
 
 // POPUP
 //  void                             onCreatePopup( QPopupMenu* );
 //  void                             onDestroyPopup( QPopupMenu* );
 
+public slots:
+  virtual bool                   synchronize( OCCViewer_ViewPort* );
+
 protected slots:
-  virtual void                  onChangeBgColor();
+  virtual void                   onChangeBackground();
 
 signals:
-  void                          vpKeyEvent( QKeyEvent* );
-  void                          vpMouseEvent( QMouseEvent* );
-  void                          vpDrawExternal( QPainter* );
+  void                           vpKeyEvent( QKeyEvent* );
+  void                           vpMouseEvent( QMouseEvent* );
+  void                           vpDrawExternal( QPainter* );
   void                           vpChangeBGColor( QColor );
+  void                           vpTransformed( OCCViewer_ViewPort* );
 
 private:
-  void                          initialize();
-  void                          cleanup();
+  void                           initialize();
+  void                           cleanup();
 
 protected:
   Handle(Aspect_Window)          myWindow;
-  bool                          myEnableSketching;
-  bool                          myEnableTransform;
-  bool                          myPaintersRedrawing; /* set to draw externally */
+  bool                           myEnableSketching;
+  bool                           myEnableTransform;
+  bool                           myPaintersRedrawing; /* set to draw externally */
   QList<QtxAction*>              myPopupActions;
-
+  
 private:
-  static int                    nCounter; /* objects counter */
+  static int                     nCounter; /* objects counter */
 };
 
 #ifdef WIN32
index 7fc204ddd3a1e489df889386d10da86c93c4ac02..26b0736b2f25f5daf4f93e5081b5bf94465baa1e 100755 (executable)
@@ -1,33 +1,39 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_ViewPort3d.h"
 
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewModel.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
 
 #include <QColor>
+#include <QFileInfo>
+#include <QString>
 #include <QRect>
 #include <QPaintEvent>
 #include <QResizeEvent>
@@ -38,6 +44,8 @@
 #include <V3d_PerspectiveView.hxx>
 #include <V3d_OrthographicView.hxx>
 
+#include "utilities.h"
+
 #if defined WNT
 #include <WNT_Window.hxx>
 #else
@@ -50,17 +58,21 @@ static int sx = 0;
 static int sy = 0;
 static Standard_Boolean zRotation = Standard_False;
 
+//#include <Standard_Version.hxx>
+
 /*!
-    Constructor
+  Constructor
 */
 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView  type )
-: OCCViewer_ViewPort( parent ),
-myScale( 1.0 ),
-myDegenerated( true ),
-myAnimate( false ),
-myBusy( true )
+  : OCCViewer_ViewPort( parent ),
+    myScale( 1.0 ),
+    myDegenerated( true ),
+    myAnimate( false ),
+    myBusy( true ),
+    myIsAdvancedZoomingEnabled( false )
 {
-  selectVisualId();
+  // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
+  //selectVisualId();
 
   if ( type == V3d_ORTHOGRAPHIC ) {
     myOrthoView = new V3d_OrthographicView( viewer );
@@ -72,10 +84,11 @@ myBusy( true )
   }
   if ( myDegenerated )
     activeView()->SetDegenerateModeOn();
+  setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
 }
 
 /*!
-    Destructor
+  Destructor
 */
 OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
 {
@@ -85,41 +98,40 @@ OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
 }
 
 /*!
-    Activates the desired 'type' of view in the viewer
-    ( view of 'type' is created if it doesn't exist ). [ public ]
+  Activates the desired 'type' of view in the viewer
+  ( view of 'type' is created if it doesn't exist ). [ public ]
 */
 /*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
 {
-    if ( activeView().IsNull() )
-        return;
+  if ( activeView().IsNull() )
+  return;
 
-    if ( activeView()->Type() != type )
-    {
-        if ( type == V3d_ORTHOGRAPHIC )
-            setView( myOrthoView );
-        if ( type == V3d_PERSPECTIVE )
-            setView( myPerspView );
-    }
+  if ( activeView()->Type() != type )
+  {
+  if ( type == V3d_ORTHOGRAPHIC )
+  setView( myOrthoView );
+  if ( type == V3d_PERSPECTIVE )
+  setView( myPerspView );
+  }
 }*/
 
 /*!
-    Maps CasCade 'view' to this viewport. [ private ]
+  Maps CasCade 'view' to this viewport. [ private ]
 */
 bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
 {
   if ( !setWindow( view ) )
     return false;
 
-  if ( !mapped( view ) )
-       {
-               view->SetWindow( myWindow );
-               if ( view != activeView() )
-           view->View()->Deactivate();
-       }
+  if ( !mapped( view ) ) {
+    view->SetWindow( myWindow );
+    if ( view != activeView() )
+      view->View()->Deactivate();
+  }
 
   /* create static trihedron (16551: EDF PAL 501) */
-  OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget() );
-  if ( aVW ){
+  OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
+  if ( aVW ) {
     OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
     if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
       view->ZBufferTriedronSetup();
@@ -129,8 +141,10 @@ bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
   return true;
 }
 
+
+
 /*!
-    Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
+  Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
 */
 Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
 {
@@ -138,13 +152,14 @@ Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view
   if ( view == activeView() || !mapView( view ) )
     return activeView();
 
-    /* activate the new view*/
+  /* activate the new view*/
   Handle( V3d_View ) oldView = activeView();
-       if ( !oldView.IsNull() )
-  {
-               oldView->View()->Deactivate();
-               view->SetBackgroundColor( oldView->BackgroundColor() );
-       }
+  if ( !oldView.IsNull() ) {
+    if (oldView->View()->IsDefined())
+      oldView->View()->Deactivate();
+    view->SetBackgroundColor( oldView->BackgroundColor() );
+  }
+
   if ( myDegenerated )
     view->SetDegenerateModeOn();
   else
@@ -152,32 +167,32 @@ Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view
 
   view->View()->Activate();
   activeView() = view;
-       return oldView;
+  return oldView;
 }
 
 /*!
-    Returns CasCade 3D view. [ public ]
+  Returns CasCade 3D view. [ public ]
 */
 Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
 {
-       return activeView();
+  return activeView();
 }
 
 /*!
-    Returns CasCade 3D viewer [ public ]
+  Returns CasCade 3D viewer [ public ]
 */
 Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
 {
-       Handle(V3d_Viewer) viewer;
-       if ( !activeView().IsNull() )
+  Handle(V3d_Viewer) viewer;
+  if ( !activeView().IsNull() )
     viewer = activeView()->Viewer();
-       return viewer;
+  return viewer;
 }
 
 /*!
-    Syncronizes visual state of this viewport with 'ref'
-    ( scale, projection, eye etc ) Returns 'true' if copied OK,
-    'false' otherwise. [ virtual public ]
+  Syncronizes visual state of this viewport with 'ref'
+  ( scale, projection, eye etc ) Returns 'true' if copied OK,
+  'false' otherwise. [ virtual public ]
 */
 bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 {
@@ -186,11 +201,11 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
   Handle(V3d_View) tgtView = getView();
 
   /* Syncronize view types */
-/*    if ( tgtView->Type() != refView->Type() )
-  {
-      setActive( refView->Type() );
-      tgtView = getView();
-  }*/
+  /*    if ( tgtView->Type() != refView->Type() )
+        {
+        setActive( refView->Type() );
+        tgtView = getView();
+        }*/
 
   /*  The following params are copied:
       - view type( ortho/persp )
@@ -208,7 +223,7 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 
   /* perspective */
   if ( refView->Type() == V3d_PERSPECTIVE )
-      tgtView->SetFocale( refView->Focale() );
+    tgtView->SetFocale( refView->Focale() );
 
   /* copy params */
   Standard_Real x, y, z;
@@ -227,7 +242,7 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 }
 
 /*!
-    Returns Z-size of this view. [ public ]
+  Returns Z-size of this view. [ public ]
 */
 double OCCViewer_ViewPort3d::getZSize() const
 {
@@ -237,46 +252,208 @@ double OCCViewer_ViewPort3d::getZSize() const
 }
 
 /*!
-    Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
+  Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
 */
 void OCCViewer_ViewPort3d::setZSize( double zsize )
 {
   myActiveView->SetZSize( zsize );
-/*    if ( !myOrthoView.IsNull() )
+  /*    if ( !myOrthoView.IsNull() )
         myOrthoView->SetZSize( zsize );
-    if ( !myPerspView.IsNull() )
+        if ( !myPerspView.IsNull() )
         myPerspView->SetZSize( zsize );*/
 }
 
 /*!
-    Returns the background color [ virtual public ]
+  Get axial scale to the view
+*/
+void OCCViewer_ViewPort3d::getAxialScale( double& xScale, double& yScale, double& zScale )
+{
+  xScale = yScale = zScale = 1.;
+
+  if ( !activeView().IsNull() )
+    activeView()->AxialScale( xScale, yScale, zScale );
+}
+
+/*!
+  Returns the background color [ virtual public ] [ obsolete ]
 */
 QColor OCCViewer_ViewPort3d::backgroundColor() const
 {
-       if ( !activeView().IsNull() )
-       {
-               Standard_Real aRed, aGreen, aBlue;
-               activeView()->BackgroundColor( Quantity_TOC_RGB, aRed, aGreen, aBlue );
-               int red = (int) (aRed * 255);
-               int green = (int) (aGreen * 255);
-               int blue = (int) (aBlue * 255);
-               return QColor( red, green, blue );
-       }
-       return OCCViewer_ViewPort::backgroundColor();
+  return background().color();
 }
 
 /*!
-    Sets the background color [ virtual public ]
+  Sets the background color [ virtual public ] [ obsolete ]
 */
 void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 {
-       if ( !activeView().IsNull() )
-       {
-         activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
-                                           color.green()/255., color.blue()/255.);
-         activeView()->Update();
-         emit vpChangeBGColor( color );
+  Qtx::BackgroundData bg = background();
+  bg.setColor( color );
+  setBackground( bg );
+}
+
+/*!
+  Returns the background data
+*/
+Qtx::BackgroundData OCCViewer_ViewPort3d::background() const
+{
+  return myBackground;
+}
+
+/*!
+  Sets the background data
+*/
+void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData )
+{
+  if ( bgData.isValid() ) {
+    myBackground = bgData;
+    updateBackground();
+    emit vpChangeBackground( myBackground );
+  }
+}
+
+void OCCViewer_ViewPort3d::updateBackground()
+{
+  if ( activeView().IsNull() ) return;
+  if ( !myBackground.isValid() ) return;
+
+  // VSR: Important note on below code.
+  // In OCCT (in version 6.5.2), things about the background drawing
+  // are not straightforward and not clearly understandable:
+  // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
+  // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
+  // - First and second diagonal gradients are confused.
+  // - Image texture, once set, can not be removed (!).
+  // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
+  //   as Aspect_FM_CENTERED).
+  // - The only way to cancel gradient background (and get back to single colored) is to
+  //   set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
+  //   (see V3d_View::SetBgGradientColors() function).
+  // - Also, it is impossible to draw texture image above the gradiented background (only above
+  //   single-colored).
+  // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
+  // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
+  switch ( myBackground.mode() ) {
+  case Qtx::ColorBackground:
+    {
+      QColor c = myBackground.color();
+      if ( c.isValid() ) {
+       // Unset texture should be done here
+       // ...
+       Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+       activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
+       activeView()->SetBgImageStyle( Aspect_FM_NONE );     // cancel texture background
+#else
+       // cancel gradient background (in OCC before v6.5.3 the only way to do this is to set it to NONE type passing arbitrary colors as parameters)
+       activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
+#endif
+       // then change background color
+       activeView()->SetBackgroundColor( qCol );
+       // update viewer
+       activeView()->Update();
+      }
+      break;
+    }
+  case Qtx::SimpleGradientBackground:
+    {
+      QColor c1, c2;
+      int type = myBackground.gradient( c1, c2 );
+      if ( c1.isValid() && type >= OCCViewer_Viewer::HorizontalGradient && type <= OCCViewer_Viewer::LastGradient ) {
+       // Unset texture should be done here
+       // ...
+       // Get colors and set-up gradiented background
+       if ( !c2.isValid() ) c2 = c1;
+       Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
+       Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
+       activeView()->SetBgImageStyle( Aspect_FM_NONE );    // cancel texture background
+       switch ( type ) {
+       case OCCViewer_Viewer::HorizontalGradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
+#else
+         // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
+         // and interchange the colors
+         activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
+#endif
+         break;
+       case OCCViewer_Viewer::VerticalGradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
+#else
+         // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
+#endif
+         break;
+       case OCCViewer_Viewer::Diagonal1Gradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
+#else
+         // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
+         // and interchange the colors
+         activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
+#endif
+         break;
+       case OCCViewer_Viewer::Diagonal2Gradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
+#else
+         // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
+#endif
+         break;
+       case OCCViewer_Viewer::Corner1Gradient:
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
+         break;
+       case OCCViewer_Viewer::Corner2Gradient:
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
+         break;
+       case OCCViewer_Viewer::Corner3Gradient:
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
+         break;
+       case OCCViewer_Viewer::Corner4Gradient:
+         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
+         break;
+       default:
+         break;
        }
+      }
+      break;
+    }
+  case Qtx::CustomGradientBackground:
+    {
+      // NOT IMPLEMENTED YET
+      break;
+    }
+  default:
+    break;
+  }
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+  // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
+  // clear the background texture image as soon as it was once set to the viewer.
+  if ( myBackground.isTextureShown() ) {
+    QString fileName;
+    int textureMode = myBackground.texture( fileName );
+    QFileInfo fi( fileName );
+    if ( !fileName.isEmpty() && fi.exists() ) {
+      // set texture image: file name and fill mode
+      switch ( textureMode ) {
+      case Qtx::CenterTexture:
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
+       break;
+      case Qtx::TileTexture:
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
+       break;
+      case Qtx::StretchTexture:
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
+       break;
+      default:
+       break;
+      }
+      activeView()->Update();
+    }
+  }
+#endif
 }
 
 /*!
@@ -285,15 +462,14 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 */
 void OCCViewer_ViewPort3d::setAnimationMode(bool theDegenerated)
 {
-       if ( !activeView().IsNull() )
-       {
+  if ( !activeView().IsNull() ) {
     myAnimate = theDegenerated;
     activeView()->SetAnimationMode(true, theDegenerated);
   }
 }
 
 /*!
-    Updates the active viewport. [ virtual public ]
+  Updates the active viewport. [ virtual public ]
 */
 void OCCViewer_ViewPort3d::onUpdate()
 {
@@ -302,16 +478,29 @@ void OCCViewer_ViewPort3d::onUpdate()
 }
 
 /*!
-    Called at 'window fit' transformation. [ virtual protected ]
+  Called at 'window fit' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
 {
-       if ( !activeView().IsNull() )
-         activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
+  if ( !activeView().IsNull() ) {
+    activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
+    emit vpTransformed( this );
+  }
 }
 
 /*!
-    Called at 'zoom' transformation. [ virtual protected ]
+  Inits 'zoom' transformation. [ protected ]
+*/
+void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
+{
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+  if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
+    activeView()->StartZoomAtPoint( x, y );
+#endif
+}
+
+/*!
+  Called at 'zoom' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
 {
@@ -319,83 +508,93 @@ void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
     // as OCCT respects a sign of only dx,
     // but we want both signes to be taken into account
     //activeView()->Zoom( x0, y0, x, y );
-    activeView()->Zoom( x0 + y0, 0, x + y, 0 );
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+    if ( isAdvancedZoomingEnabled() )
+      activeView()->ZoomAtPoint( x0, y0, x, y );
+    else
+#endif
+      activeView()->Zoom( x0 + y0, 0, x + y, 0 );
+    emit vpTransformed( this );
   }
 }
 
 /*!
-    Centers the viewport. [ virtual protected ]
+  Centers the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::setCenter( int x, int y )
 {
-       if ( !activeView().IsNull() )
-           activeView()->Place( x, y, myScale );
+  if ( !activeView().IsNull() ) {
+    activeView()->Place( x, y, myScale );
+    emit vpTransformed( this );
+  }
 }
 
 /*!
-    Called at 'pan' transformation. [ virtual protected ]
+  Called at 'pan' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::pan( int dx, int dy )
 {
-       if ( !activeView().IsNull() )
-        activeView()->Pan( dx, dy, 1.0 );
+  if ( !activeView().IsNull() ) {
+    activeView()->Pan( dx, dy, 1.0 );
+    emit vpTransformed( this );
+  }
 }
 
 /*!
-    Inits 'rotation' transformation. [ protected ]
+  Inits 'rotation' transformation. [ protected ]
 */
-void OCCViewer_ViewPort3d::startRotation( int x, int y, 
-                                         int theRotationPointType,
-                                         const gp_Pnt& theSelectedPoint )
+void OCCViewer_ViewPort3d::startRotation( int x, int y,
+                                          int theRotationPointType,
+                                          const gp_Pnt& theSelectedPoint )
 {
-  if ( !activeView().IsNull() )
-    {
-      myDegenerated = activeView()->DegenerateModeIsOn();
-      activeView()->SetDegenerateModeOn();
-      if (myAnimate) activeView()->SetAnimationModeOn();
+  if ( !activeView().IsNull() ) {
+    myDegenerated = activeView()->DegenerateModeIsOn();
+    activeView()->SetDegenerateModeOn();
+    if (myAnimate) activeView()->SetAnimationModeOn();
 
-      //double gx, gy, gz;
-      //double gx = activeView()->gx;
-      //activeView()->Gravity(gx,gy,gz);
+    //double gx, gy, gz;
+    //double gx = activeView()->gx;
+    //activeView()->Gravity(gx,gy,gz);
 
-      switch ( theRotationPointType ) {
-      case OCCViewer_ViewWindow::GRAVITY:
-       activeView()->StartRotation( x, y, 0.45 );
-       break;
-      case OCCViewer_ViewWindow::SELECTED:
-       sx = x; sy = y;
-       
-       double X,Y;
-       activeView()->Size(X,Y);
-       rx = Standard_Real(activeView()->Convert(X)); 
-       ry = Standard_Real(activeView()->Convert(Y)); 
-       
-       activeView()->Rotate( 0., 0., 0., 
-                             theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), 
-                             Standard_True );
-       
-       Quantity_Ratio zRotationThreshold;
-       zRotation = Standard_False;
-       zRotationThreshold = 0.45;
-       if( zRotationThreshold > 0. ) {
-         Standard_Real dx = Abs(sx - rx/2.);
-         Standard_Real dy = Abs(sy - ry/2.);
-         Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
-         if( dx > dd || dy > dd ) zRotation = Standard_True;
-       }
-       break;
-      default:
-       break;
+    switch ( theRotationPointType ) {
+    case OCCViewer_ViewWindow::GRAVITY:
+      activeView()->StartRotation( x, y, 0.45 );
+      break;
+    case OCCViewer_ViewWindow::SELECTED:
+      sx = x; sy = y;
+
+      double X,Y;
+      activeView()->Size(X,Y);
+      rx = Standard_Real(activeView()->Convert(X));
+      ry = Standard_Real(activeView()->Convert(Y));
+
+      activeView()->Rotate( 0., 0., 0.,
+                            theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
+                            Standard_True );
+
+      Quantity_Ratio zRotationThreshold;
+      zRotation = Standard_False;
+      zRotationThreshold = 0.45;
+      if( zRotationThreshold > 0. ) {
+        Standard_Real dx = Abs(sx - rx/2.);
+        Standard_Real dy = Abs(sy - ry/2.);
+        Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
+        if( dx > dd || dy > dd ) zRotation = Standard_True;
       }
+      break;
+    default:
+      break;
     }
+    activeView()->DepthFitAll();
+  }
 }
 
 /*!
-    Rotates the viewport. [ protected ]
+  Rotates the viewport. [ protected ]
 */
-void OCCViewer_ViewPort3d::rotate( int x, int y, 
-                                  int theRotationPointType,
-                                  const gp_Pnt& theSelectedPoint )
+void OCCViewer_ViewPort3d::rotate( int x, int y,
+                                   int theRotationPointType,
+                                   const gp_Pnt& theSelectedPoint )
 {
   if ( !activeView().IsNull() ) {
     switch ( theRotationPointType ) {
@@ -405,150 +604,234 @@ void OCCViewer_ViewPort3d::rotate( int x, int y,
     case OCCViewer_ViewWindow::SELECTED:
       double dx, dy, dz;
       if( zRotation ) {
-       dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) - 
-         atan2(sx-rx/2.,ry/2.-sy);
-       dx = dy = 0.;
+        dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
+          atan2(sx-rx/2.,ry/2.-sy);
+        dx = dy = 0.;
       }
       else {
-       dx = (Standard_Real(x) - sx) * Standard_PI/rx;
-       dy = (sy - Standard_Real(y)) * Standard_PI/ry;
-       dz = 0.;
+        dx = (Standard_Real(x) - sx) * M_PI/rx;
+        dy = (sy - Standard_Real(y)) * M_PI/ry;
+        dz = 0.;
       }
-      
-      activeView()->Rotate( dx, dy, dz, 
-                           theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
-                           Standard_False );
+
+      activeView()->Rotate( dx, dy, dz,
+                            theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
+                            Standard_False );
       break;
     default:
       break;
     }
+    emit vpTransformed( this );
   }
   //  setZSize( getZSize() );
 }
 
 /*!
-    Resets the viewport after 'rotation'. [ protected ]
+  Resets the viewport after 'rotation'. [ protected ]
 */
 void OCCViewer_ViewPort3d::endRotation()
 {
-  if ( !activeView().IsNull() )
-    {
-      if (myAnimate) activeView()->SetAnimationModeOff();
-      if ( !myDegenerated )
-       activeView()->SetDegenerateModeOff();
-      activeView()->ZFitAll(1.);
-      activeView()->SetZSize(0.);
-      activeView()->Update();
-    }
+  if ( !activeView().IsNull() ) {
+    if (myAnimate) activeView()->SetAnimationModeOff();
+    if ( !myDegenerated )
+      activeView()->SetDegenerateModeOff();
+    activeView()->ZFitAll(1.);
+    activeView()->SetZSize(0.);
+    activeView()->Update();
+    emit vpTransformed( this );
+  }
 }
 
 /*!
-    Repaints the viewport. [ virtual protected ]
+  Repaints the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
 {
 #ifndef WNT
-       /* X11 : map before show doesn't work */
-       if ( !mapped( activeView() ) )
-       mapView( activeView() );
+  /* X11 : map before show doesn't work */
+  if ( !mapped( activeView() ) )
+    mapView( activeView() );
 #endif
-       if ( !myWindow.IsNull() )
-       {
-               QApplication::syncX();
-               QRect rc = e->rect();
-               if ( !myPaintersRedrawing )
-                   activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
-       }
-       OCCViewer_ViewPort::paintEvent( e );
-       myBusy = false;
+  if ( !myWindow.IsNull() ) {
+    QApplication::syncX();
+    QRect rc = e->rect();
+    if ( !myPaintersRedrawing )
+      activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
+  }
+  OCCViewer_ViewPort::paintEvent( e );
+  myBusy = false;
 }
 
 /*!
-    Resizes the viewport. [ virtual protected ]
+  Resizes the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 {
 #ifdef WNT
-       /* Win32 : map before first show to avoid flicker */
-       if ( !mapped( activeView() ) )
-           mapView( activeView() );
+  /* Win32 : map before first show to avoid flicker */
+  if ( !mapped( activeView() ) )
+    mapView( activeView() );
 #endif
-       QApplication::syncX();
-    if ( !activeView().IsNull() )
-        activeView()->MustBeResized();
+  QApplication::syncX();
+  if ( !activeView().IsNull() )
+    activeView()->MustBeResized();
 }
 
 /*!
-    Fits all objects in view. [ virtual protected ]
+  Fits all objects in view. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 {
   if ( activeView().IsNull() )
     return;
 
-
   if ( keepScale )
     myScale = activeView()->Scale();
 
   Standard_Real margin = 0.01;
   activeView()->FitAll( margin, withZ, upd );
   activeView()->SetZSize(0.);
+  emit vpTransformed( this );
 }
 
 /*!
-    Resets the view. [ virtual protected ]
+  Resets the view. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::reset()
 {
-//  double zsize = getZSize();
-       if ( !activeView().IsNull() )
-        activeView()->Reset();
-//    setZSize( zsize );
+  //  double zsize = getZSize();
+  if ( !activeView().IsNull() ) {
+    activeView()->Reset();
+    emit vpTransformed( this );
+  //    setZSize( zsize );
+  }
 }
 
 /*!
-    Passed the handle of native window of the component to CASCADE view. [ private ]
+  Rotate the view in the view plane (orthogonal to the view vector)
+*/
+void OCCViewer_ViewPort3d::rotateXY( double degrees )
+{
+  if ( activeView().IsNull() )
+    return;
+
+  int x = width()/2, y = height()/2;
+  double X, Y, Z;
+  activeView()->Convert( x, y, X, Y, Z );
+  activeView()->Rotate( 0, 0, degrees * M_PI / 180., X, Y, Z );
+  emit vpTransformed( this );
+}
+
+/*!
+  Set axial scale to the view
+*/
+void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double zScale )
+{
+  if ( activeView().IsNull() )
+    return;
+
+  activeView()->SetAxialScale( xScale, yScale, zScale );
+  emit vpTransformed( this );
+}
+
+/*!
+  Passed the handle of native window of the component to CASCADE view. [ private ]
 */
 bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
 {
-       if ( !myWindow.IsNull() )
-               return true;
+  if ( !myWindow.IsNull() )
+    return true;
 
-       if ( view.IsNull() )
-               return false;
+  if ( view.IsNull() )
+    return false;
+
+  int hwnd = (int)winId();
+  if ( !hwnd )
+    return false;
 
-       int hwnd = (int)winId();
-       if ( !hwnd )
-        return false;
+  /* set this widget as the drawing window */
+  short lo = (short)hwnd;
+  short hi = (short)( hwnd >> 16 );
 
-       /* set this widget as the drawing window */
-       short lo = (short)hwnd;
-       short hi = (short)( hwnd >> 16 );
-       OCCViewer_VService::SetWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY );
-       myWindow = view->Window();
-       return !myWindow.IsNull();
+  attachWindow( view, OCCViewer_VService::CreateWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY ) );
+
+  myWindow = view->Window();
+  return !myWindow.IsNull();
+}
+
+void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view,
+                                         const Handle(Aspect_Window)& window)
+{
+  if (!view.IsNull()) {
+    view->SetWindow( window );
+    updateBackground();
+  }
 }
 
 /*!
-       Returns the current active view. [ private ]
+  Returns the current active view. [ private ]
 */
 Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
 {
-       return myActiveView;
+  return myActiveView;
 }
 
 /*!
-       Returns the current inactive view [ private ]
+  Returns the current inactive view [ private ]
 */
 /*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
-{
-       return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
-}*/
+  {
+  return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
+  }*/
 
 /*!
-       Returns 'true' if the given view is mapped to window. [ private ]
+  Returns 'true' if the given view is mapped to window. [ private ]
 */
 bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
 {
-       return ( !view.IsNull() && view->View()->IsDefined() );
+  return ( !view.IsNull() && view->View()->IsDefined() );
+}
+
+/*!
+  Performs synchronization of view parameters with the specified view.
+  Returns \c true if synchronization is done successfully or \c false otherwise.
+  Default implementation does nothing (return \c false)
+*/
+bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
+{
+  bool ok = false;
+  OCCViewer_ViewPort3d* vp3d = qobject_cast<OCCViewer_ViewPort3d*>( view );
+  if ( vp3d ) {
+    bool blocked = blockSignals( false );
+    Handle(V3d_View) aView3d = getView();
+    Handle(V3d_View) aRefView3d = vp3d->getView();
+    aView3d->SetImmediateUpdate( Standard_False );
+    aView3d->SetViewMapping( aRefView3d->ViewMapping() );
+    aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
+    aView3d->ZFitAll();
+    aView3d->SetImmediateUpdate( Standard_True );
+    aView3d->Update();
+    blockSignals( blocked );
+    ok = true;
+  }
+  return ok;
+}
+
+/*
+ * Show/Hide static triedron
+ */
+void OCCViewer_ViewPort3d::updateStaticTriedronVisibility() {
+  OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
+  if ( aVW ) {
+    OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
+    Handle(V3d_View) aView = activeView();
+    if ( aViewModel ){
+      if(aViewModel->isStaticTrihedronDisplayed()) {
+       aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
+      } else {
+       aView->TriedronErase();
+      }
+      aView->Update();
+    }
+  }
 }
index efa011d4b5e408dcfd24ddf2ec86fbf17719213c..17847bc3d776c5a876fff05d5e46ec87da565ca2 100755 (executable)
@@ -1,32 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWPORT3D_H
 #define OCCVIEWER_VIEWPORT3D_H
 
 #include "OCCViewer_ViewPort.h"
+#include "Qtx.h"
 
 #include <V3d_View.hxx>
 
 class QColor;
+class QString;
 class QRect;
 
 class Handle(V3d_Viewer);
@@ -46,56 +49,85 @@ public:
   virtual ~OCCViewer_ViewPort3d();
 
 public:
-  Handle(V3d_View)        getView() const;
-  Handle(V3d_View)       setView( const Handle(V3d_View)& );
-  Handle(V3d_Viewer)      getViewer() const;
+  Handle(V3d_View)      getView() const;
+  Handle(V3d_View)      setView( const Handle(V3d_View)& );
+  Handle(V3d_Viewer)    getViewer() const;
+
+  void                  setAnimationMode(bool theDegenerated);
+
+  virtual void          setBackgroundColor( const QColor& color);    // obsolete
+  virtual QColor        backgroundColor() const;                     // obsolete
+  void                  setBackground( const Qtx::BackgroundData& color);
+  Qtx::BackgroundData   background() const;
 
-  void setAnimationMode(bool theDegenerated);
+  virtual int           getBgImgHeight(){return myBgImgHeight; };
+  virtual int           getBgImgWidth() {return myBgImgWidth;  };
 
-  virtual void         setBackgroundColor( const QColor& color);
-  virtual QColor       backgroundColor() const;
+  virtual void          updateStaticTriedronVisibility();
 
 //   void         setActive( V3d_TypeOfView );
-  virtual bool syncronize( const OCCViewer_ViewPort3d* );
+  virtual bool          syncronize( const OCCViewer_ViewPort3d* );
 
-  double getZSize() const;
-  void   setZSize( double );
+  double                getZSize() const;
+  void                  setZSize( double );
 
-  virtual void onUpdate();
+  void                  getAxialScale( double&, double&, double& );
+
+  virtual void          onUpdate();
 
   // TRANSFORMATIONS
-  virtual void         reset();
-  virtual void         pan( int , int );
-  virtual void         setCenter( int , int );
-  virtual void         fitRect( const QRect& );
-  virtual void         zoom( int, int, int, int );
-  virtual void         fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
-
-  void                 startRotation( int, int, int, const gp_Pnt& );
-  void                 rotate( int, int, int, const gp_Pnt& );
-  void                 endRotation();
+  virtual void          reset();
+  virtual void          pan( int , int );
+  virtual void          setCenter( int , int );
+  virtual void          fitRect( const QRect& );
+  virtual void          startZoomAtPoint( int, int );
+  virtual void          zoom( int, int, int, int );
+  virtual void          fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
+  virtual void          rotateXY( double );
+  virtual void          setAxialScale( double, double, double );
+
+  virtual void          startRotation( int, int, int, const gp_Pnt& );
+  virtual void          rotate( int, int, int, const gp_Pnt& );
+  virtual void          endRotation();
   bool                  isBusy() {return myBusy;} // check that View Port is fully initialized
 
+  void                  setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+  bool                  isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
+signals:
+  void                  vpChangeBackground( const Qtx::BackgroundData& );
+
+public slots:
+  virtual bool          synchronize( OCCViewer_ViewPort* );
+
 protected:
     // EVENTS
-  virtual void         paintEvent( QPaintEvent* );
+  virtual void          paintEvent( QPaintEvent* );
   virtual void          resizeEvent( QResizeEvent* );
 
-private:
-  Handle(V3d_View) activeView() const;
-  Handle(V3d_View) inactiveView() const;
-  bool             mapView( const Handle(V3d_View)& );
-  bool            setWindow( const Handle(V3d_View)& );
-  bool            mapped( const Handle(V3d_View)& ) const;
+  // initialization
+  virtual void          attachWindow( const Handle(V3d_View)&, const Handle(Aspect_Window)& );
 
 private:
-  Handle(V3d_View)     myOrthoView;
-  Handle(V3d_View)     myPerspView;
-  Handle(V3d_View)     myActiveView;
-  bool                 myDegenerated;
+  Handle(V3d_View)      activeView() const;
+  Handle(V3d_View)      inactiveView() const;
+  bool                  mapView( const Handle(V3d_View)& );
+  bool                  setWindow( const Handle(V3d_View)& );
+  bool                  mapped( const Handle(V3d_View)& ) const;
+  void                  updateBackground();
+  
+private:
+  Handle(V3d_View)      myOrthoView;
+  Handle(V3d_View)      myPerspView;
+  Handle(V3d_View)      myActiveView;
+  bool                  myDegenerated;
   bool                  myAnimate;
   bool                  myBusy;
-  double               myScale;
+  double                myScale;
+  bool                  myIsAdvancedZoomingEnabled;
+  Qtx::BackgroundData   myBackground;
+  int                   myBgImgHeight;
+  int                   myBgImgWidth;
 };
 
 #ifdef WIN32
index eec828a81dc587dab09435cb6231c293525f816b..d630669b9d4d648df6605c0432d51dae5f90fe7c 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OCCViewer_ViewSketcher.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewPort3d.h"
@@ -255,7 +253,7 @@ void OCCViewer_RectSketcher::onMouse( QMouseEvent* e )
     myResult = Accept;
     QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
                                                    e->globalPos(), e->button(), 
-                                                  e->buttons(), e->modifiers() ) );
+                                                   e->buttons(), e->modifiers() ) );
   }
 }
 
@@ -432,7 +430,7 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e )
     myResult = Reject;
     QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
                                                    e->globalPos(), e->button(), 
-                                                  e->buttons(), e->modifiers() ) );
+                                                   e->buttons(), e->modifiers() ) );
   }
   else if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & myAddButton ) )
   {
@@ -540,7 +538,7 @@ bool OCCViewer_PolygonSketcher::isValid( const QPolygon* aPoints, const QPoint&
 }
 
 bool OCCViewer_PolygonSketcher::isIntersect( const QPoint& aStart1, const QPoint& anEnd1,
-                                            const QPoint& aStart2, const QPoint& anEnd2 ) const
+                                             const QPoint& aStart2, const QPoint& anEnd2 ) const
 {
   if ( ( aStart1 == aStart2 && anEnd1 == anEnd2 ) ||
        ( aStart1 == anEnd2 && anEnd1 == aStart2 ) )
index b33b0690d10afc457f590471dd4d6dfc401dca9f..b50b948456fcd458c1a708c0ef1ad0dbce321b26 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWSKETCHER_H
 #define OCCVIEWER_VIEWSKETCHER_H
 
index a366dfbb5e52ba24cb8b1adf1ef6942e9c8e9be0..26e9ba79db5f86e6772d1b1dbdce2634d67a52a6 100755 (executable)
@@ -1,27 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : OCCViewer_ViewWindow.cxx
 // Author :
-//
+
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewPort3d.h"
@@ -31,6 +32,9 @@
 #include "OCCViewer_ClippingDlg.h"
 #include "OCCViewer_SetRotationPointDlg.h"
 #include "OCCViewer_AxialScaleDlg.h"
+#include "OCCViewer_CubeAxesDlg.h"
+
+#include <Basics_OCCTVersion.hxx>
 
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
 #include <SUIT_Tools.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_Application.h>
 
 #include <QtxActionToolMgr.h>
 #include <QtxMultiAction.h>
 #include <QtxRubberBand.h>
 
+#include <OpenGLUtils_FrameBuffer.h>
+
 #include <QPainter>
 #include <QTime>
 #include <QImage>
+#include <QKeyEvent>
 #include <QMouseEvent>
 #include <QApplication>
-
-#include <V3d_Plane.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pln.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
+#include <QMenu>
 
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <AIS_Shape.hxx>
 
 #include <BRep_Tool.hxx>
+#include <BRepBndLib.hxx>
 #include <TopoDS.hxx>
 
-#include <BRepBndLib.hxx>
 #include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
-#include <Visual3d_View.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <Graphic3d_ExportFormat.hxx>
 
+#include <Visual3d_View.hxx>
+#include <V3d_Plane.hxx>
+#include <V3d_Light.hxx>
+
+#include <gp_Dir.hxx>
+#include <gp_Pln.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+
+#include <Standard_Version.hxx>
+
+#include "utilities.h"
+
+// // OpenCV includes
+// #include <cv.h>
+// #include <highgui.h>
+
 static QEvent* l_mbPressEvent = 0;
 
 #ifdef WIN32
 # include <QWindowsStyle>
 #endif
 
+#include <GL/gl.h>
+
 const char* imageZoomCursor[] = {
 "32 32 3 1",
 ". c None",
@@ -195,20 +216,29 @@ const char* imageCrossCursor[] = {
   \param theModel OCC 3D viewer
 */
 OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop*     theDesktop,
-                                           OCCViewer_Viewer* theModel )
+                                            OCCViewer_Viewer* theModel )
 : SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
   myRestoreFlag = 0;
   myEnableDrawMode = false;
+  myDrawRect=false;
   updateEnabledDrawMode();
   myClippingDlg = 0;
   myScalingDlg = 0;
   mySetRotationPointDlg = 0;
   myRectBand = 0;
+  
+  IsSketcherStyle = false;
 
   mypSketcher = 0;
   myCurSketch = -1;
+  my2dMode = No2dMode;
+
+  myInteractionStyle = SUIT_ViewModel::STANDARD;
+
+  clearViewAspects();
+  
 }
 
 /*!
@@ -226,7 +256,6 @@ OCCViewer_ViewWindow::~OCCViewer_ViewWindow()
 void OCCViewer_ViewWindow::initLayout()
 {
   myViewPort = new OCCViewer_ViewPort3d( this, myModel->getViewer3d(), V3d_ORTHOGRAPHIC );
-  myViewPort->setBackgroundColor(Qt::black);
   myViewPort->installEventFilter(this);
   setCentralWidget(myViewPort);
   myOperation = NOTHING;
@@ -241,6 +270,28 @@ void OCCViewer_ViewWindow::initLayout()
 
   createActions();
   createToolBar();
+
+  switch (my2dMode) {
+  case XYPlane:
+    onTopView();
+    break;
+  case XZPlane:
+    onLeftView();
+    break;
+  case YZPlane:
+    onFrontView();
+    break;
+  }
+
+  // Graduated axes dialog
+  QtxAction* anAction = dynamic_cast<QtxAction*>( toolMgr()->action( GraduatedAxesId ) );
+  myCubeAxesDlg = new OCCViewer_CubeAxesDlg( anAction, this, "OCCViewer_CubeAxesDlg" );
+  myCubeAxesDlg->initialize();
+}
+
+OCCViewer_ViewWindow* OCCViewer_ViewWindow::getView( const int mode ) const
+{
+  return mode == get2dMode() ? const_cast<OCCViewer_ViewWindow*>( this ) : 0;
 }
 
 /*!
@@ -250,17 +301,19 @@ void OCCViewer_ViewWindow::initLayout()
   \return type of the operation
 */
 OCCViewer_ViewWindow::OperationType
-OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent )
+OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent, int theInteractionStyle )
 {
   OperationType aOp = NOTHING;
-  if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ZOOM]) &&
-      (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ZOOM]) )
+  SUIT_ViewModel::InteractionStyle aStyle = (SUIT_ViewModel::InteractionStyle)theInteractionStyle;
+  if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ZOOM]) &&
+      (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ZOOM]) )
     aOp = ZOOMVIEW;
-  else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::PAN]) &&
-           (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::PAN]) )
+  else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::PAN]) &&
+           (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::PAN]) )
     aOp = PANVIEW;
-  else if( (theEvent->modifiers()  == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ROTATE]) &&
-           (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ROTATE]) )
+  else if( (theEvent->modifiers()  == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ROTATE]) &&
+           (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ROTATE]) &&
+           (my2dMode == No2dMode))
     aOp = ROTATE;
 
   return aOp;
@@ -296,9 +349,13 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
     case QEvent::Wheel:
       {
         QWheelEvent* aEvent = (QWheelEvent*) e;
-        double aDelta = aEvent->delta();
-        double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.;
-        myViewPort->getView()->SetZoom(aScale);
+       myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
+       double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
+       int x  = aEvent->x();
+       int y  = aEvent->y();
+       int x1 = (int)( aEvent->x() + width()*delta/100 );
+       int y1 = (int)( aEvent->y() + height()*delta/100 );
+       myViewPort->zoom( x, y, x1, y1 );
       }
       return true;
 
@@ -310,6 +367,10 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
       }
       return true;
 
+    case QEvent::KeyPress:
+      emit keyPressed(this, (QKeyEvent*) e);
+      return true;
+
     default:
       break;
     }
@@ -334,6 +395,17 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
 {
   myStartX = theEvent->x();
   myStartY = theEvent->y();
+  int anInteractionStyle = interactionStyle();
+
+  // in "key free" interaction style zoom operation is activated by two buttons (simultaneously pressed),
+  // which are assigned for pan and rotate - these operations are activated immediately after pressing 
+  // of the first button, so it is necessary to switch to zoom when the second button is pressed
+  bool aSwitchToZoom = false;
+  if ( anInteractionStyle == SUIT_ViewModel::KEY_FREE && 
+       ( myOperation == PANVIEW || myOperation == ROTATE ) ) {
+    aSwitchToZoom = getButtonState( theEvent, anInteractionStyle ) == ZOOMVIEW;
+  }
+
   switch ( myOperation ) {
   case WINDOWFIT:
     if ( theEvent->button() == Qt::LeftButton )
@@ -346,76 +418,87 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
     break;
 
   case ZOOMVIEW:
-    if ( theEvent->button() == Qt::LeftButton )
+    if ( theEvent->button() == Qt::LeftButton ) {
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
       emit vpTransformationStarted ( ZOOMVIEW );
+    }
     break;
 
   case PANVIEW:
-    if ( theEvent->button() == Qt::LeftButton )
+    if ( aSwitchToZoom ) {
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
+      activateZoom();
+    }
+    else if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( PANVIEW );
     break;
 
   case ROTATE:
-    if ( theEvent->button() == Qt::LeftButton ) {
-           myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
-           emit vpTransformationStarted ( ROTATE );
-         }
+    if ( aSwitchToZoom ) {
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
+      activateZoom();
+    }
+    else if ( theEvent->button() == Qt::LeftButton ) {
+      myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
+      emit vpTransformationStarted ( ROTATE );
+    }
     break;
 
   default:
   /*  Try to activate a transformation */
-    switch ( getButtonState(theEvent) ) {
+    switch ( getButtonState(theEvent, anInteractionStyle) ) {
     case ZOOMVIEW:
-           activateZoom();
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
+      activateZoom();
       break;
     case PANVIEW:
-           activatePanning();
+            activatePanning();
       break;
     case ROTATE:
-           activateRotation();
-           myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
+            activateRotation();
+            myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
       break;
     default:
       if ( myRotationPointSelection )
       {
-       if ( theEvent->button() == Qt::LeftButton )
-       {
-         Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
-         ic->Select();
-         for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
-         {
-           TopoDS_Shape aShape = ic->SelectedShape();
-           if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
-           {
-             gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
-             if ( mySetRotationPointDlg )
-             {
-               myRotationPointSelection = false;
-               mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
-             }
-           }
-           else
-           {
-             myCurrPointType = myPrevPointType;
-             break;
-           }
-         }
-         if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType;
-         if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange();
-         ic->CloseAllContexts();
-         myOperation = NOTHING;
-         myViewPort->setCursor( myCursor );
-         myCursorIsHand = false;
-         myRotationPointSelection = false;
-       }
+        if ( theEvent->button() == Qt::LeftButton )
+        {
+          Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+          ic->Select();
+          for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
+          {
+            TopoDS_Shape aShape = ic->SelectedShape();
+            if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+            {
+              gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
+              if ( mySetRotationPointDlg )
+              {
+                myRotationPointSelection = false;
+                mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+              }
+            }
+            else
+            {
+              myCurrPointType = myPrevPointType;
+              break;
+            }
+          }
+          if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType;
+          if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange();
+          ic->CloseAllContexts();
+          myOperation = NOTHING;
+          myViewPort->setCursor( myCursor );
+          myCursorIsHand = false;
+          myRotationPointSelection = false;
+        }
       }
       else
-       emit mousePressed(this, theEvent);
+        emit mousePressed(this, theEvent);
       break;
     }
     /* notify that we start a transformation */
     if ( transformRequested() )
-           emit vpTransformationStarted ( myOperation );
+            emit vpTransformationStarted ( myOperation );
   }
   if ( transformRequested() )
     setTransformInProcess( true );
@@ -435,13 +518,13 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
 void OCCViewer_ViewWindow::activateZoom()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               /* save old cursor */
+    myCursor = cursor();                /* save old cursor */
 
   if ( myOperation != ZOOMVIEW ) {
     QPixmap zoomPixmap (imageZoomCursor);
     QCursor zoomCursor (zoomPixmap);
-    setTransformRequested ( ZOOMVIEW );
-    myViewPort->setCursor( zoomCursor );
+    if( setTransformRequested ( ZOOMVIEW ) )
+      myViewPort->setCursor( zoomCursor );
   }
 }
 
@@ -454,12 +537,12 @@ void OCCViewer_ViewWindow::activateZoom()
 void OCCViewer_ViewWindow::activatePanning()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               // save old cursor
+    myCursor = cursor();                // save old cursor
 
   if ( myOperation != PANVIEW ) {
     QCursor panCursor (Qt::SizeAllCursor);
-    setTransformRequested ( PANVIEW );
-    myViewPort->setCursor( panCursor );
+    if( setTransformRequested ( PANVIEW ) )
+      myViewPort->setCursor( panCursor );
   }
 }
 
@@ -471,13 +554,13 @@ void OCCViewer_ViewWindow::activatePanning()
 void OCCViewer_ViewWindow::activateRotation()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               // save old cursor
+    myCursor = cursor();                // save old cursor
 
   if ( myOperation != ROTATE ) {
     QPixmap rotatePixmap (imageRotateCursor);
     QCursor rotCursor (rotatePixmap);
-    setTransformRequested ( ROTATE );
-    myViewPort->setCursor( rotCursor );
+    if( setTransformRequested ( ROTATE ) )
+      myViewPort->setCursor( rotCursor );
   }
 }
 
@@ -663,10 +746,10 @@ void OCCViewer_ViewWindow::activateGlobalPanning()
     QCursor glPanCursor (globalPanPixmap);
     myCurScale = aView3d->Scale();
     aView3d->FitAll(0.01, false);
-    myCursor = cursor();               // save old cursor
+    myCursor = cursor();                // save old cursor
     myViewPort->fitAll(); // fits view before selecting a new scene center
-    setTransformRequested( PANGLOBAL );
-    myViewPort->setCursor( glPanCursor );
+    if( setTransformRequested( PANGLOBAL ) )
+      myViewPort->setCursor( glPanCursor );
   }
 }
 
@@ -678,26 +761,29 @@ void OCCViewer_ViewWindow::activateGlobalPanning()
 void OCCViewer_ViewWindow::activateWindowFit()
 {
   if ( !transformRequested() && !myCursorIsHand )
-    myCursor = cursor();               /* save old cursor */
+    myCursor = cursor();                /* save old cursor */
 
   if ( myOperation != WINDOWFIT ) {
     QCursor handCursor (Qt::PointingHandCursor);
-    setTransformRequested ( WINDOWFIT );
-    myViewPort->setCursor ( handCursor );
-    myCursorIsHand = true;
+    if( setTransformRequested ( WINDOWFIT ) )
+    {
+      myViewPort->setCursor ( handCursor );
+      myCursorIsHand = true;
+    }
   }
 }
 
 /*!
   \brief Start delayed viewer operation.
 */
-void OCCViewer_ViewWindow::setTransformRequested( OperationType op )
+bool OCCViewer_ViewWindow::setTransformRequested( OperationType op )
 {
-  myOperation = op;
-  myViewPort->setMouseTracking( myOperation == NOTHING );
+  bool ok = transformEnabled( op );
+  myOperation = ok ? op : NOTHING;
+  myViewPort->setMouseTracking( myOperation == NOTHING );  
+  return ok;
 }
 
-
 /*!
   \brief Handle mouse move event.
   \param theEvent mouse event
@@ -732,52 +818,58 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent )
     break;
 
   default:
-    if ( myRotationPointSelection )
+    if ( myRotationPointSelection || isSketcherStyle() )
+    {
       emit mouseMoving( this, theEvent );
+    }
     else
     {
       int aState = theEvent->modifiers();
       int aButton = theEvent->buttons();
-      if ( aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
-       myDrawRect = myEnableDrawMode;
-       if ( myDrawRect ) {
-         drawRect();
-         if ( !myCursorIsHand )        {   // we are going to sketch a rectangle
-           QCursor handCursor (Qt::PointingHandCursor);
-           myCursorIsHand = true;
-           myCursor = cursor();
-           myViewPort->setCursor( handCursor );
-         }
-       }
+      int anInteractionStyle = interactionStyle();
+      if ( anInteractionStyle == SUIT_ViewModel::STANDARD && 
+           aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
+        myDrawRect = myEnableDrawMode;
+        if ( myDrawRect ) {
+          drawRect();
+          if ( !myCursorIsHand )        {   // we are going to sketch a rectangle
+            QCursor handCursor (Qt::PointingHandCursor);
+            myCursorIsHand = true;
+            myCursor = cursor();
+            myViewPort->setCursor( handCursor );
+          }
+        }
+        emit mouseMoving( this, theEvent );
       }
-      else if ( aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
-       OCCViewer_ViewSketcher* sketcher = 0;
-       QList<OCCViewer_ViewSketcher*>::Iterator it;
-       for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
-       {
-         OCCViewer_ViewSketcher* sk = (*it);
-         if( sk->isDefault() && sk->sketchButton() == aButton )
-           sketcher = sk;
-       }
-       if ( sketcher && myCurSketch == -1 )
-       {
-         activateSketching( sketcher->type() );
-         if ( mypSketcher )
-         {
-           myCurSketch = mypSketcher->sketchButton();
-
-           if ( l_mbPressEvent )
-           {
-             QApplication::sendEvent( getViewPort(), l_mbPressEvent );
-             delete l_mbPressEvent;
-             l_mbPressEvent = 0;
-           }
-           QApplication::sendEvent( getViewPort(), theEvent );
-         }
-       }
+      else if ( anInteractionStyle == SUIT_ViewModel::STANDARD && 
+                aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
+        OCCViewer_ViewSketcher* sketcher = 0;
+        QList<OCCViewer_ViewSketcher*>::Iterator it;
+        for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
+        {
+          OCCViewer_ViewSketcher* sk = (*it);
+          if( sk->isDefault() && sk->sketchButton() == aButton )
+            sketcher = sk;
+        }
+        if ( sketcher && myCurSketch == -1 )
+        {
+          activateSketching( sketcher->type() );
+          if ( mypSketcher )
+          {
+            myCurSketch = mypSketcher->sketchButton();
+
+            if ( l_mbPressEvent )
+            {
+              QApplication::sendEvent( getViewPort(), l_mbPressEvent );
+              delete l_mbPressEvent;
+              l_mbPressEvent = 0;
+            }
+            QApplication::sendEvent( getViewPort(), theEvent );
+          }
+        }
       }
       else
-       emit mouseMoving( this, theEvent );
+        emit mouseMoving( this, theEvent );
     }
   }
 }
@@ -794,13 +886,13 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
       int prevState = myCurSketch;
       if(theEvent->button() == Qt::RightButton)
       {
-       QList<OCCViewer_ViewSketcher*>::Iterator it;
-       for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it )
-       {
-         OCCViewer_ViewSketcher* sk = (*it);
-         if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch )
-           myCurSketch = -1;
-       }
+        QList<OCCViewer_ViewSketcher*>::Iterator it;
+        for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it )
+        {
+          OCCViewer_ViewSketcher* sk = (*it);
+          if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch )
+            myCurSketch = -1;
+        }
       }
 
       emit mouseReleased(this, theEvent);
@@ -1004,51 +1096,75 @@ void OCCViewer_ViewWindow::createActions()
 
   // Projections
   aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_FRONT" ) ),
-                           tr( "MNU_FRONT_VIEW" ), 0, this);
+                           tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
   aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, FrontId );
 
   aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BACK" ) ),
-                           tr( "MNU_BACK_VIEW" ), 0, this);
+                           tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
   aAction->setStatusTip(tr("DSC_BACK_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onBackView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, BackId );
 
   aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TOP" ) ),
-                           tr( "MNU_TOP_VIEW" ), 0, this);
+                           tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
   aAction->setStatusTip(tr("DSC_TOP_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onTopView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, TopId );
 
   aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BOTTOM" ) ),
-                           tr( "MNU_BOTTOM_VIEW" ), 0, this);
+                           tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
   aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, BottomId );
-
+  
   aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_LEFT" ) ),
-                           tr( "MNU_LEFT_VIEW" ), 0, this);
+                           tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
   aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, LeftId );
 
   aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RIGHT" ) ),
-                           tr( "MNU_RIGHT_VIEW" ), 0, this);
+                           tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
   aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onRightView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, RightId );
 
+  // rotate anticlockwise
+  aAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_ANTICLOCKWISE" ) ),
+                           tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+  aAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+  this->addAction(aAction);
+  toolMgr()->registerAction( aAction, AntiClockWiseId );
+
+  // rotate clockwise
+  aAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_CLOCKWISE" ) ),
+                           tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+  aAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+  this->addAction(aAction);
+  toolMgr()->registerAction( aAction, ClockWiseId );
+
   // Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
-                           tr( "MNU_RESET_VIEW" ), 0, this);
+                           tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView()));
+  this->addAction(aAction);
   toolMgr()->registerAction( aAction, ResetId );
 
-  // Reset
-  aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLONE_VIEW" ) ),
-                           tr( "MNU_CLONE_VIEW" ), 0, this);
+  // Clone
+  aAction = new QtxAction(tr("MNU_CLONE_VIEW"),
+                          aResMgr->loadPixmap("OCCViewer", tr("ICON_OCCVIEWER_CLONE_VIEW")),
+                          tr("MNU_CLONE_VIEW"), 0, this);
   aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView()));
   toolMgr()->registerAction( aAction, CloneId );
@@ -1086,6 +1202,53 @@ void OCCViewer_ViewWindow::createActions()
   aAction->setStatusTip(tr("DSC_SCALING"));
   connect(aAction, SIGNAL(triggered()), this, SLOT(onAxialScale()));
   toolMgr()->registerAction( aAction, AxialScaleId );
+
+  // Graduated axes 
+  aAction = new QtxAction(tr("MNU_GRADUATED_AXES"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_GRADUATED_AXES" ) ),
+                           tr( "MNU_GRADUATED_AXES" ), 0, this);
+  aAction->setStatusTip(tr("DSC_GRADUATED_AXES"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onGraduatedAxes()));
+  toolMgr()->registerAction( aAction, GraduatedAxesId );
+
+  // Active only ambient light or not
+  aAction = new QtxAction(tr("MNU_AMBIENT"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_AMBIENT" ) ),
+                           tr( "MNU_AMBIENT" ), 0, this);
+  aAction->setStatusTip(tr("DSC_AMBIENT"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onAmbientToogle()));
+  toolMgr()->registerAction( aAction, AmbientId );
+
+  // Switch between interaction styles
+  aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STYLE_SWITCH" ) ),
+                          tr( "MNU_STYLE_SWITCH" ), 0, this);
+  aAction->setStatusTip(tr("DSC_STYLE_SWITCH"));
+  aAction->setCheckable(true);
+  connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
+  toolMgr()->registerAction( aAction, SwitchInteractionStyleId );
+
+  // Switch between zooming styles
+  aAction = new QtxAction(tr("MNU_ZOOMING_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH" ) ),
+                          tr( "MNU_ZOOMING_STYLE_SWITCH" ), 0, this);
+  aAction->setStatusTip(tr("DSC_ZOOMING_STYLE_SWITCH"));
+  aAction->setCheckable(true);
+  connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+  toolMgr()->registerAction( aAction, SwitchZoomingStyleId );
+
+  // Maximized view
+  aAction = new QtxAction(tr("MNU_MINIMIZE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MINIMIZE" ) ),
+                          tr( "MNU_MINIMIZE_VIEW" ), 0, this );
+  aAction->setStatusTip(tr("DSC_MINIMIZE_VIEW"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onMaximizedView()));
+  toolMgr()->registerAction( aAction, MaximizedId );
+
+  // Synchronize view
+  aAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SYNC" ) ),
+                          tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this );
+  aAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+  aAction->setMenu( new QMenu( this ) );
+  aAction->setCheckable(true);
+  connect(aAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+  connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSynchronizeView(bool)));
+  toolMgr()->registerAction( aAction, SynchronizeId );
 }
 
 /*!
@@ -1093,10 +1256,29 @@ void OCCViewer_ViewWindow::createActions()
 */
 void OCCViewer_ViewWindow::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  QString aToolbarName;
+  switch (my2dMode) {
+  case XYPlane:
+    aToolbarName = tr( "LBL_XYTOOLBAR_LABEL" );
+    break;
+  case XZPlane:
+    aToolbarName = tr( "LBL_XZTOOLBAR_LABEL" );
+    break;
+  case YZPlane:
+    aToolbarName = tr( "LBL_YZTOOLBAR_LABEL" );
+    break;
+  default:
+    aToolbarName = tr( "LBL_3DTOOLBAR_LABEL" );
+  }
+  
+  int tid = toolMgr()->createToolBar( aToolbarName, false );
 
   toolMgr()->append( DumpId, tid );
-  if( myModel->trihedronActivated() ) 
+  toolMgr()->append( SwitchInteractionStyleId, tid );
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+  toolMgr()->append( SwitchZoomingStyleId, tid );
+#endif
+  if( myModel->trihedronActivated() )
     toolMgr()->append( TrihedronShowId, tid );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
@@ -1110,19 +1292,24 @@ void OCCViewer_ViewWindow::createToolBar()
   aPanningAction->insertAction( toolMgr()->action( GlobalPanId ) );
   toolMgr()->append( aPanningAction, tid );
 
-  toolMgr()->append( ChangeRotationPointId, tid );
-  toolMgr()->append( RotationId, tid );
+  if (my2dMode == No2dMode) {
+    toolMgr()->append( ChangeRotationPointId, tid );
+    toolMgr()->append( RotationId, tid );
+
+    QtxMultiAction* aViewsAction = new QtxMultiAction( this );
+    aViewsAction->insertAction( toolMgr()->action( FrontId ) );
+    aViewsAction->insertAction( toolMgr()->action( BackId ) );
+    aViewsAction->insertAction( toolMgr()->action( TopId ) );
+    aViewsAction->insertAction( toolMgr()->action( BottomId ) );
+    aViewsAction->insertAction( toolMgr()->action( LeftId ) );
+    aViewsAction->insertAction( toolMgr()->action( RightId ) );
+    toolMgr()->append( aViewsAction, tid );
 
-  QtxMultiAction* aViewsAction = new QtxMultiAction( this );
-  aViewsAction->insertAction( toolMgr()->action( FrontId ) );
-  aViewsAction->insertAction( toolMgr()->action( BackId ) );
-  aViewsAction->insertAction( toolMgr()->action( TopId ) );
-  aViewsAction->insertAction( toolMgr()->action( BottomId ) );
-  aViewsAction->insertAction( toolMgr()->action( LeftId ) );
-  aViewsAction->insertAction( toolMgr()->action( RightId ) );
-  toolMgr()->append( aViewsAction, tid );
+    toolMgr()->append( AntiClockWiseId, tid );
+    toolMgr()->append( ClockWiseId, tid );
 
-  toolMgr()->append( ResetId, tid );
+    toolMgr()->append( ResetId, tid );
+  }
 
   QtxMultiAction* aMemAction = new QtxMultiAction( this );
   aMemAction->insertAction( toolMgr()->action( MemId ) );
@@ -1135,6 +1322,13 @@ void OCCViewer_ViewWindow::createToolBar()
   toolMgr()->append( toolMgr()->separator(), tid );
   toolMgr()->append( ClippingId, tid );
   toolMgr()->append( AxialScaleId, tid );
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+  toolMgr()->append( GraduatedAxesId, tid );
+#endif
+  toolMgr()->append( AmbientId, tid );
+
+  toolMgr()->append( MaximizedId, tid );
+  toolMgr()->append( SynchronizeId, tid );
 }
 
 /*!
@@ -1154,6 +1348,7 @@ void OCCViewer_ViewWindow::onFrontView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xpos);
   onViewFitAll();
+  emit vpTransformationFinished ( FRONTVIEW );
 }
 
 /*!
@@ -1165,6 +1360,7 @@ void OCCViewer_ViewWindow::onBackView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xneg);
   onViewFitAll();
+  emit vpTransformationFinished ( BACKVIEW );
 }
 
 /*!
@@ -1176,6 +1372,7 @@ void OCCViewer_ViewWindow::onTopView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zpos);
   onViewFitAll();
+  emit vpTransformationFinished ( TOPVIEW );
 }
 
 /*!
@@ -1187,6 +1384,7 @@ void OCCViewer_ViewWindow::onBottomView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zneg);
   onViewFitAll();
+  emit vpTransformationFinished ( BOTTOMVIEW );
 }
 
 /*!
@@ -1198,6 +1396,7 @@ void OCCViewer_ViewWindow::onLeftView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Yneg);
   onViewFitAll();
+  emit vpTransformationFinished ( LEFTVIEW );
 }
 
 /*!
@@ -1209,6 +1408,27 @@ void OCCViewer_ViewWindow::onRightView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Ypos);
   onViewFitAll();
+  emit vpTransformationFinished ( RIGHTVIEW );
+}
+
+/*!
+  \brief Rotate view 90 degrees clockwise
+*/
+void OCCViewer_ViewWindow::onClockWiseView()
+{
+  emit vpTransformationStarted ( CLOCKWISEVIEW );
+  myViewPort->rotateXY( 90. );
+  emit vpTransformationFinished ( CLOCKWISEVIEW );
+}
+
+/*!
+  \brief Rotate view 90 degrees conterclockwise
+*/
+void OCCViewer_ViewWindow::onAntiClockWiseView()
+{
+  emit vpTransformationStarted ( ANTICLOCKWISEVIEW );
+  myViewPort->rotateXY( -90. );
+  emit vpTransformationFinished ( ANTICLOCKWISEVIEW );
 }
 
 /*!
@@ -1224,6 +1444,7 @@ void OCCViewer_ViewWindow::onResetView()
   myViewPort->fitAll( false, true, false );
   myViewPort->getView()->SetImmediateUpdate( upd );
   myViewPort->getView()->Update();
+  emit vpTransformationFinished( RESETVIEW );
 }
 
 /*!
@@ -1233,6 +1454,7 @@ void OCCViewer_ViewWindow::onFitAll()
 {
   emit vpTransformationStarted( FITALLVIEW );
   myViewPort->fitAll();
+  emit vpTransformationFinished( FITALLVIEW );
 }
 
 /*!
@@ -1241,30 +1463,31 @@ void OCCViewer_ViewWindow::onFitAll()
 */
 void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
 {
-  if ( on )
+  if (on)
+  {
+    if (!mySetRotationPointDlg)
     {
-      if ( !mySetRotationPointDlg )
-       {
-         mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg( this, myDesktop );
-         mySetRotationPointDlg->SetAction( mySetRotationPointAction );
-       }
+      mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg (this);
+      mySetRotationPointDlg->SetAction(mySetRotationPointAction);
+    }
 
-      if ( !mySetRotationPointDlg->isVisible() )
+    if (!mySetRotationPointDlg->isVisible())
+    {
+      //if (mySetRotationPointDlg->IsFirstShown())
+      if (myCurrPointType == GRAVITY)
       {
-       if ( mySetRotationPointDlg->IsFirstShown() )
-       {
-         Standard_Real Xcenter, Ycenter, Zcenter;
-         if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) )
-           mySetRotationPointDlg->setCoords( Xcenter, Ycenter, Zcenter );
-       }
-       mySetRotationPointDlg->show();
+        Standard_Real Xcenter, Ycenter, Zcenter;
+        if (computeGravityCenter(Xcenter, Ycenter, Zcenter))
+          mySetRotationPointDlg->setCoords(Xcenter, Ycenter, Zcenter);
       }
+      mySetRotationPointDlg->show();
     }
+  }
   else
-    {
-      if ( mySetRotationPointDlg->isVisible() )
-       mySetRotationPointDlg->hide();
-    }
+  {
+    if (mySetRotationPointDlg->isVisible())
+      mySetRotationPointDlg->hide();
+  }
 }
 
 /*!
@@ -1293,23 +1516,26 @@ void OCCViewer_ViewWindow::onClipping( bool on )
   else
     myActionsMap[ ClippingId ]->setIcon(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" )));
   */
+  OCCViewer_ViewWindow* aParent = dynamic_cast<OCCViewer_ViewWindow*>(parent()->parent());
+  if (!aParent)
+    aParent = this;
   if ( on )
-  {
-    if ( !myClippingDlg )
     {
-      myClippingDlg = new OCCViewer_ClippingDlg( this, myDesktop );
-      myClippingDlg->SetAction( myClippingAction );
-    }
+      if ( !myClippingDlg )
+        {
+          myClippingDlg = new OCCViewer_ClippingDlg( aParent );
+          myClippingDlg->SetAction( myClippingAction );
+        }
     
-    if ( !myClippingDlg->isVisible() )
-      myClippingDlg->show();
-  }
+      if ( !myClippingDlg->isVisible() )
+        myClippingDlg->show();
+    }
   else
-  {
-    if ( myClippingDlg->isVisible() )
-      myClippingDlg->hide();
-    setCuttingPlane(false);
-  }
+    {
+      if ( myClippingDlg->isVisible() )
+        myClippingDlg->hide();
+      aParent->setCuttingPlane(false);
+    }
 }
 
 /*!
@@ -1318,18 +1544,45 @@ void OCCViewer_ViewWindow::onClipping( bool on )
 void OCCViewer_ViewWindow::onAxialScale()
 {
   if ( !myScalingDlg )
-    myScalingDlg = new OCCViewer_AxialScaleDlg( this, myDesktop );
+    myScalingDlg = new OCCViewer_AxialScaleDlg( this );
   
   if ( !myScalingDlg->isVisible() )
     myScalingDlg->show();
 }
 
+/*!
+  Shows Graduated Axes dialog
+*/
+void OCCViewer_ViewWindow::onGraduatedAxes()
+{
+  myCubeAxesDlg->Update();
+  myCubeAxesDlg->show();
+}
+
+void OCCViewer_ViewWindow::onAmbientToogle()
+{
+  Handle(V3d_Viewer) viewer = myViewPort->getViewer();
+  viewer->InitDefinedLights();
+  while(viewer->MoreDefinedLights())
+    {
+      Handle(V3d_Light) light = viewer->DefinedLight();
+      if(light->Type() != V3d_AMBIENT)
+        {
+          Handle(V3d_View) aView3d = myViewPort->getView();
+          if( aView3d->IsActiveLight(light) ) viewer->SetLightOff(light);
+          else viewer->SetLightOn(light);
+        }
+      viewer->NextDefinedLights();
+    }
+  viewer->Update();
+}
+
 /*!
   \brief Store view parameters.
 */
 void OCCViewer_ViewWindow::onMemorizeView()
 {
-  myModel->appendViewAspect( getViewParams() );
+  appendViewAspect( getViewParams() );
 }
 
 /*!
@@ -1337,10 +1590,10 @@ void OCCViewer_ViewWindow::onMemorizeView()
 */
 void OCCViewer_ViewWindow::onRestoreView()
 {
-  OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), myModel );
+  OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), this );
   connect( aDlg, SIGNAL( dlgOk() ), this, SLOT( setRestoreFlag() ) );
   aDlg->exec();
-  myModel->updateViewAspects( aDlg->parameters() );
+  updateViewAspects( aDlg->parameters() );
   if( myRestoreFlag && aDlg->parameters().count() )
     performRestoring( aDlg->currentItem() );
 }
@@ -1349,7 +1602,7 @@ void OCCViewer_ViewWindow::onRestoreView()
   \brief Restore view parameters.
   \param anItem view parameters
 */
-void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
+void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool baseParamsOnly )
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
 
@@ -1362,9 +1615,62 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
   aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
   aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
   aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
-  myModel->setTrihedronShown( anItem.isVisible );
-  myModel->setTrihedronSize( anItem.size );
-       
+
+  if ( !baseParamsOnly ) {
+
+    myModel->setTrihedronShown( anItem.isVisible );
+    myModel->setTrihedronSize( anItem.size );
+        
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+    // graduated trihedron
+    bool anIsVisible = anItem.gtIsVisible;
+    OCCViewer_AxisWidget::AxisData anAxisData[3];
+    anAxisData[0].DrawName = anItem.gtDrawNameX;
+    anAxisData[1].DrawName = anItem.gtDrawNameZ;
+    anAxisData[2].DrawName = anItem.gtDrawNameZ;
+    anAxisData[0].Name = anItem.gtNameX;
+    anAxisData[1].Name = anItem.gtNameZ;
+    anAxisData[2].Name = anItem.gtNameZ;
+    anAxisData[0].NameColor = QColor( anItem.gtNameColorRX,
+                                     anItem.gtNameColorGX,
+                                     anItem.gtNameColorBX );
+    anAxisData[1].NameColor = QColor( anItem.gtNameColorRY,
+                                     anItem.gtNameColorGY,
+                                     anItem.gtNameColorBY );
+    anAxisData[2].NameColor = QColor( anItem.gtNameColorRZ,
+                                     anItem.gtNameColorGZ,
+                                     anItem.gtNameColorBZ );
+    anAxisData[0].DrawValues = anItem.gtDrawValuesX;
+    anAxisData[1].DrawValues = anItem.gtDrawValuesY;
+    anAxisData[2].DrawValues = anItem.gtDrawValuesZ;
+    anAxisData[0].NbValues = anItem.gtNbValuesX;
+    anAxisData[1].NbValues = anItem.gtNbValuesY;
+    anAxisData[2].NbValues = anItem.gtNbValuesZ;
+    anAxisData[0].Offset = anItem.gtOffsetX;
+    anAxisData[1].Offset = anItem.gtOffsetY;
+    anAxisData[2].Offset = anItem.gtOffsetZ;
+    anAxisData[0].Color = QColor( anItem.gtColorRX,
+                                 anItem.gtColorGX,
+                                 anItem.gtColorBX );
+    anAxisData[1].Color = QColor( anItem.gtColorRY,
+                                 anItem.gtColorGY,
+                                 anItem.gtColorBY );
+    anAxisData[2].Color = QColor( anItem.gtColorRZ,
+                                 anItem.gtColorGZ,
+                                 anItem.gtColorBZ );
+    anAxisData[0].DrawTickmarks = anItem.gtDrawTickmarksX;
+    anAxisData[1].DrawTickmarks = anItem.gtDrawTickmarksY;
+    anAxisData[2].DrawTickmarks = anItem.gtDrawTickmarksZ;
+    anAxisData[0].TickmarkLength = anItem.gtTickmarkLengthX;
+    anAxisData[1].TickmarkLength = anItem.gtTickmarkLengthY;
+    anAxisData[2].TickmarkLength = anItem.gtTickmarkLengthZ;
+
+    myCubeAxesDlg->SetData( anIsVisible, anAxisData );
+    myCubeAxesDlg->ApplyData( aView3d );
+#endif
+
+  } // if ( !baseParamsOnly )
+
   myRestoreFlag = 0;
 }
 
@@ -1384,19 +1690,126 @@ void OCCViewer_ViewWindow::onTrihedronShow()
   myModel->toggleTrihedron();
 }
 
+/*!
+  \brief Switches "keyboard free" interaction style on/off
+*/
+void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on )
+{
+  myInteractionStyle = on ? (int)SUIT_ViewModel::KEY_FREE : (int)SUIT_ViewModel::STANDARD;
+
+  // update action state if method is called outside
+  QtxAction* a = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchInteractionStyleId ) );
+  if ( a->isChecked() != on )
+    a->setChecked( on );
+}
+
+/*!
+  \brief Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void OCCViewer_ViewWindow::onSwitchZoomingStyle( bool on )
+{
+  myViewPort->setAdvancedZoomingEnabled( on );
+
+  // update action state if method is called outside
+  QtxAction* a = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
+  if ( a->isChecked() != on )
+    a->setChecked( on );
+}
+
+/*!
+  \brief Get current interaction style
+  \return interaction style
+*/
+int OCCViewer_ViewWindow::interactionStyle() const
+{
+  return myInteractionStyle;
+}
+
+/*!
+  \brief Set current interaction style
+  \param theStyle interaction style
+*/
+void OCCViewer_ViewWindow::setInteractionStyle( const int theStyle )
+{
+  onSwitchInteractionStyle( theStyle == (int)SUIT_ViewModel::KEY_FREE );
+}
+
+/*!
+  \brief Get current zooming style
+  \return zooming style
+*/
+int OCCViewer_ViewWindow::zoomingStyle() const
+{
+  return myViewPort->isAdvancedZoomingEnabled() ? 1 : 0;
+}
+
+/*!
+  \brief Set current zooming style
+  \param theStyle zooming style
+*/
+void OCCViewer_ViewWindow::setZoomingStyle( const int theStyle )
+{
+  onSwitchZoomingStyle( theStyle == 1 );
+}
+
 /*!
   \brief Dump view window contents to the pixmap.
   \return pixmap containing all scene rendered in the window
 */
 QImage OCCViewer_ViewWindow::dumpView()
 {
-  QPixmap px = QPixmap::grabWindow( myViewPort->winId() );
-  return px.toImage();
+  Handle(V3d_View) view = myViewPort->getView();
+  if ( view.IsNull() )
+    return QImage();
+  
+  int aWidth = myViewPort->width();
+  int aHeight = myViewPort->height();
+  QApplication::syncX();
+  view->Redraw(); // In order to reactivate GL context
+  //view->Update();
+
+  OpenGLUtils_FrameBuffer aFrameBuffer;
+  if( aFrameBuffer.init( aWidth, aHeight ) )
+  {
+    QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+   
+    glPushAttrib( GL_VIEWPORT_BIT );
+    glViewport( 0, 0, aWidth, aHeight );
+    aFrameBuffer.bind();
+
+    // draw scene
+    view->Redraw();
+
+    aFrameBuffer.unbind();
+    glPopAttrib();
+
+    aFrameBuffer.bind();
+    glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
+    aFrameBuffer.unbind();
+
+    anImage = anImage.rgbSwapped();
+    anImage = anImage.mirrored();
+    return anImage;
+  }
+  // if frame buffers are unsupported, use old functionality
+  //view->Redraw();
+
+  unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];
+
+  QPoint p = myViewPort->mapFromParent(myViewPort->geometry().topLeft());
+
+  glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE,
+                data);
+
+  QImage anImage( data, aWidth, aHeight, QImage::Format_ARGB32 );
+  anImage = anImage.mirrored();
+  anImage = anImage.rgbSwapped();
+  return anImage;
 }
 
 bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, 
-                                            const QString& fileName, 
-                                            const QString& format )
+                                             const QString& fileName, 
+                                             const QString& format )
 {
   if ( format != "PS" && format != "EPS")
     return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format );
@@ -1404,9 +1817,9 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
   Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
 
   if (format == "PS")
-    a3dView->Export(qPrintable(fileName), Graphic3d_EF_PostScript);
+    a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
   else if (format == "EPS")
-    a3dView->Export(qPrintable(fileName), Graphic3d_EF_EnhPostScript);
+    a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
 
   return true;
 }
@@ -1429,7 +1842,7 @@ QString OCCViewer_ViewWindow::filter() const
   \param dz Z coordinate of plane normal
 */
 void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const double y,  const double z,
-                                           const double dx, const double dy, const double dz )
+                                            const double dx, const double dy, const double dz )
 {
   Handle(V3d_View) view = myViewPort->getView();
   if ( view.IsNull() )
@@ -1441,18 +1854,29 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const doub
     // try to use already existing plane or create a new one
     Handle(V3d_Plane) clipPlane;
     view->InitActivePlanes();
-    if ( view->MoreActivePlanes() )
+
+    // calculate new a,b,c,d values for the plane
+    gp_Pln pln (gp_Pnt(x, y, z), gp_Dir(dx, dy, dz));
+    double a, b, c, d;
+    pln.Coefficients(a, b, c, d);
+
+#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
+    if (view->MoreActivePlanes()) {
+      clipPlane = view->ActivePlane();
+      clipPlane->SetPlane(a, b, c, d);
+    }
+    else
+      clipPlane = new V3d_Plane (a, b, c, d);
+#else
+    if (view->MoreActivePlanes())
       clipPlane = view->ActivePlane();
     else
-      clipPlane = new V3d_Plane( viewer );
+      clipPlane = new V3d_Plane (viewer);
 
-    // set new a,b,c,d values for the plane
-    gp_Pln pln( gp_Pnt( x, y, z ), gp_Dir( dx, dy, dz ) );
-    double a, b, c, d;
-    pln.Coefficients( a, b, c, d );
-    clipPlane->SetPlane( a, b, c, d );
+    clipPlane->SetPlane(a, b, c, d);
+#endif
 
-    view->SetPlaneOn( clipPlane );
+    view->SetPlaneOn(clipPlane);
   }
   else
     view->SetPlaneOff();
@@ -1461,6 +1885,14 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const doub
   view->Redraw();
 }
 
+void OCCViewer_ViewWindow::setCuttingPlane( bool on, const gp_Pln pln )
+{
+  gp_Dir aDir = pln.Axis().Direction();
+  gp_Pnt aPnt = pln.Location();
+  setCuttingPlane(on, aPnt.X(), aPnt.Y(), aPnt.Z(), aDir.X(), aDir.Y(), aDir.Z());
+}
+
+
 /*!
   \brief Check if any cutting plane is enabled
   \return \c true if at least one cutting plane is enabled
@@ -1514,10 +1946,58 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   params.scaleX   = aScaleX;
   params.scaleY   = aScaleY;
   params.scaleZ   = aScaleZ;
-  params.name    = aName;
+  params.name     = aName;
   params.isVisible= isShown;
   params.size     = size;
 
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+  // graduated trihedron
+  bool anIsVisible = false;
+  OCCViewer_AxisWidget::AxisData anAxisData[3];
+  myCubeAxesDlg->GetData( anIsVisible, anAxisData );
+
+  params.gtIsVisible = anIsVisible;
+  params.gtDrawNameX = anAxisData[0].DrawName;
+  params.gtDrawNameY = anAxisData[1].DrawName;
+  params.gtDrawNameZ = anAxisData[2].DrawName;
+  params.gtNameX = anAxisData[0].Name;
+  params.gtNameY = anAxisData[1].Name;
+  params.gtNameZ = anAxisData[2].Name;
+  params.gtNameColorRX = anAxisData[0].NameColor.red();
+  params.gtNameColorGX = anAxisData[0].NameColor.green();
+  params.gtNameColorBX = anAxisData[0].NameColor.blue();
+  params.gtNameColorRY = anAxisData[1].NameColor.red();
+  params.gtNameColorGY = anAxisData[1].NameColor.green();
+  params.gtNameColorBY = anAxisData[1].NameColor.blue();
+  params.gtNameColorRZ = anAxisData[2].NameColor.red();
+  params.gtNameColorGZ = anAxisData[2].NameColor.green();
+  params.gtNameColorBZ = anAxisData[2].NameColor.blue();
+  params.gtDrawValuesX = anAxisData[0].DrawValues;
+  params.gtDrawValuesY = anAxisData[1].DrawValues;
+  params.gtDrawValuesZ = anAxisData[2].DrawValues;
+  params.gtNbValuesX = anAxisData[0].NbValues;
+  params.gtNbValuesY = anAxisData[1].NbValues;
+  params.gtNbValuesZ = anAxisData[2].NbValues;
+  params.gtOffsetX = anAxisData[0].Offset;
+  params.gtOffsetY = anAxisData[1].Offset;
+  params.gtOffsetZ = anAxisData[2].Offset;
+  params.gtColorRX = anAxisData[0].Color.red();
+  params.gtColorGX = anAxisData[0].Color.green();
+  params.gtColorBX = anAxisData[0].Color.blue();
+  params.gtColorRY = anAxisData[1].Color.red();
+  params.gtColorGY = anAxisData[1].Color.green();
+  params.gtColorBY = anAxisData[1].Color.blue();
+  params.gtColorRZ = anAxisData[2].Color.red();
+  params.gtColorGZ = anAxisData[2].Color.green();
+  params.gtColorBZ = anAxisData[2].Color.blue();
+  params.gtDrawTickmarksX = anAxisData[0].DrawTickmarks;
+  params.gtDrawTickmarksY = anAxisData[1].DrawTickmarks;
+  params.gtDrawTickmarksZ = anAxisData[2].DrawTickmarks;
+  params.gtTickmarkLengthX = anAxisData[0].TickmarkLength;
+  params.gtTickmarkLengthY = anAxisData[1].TickmarkLength;
+  params.gtTickmarkLengthZ = anAxisData[2].TickmarkLength;
+#endif
+
   return params;
 }
 
@@ -1529,13 +2009,75 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
 QString OCCViewer_ViewWindow::getVisualParameters()
 {
   viewAspect params = getViewParams();
-  QString retStr;
-  retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale,
-                 params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist,
-                 params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ,
-                 params.scaleX, params.scaleY, params.scaleZ );
-  retStr += QString().sprintf("*%u*%.2f", params.isVisible, params.size );
-  return retStr;
+
+  QStringList data;
+
+  data << QString( "scale=%1" )    .arg( params.scale,   0, 'e', 12 );
+  data << QString( "centerX=%1" )  .arg( params.centerX, 0, 'e', 12 );
+  data << QString( "centerY=%1" )  .arg( params.centerY, 0, 'e', 12 );
+  data << QString( "projX=%1" )    .arg( params.projX,   0, 'e', 12 );
+  data << QString( "projY=%1" )    .arg( params.projY,   0, 'e', 12 );
+  data << QString( "projZ=%1" )    .arg( params.projZ,   0, 'e', 12 );
+  data << QString( "twist=%1" )    .arg( params.twist,   0, 'e', 12 );
+  data << QString( "atX=%1" )      .arg( params.atX,     0, 'e', 12 );
+  data << QString( "atY=%1" )      .arg( params.atY,     0, 'e', 12 );
+  data << QString( "atZ=%1" )      .arg( params.atZ,     0, 'e', 12 );
+  data << QString( "eyeX=%1" )     .arg( params.eyeX,    0, 'e', 12 );
+  data << QString( "eyeY=%1" )     .arg( params.eyeY,    0, 'e', 12 );
+  data << QString( "eyeZ=%1" )     .arg( params.eyeZ,    0, 'e', 12 );
+  data << QString( "scaleX=%1" )   .arg( params.scaleX,  0, 'e', 12 );
+  data << QString( "scaleY=%1" )   .arg( params.scaleY,  0, 'e', 12 );
+  data << QString( "scaleZ=%1" )   .arg( params.scaleZ,  0, 'e', 12 );
+  data << QString( "isVisible=%1" ).arg( params.isVisible );
+  data << QString( "size=%1" )     .arg( params.size,    0, 'f',  2 );
+
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 or newer version
+  // graduated trihedron
+  data << QString( "gtIsVisible=%1" )      .arg( params.gtIsVisible );
+  data << QString( "gtDrawNameX=%1" )      .arg( params.gtDrawNameX );
+  data << QString( "gtDrawNameY=%1" )      .arg( params.gtDrawNameY );
+  data << QString( "gtDrawNameZ=%1" )      .arg( params.gtDrawNameZ );
+  data << QString( "gtNameX=%1" )          .arg( params.gtNameX );
+  data << QString( "gtNameY=%1" )          .arg( params.gtNameY );
+  data << QString( "gtNameZ=%1" )          .arg( params.gtNameZ );
+  data << QString( "gtNameColorRX=%1" )    .arg( params.gtNameColorRX );
+  data << QString( "gtNameColorGX=%1" )    .arg( params.gtNameColorGX );
+  data << QString( "gtNameColorBX=%1" )    .arg( params.gtNameColorBX );
+  data << QString( "gtNameColorRY=%1" )    .arg( params.gtNameColorRY );
+  data << QString( "gtNameColorGY=%1" )    .arg( params.gtNameColorGY );
+  data << QString( "gtNameColorBY=%1" )    .arg( params.gtNameColorBY );
+  data << QString( "gtNameColorRZ=%1" )    .arg( params.gtNameColorRZ );
+  data << QString( "gtNameColorGZ=%1" )    .arg( params.gtNameColorGZ );
+  data << QString( "gtNameColorBZ=%1" )    .arg( params.gtNameColorBZ );
+  data << QString( "gtDrawValuesX=%1" )    .arg( params.gtDrawValuesX );
+  data << QString( "gtDrawValuesY=%1" )    .arg( params.gtDrawValuesY );
+  data << QString( "gtDrawValuesZ=%1" )    .arg( params.gtDrawValuesZ );
+  data << QString( "gtNbValuesX=%1" )      .arg( params.gtNbValuesX );
+  data << QString( "gtNbValuesY=%1" )      .arg( params.gtNbValuesY );
+  data << QString( "gtNbValuesZ=%1" )      .arg( params.gtNbValuesZ );
+  data << QString( "gtOffsetX=%1" )        .arg( params.gtOffsetX );
+  data << QString( "gtOffsetY=%1" )        .arg( params.gtOffsetY );
+  data << QString( "gtOffsetZ=%1" )        .arg( params.gtOffsetZ );
+  data << QString( "gtColorRX=%1" )        .arg( params.gtColorRX );
+  data << QString( "gtColorGX=%1" )        .arg( params.gtColorGX );
+  data << QString( "gtColorBX=%1" )        .arg( params.gtColorBX );
+  data << QString( "gtColorRY=%1" )        .arg( params.gtColorRY );
+  data << QString( "gtColorGY=%1" )        .arg( params.gtColorGY );
+  data << QString( "gtColorBY=%1" )        .arg( params.gtColorBY );
+  data << QString( "gtColorRZ=%1" )        .arg( params.gtColorRZ );
+  data << QString( "gtColorGZ=%1" )        .arg( params.gtColorGZ );
+  data << QString( "gtColorBZ=%1" )        .arg( params.gtColorBZ );
+  data << QString( "gtDrawTickmarksX=%1" ) .arg( params.gtDrawTickmarksX );
+  data << QString( "gtDrawTickmarksY=%1" ) .arg( params.gtDrawTickmarksY );
+  data << QString( "gtDrawTickmarksZ=%1" ) .arg( params.gtDrawTickmarksZ );
+  data << QString( "gtTickmarkLengthX=%1" ).arg( params.gtTickmarkLengthX );
+  data << QString( "gtTickmarkLengthY=%1" ).arg( params.gtTickmarkLengthY );
+  data << QString( "gtTickmarkLengthZ=%1" ).arg( params.gtTickmarkLengthZ );
+#endif
+  QString bg = Qtx::backgroundToString( background() ).replace( "=", "$" );
+  data << QString( "background=%1" ).arg( bg );
+
+  return data.join("*");
 }
 
 /*!
@@ -1544,36 +2086,104 @@ QString OCCViewer_ViewWindow::getVisualParameters()
 */
 void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
 {
-  QStringList paramsLst = parameters.split( '*' );
-  if ( paramsLst.size() >= 15 ) {
-    viewAspect params;
-    params.scale    = paramsLst[0].toDouble();
-    params.centerX  = paramsLst[1].toDouble();
-    params.centerY  = paramsLst[2].toDouble();
-    params.projX    = paramsLst[3].toDouble();
-    params.projY    = paramsLst[4].toDouble();
-    params.projZ    = paramsLst[5].toDouble();
-    params.twist    = paramsLst[6].toDouble();
-    params.atX      = paramsLst[7].toDouble();
-    params.atY      = paramsLst[8].toDouble();
-    params.atZ      = paramsLst[9].toDouble();
-    params.eyeX     = paramsLst[10].toDouble();
-    params.eyeY     = paramsLst[11].toDouble();
-    params.eyeZ     = paramsLst[12].toDouble();
-    if ( paramsLst.size() == 18 ) {
-      params.scaleX    = paramsLst[13].toDouble();
-      params.scaleY    = paramsLst[14].toDouble();
-      params.scaleZ    = paramsLst[15].toDouble();
-      params.isVisible = paramsLst[16].toDouble();
-      params.size      = paramsLst[17].toDouble();
-    } 
-    else {
-      params.scaleX    = 1.;
-      params.scaleY    = 1.;
-      params.scaleZ    = 1.;
+  viewAspect params;
+
+  QStringList data = parameters.split( '*' );
+  Qtx::BackgroundData bgData;
+  if ( parameters.contains( '=' )  ) // new format - "scale=1.000e+00*centerX=0.000e+00..."
+  {
+    foreach( QString param, data ) {
+      QString paramName  = param.section( '=', 0, 0 ).trimmed();
+      QString paramValue = param.section( '=', 1, 1 ).trimmed();
+      if      ( paramName == "scale" )             params.scale             = paramValue.toDouble();
+      else if ( paramName == "centerX" )           params.centerX           = paramValue.toDouble();
+      else if ( paramName == "centerY" )           params.centerY           = paramValue.toDouble();
+      else if ( paramName == "projX" )             params.projX             = paramValue.toDouble();
+      else if ( paramName == "projY" )             params.projY             = paramValue.toDouble();
+      else if ( paramName == "projZ" )             params.projZ             = paramValue.toDouble();
+      else if ( paramName == "twist" )             params.twist             = paramValue.toDouble();
+      else if ( paramName == "atX" )               params.atX               = paramValue.toDouble();
+      else if ( paramName == "atY" )               params.atY               = paramValue.toDouble();
+      else if ( paramName == "atZ" )               params.atZ               = paramValue.toDouble();
+      else if ( paramName == "eyeX" )              params.eyeX              = paramValue.toDouble();
+      else if ( paramName == "eyeY" )              params.eyeY              = paramValue.toDouble();
+      else if ( paramName == "eyeZ" )              params.eyeZ              = paramValue.toDouble();
+      else if ( paramName == "scaleX" )            params.scaleX            = paramValue.toDouble();
+      else if ( paramName == "scaleY" )            params.scaleY            = paramValue.toDouble();
+      else if ( paramName == "scaleZ" )            params.scaleZ            = paramValue.toDouble();
+      else if ( paramName == "isVisible" )         params.isVisible         = paramValue.toInt();
+      else if ( paramName == "size" )              params.size              = paramValue.toDouble();
+      // graduated trihedron
+      else if ( paramName == "gtIsVisible" )       params.gtIsVisible       = paramValue.toInt();
+      else if ( paramName == "gtDrawNameX" )       params.gtDrawNameX       = paramValue.toInt();
+      else if ( paramName == "gtDrawNameY" )       params.gtDrawNameY       = paramValue.toInt();
+      else if ( paramName == "gtDrawNameZ" )       params.gtDrawNameZ       = paramValue.toInt();
+      else if ( paramName == "gtNameX" )           params.gtNameX           = paramValue;
+      else if ( paramName == "gtNameY" )           params.gtNameY           = paramValue;
+      else if ( paramName == "gtNameZ" )           params.gtNameZ           = paramValue;
+      else if ( paramName == "gtNameColorRX" )     params.gtNameColorRX     = paramValue.toInt();
+      else if ( paramName == "gtNameColorGX" )     params.gtNameColorGX     = paramValue.toInt();
+      else if ( paramName == "gtNameColorBX" )     params.gtNameColorBX     = paramValue.toInt();
+      else if ( paramName == "gtNameColorRY" )     params.gtNameColorRY     = paramValue.toInt();
+      else if ( paramName == "gtNameColorGY" )     params.gtNameColorGY     = paramValue.toInt();
+      else if ( paramName == "gtNameColorBY" )     params.gtNameColorBY     = paramValue.toInt();
+      else if ( paramName == "gtNameColorRZ" )     params.gtNameColorRZ     = paramValue.toInt();
+      else if ( paramName == "gtNameColorGZ" )     params.gtNameColorGZ     = paramValue.toInt();
+      else if ( paramName == "gtNameColorBZ" )     params.gtNameColorBZ     = paramValue.toInt();
+      else if ( paramName == "gtDrawValuesX" )     params.gtDrawValuesX     = paramValue.toInt();
+      else if ( paramName == "gtDrawValuesY" )     params.gtDrawValuesY     = paramValue.toInt();
+      else if ( paramName == "gtDrawValuesZ" )     params.gtDrawValuesZ     = paramValue.toInt();
+      else if ( paramName == "gtNbValuesX" )       params.gtNbValuesX       = paramValue.toInt();
+      else if ( paramName == "gtNbValuesY" )       params.gtNbValuesY       = paramValue.toInt();
+      else if ( paramName == "gtNbValuesZ" )       params.gtNbValuesZ       = paramValue.toInt();
+      else if ( paramName == "gtOffsetX" )         params.gtOffsetX         = paramValue.toInt();
+      else if ( paramName == "gtOffsetY" )         params.gtOffsetY         = paramValue.toInt();
+      else if ( paramName == "gtOffsetZ" )         params.gtOffsetZ         = paramValue.toInt();
+      else if ( paramName == "gtColorRX" )         params.gtColorRX         = paramValue.toInt();
+      else if ( paramName == "gtColorGX" )         params.gtColorGX         = paramValue.toInt();
+      else if ( paramName == "gtColorBX" )         params.gtColorBX         = paramValue.toInt();
+      else if ( paramName == "gtColorRY" )         params.gtColorRY         = paramValue.toInt();
+      else if ( paramName == "gtColorGY" )         params.gtColorGY         = paramValue.toInt();
+      else if ( paramName == "gtColorBY" )         params.gtColorBY         = paramValue.toInt();
+      else if ( paramName == "gtColorRZ" )         params.gtColorRZ         = paramValue.toInt();
+      else if ( paramName == "gtColorGZ" )         params.gtColorGZ         = paramValue.toInt();
+      else if ( paramName == "gtColorBZ" )         params.gtColorBZ         = paramValue.toInt();
+      else if ( paramName == "gtDrawTickmarksX" )  params.gtDrawTickmarksX  = paramValue.toInt();
+      else if ( paramName == "gtDrawTickmarksY" )  params.gtDrawTickmarksY  = paramValue.toInt();
+      else if ( paramName == "gtDrawTickmarksZ" )  params.gtDrawTickmarksZ  = paramValue.toInt();
+      else if ( paramName == "gtTickmarkLengthX" ) params.gtTickmarkLengthX = paramValue.toInt();
+      else if ( paramName == "gtTickmarkLengthY" ) params.gtTickmarkLengthY = paramValue.toInt();
+      else if ( paramName == "gtTickmarkLengthZ" ) params.gtTickmarkLengthZ = paramValue.toInt();
+      else if ( paramName == "background" )        {
+       QString bg = paramValue.replace( "$", "=" );
+       bgData = Qtx::stringToBackground( bg );
+      }
     }
-    performRestoring( params );
   }
+  else // old format - "1.000e+00*0.000e+00..."
+  {
+    int idx = 0;
+    params.scale     = data.count() > idx ? data[idx++].toDouble() : 1.0;
+    params.centerX   = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.centerY   = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.projX     = data.count() > idx ? data[idx++].toDouble() : sqrt(1./3);
+    params.projY     = data.count() > idx ? data[idx++].toDouble() : -sqrt(1./3);
+    params.projZ     = data.count() > idx ? data[idx++].toDouble() : sqrt(1./3);
+    params.twist     = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.atX       = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.atY       = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.atZ       = data.count() > idx ? data[idx++].toDouble() : 0.0;
+    params.eyeX      = data.count() > idx ? data[idx++].toDouble() : sqrt(250000./3);
+    params.eyeY      = data.count() > idx ? data[idx++].toDouble() : -sqrt(250000./3);
+    params.eyeZ      = data.count() > idx ? data[idx++].toDouble() : sqrt(250000./3);
+    params.scaleX    = data.count() > idx ? data[idx++].toDouble() : 1.0;
+    params.scaleY    = data.count() > idx ? data[idx++].toDouble() : 1.0;
+    params.scaleZ    = data.count() > idx ? data[idx++].toDouble() : 1.0;
+    params.isVisible = data.count() > idx ? data[idx++].toInt()    : 1;
+    params.size      = data.count() > idx ? data[idx++].toDouble() : 100.0;
+  }
+  performRestoring( params );
+  setBackground( bgData );
 }
 
 /*!
@@ -1682,6 +2292,7 @@ void OCCViewer_ViewWindow::onSketchingStarted()
 */
 void OCCViewer_ViewWindow::onSketchingFinished()
 {
+  MESSAGE("OCCViewer_ViewWindow::onSketchingFinished()")
   if ( mypSketcher && mypSketcher->result() == OCCViewer_ViewSketcher::Accept )
   {
     Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
@@ -1690,19 +2301,20 @@ void OCCViewer_ViewWindow::onSketchingFinished()
     {
     case Rect:
       {
-       QRect* aRect = (QRect*)mypSketcher->data();
-       if( aRect )
-       {
-         int aLeft = aRect->left();
-         int aRight = aRect->right();
-         int aTop = aRect->top();
-         int aBottom = aRect->bottom();
-
-         if( append )
-           ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
-         else
-           ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
-       }
+        QRect* aRect = (QRect*)mypSketcher->data();
+        if( aRect )
+        {
+          int aLeft = aRect->left();
+          int aRight = aRect->right();
+          int aTop = aRect->top();
+          int aBottom = aRect->bottom();
+//           myRect = aRect;
+
+          if( append )
+            ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
+          else
+            ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
+        }
       }
       break;
     case Polygon:
@@ -1710,21 +2322,21 @@ void OCCViewer_ViewWindow::onSketchingFinished()
         QPolygon* aPolygon = (QPolygon*)mypSketcher->data();
         if( aPolygon )
         {
-         int size = aPolygon->size();
-         TColgp_Array1OfPnt2d anArray( 1, size );
-
-         QPolygon::Iterator it = aPolygon->begin();
-         QPolygon::Iterator itEnd = aPolygon->end();
-         for( int index = 1; it != itEnd; ++it, index++ )
-         {
-           QPoint aPoint = *it;
-           anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) );
-         }
-
-         if( append )
-           ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False );
-         else
-           ic->Select( anArray, getViewPort()->getView(), Standard_False );
+          int size = aPolygon->size();
+          TColgp_Array1OfPnt2d anArray( 1, size );
+
+          QPolygon::Iterator it = aPolygon->begin();
+          QPolygon::Iterator itEnd = aPolygon->end();
+          for( int index = 1; it != itEnd; ++it, index++ )
+          {
+            QPoint aPoint = *it;
+            anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) );
+          }
+
+          if( append )
+            ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False );
+          else
+            ic->Select( anArray, getViewPort()->getView(), Standard_False );
         }
       }
       break;
@@ -1756,3 +2368,269 @@ void OCCViewer_ViewWindow::setTransformInProcess( bool bOn )
 {
   myEventStarted = bOn;
 }
+
+/*!
+  Set enabled state of transformation (rotate, zoom, etc)
+*/
+void OCCViewer_ViewWindow::setTransformEnabled( const OperationType id, const bool on )
+{
+  if ( id != NOTHING ) myStatus.insert( id, on );
+}
+
+/*!
+  \return enabled state of transformation (rotate, zoom, etc)
+*/
+bool OCCViewer_ViewWindow::transformEnabled( const OperationType id ) const
+{
+  return myStatus.contains( id ) ? myStatus[ id ] : true;
+}
+
+void OCCViewer_ViewWindow::onMaximizedView()
+{
+  setMaximized(!isMaximized());
+}
+
+
+void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal)
+{
+  QAction* anAction =  toolMgr()->action( MaximizedId );
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  if ( toMaximize ) {
+    anAction->setText( tr( "MNU_MINIMIZE_VIEW" ) );  
+    anAction->setToolTip( tr( "MNU_MINIMIZE_VIEW" ) );  
+    anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MINIMIZE" ) ) );
+    anAction->setStatusTip( tr( "DSC_MINIMIZE_VIEW" ) );
+    if (toSendSignal) {
+      emit maximized( this, true );
+    }
+  }
+  else {
+    anAction->setText( tr( "MNU_MAXIMIZE_VIEW" ) );  
+    anAction->setToolTip( tr( "MNU_MAXIMIZE_VIEW" ) );  
+    anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MAXIMIZE" ) ) );
+    anAction->setStatusTip( tr( "DSC_MAXIMIZE_VIEW" ) );
+    if (toSendSignal) {
+      emit maximized( this, false );
+    }
+  }
+}
+
+
+bool OCCViewer_ViewWindow::isMaximized() const
+{
+  return !(toolMgr()->action( MaximizedId )->text() == tr( "MNU_MAXIMIZE_VIEW" ));
+}
+
+void OCCViewer_ViewWindow::setSketcherStyle( bool enable )
+{ 
+  IsSketcherStyle = enable; 
+}
+
+bool OCCViewer_ViewWindow::isSketcherStyle() const 
+{ 
+  return IsSketcherStyle; 
+}
+
+
+void OCCViewer_ViewWindow::set2dMode(Mode2dType theType)
+{
+  my2dMode = theType;
+}
+
+// obsolete   
+QColor OCCViewer_ViewWindow::backgroundColor() const
+{
+  return myViewPort ? myViewPort->backgroundColor() : Qt::black;
+}
+   
+// obsolete
+void OCCViewer_ViewWindow::setBackgroundColor( const QColor& theColor )
+{
+  if ( myViewPort ) myViewPort->setBackgroundColor( theColor );
+}
+
+Qtx::BackgroundData OCCViewer_ViewWindow::background() const
+{
+  return myViewPort ? myViewPort->background() : Qtx::BackgroundData();
+}
+   
+void OCCViewer_ViewWindow::setBackground( const Qtx::BackgroundData& theBackground )
+{
+  if ( myViewPort ) myViewPort->setBackground( theBackground );
+}
+
+/*!
+  Clears view aspects
+*/
+void OCCViewer_ViewWindow::clearViewAspects()
+{
+  myViewAspects.clear();
+}
+
+/*!
+  \return const reference to list of view aspects
+*/
+const viewAspectList& OCCViewer_ViewWindow::getViewAspects()
+{
+  return myViewAspects;
+}
+
+/*!
+  Appends new view aspect
+  \param aParams - new view aspects
+*/
+void OCCViewer_ViewWindow::appendViewAspect( const viewAspect& aParams )
+{
+  myViewAspects.append( aParams );
+}
+
+/*!
+  Replaces old view aspects by new ones
+  \param aViewList - list of new view aspects
+*/
+void OCCViewer_ViewWindow::updateViewAspects( const viewAspectList& aViewList )
+{
+  myViewAspects = aViewList;
+}
+
+void OCCViewer_ViewWindow::synchronizeView( OCCViewer_ViewWindow* viewWindow, int id )
+{
+  OCCViewer_ViewWindow* otherViewWindow = 0;
+  QList<OCCViewer_ViewWindow*> compatibleViews;
+
+  bool isSync = viewWindow->toolMgr()->action( SynchronizeId )->isChecked();
+
+  int vwid = viewWindow->getId();
+  
+  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+  if ( !app ) return;
+
+  QList<SUIT_ViewManager*> wmlist;
+  app->viewManagers( viewWindow->getViewManager()->getType(), wmlist );
+
+  foreach( SUIT_ViewManager* wm, wmlist ) {
+    QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+
+    foreach( SUIT_ViewWindow* vw, vwlist ) {
+      OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+      if ( !occVW ) continue;
+
+      // check only compatible types
+      occVW = occVW->getView( viewWindow->get2dMode() );
+      if ( occVW ) {
+       if ( occVW->getId() == id ) 
+         otherViewWindow = occVW;
+       else if ( occVW != viewWindow )
+         compatibleViews.append( occVW );
+      }
+    }
+  }
+
+  if ( isSync && id ) {
+    // remove all possible disconnections
+    foreach( OCCViewer_ViewWindow* vw, compatibleViews ) {
+      // disconnect target view
+      vw->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), vw->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      if ( otherViewWindow ) {
+       // disconnect source view
+       vw->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+       otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), vw->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      }
+      QAction* a = vw->toolMgr()->action( SynchronizeId );
+      if ( a ) {
+       int anid = a->data().toInt();
+       if ( a->isChecked() && ( anid == id || anid == vwid ) ) {
+         bool blocked = a->blockSignals( true );
+         a->setChecked( false );
+         a->blockSignals( blocked );
+       }
+      }
+    }
+    if ( otherViewWindow ) {
+      // reconnect source and target view
+      otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      otherViewWindow->getViewPort()->connect( viewWindow->getViewPort(), SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      viewWindow->getViewPort()->connect( otherViewWindow->getViewPort(), SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+      // synchronize target view with source view
+      viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
+      viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+      QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+      if (anOtherAcion) {
+        anOtherAcion->setData( viewWindow->getId() );
+        if ( !anOtherAcion->isChecked() ) {
+               bool blocked = anOtherAcion->blockSignals( true );
+               anOtherAcion->setChecked( true );
+               anOtherAcion->blockSignals( blocked );
+        }
+      }
+    }
+  }
+  else if ( otherViewWindow ) {
+    // reconnect source and target view
+    otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+    viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+    viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
+    viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+    QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+    if (anOtherAcion) {
+      if ( anOtherAcion->data().toInt() == viewWindow->getId() && anOtherAcion->isChecked() ) {
+        bool blocked = anOtherAcion->blockSignals( true );
+        anOtherAcion->setChecked( false );
+        anOtherAcion->blockSignals( blocked );
+      }
+    }
+  }
+}
+
+/*!
+  "Synchronize View" action slot.
+*/
+void OCCViewer_ViewWindow::onSynchronizeView(bool checked)
+{
+  QAction* a = qobject_cast<QAction*>( sender() );
+  if ( a ) {
+    synchronizeView( this, a->data().toInt() );
+  }
+}
+
+/*!
+  Update list of available view for the "Synchronize View" action
+*/
+void OCCViewer_ViewWindow::updateSyncViews()
+{
+  QAction* anAction = toolMgr()->action( SynchronizeId );
+  if ( anAction && anAction->menu() ) {
+    int currentId = anAction->data().toInt();
+    anAction->menu()->clear();
+    SUIT_Application* app = SUIT_Session::session()->activeApplication();
+    if ( app ) { 
+      QList<SUIT_ViewManager*> wmlist;
+      app->viewManagers( getViewManager()->getType(), wmlist );
+      foreach( SUIT_ViewManager* wm, wmlist ) {
+       QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+       foreach ( SUIT_ViewWindow* vw, vwlist ) {
+         OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+         if ( !occVW || occVW == this ) continue;
+         // list only compatible types
+         OCCViewer_ViewWindow* subWindow = occVW->getView( get2dMode() );
+         if ( subWindow && subWindow != this ) {
+           QAction* a = anAction->menu()->addAction( occVW->windowTitle() );
+           if ( subWindow->getId() == currentId ) {
+             QFont f = a->font();
+             f.setBold( true );
+             a->setFont( f );
+           }
+           a->setData( subWindow->getId() );
+           connect( a, SIGNAL( triggered(bool) ), this, SLOT( onSynchronizeView(bool) ) );
+         }
+       }
+      }
+    }
+    if ( anAction->menu()->actions().isEmpty() ) {
+      anAction->setData( 0 );
+      anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+    }
+  }
+}
index 180e66c1975e09fb4274cb9846579ba7093bf07e..28d3d8d649bf53aea819a0b044f813fa02386e1d 100755 (executable)
@@ -1,30 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWWINDOW_H
 #define OCCVIEWER_VIEWWINDOW_H
 
 #include "OCCViewer.h"
+#include "Qtx.h"
 #include "SUIT_ViewWindow.h"
 #include <gp_Pnt.hxx>
+#include <V3d_Plane.hxx>
 
 class QtxRectRubberBand;
 class SUIT_Desktop;
@@ -34,9 +37,76 @@ class OCCViewer_ClippingDlg;
 class OCCViewer_AxialScaleDlg;
 class OCCViewer_SetRotationPointDlg;
 class OCCViewer_Viewer;
-class viewAspect;
+class OCCViewer_CubeAxesDlg;
 class QtxAction;
 
+struct viewAspect
+{
+public:
+        double    scale;
+        double  centerX;
+        double  centerY;
+        double    projX;
+        double    projY;
+        double    projZ;
+        double    twist;
+        double      atX;
+        double      atY;
+        double      atZ;
+        double     eyeX;
+        double     eyeY;
+        double     eyeZ;
+        double   scaleX;
+        double   scaleY;
+        double   scaleZ;
+        QString    name;
+        bool     isVisible;
+        double   size;
+        // graduated trihedron
+        bool    gtIsVisible;
+        bool    gtDrawNameX;
+        bool    gtDrawNameY;
+        bool    gtDrawNameZ;
+        QString gtNameX;
+        QString gtNameY;
+        QString gtNameZ;
+        int     gtNameColorRX;
+        int     gtNameColorGX;
+        int     gtNameColorBX;
+        int     gtNameColorRY;
+        int     gtNameColorGY;
+        int     gtNameColorBY;
+        int     gtNameColorRZ;
+        int     gtNameColorGZ;
+        int     gtNameColorBZ;
+        bool    gtDrawValuesX;
+        bool    gtDrawValuesY;
+        bool    gtDrawValuesZ;
+        int     gtNbValuesX;
+        int     gtNbValuesY;
+        int     gtNbValuesZ;
+        int     gtOffsetX;
+        int     gtOffsetY;
+        int     gtOffsetZ;
+        int     gtColorRX;
+        int     gtColorGX;
+        int     gtColorBX;
+        int     gtColorRY;
+        int     gtColorGY;
+        int     gtColorBY;
+        int     gtColorRZ;
+        int     gtColorGZ;
+        int     gtColorBZ;
+        bool    gtDrawTickmarksX;
+        bool    gtDrawTickmarksY;
+        bool    gtDrawTickmarksZ;
+        int     gtTickmarkLengthX;
+        int     gtTickmarkLengthY;
+        int     gtTickmarkLengthZ;
+};
+
+typedef QList<viewAspect> viewAspectList;
+
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
@@ -47,76 +117,123 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow
 
 public:
   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
-        ChangeRotationPointId, RotationId,
-         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
-         TrihedronShowId, AxialScaleId };
+         ChangeRotationPointId, RotationId,
+         FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
+        ResetId, CloneId, ClippingId, MemId, RestoreId,
+         TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
+        SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, SynchronizeId, UserId };
 
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, 
-                     PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
-                      FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW };
+                      PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
+                      FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW,
+                     CLOCKWISEVIEW, ANTICLOCKWISEVIEW };
 
   enum RotationPointType{ GRAVITY, SELECTED };
 
   enum SketchingType { NoSketching, Rect, Polygon };
 
+  enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane};
+
+
   OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
   virtual ~OCCViewer_ViewWindow();
 
-  OCCViewer_ViewPort3d* getViewPort();
+  virtual OCCViewer_ViewWindow* getView( const int ) const;
+
+  virtual OCCViewer_ViewPort3d* getViewPort();
 
-  bool eventFilter(QObject* watched, QEvent* e);
+  virtual bool eventFilter(QObject* watched, QEvent* e);
 
-  void performRestoring( const viewAspect& );
+  virtual void performRestoring( const viewAspect&, bool = false );
   
   virtual void initLayout();
 
-  void updateEnabledDrawMode();
+  virtual void updateEnabledDrawMode();
 
-  void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
-                                 const double dx = 0, const double dy = 0, const double dz = 1);
+  virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
+                               const double dx = 0, const double dy = 0, const double dz = 1);
 
-  bool isCuttingPlane();
+  virtual void setCuttingPlane( bool on, const gp_Pln thePln );
+
+  virtual bool isCuttingPlane();
 
   virtual QString   getVisualParameters();
   virtual void      setVisualParameters( const QString& parameters );
 
-  virtual void            initSketchers();
-  OCCViewer_ViewSketcher* getSketcher( const int );
+  virtual void                    initSketchers();
+  virtual OCCViewer_ViewSketcher* getSketcher( const int );
+
+  virtual void                    activateSketching( int );
 
-  void                    activateSketching( int );
+  virtual int                     interactionStyle() const;
+  virtual void                    setInteractionStyle( const int );
+  virtual int                     zoomingStyle() const;
+  virtual void                    setZoomingStyle( const int );
  
+  void setTransformEnabled( const OperationType, const bool );
+  bool transformEnabled( const OperationType ) const;
+
+
+  void            set2dMode( Mode2dType );
+  Mode2dType      get2dMode() const { return my2dMode; }
+
+  void            setMaximized( bool, bool = true );
+  bool            isMaximized() const;
+  
+  void            setSketcherStyle( bool enable );
+  bool            isSketcherStyle() const;
+
+  virtual QColor  backgroundColor() const;                      // obsolete
+  virtual void    setBackgroundColor( const QColor& );          // obsolete
+
+  virtual Qtx::BackgroundData  background() const;
+  virtual void                 setBackground( const Qtx::BackgroundData& );
+
+  virtual const   viewAspectList& getViewAspects();
+  virtual void                    appendViewAspect( const viewAspect& );
+  virtual void                    updateViewAspects( const viewAspectList& );
+  virtual void                    clearViewAspects();
+
 public slots:
-  void onFrontView();
-  void onViewFitAll();
-  void onBackView();
-  void onTopView();
-  void onBottomView();
-  void onLeftView();
-  void onRightView();
-  void onResetView();
-  void onFitAll();
-  void activateZoom();
-  void activateWindowFit();
-  void activateRotation();
-  void activatePanning();
-  void activateGlobalPanning();
-  void onSetRotationPoint( bool on );
-  void onCloneView();
-  void onClipping( bool on );
-  void onAxialScale();
-  void onMemorizeView();
-  void onRestoreView();
-  void onTrihedronShow();
-  void setRestoreFlag();
-
-  void activateSetRotationGravity();
-  void activateSetRotationSelected( double theX, double theY, double theZ );
-  void activateStartPointSelection();
-  void updateGravityCoords();
+  virtual void onFrontView();
+  virtual void onViewFitAll();
+  virtual void onBackView();
+  virtual void onTopView();
+  virtual void onBottomView();
+  virtual void onLeftView();
+  virtual void onRightView();
+  virtual void onClockWiseView();
+  virtual void onAntiClockWiseView();
+  virtual void onResetView();
+  virtual void onFitAll();
+  virtual void activateZoom();
+  virtual void activateWindowFit();
+  virtual void activateRotation();
+  virtual void activatePanning();
+  virtual void activateGlobalPanning();
+  virtual void onSetRotationPoint( bool on );
+  virtual void onCloneView();
+  virtual void onClipping( bool on );
+  virtual void onAxialScale();
+  virtual void onGraduatedAxes();
+  virtual void onAmbientToogle();
+  virtual void onMemorizeView();
+  virtual void onRestoreView();
+  virtual void onTrihedronShow();
+  virtual void setRestoreFlag();
+  virtual void onSwitchInteractionStyle( bool on );
+  virtual void onSwitchZoomingStyle( bool on );
+
+  virtual void activateSetRotationGravity();
+  virtual void activateSetRotationSelected( double theX, double theY, double theZ );
+  virtual void activateStartPointSelection();
+  virtual void updateGravityCoords();
    
   virtual void showEvent( QShowEvent * );
   virtual void hideEvent( QHideEvent * );
 
+  virtual void onMaximizedView();
 
 signals:
   void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
@@ -125,19 +242,22 @@ signals:
 
   void Show( QShowEvent * );
   void Hide( QHideEvent * );
+  void maximized( OCCViewer_ViewWindow*, bool );
 
-protected:
+public:
   virtual QImage dumpView();
   virtual bool   dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
+
+protected:
   virtual QString  filter() const;
 
   /* Transformation selected but not started yet */
   bool transformRequested() const;
-  void setTransformRequested ( OperationType );
+  bool setTransformRequested ( OperationType );
 
   /* Transformation is selected and already started */
-  bool         transformInProcess() const;
-  void         setTransformInProcess( bool );
+  bool          transformInProcess() const;
+  void          setTransformInProcess( bool );
 
   void vpMousePressEvent(QMouseEvent* theEvent);
   void vpMouseReleaseEvent(QMouseEvent* theEvent);
@@ -150,7 +270,7 @@ protected:
   void createActions();
   void createToolBar();
  
-  virtual OperationType getButtonState(QMouseEvent* theEvent);
+  virtual OperationType getButtonState(QMouseEvent* theEvent, int theInteractionStyle);
 
   viewAspect getViewParams() const;
 
@@ -170,28 +290,38 @@ protected:
   OCCViewer_Viewer*     myModel;
   OCCViewer_ViewPort3d* myViewPort;
 
+  OCCViewer_CubeAxesDlg* myCubeAxesDlg;
+
   RotationPointType     myCurrPointType;
   RotationPointType     myPrevPointType;
   gp_Pnt                mySelectedPoint;
   bool                  myRotationPointSelection;
 
-  int                                  myRestoreFlag;
+  int                                   myRestoreFlag;
 
-  int                                  myStartX;
-  int                                  myStartY;
-  int                                  myCurrX;
-  int                                  myCurrY;
+  int                                   myStartX;
+  int                                   myStartY;
+  int                                   myCurrX;
+  int                                   myCurrY;
 
-  bool                 myEventStarted;       // set when transformation is in process 
-  bool                 myCursorIsHand;                 
-  bool                 myDrawRect;           // set when a rect is used for selection or magnify 
-  bool                 myEnableDrawMode;
-  bool                 myPaintersRedrawing;  // set to draw with external painters 
-  QCursor              myCursor;
+  bool                  myEventStarted;       // set when transformation is in process 
+  bool                  myCursorIsHand;                 
+  bool                  myDrawRect;           // set when a rect is used for selection or magnify 
+  bool                  myEnableDrawMode;
+  bool                  myPaintersRedrawing;  // set to draw with external painters  
+  bool                  IsSketcherStyle;
+  
+  QCursor               myCursor;
 
   double myCurScale;
 
+private slots:
+  void                  onSynchronizeView(bool);
+  void                  updateSyncViews();
+
+private:
+  static void           synchronizeView( OCCViewer_ViewWindow*, int );
+
 private:
   OCCViewer_ClippingDlg* myClippingDlg;
   QtxAction* myClippingAction;
@@ -202,6 +332,17 @@ private:
   QtxAction* mySetRotationPointAction;
 
   QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band
+
+  int myInteractionStyle;
+
+  typedef QMap<OperationType, bool> MapOfTransformStatus;
+  MapOfTransformStatus myStatus;
+
+  Mode2dType my2dMode;
+
+  Handle(V3d_Plane) myReserveClippingPlane;
+
+  viewAspectList myViewAspects;
 };
 
 #ifdef WIN32
diff --git a/src/OCCViewer/resources/OCCViewer_images.po b/src/OCCViewer/resources/OCCViewer_images.po
deleted file mode 100755 (executable)
index 46123fe..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-#  File   : SALOMEGUI_icons.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_OCCVIEWER_VIEW_BACK"
-msgstr "view_back.png"
-
-msgid "ICON_OCCVIEWER_VIEW_BOTTOM"
-msgstr "view_bottom.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FRONT"
-msgstr "view_front.png"
-
-msgid "ICON_OCCVIEWER_VIEW_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_OCCVIEWER_VIEW_LEFT"
-msgstr "view_left.png"
-
-msgid "ICON_OCCVIEWER_VIEW_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_OCCVIEWER_VIEW_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_OCCVIEWER_VIEW_RIGHT"
-msgstr "view_right.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ROTATION_POINT"
-msgstr "view_rotation_point.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ROTATE"
-msgstr "view_rotate.png"
-
-msgid "ICON_OCCVIEWER_VIEW_TOP"
-msgstr "view_top.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_OCCVIEWER_VIEW_TRIHEDRON"
-msgstr "view_triedre.png"
-
-msgid "ICON_OCCVIEWER_VIEW_DUMP"
-msgstr "view_camera_dump.png"
-
-msgid "ICON_OCCVIEWER_CLONE_VIEW"
-msgstr "view_clone.png"
-
-msgid "ICON_OCCVIEWER_CLIPPING"
-msgstr "view_clipping.png"
-
-msgid "ICON_OCCVIEWER_CLIPPING_PRESSED"
-msgstr "view_clipping_pressed.png"
-
-msgid "ICON_OCCVIEWER_SHOOT_VIEW"
-msgstr "view_shoot.png"
-
-msgid "ICON_OCCVIEWER_PRESETS_VIEW"
-msgstr "view_presets.png"
-
-
-
index 11d0f3438b3ee7c1b9cdf3c5a93b0406ea350e7e..21c1ae70581fb893b2a1d34b5e5bdfdcf7428467 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>ICON_OCCVIEWER_VIEW_RIGHT</source>
         <translation>occ_view_right.png</translation>
     </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_CLOCKWISE</source>
+        <translation>occ_view_clockwise.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_VIEW_ANTICLOCKWISE</source>
+        <translation>occ_view_anticlockwise.png</translation>
+    </message>
     <message>
         <source>ICON_OCCVIEWER_CLIPPING</source>
         <translation>occ_view_clipping.png</translation>
         <source>ICON_OCCVIEWER_SCALING</source>
         <translation>occ_view_scaling.png</translation>
     </message>
+    <message>
+        <source>ICON_OCCVIEWER_GRADUATED_AXES</source>
+        <translation>occ_view_graduated_axes.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_AMBIENT</source>
+        <translation>occ_view_ambient.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_STYLE_SWITCH</source>
+        <translation>occ_view_style_switch.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH</source>
+        <translation>occ_view_zooming_style_switch.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_MAXIMIZE</source>
+        <translation>occ_view_maximized.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_MINIMIZE</source>
+        <translation>occ_view_minimized.png</translation>
+    </message>
+    <message>
+        <source>ICON_OCCVIEWER_SYNC</source>
+        <translation>occ_view_sync.png</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/OCCViewer/resources/OCCViewer_msg_en.po b/src/OCCViewer/resources/OCCViewer_msg_en.po
deleted file mode 100755 (executable)
index f67099f..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-#  File   : SALOMEGUI_msg_en.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change the point, around which the rotation is performed"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "OCCViewer_SetRotationPointDlg::CAPTION"
-msgstr "Set Rotation Point"
-
-msgid "OCCViewer_SetRotationPointDlg::USE_BBCENTER"
-msgstr "Use Bounding Box Center"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_TOORIGIN"
-msgstr "Set to Origin"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_SELECTPOINT"
-msgstr "Select Point from View"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_X"
-msgstr "X :"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_Y"
-msgstr "Y :"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_Z"
-msgstr "Z :"
-
-msgid "MNU_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change Rotation Point"
-
-msgid "MNU_ROTATIONPOINTGRAVITY_VIEW"
-msgstr "Rotation Point : the gravity center"
-
-msgid "MNU_ROTATIONPOINT000_VIEW"
-msgstr "Rotation Point : (0,0,0)"
-
-msgid "MNU_ROTATIONPOINTSELECTED_VIEW"
-msgstr "Rotation Point : the point selected by the user"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_CLONE_VIEW"
-msgstr "Create new OCC viewer for the active scene"
-
-msgid "MNU_CLONE_VIEW"
-msgstr "Clone View"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "DSC_CLIPPING"
-msgstr "Set clipping plane"
-
-msgid "MNU_CLIPPING"
-msgstr "Clipping"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_SHOOT_VIEW"
-msgstr "Memorize View"
-
-msgid "DSC_SHOOT_VIEW"
-msgstr "Memorizes the state of the active view and adds it to the list"
-
-msgid "MNU_PRESETS_VIEW"
-msgstr "Restore View"
-
-msgid "DSC_PRESETS_VIEW"
-msgstr "Selection of the memorized state of the active view"
-
-msgid "OCC_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "INF_APP_SHOOT_VIEW"
-msgstr "Memorize view"
-
-msgid "INF_APP_PRESETS_VIEW"
-msgstr "Restore view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "OCCViewer_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "OCCViewer_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "OCCViewer_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "OCCViewer_ViewManager::OCC_VIEW_TITLE"
-msgstr "OCC scene:%M - viewer:%V"
-
-
-msgid "OCCViewer_CreateRestoreViewDlg::CAPTION"
-msgstr "Restore view"
-
-msgid "MNU_SHOW_TRIHEDRE"
-msgstr "Show/Hide trihedron"
-
-msgid "DSC_SHOW_TRIHEDRE"
-msgstr "Show/Hide trihedron in the current view"
index e48ac131a411d2b0a24b7c8132de385e4c318589..301870645feacc1a2c5cd258b7605e98a8291628 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>MNU_ROTATE_VIEW</source>
         <translation>Rotation</translation>
     </message>
-    <message>
-        <source>OCC_IMAGE_FILES</source>
-        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
-    </message>
     <message>
         <source>DSC_FRONT_VIEW</source>
         <translation>Front View</translation>
         <source>DSC_RIGHT_VIEW</source>
         <translation>Right View</translation>
     </message>
+    <message>
+        <source>DSC_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate view counterclockwise</translation>
+    </message>
+    <message>
+        <source>DSC_CLOCKWISE_VIEW</source>
+        <translation>Rotate View Clockwise</translation>
+    </message>
     <message>
         <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
         <translation>Change Rotation Point</translation>
         <source>MNU_PRESETS_VIEW</source>
         <translation>Restore View</translation>
     </message>
+    <message>
+        <source>MNU_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate counterclockwise</translation>
+    </message>
+    <message>
+        <source>MNU_CLOCKWISE_VIEW</source>
+        <translation>Rotate clockwise</translation>
+    </message>
     <message>
         <source>MNU_RIGHT_VIEW</source>
         <translation>Right</translation>
         <translation>Restore view</translation>
     </message>
     <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>View Operations</translation>
+        <source>LBL_XYTOOLBAR_LABEL</source>
+        <translation>XY View Operations</translation>
+    </message>
+    <message>
+        <source>LBL_XZTOOLBAR_LABEL</source>
+        <translation>XZ View Operations</translation>
+    </message>
+    <message>
+        <source>LBL_YZTOOLBAR_LABEL</source>
+        <translation>YZ View Operations</translation>
+    </message>
+    <message>
+        <source>LBL_3DTOOLBAR_LABEL</source>
+        <translation>3D View Operations</translation>
     </message>
     <message>
         <source>DSC_BACK_VIEW</source>
         <source>MNU_SCALING</source>
         <translation>Scaling</translation>
     </message>
+    <message>
+        <source>DSC_GRADUATED_AXES</source>
+        <translation>Graduated axes</translation>
+    </message>
+    <message>
+        <source>MNU_GRADUATED_AXES</source>
+        <translation>Graduated axes</translation>
+    </message>
+    <message>
+        <source>DSC_AMBIENT</source>
+        <translation>Toogle keep only ambient light</translation>
+    </message>
+    <message>
+        <source>MNU_AMBIENT</source>
+        <translation>Toogle keep only ambient light</translation>
+    </message>
+    <message>
+        <source>DSC_STYLE_SWITCH</source>
+        <translation>Interaction style switch</translation>
+    </message>
+    <message>
+        <source>MNU_STYLE_SWITCH</source>
+        <translation>Interaction style switch</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zooming style switch</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zooming style switch</translation>
+    </message>
     <message>
         <source>OCC_IMAGE_FILES</source>
         <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
     </message>
+    <message>
+        <source>OCC_TEXTURE_FILES</source>
+        <translation>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+    </message>
+    <message>
+        <source>DSC_MAXIMIZE_VIEW</source>
+        <translation>Maximize view</translation>
+    </message>
+    <message>
+        <source>DSC_MINIMIZE_VIEW</source>
+        <translation>Minimize view</translation>
+    </message>
+    <message>
+        <source>DSC_SYNCHRONIZE_VIEW</source>
+        <translation>Synchronize view</translation>
+    </message>
+    <message>
+        <source>MNU_MAXIMIZE_VIEW</source>
+        <translation>Maximize</translation>
+    </message>
+    <message>
+        <source>MNU_MINIMIZE_VIEW</source>
+        <translation>Minimize</translation>
+    </message>
+    <message>
+        <source>MNU_SYNCHRONIZE_VIEW</source>
+        <translation>Synchronize</translation>
+    </message>
+    <message>
+        <source>MNU_SYNC_NO_VIEW</source>
+        <translation>[ No appropriate view ]</translation>
+    </message>
 </context>
 <context>
     <name>OCCViewer_CreateRestoreViewDlg</name>
         <translation>Show Toolbar</translation>
     </message>
     <message>
-        <source>MEN_CHANGE_BACKGROUD</source>
+        <source>MEN_CHANGE_BACKGROUND</source>
         <translation>Change Background...</translation>
     </message>
+    <message>
+        <source>MEN_CHANGE_IMAGE</source>
+        <translation>Set/Change Background Image...</translation>
+    </message>
+    <message>
+        <source>SELECT_IMAGE</source>
+        <translation>Select image...</translation>
+    </message>
+    <message>
+        <source>CENTERED</source>
+        <translation>in centered mode</translation>
+    </message>
+    <message>
+        <source>TILED</source>
+        <translation>in tiled mode</translation>
+    </message>
+    <message>
+        <source>STRETCHED</source>
+        <translation>in stretched mode</translation>
+    </message>
+    <message>
+        <source>GT_HORIZONTALGRADIENT</source>
+        <translation>Horizontal gradient</translation>
+    </message>
+    <message>
+        <source>GT_VERTICALGRADIENT</source>
+        <translation>Vertical gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTDIAGONALGRADIENT</source>
+        <translation>First diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDDIAGONALGRADIENT</source>
+        <translation>Second diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTCORNERGRADIENT</source>
+        <translation>First corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDCORNERGRADIENT</source>
+        <translation>Second corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_THIRDCORNERGRADIENT</source>
+        <translation>Third corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_FORTHCORNERGRADIENT</source>
+        <translation>Fourth corner gradient</translation>
+    </message>
+    <message>
+        <source>BG_IMAGE_FILES</source>
+        <translation>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+    </message>
 </context>
 <context>
     <name>OCCViewer_AxialScaleDlg</name>
index de6ed12b08de21e9964f21f572c372dbf9a7d0eb..7c96eb3990bc5a9d4e76af0c0ec0918fd1314734 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : ObjectBrowser
@@ -44,7 +45,7 @@ MOC_FILES =                   \
 
 nodist_libObjBrowser_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = OB_msg_en.qm
+nodist_salomeres_DATA = OB_msg_en.qm OB_msg_fr.qm
 
 libObjBrowser_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx
 libObjBrowser_la_LDFLAGS  = $(QT_MT_LIBS)
index a72acf7bb408fae8c91c5cbb1983a7e115077dfa..2ac997342b1eca35e5231da4d34a7f69cf3eaa58 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OB_H
 #define OB_H
 
 #if defined WIN32
-#  if defined OB_EXPORTS || defined OBJBROWSER_EXPORTS
+#  if defined OB_EXPORTS || defined OBJBROWSER_EXPORTS || defined ObjBrowser_EXPORTS
 #    define OB_EXPORT __declspec( dllexport )
 #  else
 #    define OB_EXPORT __declspec( dllimport )
index 4fd97c7c0cc23c694a4472b9e1a2edb547613383..a628ccb78e67b60f5777fcd9c953e8f844f70720 100755 (executable)
@@ -1,27 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : OB_Browser.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #include "OB_Browser.h"
 
 //#include "OB_Filter.h"
@@ -91,7 +92,7 @@ OB_Browser::ToolTip::~ToolTip()
 void OB_Browser::ToolTip::maybeTip( const QPoint& pos )
 {
   if ( !parentWidget() || !myBrowser || !myBrowser->isShowToolTips() )
-         return;
+          return;
 
   QListView* lv = myBrowser->listView();
 
@@ -136,16 +137,23 @@ OB_Browser::OB_Browser( QWidget* parent, QAbstractItemModel* model )
 : QWidget( parent ),
   myAutoOpenLevel( 0 )
 {
-  myView = new QtxTreeView( this );
-  myView->setRootIsDecorated( true );
-  myView->setSelectionMode( QAbstractItemView::ExtendedSelection );
-  myView->setAllColumnsShowFocus( true );
-
-  mySearchTool = new QtxSearchTool( this, myView );
-  mySearchTool->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
-  mySearchTool->setActivators( QtxSearchTool::StandardKey | QtxSearchTool::SlashKey );
-  mySearchTool->setSearcher( new QtxTreeViewSearcher( myView ) );
+  // set-up tree view
+  myView = new QtxTreeView( this );                                  // create tree view
+  myView->setRootIsDecorated( true );                                // show root item
+  myView->setSelectionMode( QAbstractItemView::ExtendedSelection );  // enable extended selection mode
+  myView->setAllColumnsShowFocus( true );                            // focus is shown in all columns
+
+  // enable drag-n-drop support
+  myView->setDragDropMode( QAbstractItemView::DragDrop );            // enable both drag and drop operations
+  myView->setDropIndicatorShown( true );                             // show drag indicator on dragging
+
+  // set-up search tool
+  mySearchTool = new QtxSearchTool( this, myView );                  // create search tool
+  mySearchTool->setFrameStyle( QFrame::NoFrame | QFrame::Plain );    // do not show frame
+  mySearchTool->setActivators( QtxSearchTool::StandardKey | QtxSearchTool::SlashKey ); // set activation mode
+  mySearchTool->setSearcher( new QtxTreeViewSearcher( myView ) );    // assign searcher (for tree view)
   
+  // layout widgets
   QVBoxLayout* main = new QVBoxLayout( this );
   main->addWidget( myView );
   main->addWidget( mySearchTool );
@@ -163,8 +171,7 @@ OB_Browser::OB_Browser( QWidget* parent, QAbstractItemModel* model )
   setModel( model );
 
   connect( myView, SIGNAL( selectionChanged() ),
-          this,   SIGNAL( selectionChanged() ) );
-
+           this,   SIGNAL( selectionChanged() ) );
 }
 
 /*!
@@ -357,7 +364,8 @@ void OB_Browser::setShowToolTips( const bool theDisplay )
 */
 int OB_Browser::numberOfSelected() const
 {
-  return myView->selectionModel() ? myView->selectionModel()->selectedIndexes().count() : 0;
+  // we take selection by rows
+  return myView->selectionModel() ? myView->selectionModel()->selectedRows().count() : 0;
 }
 
 /*!
@@ -366,7 +374,8 @@ int OB_Browser::numberOfSelected() const
 */
 QModelIndexList OB_Browser::selectedIndexes() const
 {
-  return myView->selectionModel() ? myView->selectionModel()->selectedIndexes() : QModelIndexList();
+  // we take selection by rows
+  return myView->selectionModel() ? myView->selectionModel()->selectedRows() : QModelIndexList();
 }
 
 /*!
@@ -414,15 +423,42 @@ void OB_Browser::select( const QModelIndexList& indexes, const bool on, const bo
   myView->blockSignals( true );
 
   QModelIndex idx;
-  bool first = true;
 
   if ( !indexes.isEmpty() ) {
-    foreach( idx, indexes ) {
-      select( idx, on, first ? keepSelection : true );
-      first = false;
+    QItemSelection mysel;
+    // select by range if indexes are contiguous
+    QModelIndex first=indexes.at(0);
+    QModelIndex last=first;
+    if (indexes.size() > 1) {
+      for (int i = 1; i < indexes.size(); ++i) 
+      {
+        idx=indexes.at(i);
+        if(idx.parent().internalId()==last.parent().internalId() && idx.row()==last.row()+1 && idx.column()==last.column())
+        {
+          // index is contiguous to last: extend the range
+          last=idx;
+        }
+        else
+        {
+          // index idx is not contiguous: create a new range
+          mysel.select(first,last);
+          first=idx;
+          last=idx;
+        }
+      }
+    }
+    mysel.select(first,last);
+
+    if ( myView->selectionModel() ) {
+      QItemSelectionModel::SelectionFlags f = on ? QItemSelectionModel::Select : QItemSelectionModel::Deselect;
+      f = f | QItemSelectionModel::Rows;
+      if ( !keepSelection )
+        f = f | QItemSelectionModel::Clear;
+      myView->selectionModel()->select( mysel, f );
     }
   }
-  else if ( !keepSelection ) {
+  else if ( !keepSelection )
+  {
     myView->clearSelection();
   }
 
@@ -758,7 +794,7 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap
     {
       bool parentOpen = true;
       if( item && item->parent() )
-       parentOpen = item->parent()->isOpen();
+        parentOpen = item->parent()->isOpen();
 
       if ( openObjs[obj] && parentOpen )
         lv->setOpen( item, true );
@@ -767,10 +803,10 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap
     {
       bool parentOpen = true;
       if( item && item->parent() )
-       parentOpen = item->parent()->isOpen();
+        parentOpen = item->parent()->isOpen();
 
       if( parentOpen )
-       lv->setOpen( item, true );
+        lv->setOpen( item, true );
     }
 
     if ( !curItem && ( curObj == obj || ( !curKey.isNull() && curKey == key )) )
@@ -984,12 +1020,12 @@ void OB_Browser::createPopupMenu( QMenu* menu )
   bool closed = false, opened = false;
   
   for ( QModelIndexList::Iterator it = indexes.begin(); 
-       it != indexes.end() && !closed; ++it ) {
+        it != indexes.end() && !closed; ++it ) {
     closed = hasCollased( *it );
   }
 
   for ( QModelIndexList::Iterator it = indexes.begin(); 
-       it != indexes.end() && !opened; ++it ) {
+        it != indexes.end() && !opened; ++it ) {
     opened = hasExpanded( *it );
   }
 
@@ -1033,8 +1069,8 @@ bool OB_Browser::hasCollased( const QModelIndex& index ) const
     if ( !result && hasChildren ) {
       int rows = model()->rowCount( index );
       for ( int i = 0; i < rows && !result; i ++ ) {
-       QModelIndex child = model()->index( i, 0, index );
-       result = hasCollased( child );
+        QModelIndex child = model()->index( i, 0, index );
+        result = hasCollased( child );
       }
     }
   }
@@ -1055,8 +1091,8 @@ bool OB_Browser::hasExpanded( const QModelIndex& index ) const
     if ( !result && hasChildren ) {
       int rows = model()->rowCount( index );
       for ( int i = 0; i < rows && !result; i ++ ) {
-       QModelIndex child = model()->index( i, 0, index );
-       result = hasExpanded( child );
+        QModelIndex child = model()->index( i, 0, index );
+        result = hasExpanded( child );
       }
     }
   }
index 378900ce8cb1c2f7ded6bf58e9935300da4d674b..a3d42a0d4c226a51ae0a935f2797441b31b2a248 100755 (executable)
@@ -1,27 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : OB_Browser.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef OB_BROWSER_H
 #define OB_BROWSER_H
 
@@ -69,7 +70,7 @@ public:
   QtxSearchTool*         searchTool() const;
   bool                   isSearchToolEnabled() const;
   void                   setSearchToolEnabled( const bool );
-  
+
   int                    autoOpenLevel() const;
   void                   setAutoOpenLevel( const int );
   void                   openLevels( const int = -1 );
@@ -104,7 +105,7 @@ public:
 
   unsigned long          getModifiedTime() const;
   void                   setModified();
-  
+
   // san - moved to SUIT_TreeModel
   //OB_Updater*       getUpdater() const;
   //virtual void      setUpdater( OB_Updater* theUpdate = 0 );
@@ -119,10 +120,10 @@ signals:
 private slots:
   void                   onExpandAll();
   void                   onCollapseAll();
-  //void              onDestroyed( SUIT_DataObject* );
-  //void              onDoubleClicked ( QListViewItem* );
-  //void              onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
-  
+  //void                   onDestroyed( SUIT_DataObject* );
+  //void                   onDoubleClicked ( QListViewItem* );
+  //void                   onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
+
 protected:
   //void              adjustWidth( QListViewItem* );
   //virtual void      updateText();
index edc1816af93e25d38d39741aee26615966497d39..fa7b42e2e5708a88ce7310865a5f872f902c017e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "OB_Filter.h"
 
 /*!
index ee10e8fdb73ebc941ea656af8702945971ce483b..c635aedbd8448133e78edf37ed514280b08c8824 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OB_FILTER_H
 #define OB_FILTER_H
 
diff --git a/src/ObjBrowser/resources/OB_msg_en.po b/src/ObjBrowser/resources/OB_msg_en.po
deleted file mode 100755 (executable)
index ad3289b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "MEN_EXPAND_ALL"
-msgstr "Expand All"
-
index 560c0b9470c3f8ca9e6f88dd1732586617fb052d..ae666a88dcf1b3da7c7de0f7d75109ba5b59f17c 100644 (file)
@@ -1,26 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>OB_Browser</name>
     <message>
index c68c582b461f41dde53ab8b59aabde179811cc90..f806f9b6fccd207a7cbee67b13da6cbce2281f21 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : Plot2d
@@ -29,22 +30,39 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 lib_LTLIBRARIES = libPlot2d.la
 
 # header files 
-salomeinclude_HEADERS =                \
-       Plot2d.h                \
-       Plot2d_Curve.h          \
-       Plot2d_FitDataDlg.h     \
-       Plot2d_Prs.h            \
-       Plot2d_SetupViewDlg.h   \
-       Plot2d_ViewFrame.h      \
-       Plot2d_ViewManager.h    \
-       Plot2d_ViewModel.h      \
-       Plot2d_ViewWindow.h     \
-       Plot2d_SetupCurveDlg.h  \
-       Plot2d_ToolTip.h
+salomeinclude_HEADERS =                        \
+       Plot2d.h                        \
+       Plot2d_PlotItems.h              \
+       Plot2d_Object.h                 \
+       Plot2d_Curve.h                  \
+       Plot2d_Histogram.h              \
+       Plot2d_FitDataDlg.h             \
+       Plot2d_Prs.h                    \
+       Plot2d_SetupViewDlg.h           \
+       Plot2d_ViewFrame.h              \
+       Plot2d_ViewManager.h            \
+       Plot2d_ViewModel.h              \
+       Plot2d_ViewWindow.h             \
+       Plot2d_Algorithm.h              \
+       Plot2d_NormalizeAlgorithm.h     \
+       Plot2d_SetupCurveDlg.h          \
+       Plot2d_ToolTip.h                \
+       Plot2d_SetupCurveScaleDlg.h     
+
+if ENABLE_PYCONSOLE
+salomeinclude_HEADERS +=                \
+       Plot2d_AnalyticalCurve.h        \
+       Plot2d_AnalyticalCurveDlg.h       \
+        Plot2d_AnalyticalParser.h
+endif
+
 
 dist_libPlot2d_la_SOURCES =            \
        Plot2d.cxx                      \
+       Plot2d_PlotItems.cxx            \
+       Plot2d_Object.cxx               \
        Plot2d_Curve.cxx                \
+       Plot2d_Histogram.cxx            \
        Plot2d_FitDataDlg.cxx           \
        Plot2d_Prs.cxx                  \
        Plot2d_SetupViewDlg.cxx         \
@@ -52,8 +70,18 @@ dist_libPlot2d_la_SOURCES =          \
        Plot2d_ViewManager.cxx          \
        Plot2d_ViewModel.cxx            \
        Plot2d_ViewWindow.cxx           \
+       Plot2d_Algorithm.cxx            \
+       Plot2d_NormalizeAlgorithm.cxx   \
        Plot2d_SetupCurveDlg.cxx        \
-       Plot2d_ToolTip.cxx
+       Plot2d_SetupCurveScaleDlg.cxx   \
+       Plot2d_ToolTip.cxx              
+
+if ENABLE_PYCONSOLE
+dist_libPlot2d_la_SOURCES +=            \
+       Plot2d_AnalyticalCurve.cxx      \
+       Plot2d_AnalyticalCurveDlg.cxx     \
+        Plot2d_AnalyticalParser.cxx
+endif
 
 MOC_FILES =                            \
        Plot2d_FitDataDlg_moc.cxx       \
@@ -63,7 +91,15 @@ MOC_FILES =                          \
        Plot2d_ViewModel_moc.cxx        \
        Plot2d_ViewWindow_moc.cxx       \
        Plot2d_SetupCurveDlg_moc.cxx    \
+       Plot2d_Algorithm_moc.cxx                \
+       Plot2d_NormalizeAlgorithm_moc.cxx       \
+       Plot2d_SetupCurveScaleDlg_moc.cxx       \
        Plot2d_ToolTip_moc.cxx
+
+if ENABLE_PYCONSOLE
+MOC_FILES +=         Plot2d_AnalyticalCurveDlg_moc.cxx
+endif
+
 nodist_libPlot2d_la_SOURCES = $(MOC_FILES)
 
 dist_salomeres_DATA =                          \
@@ -80,17 +116,24 @@ dist_salomeres_DATA =                              \
        resources/plot2d_log_y.png              \
        resources/plot2d_pan.png                \
        resources/plot2d_points.png             \
+       resources/plot2d_print.png              \
        resources/plot2d_settings.png           \
        resources/plot2d_splines.png            \
+       resources/plot2d_analytical_curve.png   \
+       resources/plot2d_lmax_normalization.png \
+       resources/plot2d_lmin_normalization.png \
+       resources/plot2d_rmax_normalization.png \
+       resources/plot2d_rmin_normalization.png \
        resources/plot2d_zoom.png
 
 nodist_salomeres_DATA =                \
        Plot2d_images.qm        \
-       Plot2d_msg_en.qm 
+       Plot2d_msg_en.qm        \
+       Plot2d_msg_fr.qm 
 
 libPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES) \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
 
-libPlot2d_la_LDFLAGS  = $(QWT_LIBS) $(QT_MT_LIBS) ../SUIT/libsuit.la
+libPlot2d_la_LDFLAGS  = $(QWT_LIBS) $(QT_MT_LIBS) $(PYTHON_LIBS) ../SUIT/libsuit.la
 
 
index 2be404b088590d188a38641816cfdb009dda42a8..4737c228bbfe3ec0f5d2bb4eeb18a7aa5f6cc21d 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 
 #include <QPainter>
 
+#include <qwt_plot.h>
+#include <qwt_plot_curve.h>
+
+const int MSIZE  = 9;
+const int MAX_ATTEMPTS        = 10;     // max attempts
+
+// color tolerance (used to compare color values)
+const long COLOR_DISTANCE = 100;
+
+
+
+/*!
+  Constructor
+*/
+Plot2d_Point::Plot2d_Point()
+  : x( 0. ), y( 0. ), deviationPtr(0)
+{
+}
+
+/*!
+  Constructor
+*/
+Plot2d_Point::Plot2d_Point( double theX, double theY, const QString& theText )
+  : x( theX ), y( theY ), text( theText ), deviationPtr(0)
+{
+}
+
+/*!
+  Destructor.
+*/
+Plot2d_Point::~Plot2d_Point() {
+  clearDeviation();
+}
+
+/*!
+  Free memory allocated for the deviation data.
+*/
+void Plot2d_Point::clearDeviation() {
+  if(deviationPtr)
+    delete deviationPtr;
+  deviationPtr = 0;
+}
+
+/*!
+  Return true in case if deviation data is assigned to the point.
+*/
+bool Plot2d_Point::hasDeviation() const {
+  return !(deviationPtr == 0);
+}
+
+/*!
+  Assign deviation data to the point.
+*/
+void Plot2d_Point::setDeviation(double min, double max) {
+ clearDeviation();
+ deviationPtr = new double[2];
+ deviationPtr[0] = min;deviationPtr[1] = max;
+}
+
+/*!
+  Return true in case if deviation data is assigned to the point
+  and store deviation data in the input parameters.
+*/
+bool Plot2d_Point::deviation(double& min, double& max) const {
+  if(hasDeviation()) {
+    min = deviationPtr[0];
+    max = deviationPtr[1];
+  }
+  return false;
+}
+
+/*!
+  Return minimal deviation value.
+*/
+bool Plot2d_Point::minDeviation(double& min) const {
+  if(hasDeviation()) {
+    min = deviationPtr[0];
+    return true;
+  } else {
+    min = 0;
+  }
+  return false;
+}
+
+/*!
+  Return minimal deviation value.
+*/
+bool Plot2d_Point::maxDeviation(double& max) const {
+  if(hasDeviation()) {
+    max = deviationPtr[1];
+    return true;
+  } else {
+    max = 0;
+  }
+  return false;
+}
+
+
+
 /*!
   \brief Convert Plot2d marker type to Qwt marker type.
   \param m Plot2d marker type
@@ -156,7 +253,7 @@ Plot2d::LineType Plot2d::qwt2plotLine( Qt::PenStyle p )
   \param width line width
 */
 void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, 
-                      Qt::PenStyle type, const QColor& color, int width )
+                       Qt::PenStyle type, const QColor& color, int width )
 {
   painter->save();
   QPen pen( type );
@@ -177,7 +274,7 @@ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2,
   \param width line width
 */
 void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, 
-                      Plot2d::LineType type, const QColor& color, int width )
+                       Plot2d::LineType type, const QColor& color, int width )
 {
   drawLine( painter, p1, p2, plot2qwtLine( type ), color, width );
 }
@@ -194,7 +291,7 @@ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2,
   \param width line width
 */
 void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
-                      Qt::PenStyle type, const QColor& color, int width )
+                       Qt::PenStyle type, const QColor& color, int width )
 {
   drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), type, color, width );
 }
@@ -211,10 +308,10 @@ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
   \param width line width
 */
 void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
-                      Plot2d::LineType type, const QColor& color, int width )
+                       Plot2d::LineType type, const QColor& color, int width )
 {
   drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), 
-           plot2qwtLine( type), color, width );
+            plot2qwtLine( type), color, width );
 }
 
 /*!
@@ -226,7 +323,7 @@ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
   \param color marker color
 */
 void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
-                        QwtSymbol::Style type, const QColor& color )
+                         QwtSymbol::Style type, const QColor& color )
 {
   painter->save();
   painter->setPen( color );
@@ -314,7 +411,7 @@ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
   \param color marker color
 */
 void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
-                        Plot2d::MarkerType type, const QColor& color )
+                         Plot2d::MarkerType type, const QColor& color )
 {
   drawMarker( painter, p, r, plot2qwtMarker( type ), color ); 
 }
@@ -330,7 +427,7 @@ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
   \param color marker color
 */
 void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
-                        QwtSymbol::Style type, const QColor& color )
+                         QwtSymbol::Style type, const QColor& color )
 {
   drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), type, color ); 
 }
@@ -346,7 +443,117 @@ void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
   \param color marker color
 */
 void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
-                        Plot2d::MarkerType type, const QColor& color )
+                         Plot2d::MarkerType type, const QColor& color )
 {
   drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), plot2qwtMarker( type ), color ); 
 }
+
+
+/*!
+  \brief Create icon pixmap according to the marker type.
+  \param size icon size
+  \param type marker type
+  \param color icon color
+  \return icon
+*/
+QPixmap Plot2d::markerIcon(const QSize &size, const QColor& color, Plot2d::MarkerType type )
+{
+
+  QPixmap px( size );
+  px.fill( QColor( 255, 255, 255, 0 ) );
+  QPainter p( &px );
+  Plot2d::drawMarker( &p, size.width()/2, size.height()/2, MSIZE, MSIZE, type, color );
+  return px;
+}
+
+
+/*!
+  \brief Create icon pixmap according to the line type.
+  \param size icon size
+  \param type line type
+  \param color icon color
+  \return icon
+*/
+QPixmap Plot2d::lineIcon( const QSize& size,  const QColor& color, Plot2d::LineType type )
+{
+
+  QPixmap px( size );
+  px.fill( QColor( 255, 255, 255, 0 ) );
+  QPainter p( &px );
+  drawLine( &p, 5, size.height()/2, size.width()-5, size.height()/2, type,
+           color, 1 );
+  return px;
+}
+
+/*!
+  Gets new unique marker for item if possible
+*/
+void Plot2d::getNextMarker( const int rtti, const QwtPlot* thePlot, QwtSymbol::Style& typeMarker,
+                           QColor& color, Qt::PenStyle& typeLine ) 
+{
+  bool bOk = false;
+  int cnt = 0;
+  while ( !bOk ) {
+    int aRed    = (int)( 256.0 * rand() / RAND_MAX );  // generate random color
+    int aGreen  = (int)( 256.0 * rand() / RAND_MAX );  // ...
+    int aBlue   = (int)( 256.0 * rand() / RAND_MAX );  // ...
+    int aMarker = (int)( 9.0 * rand() / RAND_MAX ) + 1;// 9 markers types( not including empty )
+    int aLine   = (int)( 5.0 * rand() / RAND_MAX ) + 1;// 5 line types ( not including empty )
+    
+    typeMarker = ( QwtSymbol::Style )aMarker;
+    color      = QColor( aRed, aGreen, aBlue );
+    typeLine   = ( Qt::PenStyle )aLine;
+    
+    bOk = ( ++cnt == MAX_ATTEMPTS ) || !existMarker( rtti, thePlot, typeMarker, color, typeLine );
+  }
+}
+
+/*!
+  Checks if marker belongs to any enitity
+*/
+bool Plot2d::existMarker( const int rtti, const QwtPlot* thePlot, const QwtSymbol::Style typeMarker,
+                         const QColor& color, const Qt::PenStyle typeLine ) 
+{
+  bool ok = false;
+  
+  QColor bgColor = thePlot->palette().color( QPalette::Background );
+  if ( closeColors( color, bgColor ) ) {
+    ok = true;
+  }
+  else {
+    QwtPlotItemList anItems = thePlot->itemList();
+    QwtPlotItemIterator anIt = anItems.begin(), aLast = anItems.end();
+    QwtPlotItem* anItem;
+    for ( ; anIt != aLast && !ok; anIt++ ) {
+      anItem = *anIt;
+      if ( anItem && anItem->rtti() == rtti ) {
+       QwtPlotCurve* crv = dynamic_cast<QwtPlotCurve*>( anItem );
+       if ( crv ) {
+         QwtSymbol::Style aStyle = crv->symbol().style();
+         QColor           aColor = crv->pen().color();
+         Qt::PenStyle     aLine  = crv->pen().style();
+         ok = closeColors( aColor, color ) && aStyle == typeMarker && aLine == typeLine;
+       }
+      }
+    }
+  }
+  return ok;
+}
+
+/*!
+  Checks if two colors are close to each other
+  uses COLOR_DISTANCE variable as max tolerance for comparing of colors
+*/
+
+bool Plot2d::closeColors( const QColor& color1,
+                         const QColor& color2,
+                         int distance )
+{
+  long tol = 
+    qAbs( color2.red()   - color1.red()   ) + 
+    qAbs( color2.green() - color1.green() ) +
+    qAbs( color2.blue()  - color1.blue()  ) -
+    ( distance < 0 ? COLOR_DISTANCE : distance );
+
+  return tol <= 0;
+}
index ed34a8ba0785b6e36135f29d1de04e928bf90a96..3af11f18b5e842035d4ad7b5ff3296336e970477 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -26,7 +27,7 @@
 #define PLOT2D_H
 
 #ifdef WIN32
-#  ifdef PLOT2D_EXPORTS
+#  if defined PLOT2D_EXPORTS || defined Plot2d_EXPORTS
 #    define PLOT2D_EXPORT __declspec(dllexport)
 #  else
 #    define PLOT2D_EXPORT __declspec(dllimport)
 #include <Qt>
 
 class QPainter;
+class QwtPlot;
+
+// Properties on the deviation marker.
+#define PLOT2D_DEVIATION_COLOR "DEVIATION_COLOR"
+#define PLOT2D_DEVIATION_LW "DEVIATION_LW"
+#define PLOT2D_DEVIATION_TS "DEVIATION_TS"
+
+struct PLOT2D_EXPORT Plot2d_Point
+{
+  double x;
+  double y;
+  double* deviationPtr;
+  QString text;
+  Plot2d_Point();
+  Plot2d_Point( double theX, double theY, const QString& theText = QString() );
+  ~Plot2d_Point();
+  bool deviation(double& min, double& max) const;
+  bool hasDeviation() const;
+  void setDeviation(double min, double max);
+  void clearDeviation();
+  bool minDeviation(double& min) const;
+  bool maxDeviation(double& max) const;
+};
+
+typedef QList<Plot2d_Point> pointList;
+
 
 namespace Plot2d
 {
   typedef enum { None, 
-                Circle,  
-                Rectangle,
-                Diamond,
-                DTriangle,
-                UTriangle,
-                LTriangle,
-                RTriangle,
-                Cross,
-                XCross
+                 Circle,  
+                 Rectangle,
+                 Diamond,
+                 DTriangle,
+                 UTriangle,
+                 LTriangle,
+                 RTriangle,
+                 Cross,
+                 XCross
   } MarkerType;
 
   typedef enum {
@@ -70,30 +97,48 @@ namespace Plot2d
   LineType                 qwt2plotLine( Qt::PenStyle );
 
   void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
-                                    Qt::PenStyle = Qt::SolidLine, 
-                                    const QColor& = Qt::black, int = 0 );
+                                     Qt::PenStyle = Qt::SolidLine, 
+                                     const QColor& = Qt::black, int = 0 );
   void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
-                                    LineType = Solid, 
-                                    const QColor& = Qt::black, int = 0 );
+                                     LineType = Solid, 
+                                     const QColor& = Qt::black, int = 0 );
   void                     drawLine( QPainter*, int, int, int, int,
-                                    Qt::PenStyle = Qt::SolidLine, 
-                                    const QColor& = Qt::black, int = 0 );
+                                     Qt::PenStyle = Qt::SolidLine, 
+                                     const QColor& = Qt::black, int = 0 );
   void                     drawLine( QPainter*, int, int, int, int,
-                                    LineType = Solid, 
-                                    const QColor& = Qt::black, int = 0 );
+                                     LineType = Solid, 
+                                     const QColor& = Qt::black, int = 0 );
 
   void                     drawMarker( QPainter*, const QPoint&, const QRect&,
-                                      QwtSymbol::Style = QwtSymbol::Ellipse,
-                                      const QColor& = Qt::black );
+                                       QwtSymbol::Style = QwtSymbol::Ellipse,
+                                       const QColor& = Qt::black );
   void                     drawMarker( QPainter*, const QPoint&, const QRect&,
-                                      MarkerType = Circle,
-                                      const QColor& = Qt::black );
+                                       MarkerType = Circle,
+                                       const QColor& = Qt::black );
   void                     drawMarker( QPainter*, int, int, int, int,
-                                      QwtSymbol::Style = QwtSymbol::Ellipse,
-                                      const QColor& = Qt::black );
+                                       QwtSymbol::Style = QwtSymbol::Ellipse,
+                                       const QColor& = Qt::black );
   void                     drawMarker( QPainter*, int, int, int, int,
-                                      MarkerType = Circle,
-                                      const QColor& = Qt::black );
+                                       MarkerType = Circle,
+                                       const QColor& = Qt::black );
+  
+  QPixmap                  markerIcon( const QSize&, const QColor&, 
+                                     Plot2d::MarkerType );
+
+  QPixmap                  lineIcon( const QSize&,  const QColor&, 
+                                    Plot2d::LineType );
+
+  void                     getNextMarker( const int rtti, const QwtPlot*, QwtSymbol::Style&,
+                                         QColor&, Qt::PenStyle& );
+  
+  bool                     existMarker( const int rtti , const QwtPlot*, const QwtSymbol::Style,
+                                       const QColor&, const Qt::PenStyle );
+
+
+  bool                     closeColors( const QColor&, 
+                                       const QColor&, 
+                                       int distance = -1 );
+
 }
 
 #if defined WIN32
diff --git a/src/Plot2d/Plot2d.pro b/src/Plot2d/Plot2d.pro
deleted file mode 100644 (file)
index 684083b..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = Plot2d
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-
-QWTHOME=$$(QWTHOME)
-QWTINC=$${QWTHOME}/include
-QWTLIB=$${QWTHOME}/lib
-
-INCLUDEPATH += ../../include $${QWTINC} $${PYTHONINC}
-INCLUDEPATH += ../Qtx ../SUIT
-unix:LIBS  += -L$${QWTLIB} -lqwt
-win32:LIBS += /LIBPATH:$$(QWTLIB)
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PLOT2D_EXPORTS
-
-HEADERS  = Plot2d.h
-HEADERS += Plot2d_Curve.h
-HEADERS += Plot2d_FitDataDlg.h
-HEADERS += Plot2d_Prs.h
-HEADERS += Plot2d_SetupViewDlg.h
-HEADERS += Plot2d_ViewFrame.h
-HEADERS += Plot2d_ViewManager.h
-HEADERS += Plot2d_ViewModel.h
-HEADERS += Plot2d_ViewWindow.h
-HEADERS += Plot2d_SetupCurveDlg.h
-HEADERS += Plot2d_ToolTip.h
-
-SOURCES  = Plot2d_Curve.cxx
-SOURCES += Plot2d_FitDataDlg.cxx
-SOURCES += Plot2d_Prs.cxx
-SOURCES += Plot2d_SetupViewDlg.cxx
-SOURCES += Plot2d_ViewFrame.cxx
-SOURCES += Plot2d_ViewManager.cxx
-SOURCES += Plot2d_ViewModel.cxx
-SOURCES += Plot2d_ViewWindow.cxx
-SOURCES += Plot2d_SetupCurveDlg.cxx
-SOURCES += Plot2d_ToolTip.cxx
-
-TRANSLATIONS = resources/Plot2d_msg_en.ts \
-               resources/Plot2d_images.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 4232eff2b5a3fb67ae967ffaa50e9ea1da3bb3ed..e24fcc6dd4a67c74a8255af25a5ea06a6742b90a 100755 (executable)
@@ -1,42 +1,44 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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   : Plot2d_Curve.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File   : Plot2d_Curve.cxx
+//  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
 #include "Plot2d_Curve.h"
-#include <QColor>
+#include "Plot2d_PlotItems.h"
+#include <qwt_plot_curve.h>
+
+const int DEFAULT_LINE_WIDTH  =  0;     // (default) line width
+const int DEFAULT_MARKER_SIZE =  9;     // default marker size
 
 /*!
   Constructor
 */
 Plot2d_Curve::Plot2d_Curve()
-: myHorTitle( "" ), myVerTitle( "" ), 
-  myHorUnits( "" ), myVerUnits( "" ), 
-  myAutoAssign( true ), 
-  myColor( 0,0,0 ), 
+: Plot2d_Object(),
+  myColor( 0, 0, 0 ), 
   myMarker( Plot2d::Circle ), 
+  myMarkerSize( 0 ), 
   myLine( Plot2d::Solid ), 
-  myLineWidth( 0 ),
-  myYAxis( QwtPlot::yLeft )
+  myLineWidth( 0 )
 {
 }
 
@@ -48,373 +50,314 @@ Plot2d_Curve::~Plot2d_Curve()
 }
 
 /*!
-  Copy constructor. Makes deep copy of data.
+  Copy constructor. Makes deep copy of data
 */
 Plot2d_Curve::Plot2d_Curve( const Plot2d_Curve& curve )
+: Plot2d_Object( curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
   myColor      = curve.getColor();
   myMarker     = curve.getMarker();
+  myMarkerSize = curve.getMarkerSize();
   myLine       = curve.getLine();
   myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
 }
 
 /*!
-  operator=. Makes deep copy of data.
+  operator=. Makes deep copy of data
 */
 Plot2d_Curve& Plot2d_Curve::operator=( const Plot2d_Curve& curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
+  Plot2d_Object::operator=(curve);
   myColor      = curve.getColor();
   myMarker     = curve.getMarker();
+  myMarkerSize = curve.getMarkerSize();
   myLine       = curve.getLine();
   myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
   return *this;
 }
 
 /*!
-  \return title of table
-*/
-QString Plot2d_Curve::getTableTitle() const
-{
-  return QString();
-}
-
-/*!
-  Sets curve's horizontal title
-*/
-void Plot2d_Curve::setHorTitle( const QString& title )
-{
-  myHorTitle = title;
-}
-
-/*!
-  Gets curve's horizontal title
-*/
-QString Plot2d_Curve::getHorTitle() const
-{
-  return myHorTitle;
-}
-
-/*!
-  Sets curve's vertical title
-*/
-void Plot2d_Curve::setVerTitle( const QString& title )
-{
-  myVerTitle = title;
-}
-
-/*!
-  Gets curve's vertical title
+  Get typeid for the plot2d curve class
 */
-QString Plot2d_Curve::getVerTitle() const
+int Plot2d_Curve::rtti()
 {
-  return myVerTitle;
+  return QwtPlotItem::Rtti_PlotCurve;
 }
 
 /*!
-  Sets curve's horizontal units
+  Create plot object for the curve
 */
-void Plot2d_Curve::setHorUnits( const QString& units )
+QwtPlotItem* Plot2d_Curve::createPlotItem()
 {
-  myHorUnits = units;
+  QwtPlotCurve* aCurve = new Plot2d_QwtPlotCurve( getVerTitle(), getYAxis() );
+  updatePlotItem( aCurve );
+  return aCurve;
 }
 
 /*!
-  Gets curve's horizontal units
+  Auto fill parameters of object by plot view
 */
-QString Plot2d_Curve::getHorUnits() const
+void Plot2d_Curve::autoFill( const QwtPlot* thePlot )
 {
-  return myHorUnits;
-}
+  QwtSymbol::Style typeMarker;
+  QColor           color;
+  Qt::PenStyle     typeLine;
+  Plot2d::getNextMarker( rtti(), thePlot, typeMarker, color, typeLine );
 
-/*!
-  Sets curve's vertical units
-*/
-void Plot2d_Curve::setVerUnits( const QString& units )
-{
-  myVerUnits = units;
+  setColor( color );
+  setLine( Plot2d::qwt2plotLine( typeLine ), DEFAULT_LINE_WIDTH );
+  setMarker( Plot2d::qwt2plotMarker( typeMarker ) );
 }
 
 /*!
-  Gets curve's vertical units
+  Updates curve fields
 */
-QString Plot2d_Curve::getVerUnits() const
+void Plot2d_Curve::updatePlotItem( QwtPlotItem* theItem )
 {
-  return myVerUnits;
-}
+  if ( theItem->rtti() != rtti() )
+    return;
 
-/*!
-  Adds one point for curve.
-*/
-void Plot2d_Curve::addPoint(double theX, double theY, const QString& txt )
-{
-  Plot2d_Point aPoint;
-  aPoint.x = theX;
-  aPoint.y = theY;
-  aPoint.text = txt;
-  myPoints.append(aPoint);
-}
+  Plot2d_QwtPlotCurve* aCurve = dynamic_cast<Plot2d_QwtPlotCurve*>( theItem );
+  if ( !aCurve )
+    return;
 
-/*!
-  Insert one point for curve on some position.
-*/
-void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QString& txt)
-{
-  Plot2d_Point aPoint;
-  aPoint.x = theX;
-  aPoint.y = theY;
-  aPoint.text = txt;
-
-  pointList::iterator aIt;
-  int aCurrent = 0;
-  for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
-    if (thePos == aCurrent) {
-      myPoints.insert(aIt, aPoint);
-      return;
+  Plot2d_Object::updatePlotItem( theItem );
+
+  Qt::PenStyle     ps = Plot2d::plot2qwtLine( getLine() );
+  QwtSymbol::Style ms = Plot2d::plot2qwtMarker( getMarker() );
+  
+  QColor aColor = isSelected() ?  Plot2d_Object::selectionColor() : getColor();
+  int lineW = getLineWidth(); 
+  if ( isSelected() ) lineW += (lineW == 0 ? 3 : 2);
+
+  int markerS = isSelected() ? getMarkerSize() + 2 : getMarkerSize();
+
+  aCurve->setSelected(isSelected());
+
+  aCurve->setPen( QPen(aColor , lineW, ps ) );
+  aCurve->setSymbol( QwtSymbol( ms, QBrush( aColor ), 
+                               QPen( aColor ), 
+                               QSize( markerS , markerS ) ) );
+
+  aCurve->setLegendPen(QPen(getColor(), getLineWidth(), ps ));
+  aCurve->setLegendSymbol( QwtSymbol( ms, QBrush( getColor() ), 
+                                     QPen( getColor() ), 
+                                     QSize( getMarkerSize() , getMarkerSize() )));
+  
+  double *x, *y, *min, *max;
+  long nb = getData( &x, &y );
+  if(nb > 0 && x && y) {
+    aCurve->setData( x, y, nb );
+    delete [] x;
+    delete [] y;
+    QList<int> idx;
+    getDeviationData(min, max, idx);
+    if(idx.size() > 0 && min && max) {
+      aCurve->setDeviationData(min,max,idx);
+      delete min;
+      delete max;
+    } else {
+      aCurve->clearDeviationData();
     }
-    aCurrent++;  
   }
-  myPoints.append(aPoint);
 }
 
 /*!
-  Delete one point for curve on some position.
+  Sets curve's color ( and resets AutoAssign flag )
 */
-void Plot2d_Curve::deletePoint(int thePos)
+void Plot2d_Curve::setColor( const QColor& color )
 {
-  if ( thePos >= 0 && thePos < myPoints.count() )
-    myPoints.removeAt( thePos );
+  myColor = color;
+  setAutoAssign( false );
 }
 
 /*!
-  Remove all points for curve.
+  Gets curve's color
 */
-void Plot2d_Curve::clearAllPoints()
+QColor Plot2d_Curve::getColor() const
 {
-  myPoints.clear();
+  return myColor;
 }
 
 /*!
-  Gets curve's data : abscissas of points
+  Sets marker type and size ( and resets AutoAssign flag )
 */
-pointList Plot2d_Curve::getPointList() const
+void Plot2d_Curve::setMarker( Plot2d::MarkerType marker, const int markerSize )
 {
-  return myPoints;
+  setMarker( marker );
+  setMarkerSize( markerSize );
+  setAutoAssign( false );
 }
 
 /*!
-  Sets curve's data. 
+  Sets marker type ( and resets AutoAssign flag )
 */
-void Plot2d_Curve::setData( const double* hData, const double* vData, long size, const QStringList& lst )
+void Plot2d_Curve::setMarker( Plot2d::MarkerType marker )
 {
-  clearAllPoints();
-  QStringList::const_iterator anIt = lst.begin(), aLast = lst.end(); 
-  for( long i = 0; i < size; i++, anIt++ )
-    addPoint( hData[i], vData[i], anIt==aLast ? QString() : *anIt );
+  myMarker = marker;
+  setAutoAssign( false );
 }
 
-/*!
-  Gets curve's data : abscissas of points
-*/
-double* Plot2d_Curve::horData() const
+/* Sets Qwt marker type
+ */
+void Plot2d_Curve::setMarkerStyle( QwtSymbol::Style style)
 {
-  int aNPoints = nbPoints();
-  double* aX = new double[aNPoints];
-  for (int i = 0; i < aNPoints; i++) {
-    aX[i] = myPoints[i].x;
-  }
-  return aX;
+  myMarkerStyle = style;
 }
 
 /*!
-  Gets curve's data : ordinates of points
+  Gets marker type
 */
-double* Plot2d_Curve::verData() const
+Plot2d::MarkerType Plot2d_Curve::getMarker() const
 {
-  int aNPoints = nbPoints();
-  double* aY = new double[aNPoints];
-  for (int i = 0; i < aNPoints; i++) {
-    aY[i] = myPoints[i].y;
-  }
-  return aY;
+  return myMarker;
 }
 
-/*!
-  Gets curve's data : number of points
-*/
-int Plot2d_Curve::nbPoints() const
-{
-  return myPoints.count();
-}
 
-/*!
-  Returns true if curve has no data
-*/
-bool Plot2d_Curve::isEmpty() const
+/* Gets Qwt marker type
+ */
+QwtSymbol::Style Plot2d_Curve::getMarkerStyle() const
 {
-  return myPoints.isEmpty();
+  return myMarkerStyle;
 }
 
-/*!
-  Sets curve's AutoAssign flag - in this case attributes will be set automatically
-*/
-void Plot2d_Curve::setAutoAssign( bool on )
-{
-  myAutoAssign = on;
-}
 
-/*!
-  Gets curve's AutoAssign flag state
-*/
-bool Plot2d_Curve::isAutoAssign() const
-{
-  return myAutoAssign;
-}
 
 /*!
-  Sets curve's color ( and resets AutoAssign flag )
+  Sets new marker size ( and resets AutoAssign flag )
 */
-void Plot2d_Curve::setColor( const QColor& color )
+void Plot2d_Curve::setMarkerSize( const int theSize )
 {
-  myColor = color;
-  myAutoAssign = false;
+  myMarkerSize = theSize < 0 ? 0 : theSize;
+  setAutoAssign( false );
 }
 
 /*!
-  Gets curve's color
+  Gets marker size
 */
-QColor Plot2d_Curve::getColor() const
+int Plot2d_Curve::getMarkerSize() const
 {
-  return myColor;
+  return myMarkerSize;
 }
 
 /*!
-  Sets curve's marker ( and resets AutoAssign flag )
+  Sets line type and width ( and resets AutoAssign flag )
+  NOTE : A line width of 0 will produce a 1 pixel wide line using a fast algorithm for diagonals. 
+         A line width of 1 will also produce a 1 pixel wide line, but uses a slower more accurate 
+         algorithm for diagonals. 
+         For horizontal and vertical lines a line width of 0 is the same as a line width of 1.
 */
-void Plot2d_Curve::setMarker( Plot2d::MarkerType marker )
+void Plot2d_Curve::setLine( Plot2d::LineType line, const int lineWidth )
 {
-  myMarker = marker;
-  myAutoAssign = false;
+  setLine( line );
+  setLineWidth( lineWidth );
+  setAutoAssign( false );
 }
 
 /*!
-  Gets curve's marker
+  Sets line type ( and resets AutoAssign flag )
 */
-Plot2d::MarkerType Plot2d_Curve::getMarker() const
+void Plot2d_Curve::setLine( Plot2d::LineType line )
 {
-  return myMarker;
+  myLine = line;
+  setAutoAssign( false );
 }
 
 /*!
-  Sets curve's line type and width ( and resets AutoAssign flag )
-  NOTE : A line width of 0 will produce a 1 pixel wide line using a fast algorithm for diagonals. 
-         A line width of 1 will also produce a 1 pixel wide line, but uses a slower more accurate 
-         algorithm for diagonals. 
-         For horizontal and vertical lines a line width of 0 is the same as a line width of 1.
+  Gets line type
 */
-void Plot2d_Curve::setLine( Plot2d::LineType line, const int lineWidth )
+Plot2d::LineType Plot2d_Curve::getLine() const
 {
-  myLine = line;
-  myLineWidth = lineWidth;
-  if ( myLineWidth < 0 ) myLineWidth = 0;
-  myAutoAssign = false;
+  return myLine;
 }
 
 /*!
-  Gets curve's line type
+  Sets line width ( and resets AutoAssign flag )
 */
-Plot2d::LineType Plot2d_Curve::getLine() const
+void Plot2d_Curve::setLineWidth( const int lineWidth )
 {
-  return myLine;
+  myLineWidth = lineWidth < 0 ? 0 : lineWidth;
+  setAutoAssign( false );
 }
 
 /*!
-  Gets curve's line width
+  Gets line width
 */
 int Plot2d_Curve::getLineWidth() const
 {
   return myLineWidth;
 }
-
 /*!
-  Sets curve's y axis
+  Sets deviation data on the curve.
 */
-void Plot2d_Curve::setYAxis(QwtPlot::Axis theYAxis)
-{
-  if(theYAxis == QwtPlot::yLeft || theYAxis == QwtPlot::yRight)
-    myYAxis = theYAxis;
+void Plot2d_Curve::setDeviationData( const double* min, const double* max,const QList<int>& idx) {
+  for( int i = 0; i < idx.size(); i++ ) {
+    if(idx[i] < myPoints.size()) {
+      myPoints[idx[i]].setDeviation(min[i], max[i]);
+    }
+  }
 }
 
 /*!
-  Gets curve's y axis
+  Gets object's data
 */
-QwtPlot::Axis Plot2d_Curve::getYAxis() const
+void Plot2d_Curve::getDeviationData( double*& theMin, double*& theMax, QList<int>& idx) const
 {
-  return myYAxis;
+  int aNb = 0;
+  idx.clear();
+  for (int i = 0; i < nbPoints(); i++)
+    if(myPoints[i].hasDeviation())
+      aNb++;
+  if(aNb) {
+    double min, max;
+    theMin = new double[aNb];
+    theMax = new double[aNb];
+    for (int i = 0; i < nbPoints(); i++)
+      if(myPoints[i].hasDeviation()) {
+        myPoints[i].deviation(min,max);
+        theMin[i] = min;
+        theMax[i] = max;
+        idx.push_back(i);
+      }
+  }
 }
 
 /*!
-  Gets curve's minimal abscissa
+  Clear deviation data on the curve.
 */
-double Plot2d_Curve::getMinX() const
-{
-  pointList::const_iterator aIt;
-  double aMinX = 1e150;
-  //int aCurrent = 0;
-  for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
-    if ( (*aIt).x < aMinX )
-      aMinX = (*aIt).x;
-  }
-  return aMinX;
+void Plot2d_Curve::clearDeviationData() {
+  for( int i=0; i < myPoints.size(); i++ )
+    myPoints[i].clearDeviation();
 }
 
 /*!
-  Gets curve's minimal ordinate
+  Gets object's minimal ordinate
 */
 double Plot2d_Curve::getMinY() const
 {
-  pointList::const_iterator aIt;
   double aMinY = 1e150;
-  //int aCurrent = 0;
-  for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
-    if ( (*aIt).y < aMinY )
-      aMinY = (*aIt).y;
+  pointList::const_iterator aIt;
+  double coeff = 0.0;
+  for (aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {    
+    aMinY = qMin( aMinY, myScale * (*aIt).y );
+    if((*aIt).minDeviation(coeff))
+      aMinY = qMin( aMinY, coeff );
   }
   return aMinY;
 }
 
 /*!
-  Changes text assigned to point of curve
-  \param ind -- index of point
-  \param txt -- new text
+  Gets object's maximal ordinate
 */
-void Plot2d_Curve::setText( const int ind, const QString& txt )
+double Plot2d_Curve::getMaxY() const
 {
-  if( ind<0 || ind>=myPoints.count() )
-    return;
-
-  myPoints[ind].text = txt;
-}
-
-/*!
-  \return text assigned to point
-  \param ind -- index of point
-*/
-QString Plot2d_Curve::text( const int ind ) const
-{
-  if( ind<0 || ind>=myPoints.count() )
-    return QString();
-  else
-    return myPoints[ind].text;
+  double aMaxY = -1e150;
+  pointList::const_iterator aIt;
+  double coeff = 0.0;
+  for (aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
+    aMaxY = qMax( aMaxY, myScale * (*aIt).y);
+    if((*aIt).maxDeviation(coeff))
+      aMaxY = qMax( aMaxY, coeff);
+  }
+  return aMaxY;
 }
index 8cf390d8032f20a1119f079d2ba8c640b0c70188..0d36944c6e8ac0885c084fc13d38460332cc540f 100755 (executable)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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   : Plot2d_Curve.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File   : Plot2d_Curve.h
+//  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
 #ifndef PLOT2D_CURVE_H
 #define PLOT2D_CURVE_H
 
 #include "Plot2d.h"
+#include "Plot2d_Object.h"
 
-#include <QList>
-#include <qwt_plot.h>
-
-class QColor;
+#include <qwt_symbol.h>
 
-typedef struct
-{
-  double x;
-  double y;
-  QString text;
-} Plot2d_Point;
-
-typedef QList<Plot2d_Point> pointList;
-
-class PLOT2D_EXPORT Plot2d_Curve
+class PLOT2D_EXPORT Plot2d_Curve : public Plot2d_Object
 {
 public:
+
   Plot2d_Curve();
-  virtual ~Plot2d_Curve();
   Plot2d_Curve( const Plot2d_Curve& );
-  Plot2d_Curve& operator= ( const Plot2d_Curve& );
 
-  virtual QString    getTableTitle() const;
-  
-  void               setHorTitle( const QString& );
-  QString            getHorTitle() const;
-  void               setVerTitle( const QString& );
-  QString            getVerTitle() const;
-
-  void               setHorUnits( const QString& );
-  QString            getHorUnits() const;
-  void               setVerUnits( const QString& );
-  QString            getVerUnits() const;
-
-  void               addPoint( double, double, const QString& = QString() );
-  void               insertPoint( int, double, double, const QString& = QString() );
-  void               deletePoint( int );
-  void               clearAllPoints();
-  pointList          getPointList() const;
-
-  void               setData( const double*, const double*, 
-                             long, const QStringList& = QStringList() );
-  double*            horData() const;
-  double*            verData() const;
-
-  void               setText( const int, const QString& );
-  QString            text( const int ) const;
-
-  int                nbPoints() const;
-  bool               isEmpty() const;
+  virtual ~Plot2d_Curve();
+  Plot2d_Curve& operator= ( const Plot2d_Curve& );
 
-  void               setAutoAssign( bool );
-  bool               isAutoAssign() const;
+  virtual int          rtti();
+  virtual QwtPlotItem* createPlotItem();
+  virtual void         autoFill( const QwtPlot* );
+  virtual void         updatePlotItem( QwtPlotItem* );
 
-  void               setColor( const QColor& );
-  QColor             getColor() const;
+  void                 setColor( const QColor& );
+  QColor               getColor() const;
 
-  void               setMarker( Plot2d::MarkerType );
-  Plot2d::MarkerType getMarker() const;
+  void                 setMarker( Plot2d::MarkerType, const int );
+  void                 setMarker( Plot2d::MarkerType );
+  void                      setMarkerStyle( QwtSymbol::Style style);
+  Plot2d::MarkerType   getMarker() const;
+  QwtSymbol::Style     getMarkerStyle() const;
+  void                 setMarkerSize( const int );
+  int                  getMarkerSize() const;
 
-  void               setLine( Plot2d::LineType, const int = 0 );
-  Plot2d::LineType   getLine() const;
-  int                getLineWidth() const;
+  void                 setLine( Plot2d::LineType, const int );
+  void                 setLine( Plot2d::LineType );
+  Plot2d::LineType     getLine() const;
+  void                 setLineWidth( const int );
+  int                  getLineWidth() const;
+  void                 setDeviationData( const double*, const double*, const QList<int>&);
+  void                 getDeviationData( double*&, double*&, QList<int>& ) const;
+  void                 clearDeviationData();
 
-  void               setYAxis( QwtPlot::Axis );
-  QwtPlot::Axis      getYAxis() const;
+  virtual double          getMinY() const;
+  virtual double          getMaxY() const;
 
-  // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x: 
-  // it crashes if switched to X/Y logarithmic mode, when one or more points have
-  // non-positive X/Y coordinate
-  double             getMinX() const;
-  double             getMinY() const;
 
 protected:
-  bool               myAutoAssign;
-  QString            myHorTitle;
-  QString            myVerTitle;
-  QString            myHorUnits;
-  QString            myVerUnits;
-  QColor             myColor;
-  Plot2d::MarkerType myMarker;
-  Plot2d::LineType   myLine;
-  int                myLineWidth;
-  QwtPlot::Axis      myYAxis;
-
-  pointList          myPoints;
+
+  QColor               myColor;
+  Plot2d::MarkerType   myMarker;
+  QwtSymbol::Style     myMarkerStyle;
+  int                  myMarkerSize;
+  Plot2d::LineType     myLine;
+  int                  myLineWidth;
 };
 
 typedef QList<Plot2d_Curve*> curveList;
index 500c4c658ff23a08d4cdeb03737c989f74d2594e..b7c50470bfe90bc3086b13615e15eef0589fdc8a 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_FitDataDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index 177a504ba57b796546b5f26cf76e5e7c66e877a6..dff5163aee7b8c0349b063f4c50b1a7ecc9f679e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef PLOT2D_FITDATADLG_H
 #define PLOT2D_FITDATADLG_H
 
index db316b5a2c229fbf5fb2daf7707a8eaeb88e9e8e..4cb6409d9775f0661e3f5a6655bd1e857d82e309 100755 (executable)
@@ -1,31 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  SALOME OCCViewer : build OCC Viewer into Salome desktop
-//  File   : Plot2d_Prs.cxx
-//  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
-#include <qwt_plot.h>
+
 #include "Plot2d_Prs.h"
 
 /*!
@@ -39,7 +33,7 @@ Plot2d_Prs::Plot2d_Prs( bool theDelete )
 /*!
   Standard constructor
 */
-Plot2d_Prs::Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete )
+Plot2d_Prs::Plot2d_Prs( Plot2d_Object* obj, bool theDelete )
 : mySecondY( false), myIsAutoDel( theDelete )
 {
   AddObject( obj ); 
@@ -51,23 +45,23 @@ Plot2d_Prs::Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete )
 Plot2d_Prs::~Plot2d_Prs()
 { 
   if ( myIsAutoDel )
-    qDeleteAll( myCurves );
+    qDeleteAll( myObjects );
 }
 
 /*!
-  Get curves list
+  Get objects list
 */
-curveList Plot2d_Prs::getCurves() const
+objectList Plot2d_Prs::getObjects() const
 {
-  return myCurves;
+  return myObjects;
 }
 
 /*!
   Add curve
 */
-void Plot2d_Prs::AddObject( const Plot2d_Curve* obj )
+void Plot2d_Prs::AddObject( Plot2d_Object* obj )
 {
-  myCurves.append((Plot2d_Curve*)obj);
+  myObjects.append(obj);
 
   if (obj->getYAxis() == QwtPlot::yRight)
     mySecondY = true;
@@ -78,7 +72,7 @@ void Plot2d_Prs::AddObject( const Plot2d_Curve* obj )
 */
 bool Plot2d_Prs::IsNull() const 
 { 
-  return myCurves.isEmpty();
+  return myObjects.isEmpty();
 }
 
 /*!
index 70e6d5fbb2c1d37d8ee5f19098766b10a881ed3d..1c638f3daa27b197c8d85af37770bc94977a4770 100755 (executable)
@@ -1,50 +1,51 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef PLOT2D_PRS_H
 #define PLOT2D_PRS_H
 
 #include "Plot2d.h"
-#include "Plot2d_Curve.h"
+#include "Plot2d_Object.h"
 
 class PLOT2D_EXPORT Plot2d_Prs
 {
 public:
   Plot2d_Prs( bool theDelete = false );
-  Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete = false );
+  Plot2d_Prs( Plot2d_Object* obj, bool theDelete = false );
   ~Plot2d_Prs();
 
-  curveList getCurves() const;
-  void AddObject( const Plot2d_Curve* obj );
+  objectList getObjects() const;
+  void       AddObject( Plot2d_Object* obj );
 
-  bool IsNull() const;
+  bool       IsNull() const;
 
-  bool isSecondY() const;
+  bool       isSecondY() const;
 
-  void setAutoDel(bool theDel);
+  void       setAutoDel(bool theDel);
 
 protected:
-  curveList myCurves;
-  bool      mySecondY;
-  bool      myIsAutoDel;
+  objectList myObjects;
+  bool       mySecondY;
+  bool       myIsAutoDel;
 };
 
-#endif
+#endif // PLOT2D_PRS_H
index fd8f700532157b8f712807356f021d95ac762a63..0ba8c79f2429e77688c6d3ede890c645f43ac69d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_SetupCurveDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -63,7 +64,8 @@ Plot2d_SetupCurveDlg::Plot2d_SetupCurveDlg( QWidget* parent )
   myLineCombo = new QComboBox( this );
   myLineCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLineCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myLineCombo->setIconSize( QSize( 40, 16 ) );
+  QSize lsz( 40, 16 );
+  myLineCombo->setIconSize( lsz );
 
   // curve width
   QLabel* aLineWidthLab = new QLabel( tr( "CURVE_LINE_WIDTH_LAB" ), this );
@@ -79,7 +81,8 @@ Plot2d_SetupCurveDlg::Plot2d_SetupCurveDlg( QWidget* parent )
   myMarkerCombo = new QComboBox( this );
   myMarkerCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myMarkerCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myMarkerCombo->setIconSize( QSize( 16, 16 ) );
+  QSize sz(16, 16);
+  myMarkerCombo->setIconSize(sz);
 
   // curve color
   QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), this );
@@ -124,23 +127,27 @@ Plot2d_SetupCurveDlg::Plot2d_SetupCurveDlg( QWidget* parent )
   topLayout->addLayout( btnLayout, 5, 0, 1, 3 );
 
   // fill then combo boxes
-  myLineCombo->addItem( lineIcon( Plot2d::NoPen ),      tr( "NONE_LINE_LBL" ) );
-  myLineCombo->addItem( lineIcon( Plot2d::Solid ),      tr( "SOLID_LINE_LBL" ) );
-  myLineCombo->addItem( lineIcon( Plot2d::Dash ),       tr( "DASH_LINE_LBL" ) );
-  myLineCombo->addItem( lineIcon( Plot2d::Dot ),        tr( "DOT_LINE_LBL" ) );
-  myLineCombo->addItem( lineIcon( Plot2d::DashDot ),    tr( "DASHDOT_LINE_LBL" ) );
-  myLineCombo->addItem( lineIcon( Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
-
-  myMarkerCombo->addItem( markerIcon( Plot2d::None ),      tr( "NONE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::Circle ),    tr( "CIRCLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::Diamond ),   tr( "DIAMOND_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::Cross ),     tr( "CROSS_MARKER_LBL" ) );
-  myMarkerCombo->addItem( markerIcon( Plot2d::XCross ),    tr( "XCROSS_MARKER_LBL" ) );
+  QColor cl = myLineCombo->palette().color( QPalette::Text );
+
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::NoPen ),      tr( "NONE_LINE_LBL" ) );
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Solid ),      tr( "SOLID_LINE_LBL" ) );
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Dash ),       tr( "DASH_LINE_LBL" ) );
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Dot ),        tr( "DOT_LINE_LBL" ) );
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::DashDot ),    tr( "DASHDOT_LINE_LBL" ) );
+  myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
+
+  cl = myMarkerCombo->palette().color( QPalette::Text );
+
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::None ),      tr( "NONE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Circle ),    tr( "CIRCLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Diamond ),   tr( "DIAMOND_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Cross ),     tr( "CROSS_MARKER_LBL" ) );
+  myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::XCross ),    tr( "XCROSS_MARKER_LBL" ) );
 
   // default settings
   setLine( Plot2d::Solid, 0 );   // solid line, width = 0
@@ -243,38 +250,6 @@ QColor Plot2d_SetupCurveDlg::getColor() const
   return myColorBtn->color();
 }
 
-/*!
-  \brief Create icon pixmap according to the line type.
-  \param type line type
-  \return icon
-*/
-QPixmap Plot2d_SetupCurveDlg::lineIcon( Plot2d::LineType type ) const
-{
-  QSize sz = myLineCombo->iconSize();
-  QPixmap px( sz );
-  px.fill( QColor( 255, 255, 255, 0 ) );
-  QPainter p( &px );
-  Plot2d::drawLine( &p, 5, sz.height()/2, sz.width()-5, sz.height()/2, type,
-                   myLineCombo->palette().color( QPalette::Text ), 1 );
-  return px;
-}
-
-/*!
-  \brief Create icon pixmap according to the marker type.
-  \param type marker type
-  \return icon
-*/
-QPixmap Plot2d_SetupCurveDlg::markerIcon( Plot2d::MarkerType type ) const
-{
-  QSize sz = myMarkerCombo->iconSize();
-  QPixmap px( sz );
-  px.fill( QColor( 255, 255, 255, 0 ) );
-  QPainter p( &px );
-  Plot2d::drawMarker( &p, sz.width()/2, sz.height()/2, MSIZE, MSIZE, type,
-                     myMarkerCombo->palette().color( QPalette::Text ) );
-  return px;
-}
-
 /*
   \brief Update preview widget.
 */
@@ -287,11 +262,11 @@ void Plot2d_SetupCurveDlg::updatePreview()
   QPainter p( &px );
 
   Plot2d::drawLine( &p, 5+MSIZE/2, sz.height()/2, sz.width()-5-MSIZE/2, sz.height()/2,
-                   getLine(), getColor(), getLineWidth() );
+                    getLine(), getColor(), getLineWidth() );
   Plot2d::drawMarker( &p, 5+MSIZE/2, sz.height()/2, MSIZE, MSIZE,
-                     getMarker(), getColor() );
+                      getMarker(), getColor() );
   Plot2d::drawMarker( &p, sz.width()-5-MSIZE/2, sz.height()/2, MSIZE, MSIZE,
-                     getMarker(), getColor() );
+                      getMarker(), getColor() );
 
   myPreview->setPixmap( px );
 }
index 1c178a4a7c592a3aa30712ecf19d79079679925a..abd678c0601993286cc4fb7e1071d30e59a454b6 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_SetupCurveDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -54,9 +55,6 @@ public:
   void               setColor( const QColor& );
   QColor             getColor() const;
 
-private:
-  QPixmap            lineIcon( Plot2d::LineType ) const;
-  QPixmap            markerIcon( Plot2d::MarkerType ) const;
 
 private slots:
   void               updatePreview();
index 211a2faea272afd4631045b7d45a4182a57a7f82..c15c7390cef5291e8ff5067cef42d45cefa0be92 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_SetupViewDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -27,6 +28,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_Application.h>
 #include <QtxColorButton.h>
+#include <QtxFontEdit.h>
 
 #include <QCheckBox>
 #include <QLineEdit>
@@ -57,8 +59,8 @@ const int MIN_SPIN_WIDTH  = 70;
   \param secondAxisY if \c true, show widgets for the second (right) vertical axis
 */
 Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, 
-                                         bool showDefCheck, 
-                                         bool secondAxisY )
+                                          bool showDefCheck, 
+                                          bool secondAxisY )
 : QDialog( parent ), 
   mySecondAxisY( secondAxisY )
 {
@@ -88,6 +90,9 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   // legend
   myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
   myLegendCombo = new QComboBox( this );
+  myLegendFont = new QtxFontEdit( this );
+  myLegendColor = new QtxColorButton( this );
+  QLabel* aLegendFontLab = new QLabel( tr( "PLOT2D_LEGEND_FONT" ), this );
   myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
   myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
@@ -108,6 +113,56 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   QLabel* aBGLab  = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
   myBackgroundBtn = new QtxColorButton( this );
 
+  //Deviation marker parameters
+  QGroupBox* aDeviationGrp = new QGroupBox( tr( "PLOT2D_DEVIATION_MARKER_TLT" ), this );
+  QHBoxLayout* aDeviationLayout = new QHBoxLayout(aDeviationGrp);
+
+  //Deviation marker parameters : Line width
+  QLabel* aDeviationLwLbl  = new QLabel( tr( "PLOT2D_DEVIATION_LW_LBL" ), aDeviationGrp );
+  myDeviationLw  = new QSpinBox( aDeviationGrp );
+  myDeviationLw->setMinimum( 1 );
+  myDeviationLw->setMaximum( 5 );
+  myDeviationLw->setSingleStep( 1 );
+  myDeviationLw->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+  //Deviation marker parameters : Line width
+  QLabel* aDeviationTsLbl  = new QLabel( tr( "PLOT2D_DEVIATION_TS_LBL" ), aDeviationGrp );
+  myDeviationTs  =  new QSpinBox( aDeviationGrp );
+  myDeviationTs->setMinimum( 1 );
+  myDeviationTs->setMaximum( 5 );
+  myDeviationTs->setSingleStep( 1 );
+  myDeviationTs->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+  //Deviation marker parameters : Color
+  QLabel* aDeviationClLbl  = new QLabel( tr( "PLOT2D_DEVIATION_CL_LBL" ), aDeviationGrp );
+  myDeviationCl = new QtxColorButton( aDeviationGrp );
+
+  aDeviationLayout->addWidget( aDeviationLwLbl );
+  aDeviationLayout->addWidget( myDeviationLw );
+  aDeviationLayout->addWidget( aDeviationTsLbl );
+  aDeviationLayout->addWidget( myDeviationTs );
+  aDeviationLayout->addWidget( aDeviationClLbl );
+  aDeviationLayout->addWidget( myDeviationCl );
+
+  // normalize mode
+  QGroupBox* aNormalizeGrp = new QGroupBox( tr( "PLOT2D_NORMALIZE_TLT" ), this );
+  QGridLayout* aNormalizeLayout = new QGridLayout( aNormalizeGrp );
+  aNormalizeLayout->setMargin( MARGIN_SIZE ); aNormalizeLayout->setSpacing( SPACING_SIZE );
+  aNormalizeGrp->setLayout( aNormalizeLayout );
+  QLabel* aYLeftLab  = new QLabel( tr( "PLOT2D_NORMALIZE_LEFT_AXIS" ), aNormalizeGrp );
+  myNormLMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+  myNormLMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+  QLabel* aYRightLab  = new QLabel( tr( "PLOT2D_NORMALIZE_RIGHT_AXIS" ), aNormalizeGrp );
+  myNormRMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+  myNormRMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+
+  aNormalizeLayout->addWidget( aYLeftLab,    0, 0 );
+  aNormalizeLayout->addWidget( myNormLMaxCheck,    0, 1 );
+  aNormalizeLayout->addWidget( myNormLMinCheck, 0, 2 );
+  aNormalizeLayout->addWidget( aYRightLab,    1, 0 );
+  aNormalizeLayout->addWidget( myNormRMaxCheck,    1, 1 );
+  aNormalizeLayout->addWidget( myNormRMinCheck, 1, 2 );
+
   // scale mode
   QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
   QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
@@ -227,7 +282,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
   aGridLayoutY->addWidget( myYGridCheck,    0, 0 );
-  aGridLayoutY->addWidget( aYMajLbl,        0, 1 );
+  aGridLayoutY->addWidget( aYMajLbl,       0, 1 );
   aGridLayoutY->addWidget( myYGridSpin,     0, 2 );
   aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
   aGridLayoutY->addWidget( aYMinLbl,        1, 1 );
@@ -320,22 +375,28 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   // layout widgets
   topLayout->addWidget( myTitleCheck,  0,    0    );
   topLayout->addWidget( myTitleEdit,   0, 1, 1, 3 );
-  topLayout->addWidget( aCurveLab,     1,    0    );
-  topLayout->addWidget( myCurveCombo,  1,    1    );
-  topLayout->addWidget( myLegendCheck, 1,    2    );
-  topLayout->addWidget( myLegendCombo, 1,    3    );
-  topLayout->addWidget( aMarkerLab,    2,    0    );
-  topLayout->addWidget( myMarkerSpin,  2,    1    );
+  topLayout->addWidget( myLegendCheck, 1,    0    );
+  topLayout->addWidget( myLegendCombo, 1,    1    );
+  topLayout->addWidget( aCurveLab,  1,    2    );
+  topLayout->addWidget( myCurveCombo,  1,     3    );
+  topLayout->addWidget( aLegendFontLab,2,    0    );
+  topLayout->addWidget( myLegendFont,     2,    1    );
+  topLayout->addWidget( myLegendColor,  2,    2    );
+
+  topLayout->addWidget( aMarkerLab,    3,    0    );
+  topLayout->addWidget( myMarkerSpin,  3,    1    );
   QHBoxLayout* bgLayout = new QHBoxLayout;
   bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
-  topLayout->addWidget( aBGLab,        2,    2    );
-  topLayout->addLayout( bgLayout,      2,    3    );
-  topLayout->addWidget( aScaleGrp,     3, 0, 1, 4 );
-  topLayout->addWidget( aTabWidget,    4, 0, 1, 4 );
-  topLayout->addWidget( myDefCheck,    5, 0, 1, 4 );
-  topLayout->setRowStretch( 5, 5 );
-
-  topLayout->addLayout( btnLayout,     6, 0, 1, 4 );
+  topLayout->addWidget( aBGLab,        3,    2    );
+  topLayout->addLayout( bgLayout,      3,    3    );
+  topLayout->addWidget( aDeviationGrp,   4, 0, 1, 4 );
+  topLayout->addWidget( aNormalizeGrp,      5, 0, 1, 4 );
+  topLayout->addWidget( aScaleGrp,     6, 0, 1, 4 );
+  topLayout->addWidget( aTabWidget,    7, 0, 1, 4 );
+  topLayout->addWidget( myDefCheck,    8, 0, 1, 4 );
+  topLayout->setRowStretch( 9, 5 );
+
+  topLayout->addLayout( btnLayout,     10, 0, 1, 4 );
   
   if ( !showDefCheck )
     myDefCheck->hide();
@@ -348,6 +409,11 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   connect( myYGridCheck,    SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
   connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
   connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
+  connect( myNormLMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormLMaxChecked() ) );
+  connect( myNormLMinCheck, SIGNAL( clicked() ), this, SLOT( onNormLMinChecked() ) );
+  connect( myNormRMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormRMaxChecked() ) );
+  connect( myNormRMinCheck, SIGNAL( clicked() ), this, SLOT( onNormRMinChecked() ) );
+
 
   connect( myOkBtn,         SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( myCancelBtn,     SIGNAL( clicked() ), this, SLOT( reject() ) );
@@ -368,6 +434,10 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
   onXGridMajorChecked();
   onYGridMajorChecked();
   onXGridMinorChecked();
+  onNormLMaxChecked();
+  onNormLMinChecked();
+  onNormRMaxChecked();
+  onNormRMinChecked();
   if ( mySecondAxisY ) {
     onY2TitleChecked();
     onY2GridMajorChecked();
@@ -538,16 +608,100 @@ int Plot2d_SetupViewDlg::getCurveType()
   return myCurveCombo->currentIndex();
 }
 
+/*!
+  \brief Set normalization to maximum by left Y axis.
+  \param type normalizatoin type: true,false
+  \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMaxNormMode( const bool type )
+{
+  myNormLMaxCheck->setChecked( type );
+}
+
+/*!
+  \brief Check if normalization to maximum by left Y axis sets.
+  \return curve normalizatoin type: true,false
+  \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMaxNormMode()
+{
+  return myNormLMaxCheck->isChecked();
+}
+
+/*!
+  \brief Set normalization to minimum by left Y axis.
+  \param type normalizatoin type: true,false
+  \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMinNormMode( const bool type )
+{
+  myNormLMinCheck->setChecked( type );
+}
+
+/*!
+  \brief Check if normalization to minimum by left Y axis sets.
+  \return curve normalizatoin type: true,false
+  \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMinNormMode()
+{
+  return myNormLMinCheck->isChecked();
+}
+
+/*!
+  \brief Set normalization to maximum by right Y axis.
+  \param type normalizatoin type: true,false
+  \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMaxNormMode( const bool type )
+{
+  myNormRMaxCheck->setChecked( type );
+}
+
+/*!
+  \brief Check if normalization to maximum by right Y axis sets.
+  \return curve normalizatoin type: true,false
+  \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMaxNormMode()
+{
+  return myNormRMaxCheck->isChecked();
+}
+
+/*!
+  \brief Set normalization to minimum by right Y axis.
+  \param type normalizatoin type: true,false
+  \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMinNormMode( const bool type )
+{
+  myNormRMinCheck->setChecked( type );
+}
+
+/*!
+  \brief Check if normalization to minimum by right Y axis sets.
+  \return curve normalizatoin type: true,false
+  \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMinNormMode()
+{
+  return myNormRMinCheck->isChecked();
+}
+
 /*!
   \brief Set legend attribute.
   \param if \c true legend is shown
   \param pos legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
-  \sa isLegendEnabled(), getLegendPos()
+  \param fnt legend font
+  \param col legend font color
+  \sa isLegendEnabled(), getLegendPos(), getLegendFont()
 */
-void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
+void Plot2d_SetupViewDlg::setLegend( bool enable, int pos, const QFont& fnt, const QColor& col )
 {
   myLegendCheck->setChecked( enable );
   myLegendCombo->setCurrentIndex( pos );
+  myLegendFont->setCurrentFont( fnt );
+  myLegendColor->setColor( col );
   onLegendChecked();
 }
 
@@ -571,6 +725,26 @@ int Plot2d_SetupViewDlg::getLegendPos()
   return myLegendCombo->currentIndex();
 }
 
+/*!
+  \brief Get legend font.
+  \return legend font
+  \sa setLegend()
+*/
+QFont Plot2d_SetupViewDlg::getLegendFont()
+{
+  return myLegendFont->currentFont();
+}
+
+/*!
+  \brief Get legend font color.
+  \return legend font color
+  \sa setLegend()
+*/
+QColor Plot2d_SetupViewDlg::getLegendColor()
+{
+  return myLegendColor->color();
+}
+
 /*!
   \brief Set marker size.
   \param size marker size
@@ -590,6 +764,59 @@ int Plot2d_SetupViewDlg::getMarkerSize()
 {
   return myMarkerSpin->value();
 }
+/*!
+  \brief Set deviation marker line width.
+  \param width marker line width
+  \sa getDeviationMarkerLw()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerLw( const int width ){
+  myDeviationLw->setValue(width);
+}
+
+/*!
+  \brief Get deviation marker line width.
+  \return marker line width
+  \sa setMarkerSize()
+*/
+int Plot2d_SetupViewDlg::getDeviationMarkerLw() const {
+  return myDeviationLw->value();
+}
+
+/*!
+  \brief Set deviation marker tick size.
+  \param size marker tick size
+  \sa getDeviationMarkerTs()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerTs( const int size) {
+  myDeviationTs->setValue(size);
+}
+
+/*!
+  \brief Get deviation marker tick size.
+  \return marker tick size
+  \sa setDeviationMarkerTs()
+*/
+int Plot2d_SetupViewDlg::getDeviationMarkerTs() const {
+  return myDeviationTs->value();
+}
+
+/*!
+  \brief Set color of the deviation marker.
+  \param color marker color
+  \sa getDeviationMarkerCl()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerCl( const QColor& col) {
+  myDeviationCl->setColor( col );
+}
+
+/*!
+  \brief Get color of the deviation marker.
+  \return marker color
+  \sa setDeviationMarkerCl()
+*/
+QColor Plot2d_SetupViewDlg::getDeviationMarkerCl() const {
+ return myDeviationCl->color();
+}
 
 /*!
   \brief Set background color.
@@ -838,6 +1065,34 @@ void Plot2d_SetupViewDlg::onY2GridMinorChecked()
 {
 }
 
+/*!
+  \brief Called when user clicks "Left Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMaxChecked()
+{
+}
+
+/*!
+  \brief Called when user clicks "Left Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMinChecked()
+{
+}
+
+/*!
+  \brief Called when user clicks "Right Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMaxChecked()
+{
+}
+
+/*!
+  \brief Called when user clicks "Right Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMinChecked()
+{
+}
+
 /*!
   \brief Get "Set settings as default" check box value.
   \return \c true if "Set settings as default" check box is on
index 6de74752b3eb6eeef7e416d46f9bf86735d13a85..008ffdce1cdb834a6e6be0b7174e55d30c9dd6a6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_SetupViewDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -35,6 +36,7 @@ class QLineEdit;
 class QComboBox;
 class QPushButton;
 class QtxColorButton;
+class QtxFontEdit;
 
 class PLOT2D_EXPORT Plot2d_SetupViewDlg : public QDialog
 { 
@@ -62,9 +64,20 @@ public:
   void            setCurveType( const int );
   int             getCurveType();
 
-  void            setLegend( bool, int );
+  bool            getLMaxNormMode();
+  void            setLMaxNormMode(const bool);
+  bool            getLMinNormMode();
+  void            setLMinNormMode(const bool);
+  bool            getRMaxNormMode();
+  void            setRMaxNormMode(const bool);
+  bool            getRMinNormMode();
+  void            setRMinNormMode(const bool);
+
+  void            setLegend( bool, int, const QFont&, const QColor& );
   bool            isLegendEnabled();
   int             getLegendPos();
+  QFont           getLegendFont();
+  QColor          getLegendColor();
   
   void            setMarkerSize( const int );
   int             getMarkerSize();
@@ -81,6 +94,15 @@ public:
   int             getXScaleMode();
   int             getYScaleMode();
 
+  void            setDeviationMarkerLw( const int);
+  int             getDeviationMarkerLw() const;
+
+  void            setDeviationMarkerTs( const int);
+  int             getDeviationMarkerTs() const;
+
+  void            setDeviationMarkerCl( const QColor&);
+  QColor          getDeviationMarkerCl() const;
+
   bool            isSetAsDefault();
 
 protected slots:
@@ -95,6 +117,10 @@ protected slots:
   void            onXGridMinorChecked();
   void            onYGridMinorChecked();
   void            onY2GridMinorChecked();
+  void            onNormLMaxChecked();
+  void            onNormLMinChecked();
+  void            onNormRMaxChecked();
+  void            onNormRMinChecked();
   void            onHelp();
 
 private:
@@ -107,6 +133,8 @@ private:
   QLineEdit*      myTitleYEdit;
   QLineEdit*      myTitleY2Edit;
   QtxColorButton* myBackgroundBtn;
+  QtxColorButton* myLegendColor;
+  QtxFontEdit*    myLegendFont;
   QCheckBox*      myXGridCheck;
   QSpinBox*       myXGridSpin;
   QCheckBox*      myYGridCheck;
@@ -125,11 +153,18 @@ private:
   QSpinBox*       myMarkerSpin;
   QComboBox*      myXModeCombo;
   QComboBox*      myYModeCombo;
+  QCheckBox*      myNormLMaxCheck;
+  QCheckBox*      myNormLMinCheck;
+  QCheckBox*      myNormRMaxCheck;
+  QCheckBox*      myNormRMinCheck;
   QComboBox*      myY2ModeCombo;
   QCheckBox*      myDefCheck;
   QPushButton*    myOkBtn;
   QPushButton*    myCancelBtn;
   QPushButton*    myHelpBtn;
+  QSpinBox*       myDeviationLw;
+  QSpinBox*       myDeviationTs;
+  QtxColorButton* myDeviationCl;
   bool            mySecondAxisY;
 };
 
index ba44643f7dae1edafb1e1767081c05f6199f4966..6c20ea48fe4e5a82b7d5d990151e1decbb93eb10 100644 (file)
@@ -1,27 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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:      Plot2d_ToolTip.cxx
-// Author:    Alexandre SOLOVYOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File   : Plot2d_ToolTip.cxx
+//  Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
+
 #include "Plot2d_ToolTip.h"
 #include "Plot2d_ViewFrame.h"
 #include "Plot2d_Curve.h"
 const int maxDist = 3, tip_margin = 10;
 
 
-Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame, Plot2d_Plot2d* plot )
-: QtxToolTip( plot->canvas() ),
-  myFrame( frame ),
-  myPlot( plot )
+Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame )
+: QtxToolTip( frame->getPlotCanvas() ),
+  myFrame( frame )
 {
   connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
-          this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+           this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
 }
 
 Plot2d_ToolTip::~Plot2d_ToolTip()
@@ -54,7 +53,7 @@ void Plot2d_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect
   int pInd;
   double dist;
 
-  Plot2d_Curve* c = myPlot->getClosestCurve( p, dist, pInd );
+  Plot2d_Curve* c = myFrame->getClosestCurve( p, dist, pInd );
   if( !c || dist>maxDist )
     return;
 
index 95afdf43226c38522f4241296114ec0cb9c05784..ed9bbcc752d0b602dd07c8266ca43cc88b7244a6 100644 (file)
@@ -1,27 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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:      Plot2d_ToolTip.h
-// Author:    Alexandre SOLOVYOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File   : Plot2d_ToolTip.h
+//  Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
+
 #ifndef PLOT2D_TOOLTIP_H
 #define PLOT2D_TOOLTIP_H
 
 #include <QtxToolTip.h>
 
 class Plot2d_ViewFrame;
-class Plot2d_Plot2d;
 
 class PLOT2D_EXPORT Plot2d_ToolTip : public QtxToolTip
 {
   Q_OBJECT
 
 public:
-  Plot2d_ToolTip( Plot2d_ViewFrame*, Plot2d_Plot2d* );
+  Plot2d_ToolTip( Plot2d_ViewFrame* );
   virtual ~Plot2d_ToolTip();
 
   virtual bool eventFilter( QObject*, QEvent* );
@@ -46,7 +45,6 @@ public slots:
 
 private:
   Plot2d_ViewFrame* myFrame;
-  Plot2d_Plot2d*    myPlot;
 };
 
-#endif
+#endif // PLOT2D_TOOLTIP_H
index d57f3e94deee1ea1c44b95eeb264a43449d96e84..341ed59ff9a23da7eeead4f4d5c18e434de3ab85 100755 (executable)
@@ -1,31 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "Plot2d_ViewFrame.h"
 
 #include "Plot2d_Prs.h"
 #include "Plot2d_Curve.h"
+#include "Plot2d_PlotItems.h"
 #include "Plot2d_FitDataDlg.h"
 #include "Plot2d_ViewWindow.h"
 #include "Plot2d_SetupViewDlg.h"
+#include "Plot2d_AnalyticalCurveDlg.h"
+#include "Plot2d_AnalyticalCurve.h"
 #include "Plot2d_ToolTip.h"
 
 #include "SUIT_Tools.h"
 #include <QPrinter>
 #include <QPalette>
 #include <QLocale>
+#include <QXmlStreamWriter>
+#include <QXmlStreamReader>
 
 #include <qwt_math.h>
 #include <qwt_plot_canvas.h>
 #include <qwt_scale_div.h>
+#include <qwt_plot_marker.h>
 #include <qwt_plot_curve.h>
 #include <qwt_plot_grid.h>
 #include <qwt_scale_engine.h>
 #include <qwt_plot_zoomer.h>
 #include <qwt_curve_fitter.h>
 
-#include <iostream>
 #include <stdlib.h>
 #include <qprinter.h>
 
@@ -148,7 +154,6 @@ const char* imageCrossCursor[] = {
   "................................",
   "................................"};
   
-
 /*!
   Constructor
 */
@@ -156,38 +161,42 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
      : QWidget (parent, 0),
        myOperation( NoOpId ), 
        myCurveType( 1 ), 
-       myShowLegend( true ), myLegendPos( 1 ),
+       myShowLegend( true ), myLegendPos( 1 ), myLegendFont("Helvetic",12),
+       myLegendColor(Qt::black),
        myMarkerSize( DEFAULT_MARKER_SIZE ),
-       myTitle( "" ), myXTitle( "" ), myYTitle( "" ), myY2Title( "" ),
        myBackground( Qt::white ),
+       myTitle( "" ), myXTitle( "" ), myYTitle( "" ), myY2Title( "" ),
        myTitleEnabled( true ), myXTitleEnabled( true ),
        myYTitleEnabled( true ), myY2TitleEnabled (true),
        myXGridMajorEnabled( true ), myYGridMajorEnabled( true ), myY2GridMajorEnabled( true ), 
        myXGridMinorEnabled( false ), myYGridMinorEnabled( false ), myY2GridMinorEnabled( false ),
        myXGridMaxMajor( 8 ), myYGridMaxMajor( 8 ), myY2GridMaxMajor( 8 ),
        myXGridMaxMinor( 5 ), myYGridMaxMinor( 5 ), myY2GridMaxMinor( 5 ),
-       myXMode( 0 ), myYMode( 0 ), mySecondY( false )
+       myXMode( 0 ), myYMode( 0 ),myNormLMin(false), myNormLMax(false), myNormRMin(false), myNormRMax(false),
+       mySecondY( false ), myIsDefTitle( true )
 {
   setObjectName( title );
+  myRNormAlgo = new Plot2d_NormalizeAlgorithm(this);
+  myLNormAlgo = new Plot2d_NormalizeAlgorithm(this);
   /* Plot 2d View */
   QVBoxLayout* aLayout = new QVBoxLayout( this ); 
   myPlot = new Plot2d_Plot2d( this );
-  new Plot2d_ToolTip( this, myPlot );
+  new Plot2d_ToolTip( this );
 
   aLayout->addWidget( myPlot );
 
   //  createActions();
   connect( myPlot, SIGNAL( legendClicked( QwtPlotItem* ) ), 
-          this, SIGNAL( legendClicked( QwtPlotItem* ) ) );
+           this, SIGNAL( legendClicked( QwtPlotItem* ) ) );
 
-  connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ),
-          myPlot, SLOT( onScaleDivChanged() ) );
+  // IPAL 21465
+  /*  connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ),
+           myPlot, SLOT( onScaleDivChanged() ) );
   connect( myPlot->axisWidget( QwtPlot::yLeft ), SIGNAL( scaleDivChanged() ),
-          myPlot, SLOT( onScaleDivChanged() ) );
+           myPlot, SLOT( onScaleDivChanged() ) );
   if (mySecondY)
     connect( myPlot->axisWidget( QwtPlot::yRight ), SIGNAL( scaleDivChanged() ),
-            myPlot, SLOT( onScaleDivChanged() ) );
-
+    myPlot, SLOT( onScaleDivChanged() ) );*/
 
   /* Initial Setup - get from the preferences */
   readPreferences();
@@ -204,8 +213,12 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title )
 
   if (mySecondY)
     setTitle( myY2TitleEnabled, myY2Title, Y2Title, false );
+  setHorScaleMode( myXMode, false );
+  setVerScaleMode( myYMode, false );
   setBackgroundColor( myBackground );
   setLegendPos( myLegendPos );
+  setLegendFont( myLegendFont );
+  setLegendFontColor( myLegendColor );
   showLegend( myShowLegend, false );
   myPlot->replot();
 
@@ -241,21 +254,96 @@ QWidget* Plot2d_ViewFrame::getViewWidget()
 */
 void Plot2d_ViewFrame::DisplayAll()
 {
-  curveList clist;
-  getCurves( clist );
-  for ( int i = 0; i < (int)clist.count(); i++ ) {
-    updateCurve( clist.at( i ), false );
-  }
+  objectList olist;
+  getObjects( olist );
+  foreach ( Plot2d_Object* o, olist )
+    updateObject( o, false );
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 /*!
    Removes all curves from the view
 */
 void Plot2d_ViewFrame::EraseAll() 
 {
-  myPlot->clear();
-  myPlot->getCurves().clear();
+  objectList anObjects;
+  getObjects( anObjects );
+  eraseObjects( anObjects, false );
+  myObjects.clear();
+
+  // 1)- Erase all the intermittent segments who connect curves
+
+  int nbSeg = myIntermittentSegmentList.size();
+  if (nbSeg > 0)
+  {
+      for (int iseg=0; iseg < nbSeg; iseg++)
+      {
+          QwtPlotCurve *segment = myIntermittentSegmentList[iseg];
+
+          segment->detach();  // erase in QwtPlot window
+          delete segment;
+      }
+      myIntermittentSegmentList.clear();
+  }
+
+  // 2)- Erase all curves points markers
+
+  int nbMark = myMarkerList.size();
+  if (nbMark > 0)
+  {
+      for (int imar=0; imar < nbMark; imar++)
+      {
+          QwtPlotMarker *marker = myMarkerList[imar];
+
+          marker->detach();  // erase in QwtPlot window
+          delete marker;
+      }
+      myMarkerList.clear();
+  }
+
+  // The graphic view's picker
+  Plot2d_QwtPlotPicker *picker = myPlot->getPicker();
+
+  // Clear points markers list and associations (marker,tooltip)
+  picker->pMarkers.clear();         // QList<QwtPlotMarker*>
+  picker->pMarkersToolTip.clear();  // QMap<QwtPlotMarker*, QwtText>
+
+  // 3)- Erase all QwtPlotCurve associated with the Plot2d_Curve
+
+  int nbCur1 = myQwtPlotCurveList.size();
+  if (nbCur1 > 0)
+  {
+      for (int icur=0; icur < nbCur1; icur++)
+      {
+          QwtPlotItem *curve0 = myQwtPlotCurveList[icur];
+          QwtPlotCurve *curve = static_cast<QwtPlotCurve*>(curve0);
+
+          if (curve)
+          {
+              delete curve;
+          }
+      }
+      myQwtPlotCurveList.clear();
+  }
+
+  // 4)- Erase all curves Plot2d_Curve
+
+  int nbCur = myPlot2dCurveList.size();
+  if (nbCur > 0)
+  {
+      for (int icur=0; icur < nbCur; icur++)
+      {
+          Plot2d_Curve *curve = myPlot2dCurveList[icur];
+
+          if (curve)
+          {
+              delete curve;
+          }
+      }
+      myPlot2dCurveList.clear();
+  }
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 /*!
   Redraws viewframe contents
@@ -272,21 +360,15 @@ void Plot2d_ViewFrame::Display( const Plot2d_Prs* prs )
   if ( !prs || prs->IsNull() )
     return;
 
-  if (prs->isSecondY()) {
-    myPlot->enableAxis(QwtPlot::yRight, true);
-    mySecondY = true;
-  }
-  else {
-    myPlot->enableAxis(QwtPlot::yRight, false);
-    mySecondY = false;
-  }
+  setEnableAxis( QwtPlot::yRight, prs->isSecondY() ); // VSR: is it correct? maybe we should only enable second Y axis if required
 
-  // display all curves from presentation
-  curveList aCurves = prs->getCurves();
-  displayCurves( aCurves );
+  // display all objects from presentation
+  objectList anObjects = prs->getObjects();
+  displayObjects( anObjects );
   setXGrid( myXGridMajorEnabled, myXGridMaxMajor, myXGridMinorEnabled, myXGridMaxMinor, true );
   setYGrid( myYGridMajorEnabled, myYGridMaxMajor, myYGridMinorEnabled, myYGridMaxMinor,
             myY2GridMajorEnabled, myY2GridMaxMajor, myY2GridMinorEnabled, myY2GridMaxMinor, true );
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -297,9 +379,10 @@ void Plot2d_ViewFrame::Erase( const Plot2d_Prs* prs, const bool )
   if ( !prs || prs->IsNull() )
     return;
 
-  // erase all curves from presentation
-  curveList aCurves = prs->getCurves();
-  eraseCurves( aCurves );
+  // erase all objects from presentation
+  objectList anObjects = prs->getObjects();
+  eraseObjects( anObjects );
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
@@ -315,7 +398,7 @@ bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
           if ( plotMouseMoved( m ) )
             return true;
         }
-       break;
+        break;
       }
       case QEvent::MouseButtonPress: {
         QMouseEvent* me = (QMouseEvent*)e;
@@ -335,6 +418,10 @@ bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
         }
         break;
       }
+    case QEvent::ContextMenu:
+      // Fix from SLN
+      // Do nothing because context menu is called from MouseRelease
+      return true;
     }
   }
   return QWidget::eventFilter( watched, e );
@@ -346,6 +433,15 @@ bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
 void Plot2d_ViewFrame::setTitle( const QString& title )
 {
   setTitle( myTitleEnabled, title, MainTitle, true );
+  myIsDefTitle = false;
+}
+
+/*!
+  Gets title
+*/
+QString Plot2d_ViewFrame::getTitle() const
+{
+  return myTitle;
 }
 
 /*!
@@ -360,6 +456,8 @@ void Plot2d_ViewFrame::readPreferences()
 
   myShowLegend = resMgr->booleanValue( "Plot2d", "ShowLegend", myShowLegend );
   myLegendPos = resMgr->integerValue( "Plot2d", "LegendPos", myLegendPos );
+  myLegendFont = resMgr->fontValue( "Plot2d", "LegendFont", myLegendFont );
+  myLegendColor = resMgr->colorValue( "Plot2d", "LegendFontColor", myLegendColor );
   myMarkerSize = resMgr->integerValue( "Plot2d", "MarkerSize", myMarkerSize );
   myBackground = resMgr->colorValue( "Plot2d", "Background", myBackground );
 
@@ -386,13 +484,19 @@ void Plot2d_ViewFrame::readPreferences()
   if ( mySecondY )
     myY2GridMaxMinor = resMgr->integerValue( "Plot2d", "VerMinorGridMax", myY2GridMaxMinor );
 
-  int newXMode = resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode );
-  newXMode = qMax( 0, qMin( 1, newXMode ) );
-  setHorScaleMode( newXMode, false );
+  setHorScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode ) ) ), false );
+  setVerScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode ) ) ), false );
+  setNormLMinMode( resMgr->booleanValue( "Plot2d", "VerNormLMinMode", myNormLMin ) );
+  setNormLMaxMode( resMgr->booleanValue( "Plot2d", "VerNormLMaxMode", myNormLMax ) );
+  setNormRMinMode( resMgr->booleanValue( "Plot2d", "VerNormRMinMode", myNormRMin ) );
+  setNormRMaxMode( resMgr->booleanValue( "Plot2d", "VerNormRMaxMode", myNormRMax ) );
+  QColor c = resMgr->colorValue( "Plot2d", "DeviationMarkerColor", QColor(255,0,0));
+  myPlot->setProperty(PLOT2D_DEVIATION_COLOR, c);
+  myPlot->setProperty(PLOT2D_DEVIATION_LW, 
+                      resMgr->integerValue( "Plot2d", "DeviationMarkerLineWidth", 1));
+  myPlot->setProperty(PLOT2D_DEVIATION_TS, 
+                      resMgr->integerValue( "Plot2d", "DeviationMarkerTickSize", 2));
 
-  int newYMode = resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode );
-  newYMode = qMax( 0, qMin( 1, newYMode ) );
-  setVerScaleMode( newYMode, false );
 }
 
 /*!
@@ -405,6 +509,8 @@ void Plot2d_ViewFrame::writePreferences()
   resMgr->setValue( "Plot2d", "CurveType", myCurveType );
   resMgr->setValue( "Plot2d", "ShowLegend", myShowLegend );
   resMgr->setValue( "Plot2d", "LegendPos", myLegendPos );
+  resMgr->setValue( "Plot2d", "LegendFont", myLegendFont );
+  resMgr->setValue( "Plot2d", "LegendFontColor", myLegendColor );
   resMgr->setValue( "Plot2d", "MarkerSize", myMarkerSize );
   resMgr->setValue( "Plot2d", "Background", myBackground );
   resMgr->setValue( "Plot2d", "ShowTitle", myTitleEnabled );
@@ -435,6 +541,10 @@ void Plot2d_ViewFrame::writePreferences()
   }
 
   resMgr->setValue( "Plot2d", "VerScaleMode", myYMode );
+  resMgr->setValue( "Plot2d", "VerNormLMinMode", myNormLMin );
+  resMgr->setValue( "Plot2d", "VerNormLMaxMode", myNormLMax );
+  resMgr->setValue( "Plot2d", "VerNormRMinMode", myNormRMin );
+  resMgr->setValue( "Plot2d", "VerNormRMaxMode", myNormRMax );
 }
 
 /*!
@@ -540,171 +650,793 @@ QString Plot2d_ViewFrame::getInfo( const QPoint& pnt )
   return info;
 }
 
+/*!
+ * Create markers and tooltips associated with curve points
+ */
+void Plot2d_ViewFrame::createCurveTooltips( Plot2d_Curve *curve,
+                                            Plot2d_QwtPlotPicker *picker)
+{      
+  // Dans Plot2d.h : pointList == QList<Plot2d_Point> 
+  double x, y;
+  QString tooltip;
+
+  pointList points = curve->getPointList();
+  QColor    color  = curve->getColor();
+
+  // Point marker
+  QwtSymbol symbol;
+  symbol.setStyle(QwtSymbol::Ellipse);
+  symbol.setSize(1,1);
+  symbol.setPen( QPen(color));
+  symbol.setBrush( QBrush(color));
+
+  for (int ip=0; ip < points.count(); ip++)
+  {
+      x = points[ip].x;
+      y = points[ip].y;
+      tooltip = points[ip].text;
+
+      QwtPlotMarker *marker = myPlot->createMarkerAndTooltip( symbol,
+                                                              x,
+                                                              y,
+                                                              tooltip,
+                                                              picker);
+      // To deallocate in EraseAll()
+      myMarkerList.append( marker);
+  }
+}
+
+
+/*!
+ * Display curves of the list of lists by systems and components
+ * - the first level list contains NbSytems lists of second level
+ * - a second level list contains NbComponents curves
+ * |         system 1         |         system 2         | ..... |          system N        |
+ * | compo1 compo2 ... compoM | compo1 compo2 ... compoM | ..... | compo1 compo2 ... compoM |
+ *
+ * Draw points markers and create associated tooltips.
+ * Draw connection segments (intermittent line) between all the curves of a component.
+ */
+void Plot2d_ViewFrame::displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
+                                               Plot2d_QwtPlotPicker*         picker,
+                                               bool                          displayLegend)
+{
+  //std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
+
+  // Systems number
+  int nbSystem = sysCoCurveList.size();
+
+  // Composants number by system
+  int nbComponent = (sysCoCurveList.at(0)).size();
+
+  // Total number of curves
+  //int nbAllCurve = nbSystem*nbComponent;
+
+   //std::cout << "  Number of systems       = " << nbSystem << std::endl;
+   //std::cout << "  Number of components    = " << nbComponent << std::endl;
+   //std::cout << "  Number total of courbes = " << nbAllCurve << std::endl;
+
+   // 1)- Construction of a list by component and by system
+   // |      component 1      |      component 2      | ..... |      component M      |
+   // | syst1 syst2 ... systN | syst1 syst2 ... systN | ..... | syst1 syst2 ... systN |
+
+  QList<Plot2d_Curve*> plot2dCurveCoSysList;
+
+  //std::cout << "  Liste par composant et par systeme :" << std::endl;
+
+  for (int icom = 0; icom < nbComponent; icom++)
+  {
+      for (int isys = 0; isys < nbSystem; isys++)
+      {
+          //std::cout << "    icom= " << icom << " idev= " << isys << std::endl;
+
+         // The system curves list
+          QList<Plot2d_Curve*> sysCurveList = sysCoCurveList.at(isys);
+
+         Plot2d_Curve *curve = sysCurveList.at(icom);
+
+          plot2dCurveCoSysList.append( curve);
+      }
+  }
+
+  // 2)- Display list curves by a component's curves group
+  //     Draw connection segments (intermittent line) between the curves
+
+  displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, picker, displayLegend);
+
+  // 3)- Size of graduations labels and texts under X axis
+
+  QwtScaleWidget *wid = myPlot->axisWidget( QwtPlot::xBottom);
+  wid->setTitle( "  "); // indispensable pour que les noms des systemes apparaissent
+                        // sous l'axe des X !!
+
+  QFont xFont = myPlot->axisFont(QwtPlot::xBottom);
+  xFont.setPointSize(8); 
+  myPlot->setAxisFont( QwtPlot::xBottom, xFont);
+
+  //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
+}
+
+
+/*!
+ * Display list of curves by group of consecutive curves.
+ *
+ * Draw points markers and create associated tooltips
+ * Draw connection segments (intermittent line) between the curves
+ */
+void Plot2d_ViewFrame::displayPlot2dCurveList( QList<Plot2d_Curve*>  curveList,
+                                                                int  groupSize,
+                                               Plot2d_QwtPlotPicker* picker,
+                                                               bool  displayLegend)
+{
+  //std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
+
+  // Consider the new legend's entries
+  // (PB: to update the legend we must remove it and put a new QwtLegend in the QwtPlot)
+  myPlot->insertLegend( (QwtLegend*)NULL); // we remove here, we shall put at the end
+
+  int nbAllCurves = curveList.size();
+  int nbGroups    = nbAllCurves / groupSize;
+  int ig, icur;
+  int icur1, icur2;  // curves indices in a group
+
+  //std::cout << "  " << nbGroups << " groupes a " << groupSize << " courbes" << std::endl;
+  // I)- Compute X range and Y range for all the curves' points of all groups
+  //     In the graphic view, set the Y range 's bounds for all groups of curves
+
+  // For all groups of curves
+  double XallGroupMin, XallGroupMax;
+  double YallGroupMin, YallGroupMax;
+  bool isFirstGroup = true;
+
+  icur1 = 0;
+  for (ig=0; ig < nbGroups; ig++)  //*1*
+  {
+      icur2 = icur1 + groupSize -1;
+
+      // For all curves in one group
+      double XgroupMin, XgroupMax;
+      double YgroupMin, YgroupMax;
+
+      // For one curve
+      double XcurveMin, XcurveMax;
+      double YcurveMin, YcurveMax;
+      double *Xval;
+      double *Yval;
+      int nbPoints;
+
+      // Compute X range and Y range for all the curves' points in the group
+
+      for (icur=icur1; icur <= icur2; icur++)  //*2*
+      {
+          Plot2d_Curve *plot2dCurve = curveList.at(icur);
+
+          // Curve points
+          nbPoints = plot2dCurve->getData( &Xval, &Yval);  // dynamic allocation
+
+          for (int ip=0; ip < nbPoints; ip++)
+          {
+              if (ip == 0)  // first point
+              {
+                  XcurveMin = Xval[ip];  XcurveMax = Xval[ip];
+                  YcurveMin = Yval[ip];  YcurveMax = Yval[ip];
+              }
+              else
+              {
+                  if      (Xval[ip] < XcurveMin)  XcurveMin = Xval[ip];
+                  else if (Xval[ip] > XcurveMax)  XcurveMax = Xval[ip];
+                  if      (Yval[ip] < YcurveMin)  YcurveMin = Yval[ip];
+                  else if (Yval[ip] > YcurveMax)  YcurveMax = Yval[ip];
+              }
+          }
+          delete [] Xval;
+          delete [] Yval;
+
+          //std::cout << "  Pour la courbe d'indice " << icur << " :" << std::endl;
+          //std::cout << "    Xmin= " << XcurveMin << "  Xmax= " << XcurveMax << std::endl;
+          //std::cout << "    Ymin= " << YcurveMin << "  Ymax= " << YcurveMax << std::endl;
+
+          if (icur == icur1)  // first curve
+          {
+              XgroupMin = XcurveMin;  XgroupMax = XcurveMax;
+              YgroupMin = YcurveMin;  YgroupMax = YcurveMax;
+          }
+          else
+          {
+              if (XcurveMin < XgroupMin)  XgroupMin = XcurveMin;
+              if (XcurveMax > XgroupMax)  XgroupMax = XcurveMax;
+              if (YcurveMin < YgroupMin)  YgroupMin = YcurveMin;
+              if (YcurveMax > YgroupMax)  YgroupMax = YcurveMax;
+          }
+      } //*2*
+
+      //std::cout << "  Pour les courbes du groupe d'indice " << ig << " :" << std::endl;
+      //std::cout << "    Xmin= " << XgroupMin << "  Xmax= " << XgroupMax << std::endl;
+      //std::cout << "    Ymin= " << YgroupMin << "  Ymax= " << YgroupMax << std::endl;
+
+      if (isFirstGroup)
+      {
+          XallGroupMin = XgroupMin;  XallGroupMax = XgroupMax;
+          YallGroupMin = YgroupMin;  YallGroupMax = YgroupMax;
+          isFirstGroup = false;
+      }
+      else
+      {
+          if (XgroupMin < XallGroupMin)  XallGroupMin = XgroupMin;
+          if (XgroupMax > XallGroupMax)  XallGroupMax = XgroupMax;
+          if (YgroupMin < YallGroupMin)  YallGroupMin = YgroupMin;
+          if (YgroupMax > YallGroupMax)  YallGroupMax = YgroupMax;
+      }
+
+      // First curve of the following group
+      icur1 = icur2 + 1;
+  } //*1*
+
+  //std::cout << "  Pour tous les groupes de courbes :" << std::endl;
+  //std::cout << "    Xmin= " << XallGroupMin << "  Xmax= " << XallGroupMax << std::endl;
+  //std::cout << "    Ymin= " << YallGroupMin << "  Ymax= " << YallGroupMax << std::endl;
+
+  double deltaY = YallGroupMax - YallGroupMin;
+
+  // Set the XY range 's bounds for all groups of curves
+//myPlot->setAxisScale( QwtPlot::xBottom, XallGroupMin, XallGroupMax);
+  myPlot->setAxisScale( QwtPlot::yLeft, YallGroupMin - 0.05*deltaY, YallGroupMax + 0.05*deltaY);
+
+  // II)- Drawing curves, points markers and connection segments
+
+  icur1 = 0;
+  for (ig=0; ig < nbGroups; ig++)
+  {
+      icur2 = icur1 + groupSize -1;
+
+      //std::cout << "  Indices des courbes du groupe " << ig << " : " << icur1
+      //                                                      << " a " << icur2 << std::endl;
+      int nbCurves = icur2 - icur1 + 1;
+      //std::cout << "    groupe a " << nbCurves << " courbes" << std::endl;
+
+      // 1)- Graphical attributs of group's curves
+
+      // Graphical attributes of the first group's curve
+      //
+      Plot2d_Curve *plot2dCurve1 = curveList.at(icur1);
+      //
+      QColor color1 = plot2dCurve1->getColor();
+      Plot2d::LineType linetype1 = plot2dCurve1->getLine();
+      int lineWidth1 = plot2dCurve1->getLineWidth();
+      QwtSymbol::Style symbolStyle1 = plot2dCurve1->getMarkerStyle();
+
+      if (nbCurves > 1)
+      {
+          // We attribute to the current group's curve, the color, the line's kind
+          // and the marker's kind of the first group's curve
+
+          for (icur=icur1 +1; icur <= icur2; icur++)
+          {
+              Plot2d_Curve *plot2dCurve = curveList.at(icur);
+              //
+              plot2dCurve->setColor( color1);
+              plot2dCurve->setLine( linetype1, lineWidth1);
+              plot2dCurve->setMarkerStyle( symbolStyle1);
+          }
+      }
+
+      // 2)- Display the group's curves
+
+      for (icur=icur1; icur <= icur2; icur++)
+      {
+          Plot2d_Curve *plot2dCurve = curveList.at(icur);
+
+          QString title = plot2dCurve->getVerTitle();
+          std::string std_title = title.toStdString();
+          //const char *c_title = std_title.c_str();
+          //std::cout << "    courbe d'indice " << icur << " : |" << c_title << "|" << std::endl;
+
+          // Create the graphic curve (QwtPlotCurve) et display it in the drawing zone
+          // (Qwtplot)
+          displayCurve( plot2dCurve);
+
+         // Draw the points' markers and create the associated tooltips
+          createCurveTooltips( plot2dCurve, picker);
+
+          // Get the graphic curve
+          QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+          // Modify the points' markers
+          QwtSymbol symbol (plotCurve->symbol()) ;
+          symbol.setStyle( symbolStyle1);
+          symbol.setPen( QPen( color1, lineWidth1));
+          symbol.setBrush( QBrush( color1));
+          QSize size = 0.5*(symbol.size());
+          symbol.setSize(size);
+          //
+          plotCurve->setPen( QPen( color1, lineWidth1));
+          plotCurve->setSymbol( symbol);
+
+          if (icur > icur1)
+          {
+              //std::cout << "  courbe d'indice " << icur << " sans entree dans la legende" << std::endl;
+
+              // The curve must not have legend's entry
+              plotCurve->setItemAttribute( QwtPlotItem::Legend, false);
+          }
+          else
+          {
+              plotCurve->setItemAttribute( QwtPlotItem::Legend, true);
+          }
+      }
+
+      // 3)- Intermittent segments to connect all the group's curves
+
+      if (nbCurves > 1)
+      {
+          double *Xval;
+          double *Yval;
+          int nbPoints;
+          double Xseg[2], Yseg[2];
+          Plot2d_Curve *plot2dCurve1 = curveList.at(icur1);
+
+          // Last point of the first curve
+          nbPoints = plot2dCurve1->getData( &Xval, &Yval);  // dynamic allocation
+          Xseg[0] = Xval[ nbPoints -1];
+          Yseg[0] = Yval[ nbPoints -1];
+          delete [] Xval;
+          delete [] Yval;
+
+          for (icur=icur1 +1; icur <= icur2; icur++)
+          {
+              Plot2d_Curve *plot2dCurve = curveList.at(icur);
+
+              // First curve's point
+              nbPoints = plot2dCurve->getData( &Xval, &Yval);
+              Xseg[1] = Xval[0];
+              Yseg[1] = Yval[0];
+
+              createSegment( Xseg, Yseg, 2,
+                             Qt::DotLine,
+                             lineWidth1,
+                             color1,
+                             QwtSymbol::NoSymbol);
+
+              // Last curve's point
+              Xseg[0] = Xval[ nbPoints -1];
+              Yseg[0] = Yval[ nbPoints -1];
+              delete [] Xval;
+              delete [] Yval;
+          }
+      }
+      // First curve of the following group
+      icur1 = icur2 + 1;
+  }
+
+  if (displayLegend)
+    {
+      // Consider the new legend's entries
+      showLegend( true, true);  // show, update
+    }
+
+  //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
+}
+
+
+/*!
+ * Create and display an y=f(x) curve of points
+ * Parameters :
+ *   toDraw : true => Display the created curve
+ *                    Draw the points'markers and create associated tooltips
+ */
+Plot2d_Curve* Plot2d_ViewFrame::createPlot2dCurve( QString & title,
+                                                   QString & unit,
+                                                   QList<double> & xList,
+                                                   QList<double> & yList,
+                                                   QList<QString> & tooltipList,
+                                                   Plot2d::LineType lineKind,
+                                                   int lineWidth,
+                                                   QColor & lineColor,
+                                                   QwtSymbol::Style markerKind,
+                                                   Plot2d_QwtPlotPicker* picker,
+                                                   bool toDraw,
+                                                   bool displayLegend)
+{
+  //std::cout << "Plot2d_ViewFrame::createPlot2dCurve()" << std::endl;
+
+  // Mathematical curve
+  Plot2d_Curve* plot2dCurve = new Plot2d_Curve();
+
+  // To deallocate in EraseAll()
+  myPlot2dCurveList.append( plot2dCurve);
+
+  int nbPoint = xList.size();
+  double xVal, yVal;
+  QString tooltip;
+
+  for (int ip=0; ip < nbPoint; ip++)
+  {
+      xVal = xList.at(ip);
+      yVal = yList.at(ip);
+      tooltip = tooltipList.at(ip);
+
+      plot2dCurve->addPoint( xVal, yVal, tooltip);
+  }
+
+  plot2dCurve->setVerTitle( title);
+  plot2dCurve->setVerUnits( unit);
+  if (lineColor.isValid())
+  {
+      plot2dCurve->setColor( lineColor);
+  }
+  plot2dCurve->setLine( lineKind, lineWidth);
+  plot2dCurve->setMarkerStyle( markerKind);
+  plot2dCurve->setMarkerSize(1);
+
+  // Graphical curve (QwtPlotCurve) in the drawing zone (QwtPlot) myPlot
+  if (toDraw)
+  {
+      if (!displayLegend)
+        {
+          myPlot->insertLegend( (QwtLegend*)NULL);
+        }
+      displayCurve( plot2dCurve);
+
+      // plot points marker create associated tooltips
+      createCurveTooltips( plot2dCurve, picker);
+
+      // Get the graphical curve
+      QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+      QColor theColor;
+
+      if (lineColor.isValid())
+      {
+        //std::cout << "  valid color" << std::endl;
+          theColor = lineColor;
+      }
+      else
+      {
+        //std::cout << "  valid color" << std::endl;
+          QPen pen = plotCurve->pen();
+          theColor = pen.color();
+      }
+
+      // Modify points' markers
+      QwtSymbol symbol (plotCurve->symbol()) ;
+      symbol.setStyle( markerKind);
+      //
+      if (markerKind != QwtSymbol::NoSymbol)
+      {
+          symbol.setPen( QPen( theColor, lineWidth));
+          symbol.setBrush( QBrush( theColor));
+          QSize size = 2.0*(symbol.size()); //0.5
+          symbol.setSize(size);
+      }
+
+      plotCurve->setSymbol( symbol);
+      plotCurve->setStyle( QwtPlotCurve::Lines);
+      plotCurve->setPen( QPen( theColor, lineWidth));
+
+      // The curve must not have legend's entry
+      plotCurve->setItemAttribute( QwtPlotItem::Legend, false);
+  }
+  return plot2dCurve;
+}
+
+
+/*!
+ * Get curve's color
+ */
+QColor Plot2d_ViewFrame::getPlot2dCurveColor( Plot2d_Curve* plot2dCurve)
+{
+
+  // Get graphical curve
+  QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+  QPen pen = plotCurve->pen();
+  QColor color = pen.color();
+
+  return color;
+}
+
+
+/*!
+ * Create and display a segment with nbPoint=2 points
+ */
+void Plot2d_ViewFrame::createSegment( double *X, double *Y, int nbPoint,
+                                      Qt::PenStyle lineKind,
+                                      int lineWidth,
+                                      QColor & lineColor,
+                                      QwtSymbol::Style markerKind)
+{
+  QwtPlotCurve* aPCurve = new QwtPlotCurve();
+
+  aPCurve->setData( X, Y, nbPoint);
+
+  aPCurve->setPen( QPen( lineColor, lineWidth, lineKind));
+  QwtSymbol aSymbol;
+  aSymbol.setStyle( markerKind);
+  aPCurve->setSymbol( aSymbol);
+
+  // The segment must not have legend's entry
+  aPCurve->setItemAttribute( QwtPlotItem::Legend, false);
+
+  aPCurve->attach( myPlot);
+  // To deallocate in EraseAll()
+  myIntermittentSegmentList.append( aPCurve);
+}
+
 /*!
   Adds curve into view
 */
 void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update )
 {
-  if ( !curve )
-    return;
+  QwtPlotItem* anItem = displayObject( curve, update );
+  // To deallocate in EraseAll()
+  myQwtPlotCurveList.append( anItem);
+}
+
+/*!
+  Adds curves into view
+*/
+void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
+{
+  objectList objects;
+  foreach ( Plot2d_Curve* curve, curves )
+    objects << curve;
+  displayObjects( objects, update );
+}
+
+/*!
+  Erases curve
+*/
+void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
+{
+  eraseObject( curve, update );
+}
+
+/*!
+  Erases curves
+*/
+void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
+{
+  objectList objects;
+  foreach ( Plot2d_Curve* curve, curves )
+    objects << curve;
+  eraseObjects( objects, update );
+}
+
+/*!
+  Updates curves attributes
+*/
+void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
+{
+  updateObject( curve, update );
+}
+
+void Plot2d_ViewFrame::processFiltering(bool update) 
+{
+  CurveDict aCurves = getCurves();
+  AlgoPlot2dInputData aLData, aRData;
+  CurveDict::iterator it;
+  for ( it = aCurves.begin(); it != aCurves.end(); it++ ) {
+    Plot2d_Object* objItem = it.value();
+    if (objItem->getYAxis() == QwtPlot::yRight)
+      aRData.append(objItem);
+    else
+      aLData.append(objItem);
+  }
+
+// Normalization by left Y axis
+  if (!myNormLMin && !myNormLMax)
+    myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+  if(myNormLMin && myNormLMax)  
+    myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+  else if(myNormLMin)
+    myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+  else if(myNormLMax)
+    myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+  myLNormAlgo->setInput(aLData);
+  myLNormAlgo->execute();
+
+// Normalization by right Y axis
+  if (!myNormRMin && !myNormRMax)
+    myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+  if(myNormRMin && myNormRMax)  
+    myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+  else if(myNormRMin)
+    myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+  else if(myNormRMax)
+    myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+  myRNormAlgo->setInput(aRData);
+  myRNormAlgo->execute();
+
+  for ( it = aCurves.begin(); it != aCurves.end(); it++) {
+    QwtPlotCurve* item = it.key();
+    Plot2d_Object* objItem = it.value();
+    updatePlotItem(objItem, item);
+  }
+  if(update)
+  myPlot->replot();
+}
+
+/*!
+  Gets lsit of displayed curves
+*/
+int Plot2d_ViewFrame::getCurves( curveList& curves ) const
+{
+  curves.clear();
+
+  CurveDict aCurves = getCurves();
+  CurveDict::iterator it;
+  for ( it = aCurves.begin(); it != aCurves.end(); it++ )
+    curves << it.value();
+  return curves.count();
+}
+
+CurveDict Plot2d_ViewFrame::getCurves() const
+{
+  CurveDict curves;
+  ObjectDict::const_iterator it = myObjects.begin(), aLast = myObjects.end();
+  for ( ; it != aLast; it++ ) {
+    QwtPlotItem* anItem = it.key();
+    if ( anItem && anItem->rtti() == QwtPlotItem::Rtti_PlotCurve ) {
+      QwtPlotCurve* aPCurve = dynamic_cast<QwtPlotCurve*>( anItem );
+      Plot2d_Curve* aCurve = dynamic_cast<Plot2d_Curve*>( it.value() );
+      if ( aPCurve && aCurve )
+        curves.insert( aPCurve, aCurve );
+    }
+  }
+  return curves;
+}
+
+/*!
+  Adds object into view
+*/
+QwtPlotItem* Plot2d_ViewFrame::displayObject( Plot2d_Object* object, bool update )
+{
+  QwtPlotItem* anItem = 0;
+  if ( !object )
+    return anItem;
+  
+  if ( object->getYAxis() == QwtPlot::yRight )
+    mySecondY = true;
 
   // san -- Protection against QwtCurve bug in Qwt 0.4.x: 
   // it crashes if switched to X/Y logarithmic mode, when one or more points have
   // non-positive X/Y coordinate
-  if ( myXMode && curve->getMinX() <= 0. )
+  if ( myXMode && object->getMinX() <= 0. )
     setHorScaleMode( 0, false );
-  if ( myYMode && curve->getMinY() <= 0. )
+  if ( myYMode && object->getMinY() <= 0. )
     setVerScaleMode( 0, false );
 
-  if ( hasPlotCurve( curve ) ) {
-    updateCurve( curve, update );
+  if ( object->isAutoAssign() )
+    object->autoFill( myPlot );
+  
+  if ( hasPlotObject( object ) ) {
+    processFiltering(update);
+    updateObject( object, update );
   }
   else {
-    QwtPlotCurve* aPCurve = new QwtPlotCurve( curve->getVerTitle() );
-    aPCurve->attach( myPlot );
+    anItem = object->createPlotItem();
+    anItem->attach( myPlot );
+    myObjects.insert( anItem, object );
     //myPlot->setCurveYAxis(curveKey, curve->getYAxis());
 
-    myPlot->getCurves().insert( aPCurve, curve );
-    if ( curve->isAutoAssign() ) {
-      QwtSymbol::Style typeMarker;
-      QColor           color;
-      Qt::PenStyle     typeLine;
-
-      myPlot->getNextMarker( typeMarker, color, typeLine );
-      aPCurve->setPen( QPen( color, DEFAULT_LINE_WIDTH, typeLine ) );
-      aPCurve->setSymbol( QwtSymbol( typeMarker, 
-               QBrush( color ), 
-               QPen( color ), 
-               QSize( myMarkerSize, myMarkerSize ) ) );
-      curve->setColor( color );
-      curve->setLine( Plot2d::qwt2plotLine( typeLine ) );
-      curve->setMarker( Plot2d::qwt2plotMarker( typeMarker ) );
-    }
-    else {
-      Qt::PenStyle     ps = Plot2d::plot2qwtLine( curve->getLine() );
-      QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
-      aPCurve->setPen( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
-      aPCurve->setSymbol( QwtSymbol( ms, 
-               QBrush( curve->getColor() ), 
-               QPen( curve->getColor() ), 
-               QSize( myMarkerSize, myMarkerSize ) ) );
+    if ( object->rtti() == QwtPlotItem::Rtti_PlotCurve )
+    {
+      Plot2d_Curve* aCurve = dynamic_cast<Plot2d_Curve*>( object );
+      if ( aCurve )
+      {
+       //myMarkerSize = 1;
+        //aCurve->setMarkerSize( myMarkerSize );
+
+       if (aCurve->getMarkerSize() == 0)
+       {
+            aCurve->setMarkerSize( myMarkerSize );
+       }
+
+        processFiltering(update);
+        updatePlotItem( aCurve, anItem );
+        setCurveType( getPlotCurve( aCurve ), myCurveType );
+      }
     }
-    setCurveType( aPCurve, myCurveType );
-    aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
   }
   updateTitles();
+  myPlot->updateYAxisIdentifiers();
   if ( update )
     myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
+  return anItem;
 }
 
 /*!
-  Adds curves into view
+  Adds objects into view
 */
-void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
+void Plot2d_ViewFrame::displayObjects( const objectList& objects, bool update )
 {
   //myPlot->setUpdatesEnabled( false ); // call this function deprecate update of legend
-  curveList::const_iterator it = curves.begin();
-  Plot2d_Curve* aCurve;
-  for (; it != curves.end(); ++it ) {
-    aCurve = *it;
-    displayCurve( aCurve, false );
-  }
+  foreach ( Plot2d_Object* object, objects )
+    displayObject( object, false );
   fitAll();
   //myPlot->setUpdatesEnabled( true );
-// update legend
+  // update legend
   if ( update )
     myPlot->replot();
 }
 
 /*!
-  Erases curve
+  Erases object
 */
-void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
+void Plot2d_ViewFrame::eraseObject( Plot2d_Object* object, bool update )
 {
-  if ( !curve )
+  if ( !object )
     return;
-  if ( hasPlotCurve( curve ) ) {
-    QwtPlotCurve* aPCurve = getPlotCurve( curve );
-    aPCurve->hide();
-    aPCurve->detach();
-    myPlot->getCurves().remove( aPCurve );
+
+  if ( hasPlotObject( object ) ) {
+    QwtPlotItem* anObject = getPlotObject( object );
+    anObject->hide();
+    anObject->detach();
+    myObjects.remove( anObject );
     updateTitles();
+    myPlot->updateYAxisIdentifiers();
     if ( update )
       myPlot->replot();
   }
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
-  Erases curves
+  Erases objects
 */
-void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
+void Plot2d_ViewFrame::eraseObjects( const objectList& objects, bool update )
 {
-  curveList::const_iterator it = curves.begin();
-  Plot2d_Curve* aCurve;
-  for (; it != curves.end(); ++it ) {
-    aCurve = *it;
-    eraseCurve( aCurve, false );
-  }
-//  fitAll();
+  foreach ( Plot2d_Object* object, objects )
+    eraseObject( object, false );
+
+  //  fitAll();
   if ( update )
     myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
-  Updates curves attributes
+  Updates objects attributes
 */
-void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
+void Plot2d_ViewFrame::updateObject( Plot2d_Object* object, bool update )
 {
-  if ( !curve )
+  if ( !object )
     return;
-  if ( hasPlotCurve( curve ) ) {
-  QwtPlotCurve* aPCurve = getPlotCurve( curve );
-    if ( !curve->isAutoAssign() ) {
-      Qt::PenStyle     ps = Plot2d::plot2qwtLine( curve->getLine() );
-      QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
-      aPCurve->setPen ( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
-      aPCurve->setSymbol( QwtSymbol( ms, 
-               QBrush( curve->getColor() ), 
-               QPen( curve->getColor() ), 
-               QSize( myMarkerSize, myMarkerSize ) ) );
-      aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
-    }
-    aPCurve->setTitle( curve->getVerTitle() );
-    aPCurve->setVisible( true );
+  if ( hasPlotObject( object ) ) {
+    QwtPlotItem* anItem = getPlotObject( object );
+    if ( !anItem )
+      return;
+    updatePlotItem(object, anItem );
+    anItem->setVisible( true );
     if ( update )
       myPlot->replot();
+    if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
   }
 }
 
 /*!
   Gets lsit of displayed curves
 */
-int Plot2d_ViewFrame::getCurves( curveList& clist )
+int Plot2d_ViewFrame::getObjects( objectList& objects ) const
 {
-  clist.clear();
-
-  CurveDict::iterator it = myPlot->getCurves().begin();
-  for ( ; it != myPlot->getCurves().end(); it++ )
-    clist.append( it.value() );
-  return clist.count();
-}
+  objects.clear();
 
-const CurveDict& Plot2d_ViewFrame::getCurves()
-{
-  return myPlot->getCurves();
+  ObjectDict::const_iterator it;
+  for ( it = myObjects.begin(); it != myObjects.end(); it++ )
+    objects << it.value();
+  return objects.count();
 }
 
 /*!
   Returns true if the curve is visible
 */
-bool Plot2d_ViewFrame::isVisible( Plot2d_Curve* curve )
+bool Plot2d_ViewFrame::isVisible( Plot2d_Object* object ) const
 {
-  if(curve) {
-    if ( hasPlotCurve( curve ) ) {
-      return getPlotCurve( curve )->isVisible();
-    }
-  }
-  return false;
+  return object && hasPlotObject( object ) && getPlotObject( object )->isVisible();
 } 
 
 /*!
@@ -714,17 +1446,29 @@ void Plot2d_ViewFrame::updateLegend( const Plot2d_Prs* prs )
 {
   if ( !prs || prs->IsNull() )
     return;
-  curveList aCurves = prs->getCurves();
 
-  curveList::iterator it = aCurves.begin();
-  Plot2d_Curve* aCurve;
-  for (; it != aCurves.end(); ++it ) {
-    aCurve = *it;
-    if ( hasPlotCurve( aCurve ) )
-      getPlotCurve( aCurve )->setTitle( aCurve->getVerTitle() );
+  ObjectDict::iterator it = myObjects.begin();
+  Plot2d_Object* anObj;
+  for (; it != myObjects.end(); ++it ) {
+    anObj = *it;
+    if ( hasPlotObject( anObj ) )
+      getPlotObject( anObj )->setTitle( !anObj->getName().isEmpty() ?
+                            anObj->getName() : anObj->getVerTitle() );
+  }
+}
+
+/*!
+  update legend
+*/
+void Plot2d_ViewFrame::updateLegend() {
+  if ( myPlot->getLegend() ) {
+    ObjectDict::iterator it = myObjects.begin();
+    for( ; it != myObjects.end(); ++it ) 
+      it.key()->updateLegend(myPlot->getLegend());
   }
 }
 
+
 /*!
   Fits the view to see all data
 */
@@ -741,20 +1485,19 @@ void Plot2d_ViewFrame::fitAll()
   myPlot->setAxisAutoScale( QwtPlot::xBottom );
   myPlot->replot();
 
-  // for existing grid
-  QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
-  QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+  double xmin, xmax, y1min, y1max, y2min, y2max;
+  getFitRangeByCurves(xmin, xmax, y1min, y1max, y2min, y2max);
 
-  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2() );
-  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2() );
+  myPlot->setAxisScale( QwtPlot::xBottom, xmin, xmax );
+  myPlot->setAxisScale( QwtPlot::yLeft, y1min, y1max );
 
   if (mySecondY) {
     myPlot->setAxisAutoScale( QwtPlot::yRight );
     myPlot->replot();
-    QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
-    myPlot->setAxisScale( QwtPlot::yRight, yMap2.s1(), yMap2.s2() );
+    myPlot->setAxisScale( QwtPlot::yRight, y2min, y2max );
   }
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -782,15 +1525,16 @@ void Plot2d_ViewFrame::fitArea( const QRect& area )
             myPlot->invTransform( QwtPlot::xBottom, rect.left() ), 
             myPlot->invTransform( QwtPlot::xBottom, rect.right() ) );
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
   "Fit Data" command for TUI interface
 */
 void Plot2d_ViewFrame::fitData(const int mode,
-                              const double xMin, const double xMax,
-                              const double yMin, const double yMax,
-                              double y2Min, double y2Max)
+                               const double xMin, const double xMax,
+                               const double yMin, const double yMax,
+                               double y2Min, double y2Max)
 {
   if ( mode == 0 || mode == 2 ) {
     myPlot->setAxisScale( QwtPlot::yLeft, yMin, yMax );
@@ -800,14 +1544,15 @@ void Plot2d_ViewFrame::fitData(const int mode,
   if ( mode == 0 || mode == 1 ) 
     myPlot->setAxisScale( QwtPlot::xBottom, xMin, xMax ); 
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
   Gets current fit ranges for view frame
 */
 void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
-                                   double& yMin, double& yMax,
-                                   double& y2Min, double& y2Max)
+                                    double& yMin, double& yMax,
+                                    double& y2Min, double& y2Max)
 {
   int ixMin = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s1() );
   int ixMax = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s2() );
@@ -827,6 +1572,72 @@ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
   }
 }
 
+/*!
+  Gets current fit ranges by Curves
+*/
+void Plot2d_ViewFrame::getFitRangeByCurves(double& xMin,  double& xMax,
+                                           double& yMin,  double& yMax,
+                                           double& y2Min, double& y2Max)
+{
+  bool emptyV1 = true, emptyV2 = true;
+  if ( !myObjects.isEmpty() ) {
+    ObjectDict::const_iterator it = myObjects.begin();
+    for ( ; it != myObjects.end(); it++ ) {
+      bool isV2 = it.value()->getYAxis() == QwtPlot::yRight;
+      if ( !it.value()->isEmpty() ) {
+       if ( emptyV1 && emptyV2 ) {
+         xMin = 1e150;
+         xMax = -1e150;
+       }
+       if ( emptyV1 ) {
+         yMin = 1e150;
+         yMax = -1e150;
+       }
+       if ( emptyV2 ) {
+         y2Min = 1e150;
+         y2Max = -1e150;
+       }
+       isV2 ? emptyV2 = false : emptyV1 = false;
+       xMin = qMin( xMin, it.value()->getMinX() );
+       xMax = qMax( xMax, it.value()->getMaxX() );
+        if ( isV2 ) {
+          y2Min = qMin( y2Min, it.value()->getMinY() );
+          y2Max = qMax( y2Max, it.value()->getMaxY() );
+        }
+        else {
+          yMin = qMin( yMin, it.value()->getMinY() );
+          yMax = qMax( yMax, it.value()->getMaxY() );
+        }
+      }
+    }
+    if ( xMin == xMax ) {
+      xMin = xMin == 0. ? -1. : xMin - xMin/10.;
+      xMax = xMax == 0. ?  1. : xMax + xMax/10.;
+    }
+    if ( yMin == yMax ) {
+      yMin = yMin == 0. ? -1. : yMin - yMin/10.;
+      yMax = yMax == 0. ?  1  : yMax + yMax/10.;
+    }
+    if ( y2Min == y2Max ) {
+      y2Min = y2Min == 0. ? -1. : y2Min - y2Min/10.;
+      y2Max = y2Max == 0. ?  1  : y2Max + y2Max/10.;
+    }
+  }
+  // default values
+  if ( emptyV1 && emptyV2 ) {
+    xMin = isModeHorLinear() ? 0.    : 1.;
+    xMax = isModeHorLinear() ? 1000. : 1e5;
+  }
+  if ( emptyV1  ) {
+    yMin = isModeVerLinear() ? 0.    : 1.;
+    yMax = isModeVerLinear() ? 1000. : 1e5;
+  }
+  if ( emptyV2  ) {
+    y2Min = isModeVerLinear() ? 0.    : 1.;
+    y2Max = isModeVerLinear() ? 1000. : 1e5;
+  }
+}
+
 /*!
   Tests if it is necessary to start operation on mouse action
 */
@@ -837,24 +1648,22 @@ int Plot2d_ViewFrame::testOperation( const QMouseEvent& me )
   const int panBtn  = Qt::ControlModifier | Qt::MidButton;
   const int fitBtn  = Qt::ControlModifier | Qt::RightButton;
 
-  switch (btn)
-  {
-  case zoomBtn:
-    {
-      QPixmap zoomPixmap (imageZoomCursor);
-      QCursor zoomCursor (zoomPixmap);
-      myPlot->canvas()->setCursor( zoomCursor );
-      return ZoomId;
-    }
-  case panBtn:
+  int op = NoOpId;
+  if ( btn == zoomBtn ) {
+    QPixmap zoomPixmap (imageZoomCursor);
+    QCursor zoomCursor (zoomPixmap);
+    myPlot->canvas()->setCursor( zoomCursor );
+    op = ZoomId;
+  }
+  else if ( btn == panBtn ) {
     myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) );
-    return PanId;
-  case fitBtn:
+    op = PanId;
+  }
+  else if ( btn == fitBtn ) {
     myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) );
-    return FitAreaId;
-  default :
-    return NoOpId;
+    op = FitAreaId;
   }
+  return op;
 }
 
 /*!
@@ -908,10 +1717,28 @@ void Plot2d_ViewFrame::onSettings()
   if (mySecondY)
     dlg->setY2Title( myY2TitleEnabled, myY2Title );
   dlg->setCurveType( myCurveType );
-  dlg->setLegend( myShowLegend, myLegendPos );
+  dlg->setLegend( myShowLegend, myLegendPos, myLegendFont, myLegendColor );
   dlg->setMarkerSize( myMarkerSize );
   dlg->setBackgroundColor( myBackground );
   dlg->setScaleMode(myXMode, myYMode);
+  dlg->setLMinNormMode(myNormLMin);
+  dlg->setLMaxNormMode(myNormLMax);
+  dlg->setRMinNormMode(myNormRMin);
+  dlg->setRMaxNormMode(myNormRMax);
+
+  QVariant v = myPlot->property(PLOT2D_DEVIATION_LW);
+  int lw = v.isValid() ? v.toInt() : 1;
+
+  v = myPlot->property(PLOT2D_DEVIATION_TS);
+  int ts = v.isValid() ? v.toInt() : 2;
+
+  v = myPlot->property(PLOT2D_DEVIATION_COLOR);
+  QColor cl =  v.isValid() ? v.value<QColor>() : QColor(255,0,0);
+
+  dlg->setDeviationMarkerLw(lw);
+  dlg->setDeviationMarkerTs(ts);
+  dlg->setDeviationMarkerCl(cl);
+
   //
   dlg->setMajorGrid( myXGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::xBottom ),
          myYGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::yLeft ),
@@ -928,6 +1755,8 @@ void Plot2d_ViewFrame::onSettings()
       setTitle( dlg->isY2TitleEnabled(), dlg->getY2Title(), Y2Title, false );
 
     // main title
+    if( dlg->isMainTitleEnabled() && myTitle != dlg->getMainTitle() ) 
+      myIsDefTitle = false;
     setTitle( dlg->isMainTitleEnabled(), dlg->getMainTitle(), MainTitle, true );
     // curve type
     if ( myCurveType != dlg->getCurveType() ) {
@@ -940,6 +1769,13 @@ void Plot2d_ViewFrame::onSettings()
     if ( myLegendPos != dlg->getLegendPos() ) {
       setLegendPos( dlg->getLegendPos() );
     }
+       if ( myLegendFont != dlg->getLegendFont() ) {
+      setLegendFont( dlg->getLegendFont() );
+    }
+       if ( myLegendColor != dlg->getLegendColor() ) {
+      setLegendFontColor( dlg->getLegendColor() );
+    }
+
     // marker size
     if ( myMarkerSize != dlg->getMarkerSize() ) {
       setMarkerSize( dlg->getMarkerSize(), false );
@@ -966,6 +1802,27 @@ void Plot2d_ViewFrame::onSettings()
     if ( myYMode != dlg->getYScaleMode() ) {
       setVerScaleMode( dlg->getYScaleMode() );
     }
+    if ( myNormLMin != dlg->getLMinNormMode() ) {
+      setNormLMinMode( dlg->getLMinNormMode() );
+    }
+    if ( myNormLMax != dlg->getLMaxNormMode() ) {
+      setNormLMaxMode( dlg->getLMaxNormMode() );
+    }
+    if ( myNormRMin != dlg->getRMinNormMode() ) {
+      setNormRMinMode( dlg->getRMinNormMode() );
+    }
+    if ( myNormRMax != dlg->getRMaxNormMode() ) {
+      setNormRMaxMode( dlg->getRMaxNormMode() );
+    }
+
+    myPlot->setProperty(PLOT2D_DEVIATION_COLOR, 
+                        dlg->getDeviationMarkerCl());
+    myPlot->setProperty(PLOT2D_DEVIATION_LW, 
+                        dlg->getDeviationMarkerLw());
+    myPlot->setProperty(PLOT2D_DEVIATION_TS, 
+                         dlg->getDeviationMarkerTs());
+
+
     // update view
     myPlot->replot();
     // update preferences
@@ -975,6 +1832,116 @@ void Plot2d_ViewFrame::onSettings()
   delete dlg;
 }
 
+/*!
+  "Analytical Curves" toolbar action slot
+*/
+void Plot2d_ViewFrame::onAnalyticalCurve()
+{
+#ifndef DISABLE_PYCONSOLE
+  Plot2d_AnalyticalCurveDlg dlg( this, this );
+  dlg.exec();
+  updateAnalyticalCurves();
+#endif
+}
+
+void Plot2d_ViewFrame::addAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
+{
+#ifndef DISABLE_PYCONSOLE
+       myAnalyticalCurves.append(theCurve);
+#endif
+}
+
+void Plot2d_ViewFrame::removeAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
+{
+#ifndef DISABLE_PYCONSOLE
+       theCurve->setAction(Plot2d_AnalyticalCurve::ActRemoveFromView);
+#endif
+}
+
+/*
+  Update Analytical curve
+*/
+void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool updateView)
+{
+#ifndef DISABLE_PYCONSOLE
+  if(!c) return;
+  QwtScaleDiv* div = myPlot->axisScaleDiv(QwtPlot::xBottom);
+  c->setRangeBegin(div->lowerBound());
+  c->setRangeEnd(div->upperBound());
+  c->calculate();
+  c->setMarkerSize(myMarkerSize);
+  QwtPlotItem* item = c->plotItem();
+  
+  switch( c->getAction() ) {
+  case Plot2d_AnalyticalCurve::ActAddInView:
+    if( c->isActive() ) {
+      c->updatePlotItem();
+      item->attach( myPlot );
+      item->show();
+    }
+    c->setAction(Plot2d_AnalyticalCurve::ActNothing);
+    break;
+    
+  case Plot2d_AnalyticalCurve::ActUpdateInView:
+    if(c->isActive()) {
+      c->updatePlotItem();
+      item->show();
+    } else {      
+      item->hide();
+      item->detach();
+    }
+    
+    c->setAction(Plot2d_AnalyticalCurve::ActNothing);
+    break;    
+  case Plot2d_AnalyticalCurve::ActRemoveFromView:
+    item->hide();
+    item->detach();
+    myAnalyticalCurves.removeAll(c);
+    delete c;
+    break;
+  }
+
+  if(updateView)
+    myPlot->replot();
+#endif
+}
+
+/*
+  Update Analytical curves
+*/
+void Plot2d_ViewFrame::updateAnalyticalCurves()
+{
+#ifndef DISABLE_PYCONSOLE
+  AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+  for( ; it != myAnalyticalCurves.end(); it++) {
+    updateAnalyticalCurve(*it);
+  }
+  myPlot->replot();
+#endif
+}
+
+/*!
+  Return list of the alalytical curves.
+*/
+AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const
+{
+  return myAnalyticalCurves;
+}
+
+/*!
+  Get analytical curve by plot item.
+*/
+Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) {
+#ifndef DISABLE_PYCONSOLE
+  AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+  for( ; it != myAnalyticalCurves.end(); it++) {
+    if((*it)->plotItem() == theItem);
+               return (*it);
+  }
+  return 0;
+#endif
+}
+
 /*!
   "Fit Data" command slot
 */
@@ -990,6 +1957,7 @@ void Plot2d_ViewFrame::onFitData()
     fitData(mode,xMin,xMax,yMin,yMax,y2Min,y2Max);
   }
   delete dlg;
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -997,7 +1965,7 @@ void Plot2d_ViewFrame::onFitData()
 */
 void Plot2d_ViewFrame::onChangeBackground()
 {
-  QColor selColor = QColorDialog::getColor ( backgroundColor(), this );        
+  QColor selColor = QColorDialog::getColor ( backgroundColor(), this ); 
   if ( selColor.isValid() ) {
     setBackgroundColor( selColor );
   }
@@ -1009,8 +1977,9 @@ void Plot2d_ViewFrame::onChangeBackground()
 void Plot2d_ViewFrame::setCurveType( int curveType, bool update )
 {
   myCurveType = curveType;
-  CurveDict::iterator it = myPlot->getCurves().begin();
-  for ( ; it != myPlot->getCurves().end(); it++ ) {
+  CurveDict aCurves = getCurves();
+  CurveDict::iterator it = aCurves.begin();
+  for ( ; it != aCurves.end(); it++ ) {
     QwtPlotCurve* crv = it.key();
     if ( crv )
       setCurveType( crv, myCurveType );
@@ -1020,15 +1989,33 @@ void Plot2d_ViewFrame::setCurveType( int curveType, bool update )
   emit vpCurveChanged();
 }
 
+/*!
+  Gets curve type
+*/
+int Plot2d_ViewFrame::getCurveType() const
+{
+  return myCurveType;
+}
+
 /*!
   Sets curve title
   \param curveKey - curve id
   \param title - new title
 */
 void Plot2d_ViewFrame::setCurveTitle( Plot2d_Curve* curve, const QString& title ) 
+{
+  setObjectTitle( curve, title );
+}
+
+/*!
+  Sets object title
+  \param object - object id
+  \param title - new title
+*/
+void Plot2d_ViewFrame::setObjectTitle( Plot2d_Object* object, const QString& title ) 
 { 
-  if ( curve && hasPlotCurve( curve ) )
-    getPlotCurve( curve )->setTitle( title );
+  if ( object && hasPlotObject( object ) )
+    getPlotObject( object )->setTitle( title );
 }   
 
 /*!
@@ -1041,11 +2028,13 @@ void Plot2d_ViewFrame::showLegend( bool show, bool update )
     QwtLegend* legend = myPlot->legend();
     if ( !legend ) {
       legend = new QwtLegend( myPlot );
-      legend->setFrameStyle( QFrame::Box | QFrame::Sunken );
+      legend->setFrameStyle( QFrame::Box | QFrame::Sunken );      
     }
     legend->setItemMode( QwtLegend::ClickableItem );
     myPlot->insertLegend( legend );
     setLegendPos( myLegendPos );
+    setLegendFont( myLegendFont );
+    setLegendFontColor( myLegendColor );  
   }
   else
     myPlot->insertLegend( 0 );
@@ -1060,19 +2049,71 @@ void Plot2d_ViewFrame::setLegendPos( int pos )
 {
   myLegendPos = pos;
   QwtLegend* legend = myPlot->legend();
-  switch( pos ) {
-  case 0:
-    myPlot->insertLegend( legend, QwtPlot::LeftLegend );
-    break;
-  case 1:
-    myPlot->insertLegend( legend, QwtPlot::RightLegend );
-    break;
-  case 2:
-    myPlot->insertLegend( legend, QwtPlot::TopLegend );
-    break;
-  case 3:
-    myPlot->insertLegend( legend, QwtPlot::BottomLegend );
-    break;
+  if ( legend ) {
+    switch( pos ) {
+    case 0:
+      myPlot->insertLegend( legend, QwtPlot::LeftLegend );
+      break;
+    case 1:
+      myPlot->insertLegend( legend, QwtPlot::RightLegend );
+      break;
+    case 2:
+      myPlot->insertLegend( legend, QwtPlot::TopLegend );
+      break;
+    case 3:
+      myPlot->insertLegend( legend, QwtPlot::BottomLegend );
+      break;
+    }
+  }
+}
+
+/*!
+  Gets legend position : 0 - left, 1 - right, 2 - top, 3 - bottom
+*/
+int Plot2d_ViewFrame::getLegendPos() const
+{
+  return myLegendPos;
+}
+
+/*!
+  Sets legend font
+*/
+void Plot2d_ViewFrame::setLegendFont( const QFont& fnt )
+{
+  myLegendFont = fnt;
+  QwtLegend* legend = myPlot->legend();
+  if ( legend ) {
+    legend->setFont(fnt);
+  }
+}
+
+/*!
+  Gets legend font
+*/
+QFont Plot2d_ViewFrame::getLegendFont() const
+{
+  return myLegendFont;
+}
+
+/*!
+  Gets legend font color
+*/
+QColor Plot2d_ViewFrame::getLegendFontColor() const
+{
+  return myLegendColor;
+}
+
+/*!
+  Sets legend font color
+*/
+void Plot2d_ViewFrame::setLegendFontColor( const QColor& col )
+{
+  myLegendColor = col;
+  QwtLegend* legend = myPlot->legend();
+  if ( legend ) {
+    QPalette pal = legend->palette();
+    pal.setColor( QPalette::Text, col );
+    legend->setPalette( pal );
   }
 }
 
@@ -1084,14 +2125,17 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update )
   if ( myMarkerSize != size )
   {
     myMarkerSize = size;
-    CurveDict::iterator it = myPlot->getCurves().begin();
-    for ( ; it != myPlot->getCurves().end(); it++ ) {
+    CurveDict aCurves = getCurves();
+    CurveDict::iterator it = aCurves.begin();
+    for ( ; it != aCurves.end(); it++ ) {
       QwtPlotCurve* crv = it.key();
       if ( crv )
       {
         QwtSymbol aSymbol = crv->symbol();
         aSymbol.setSize( myMarkerSize, myMarkerSize );
         crv->setSymbol( aSymbol );
+       if(it.value())
+         it.value()->setMarkerSize( myMarkerSize );
       }
     }
     if ( update )
@@ -1099,6 +2143,14 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update )
   }
 }
 
+/*!
+  Gets new marker size
+*/
+int Plot2d_ViewFrame::getMarkerSize() const
+{
+  return myMarkerSize;
+}
+
 /*!
   Sets background color
 */
@@ -1114,6 +2166,7 @@ void Plot2d_ViewFrame::setBackgroundColor( const QColor& color )
       aPal.setColor( QPalette::Background, myBackground );
     }
     myPlot->getLegend()->setPalette( aPal );
+    updateLegend();
   }
   Repaint();
 }
@@ -1231,6 +2284,8 @@ void Plot2d_ViewFrame::setTitle( bool enabled, const QString& title,
       myY2Title = title;
       myPlot->setAxisTitle( QwtPlot::yRight, myY2TitleEnabled ? myY2Title : QString() );
       break;
+    default:
+      break;
   }
   if ( update )
     myPlot->replot();
@@ -1250,6 +2305,8 @@ QString Plot2d_ViewFrame::getTitle( ObjectType type ) const
       title = myYTitle;  break;
     case Y2Title:
       title = myY2Title; break;
+    default:
+      break;
   }
   return title;
 }
@@ -1278,6 +2335,7 @@ void Plot2d_ViewFrame::setFont( const QFont& font, ObjectType type, bool update)
   if ( update )
     myPlot->replot();
 }
+
 /*!
   Sets scale mode for horizontal axis: 0 - linear, 1 - logarithmic
 */
@@ -1302,6 +2360,15 @@ void Plot2d_ViewFrame::setHorScaleMode( const int mode, bool update )
     fitAll();
   emit vpModeHorChanged();
 }
+
+/*!
+  Gets scale mode for horizontal axis: 0 - linear, 1 - logarithmic
+*/
+int Plot2d_ViewFrame::getHorScaleMode() const
+{
+  return myXMode;
+}
+
 /*!
   Sets scale mode for vertical axis: 0 - linear, 1 - logarithmic
 */
@@ -1328,6 +2395,106 @@ void Plot2d_ViewFrame::setVerScaleMode( const int mode, bool update )
   emit vpModeVerChanged();
 }
 
+/*!
+  Gets scale mode for vertical axis: 0 - linear, 1 - logarithmic
+*/
+int Plot2d_ViewFrame::getVerScaleMode() const
+{
+  return myYMode;
+}
+
+/*!
+  Sets normalization mode to the global maximum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMaxMode( bool mode, bool update )
+{
+  if ( myNormLMax == mode )
+    return;
+
+  myNormLMax = mode;
+  processFiltering(true);
+  if ( update )
+    fitAll();
+  emit vpNormLModeChanged();
+}
+
+/*!
+  Gets normalization mode to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMaxMode() const
+{
+  return myNormLMax;
+}
+
+/*!
+  Sets normalization mode to the global minimum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMinMode( bool mode, bool update )
+{
+  if ( myNormLMin == mode )
+    return;
+
+  myNormLMin = mode;
+  processFiltering(true);
+  if ( update )
+    fitAll();
+  emit vpNormLModeChanged();
+}
+
+/*!
+  Gets normalization mode to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMinMode() const
+{
+  return myNormLMax;
+}
+
+/*!
+  Sets normalization mode to the global maximum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMaxMode( bool mode, bool update )
+{
+  if ( myNormRMax == mode )
+    return;
+
+  myNormRMax = mode;
+  processFiltering(true);
+  if ( update )
+    fitAll();
+  emit vpNormRModeChanged();
+}
+
+/*!
+  Gets normalization mode to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMaxMode() const
+{
+  return myNormRMax;
+}
+
+/*!
+  Sets normalization mode to the global minimum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMinMode( bool mode, bool update )
+{
+  if ( myNormRMin == mode )
+    return;
+
+  myNormRMin = mode;
+  processFiltering(true);
+  if ( update )
+    fitAll();
+  emit vpNormRModeChanged();
+}
+
+/*!
+  Gets normalization mode to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMinMode() const
+{
+  return myNormRMax;
+}
+
 /*!
   Return, scale mode for horizontal axis
 */
@@ -1343,6 +2510,47 @@ bool Plot2d_ViewFrame::isModeVerLinear()
 {
   return (myYMode == 0 ? true : false);
 }
+
+/*!
+  Return \c True if curves are normalize to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMaxMode()
+{
+  return (myNormLMax ? true : false);
+}
+
+/*!
+  Return \c True if curves are normalize to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMinMode()
+{
+  return (myNormLMin ? true : false);
+}
+
+/*!
+  Return \c True if curves are normalize to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMaxMode()
+{
+  return (myNormRMax ? true : false);
+}
+
+/*!
+  Return \c True if curves are normalize to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMinMode()
+{
+  return (myNormRMin ? true : false);
+}
+
+/*!
+  Return \c True if legend is shown
+*/
+bool Plot2d_ViewFrame::isLegendShow() const
+{
+  return myShowLegend;
+}
+
 /*!
   Slot, called when user presses mouse button
 */
@@ -1418,6 +2626,9 @@ void Plot2d_ViewFrame::plotMouseReleased( const QMouseEvent& me )
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
                               me.pos(), me.globalPos() );
     emit contextMenuRequested( &aEvent );
+  } 
+  else {
+    updateAnalyticalCurves();
   }
   myPlot->canvas()->setCursor( QCursor( Qt::CrossCursor ) );
   myPlot->defaultPicker();
@@ -1438,36 +2649,57 @@ void Plot2d_ViewFrame::wheelEvent(QWheelEvent* event)
   QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
   QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
 
-  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2()*aScale );
-  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2()*aScale );
+  if ( ((yMap.s2() - yMap.s1()) < 10e-13 || (xMap.s2() - xMap.s1()) < 10e-13 ) && aScale < 1 )
+    return;
+
+  myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s1() + aScale*(yMap.s2() - yMap.s1()) );
+  myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s1() + aScale*(xMap.s2() - xMap.s1()) );
   if (mySecondY) {
     QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
-    myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s2()*aScale );
+    if ( ((y2Map.s2() - y2Map.s1()) < 10e-13  ) && aScale < 1 ) return;
+    myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s1() + aScale*(y2Map.s2() - y2Map.s1()) );
   }
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
   myPnt = event->pos();
+  updateAnalyticalCurves();
 }
 
 /*!
   Returns qwt plot curve if it is existed in map of curves and 0 otherwise
 */
-QwtPlotCurve* Plot2d_ViewFrame::getPlotCurve( Plot2d_Curve* curve )
+QwtPlotCurve* Plot2d_ViewFrame::getPlotCurve( Plot2d_Curve* curve ) const
 {
-  CurveDict::iterator it = myPlot->getCurves().begin();
-  for ( ; it != myPlot->getCurves().end(); it++ ) {
-    if ( it.value() == curve )
-      return it.key();
+  return dynamic_cast<QwtPlotCurve*>( getPlotObject( curve ) );
+}
+/*!
+  Returns true if qwt plot curve is existed in map of curves and false otherwise
+*/
+bool Plot2d_ViewFrame::hasPlotCurve( Plot2d_Curve* curve ) const
+{
+  return hasPlotObject( curve );
+}
+
+/*!
+  Returns qwt plot curve if it is existed in map of curves and 0 otherwise
+*/
+QwtPlotItem* Plot2d_ViewFrame::getPlotObject( Plot2d_Object* object ) const
+{
+  ObjectDict::const_iterator it = myObjects.begin();
+  for ( ; it != myObjects.end(); it++ ) {
+    if ( it.value() == object )
+      return it.key();
   }
   return 0;
 }
 /*!
   Returns true if qwt plot curve is existed in map of curves and false otherwise
 */
-bool Plot2d_ViewFrame::hasPlotCurve( Plot2d_Curve* curve )
+bool Plot2d_ViewFrame::hasPlotObject( Plot2d_Object* object ) const
 {
-  CurveDict::iterator it = myPlot->getCurves().begin();
-  for ( ; it != myPlot->getCurves().end(); it++ ) {
-    if ( it.value() == curve )
+  ObjectDict::const_iterator it = myObjects.begin();
+  for ( ; it != myObjects.end(); it++ ) {
+    if ( it.value() == object )
       return true;
   }
   return false;
@@ -1563,8 +2795,8 @@ void Plot2d_ViewFrame::onViewGlobalPan()
 bool Plot2d_ViewFrame::isXLogEnabled() const
 {
   bool allPositive = true;
-  CurveDict::const_iterator it = myPlot->getCurves().begin();
-  for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+  ObjectDict::const_iterator it = myObjects.begin();
+  for ( ; allPositive && it != myObjects.end(); it++ )
     allPositive = ( it.value()->getMinX() > 0. );
   return allPositive;
 }
@@ -1575,12 +2807,24 @@ bool Plot2d_ViewFrame::isXLogEnabled() const
 bool Plot2d_ViewFrame::isYLogEnabled() const
 {
   bool allPositive = true;
-  CurveDict::const_iterator it = myPlot->getCurves().begin();
-  for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+  ObjectDict::const_iterator it = myObjects.begin();
+  for ( ; allPositive && it != myObjects.end(); it++ )
     allPositive = ( it.value()->getMinY() > 0. );
   return allPositive;
 }
 
+/**
+ *
+ */
+void Plot2d_ViewFrame::setEnableAxis( QwtPlot::Axis theAxis, bool isEnable )
+{
+  if ( myPlot->axisEnabled( theAxis ) == isEnable )
+    return;
+  myPlot->enableAxis( theAxis, isEnable );
+  if ( theAxis == QwtPlot::yRight )
+    mySecondY = isEnable;
+}
+
 class Plot2d_QwtPlotZoomer : public QwtPlotZoomer
 {
 public:
@@ -1601,6 +2845,11 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent )
   : QwtPlot( parent ),
     myIsPolished( false )
 {
+  // Create alternative scales
+  setAxisScaleDraw( QwtPlot::yLeft,   new Plot2d_ScaleDraw() );
+  setAxisScaleDraw( QwtPlot::xBottom, new Plot2d_ScaleDraw() );
+  setAxisScaleDraw( QwtPlot::yRight,  new Plot2d_ScaleDraw() );
+
   myPlotZoomer = new Plot2d_QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, canvas() );
   myPlotZoomer->setSelectionFlags( QwtPicker::DragSelection | QwtPicker::CornerToCorner );
   myPlotZoomer->setTrackerMode( QwtPicker::AlwaysOff );
@@ -1613,7 +2862,8 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent )
   setAxisAutoScale( QwtPlot::yLeft );
   setAxisAutoScale( QwtPlot::yRight );
   setAxisAutoScale( QwtPlot::xBottom );
-
+  
+  myScaleDraw = NULL;
 // grid
   myGrid = new QwtPlotGrid();
   QPen aMajPen = myGrid->majPen();
@@ -1631,6 +2881,13 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent )
   canvas()->setMouseTracking( true );
 
   myPlotZoomer->setEnabled( true );
+  myPlotZoomer->setZoomBase();
+
+  setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
+}
+
+Plot2d_Plot2d::~Plot2d_Plot2d()
+{
 }
 
 /*!
@@ -1649,116 +2906,40 @@ void Plot2d_Plot2d::setLogScale( int axisId, bool log10 )
 */
 void Plot2d_Plot2d::replot()
 {
-  updateLayout();  // to fix bug(?) of Qwt - view is not updated when title is changed
-  QwtPlot::replot(); 
-}
-
-/*!
-  Checks if two colors are close to each other [ static ]
-  uses COLOR_DISTANCE variable as max tolerance for comparing of colors
-*/
-const long COLOR_DISTANCE = 100;
-const int  MAX_ATTEMPTS   = 10;
-static bool closeColors( const QColor& color1, const QColor& color2 )
-{
-  long tol = abs( color2.red()   - color1.red() ) + 
-             abs( color2.green() - color1.green() ) +
-       abs( color2.blue()  - color1.blue() );
-
-  return ( tol <= COLOR_DISTANCE );
-}
-/*!
-  Gets new unique marker for item if possible
-*/
-void Plot2d_Plot2d::getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine ) 
-{
-  bool bOk = false;
-  int cnt = 1;
-  while ( !bOk ) {
-    int aRed    = (int)( 256.0 * rand() / RAND_MAX);    // generate random color
-    int aGreen  = (int)( 256.0 * rand() / RAND_MAX);    // ...
-    int aBlue   = (int)( 256.0 * rand() / RAND_MAX);    // ...
-    int aMarker = (int)( 9.0 * rand() / RAND_MAX) + 1;  // 9 markers types ( not including empty )
-    int aLine   = (int)( 5.0 * rand() / RAND_MAX) + 1;  // 5 line types ( not including empty )
-
-    typeMarker = ( QwtSymbol::Style )aMarker;
-    color      = QColor( aRed, aGreen, aBlue );
-    typeLine   = ( Qt::PenStyle )aLine;
-
-    cnt++;
-    if ( cnt == MAX_ATTEMPTS )
-      bOk = true;
-    else
-      bOk = !existMarker( typeMarker, color, typeLine );
-  }
-/*
-  static int aMarker = -1;
-  static int aColor  = -1;
-  static int aLine   = -1;
-
-  if ( myColors.isEmpty() ) {
-    // creating colors list
-    myColors.append( Qt::white );
-    myColors.append( Qt::blue );
-    myColors.append( Qt::gray );
-    myColors.append( Qt::darkGreen );
-    myColors.append( Qt::magenta );
-    myColors.append( Qt::darkGray );
-    myColors.append( Qt::red );
-    myColors.append( Qt::darkBlue );
-    myColors.append( Qt::darkYellow );
-    myColors.append( Qt::cyan );
-    myColors.append( Qt::darkRed );
-    myColors.append( Qt::darkCyan );
-    myColors.append( Qt::yellow );
-    myColors.append( Qt::darkMagenta );
-    myColors.append( Qt::green );
-    myColors.append( Qt::black );
-  }
-
-  int nbMarkers = 11;                   // QwtSymbol supports 11 marker types
-  int nbLines   = 6;                    // Qt supports 6 line types
-  int nbColors  = myColors.count();     // number of default colors supported
-
-  aMarker = ( aMarker + 1 ) % nbMarkers;  
-  if ( aMarker == QwtSymbol::None || aMarker == QwtSymbol::Triangle ) aMarker++;
-  aColor  = ( aColor  + 1 ) % nbColors;
-  aLine   = ( aLine   + 1 ) % nbLines;    
-  if ( aLine == Qt::NoPen ) aLine++;             
-
-  typeMarker = ( QwtSymbol::Style )aMarker;
-  color      = myColors[ aColor ];
-  typeLine   = ( Qt::PenStyle )aLine;
-  if ( !existMarker( typeMarker, color, typeLine ) )
-    return;
-
-  int i, j, k;
-  for ( i = 0; i < nbMarkers; i++ ) {
-    aMarker = ( aMarker + 1 ) % nbMarkers;
-    if ( aMarker == QwtSymbol::None || aMarker == QwtSymbol::Triangle ) aMarker++;
-    for ( j = 0; j < nbColors; j++ ) {
-      aColor  = ( aColor  + 1 ) % nbColors;
-      for ( k = 0; k < nbLines; k++ ) {
-        aLine = ( aLine + 1 ) % nbLines;
-  if ( aLine == Qt::NoPen ) aLine++;             
-        if ( !existMarker( ( QwtSymbol::Style )aMarker, aColor, ( Qt::PenStyle )aLine ) ) {
-          typeMarker = ( QwtSymbol::Style )aMarker;
-          color      = myColors[ aColor ];
-          typeLine   = ( Qt::PenStyle )aLine;
-          return;
-        }
-      }
+  // the following code is intended to enable only axes
+  // that are really used by displayed objects
+  bool enableXBottom = false, enableXTop   = false;
+  bool enableYLeft   = false, enableYRight = false;
+  const QwtPlotItemList& items = itemList();
+  QwtPlotItemIterator it;
+  for ( it = items.begin(); it != items.end(); it++ ) {
+    QwtPlotItem* item = *it;
+    if ( item ) {
+      enableXBottom |= item->xAxis() == QwtPlot::xBottom;
+      enableXTop    |= item->xAxis() == QwtPlot::xTop;
+      enableYLeft   |= item->yAxis() == QwtPlot::yLeft;
+      enableYRight  |= item->yAxis() == QwtPlot::yRight;
     }
   }
-*/
+  enableAxis( QwtPlot::xBottom, enableXBottom );
+  enableAxis( QwtPlot::xTop,    enableXTop );
+  enableAxis( QwtPlot::yLeft,   enableYLeft );
+  enableAxis( QwtPlot::yRight,  enableYRight );
+
+  updateLayout();  // to fix bug(?) of Qwt - view is not updated when title is changed
+  QwtPlot::replot(); 
 }
 
 /*!
-  \return the default layout behavior of the widget
+  Get legend
 */
-QSizePolicy Plot2d_Plot2d::sizePolicy() const
+QwtLegend* Plot2d_Plot2d::getLegend()
 {
-  return QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+#if QWT_VERSION < 0x040200
+  return d_legend;
+#else  
+  return legend(); /* mpv: porting to the Qwt 4.2.0 */
+#endif
 }
 
 /*!
@@ -1793,45 +2974,58 @@ void Plot2d_Plot2d::setPickerMousePattern( int button, int state )
 }
 
 /*!
-  return closest curve if it exist, else 0
-*/
-Plot2d_Curve* Plot2d_Plot2d::getClosestCurve( QPoint p, double& distance, int& index )
+ * Set the point picker associated with a graphic view
+ */
+void Plot2d_Plot2d::setPicker( Plot2d_QwtPlotPicker *picker)
 {
-  CurveDict::iterator it = getCurves().begin();
-  QwtPlotCurve* aCurve;
-  for ( ; it != getCurves().end(); it++ ) {
-    aCurve = it.key();
-    if ( !aCurve )
-      continue;
-    index = aCurve->closestPoint( p, &distance );
-    if ( index > -1 )
-      return it.value();
-  }
-  return 0;
+  myPicker = picker;
 }
 
 /*!
-  Checks if marker belongs to any enitity
-*/
-bool Plot2d_Plot2d::existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine ) 
+ * Create marker and tooltip associed with a point
+ */
+QwtPlotMarker* Plot2d_Plot2d::createMarkerAndTooltip( QwtSymbol symbol,
+                                            double    X,
+                                            double    Y,
+                                            QString & tooltip,
+                                            Plot2d_QwtPlotPicker *picker)
 {
-  QColor aColor = palette().color( QPalette::Background );
-  if ( closeColors( color, aColor ) )
-      return true;
+  QwtPlotMarker* aPlotMarker = new QwtPlotMarker();
 
-  CurveDict::iterator it = myCurves.begin();
-  for ( ; it != myCurves.end(); it++ ) {
-    QwtPlotCurve* crv = it.key();
-    if ( crv ) {
-      QwtSymbol::Style aStyle = crv->symbol().style();
-      QColor           aColor = crv->pen().color();
-      Qt::PenStyle     aLine  = crv->pen().style();
-//      if ( aStyle == typeMarker && aColor == color && aLine == typeLine )
-      if ( aStyle == typeMarker && closeColors( aColor,color ) && aLine == typeLine )
-        return true;
-    }
-  }
-  return false;
+  aPlotMarker->setSymbol( symbol );  // symbol must have a color
+  aPlotMarker->setLabelAlignment( Qt::AlignTop);
+  aPlotMarker->setXValue(X);
+  aPlotMarker->setYValue(Y);
+  //
+  aPlotMarker->attach(this);
+                       
+  // Associate a tooltip with the point's marker
+  // PB: how to obtain a tooltip with a rectangular frame ?
+  //QwtText tooltip ("X=" + QString::number(X) + " Y=" + QString::number(Y) );
+
+  QwtText text (tooltip);
+  //QColor tooltipColor( 245, 222, 179);            // Wheat  -RGB (0 a 255)
+  QColor tooltipColor( 253, 245, 230);            // OldLace
+  text.setBackgroundBrush( QBrush(tooltipColor)); //, Qt::SolidPattern));
+  //
+  picker->pMarkers.append( aPlotMarker); 
+  picker->pMarkersToolTip[ aPlotMarker] = text;
+  return aPlotMarker;
+}
+
+bool Plot2d_Plot2d::polished() const
+{
+  return myIsPolished;
+}
+
+QwtPlotGrid* Plot2d_Plot2d::grid() const
+{
+  return myGrid;
+};
+
+QwtPlotZoomer* Plot2d_Plot2d::zoomer() const
+{
+  return myPlotZoomer;
 }
 
 /*!
@@ -1855,7 +3049,7 @@ void Plot2d_Plot2d::onScaleDivChanged()
     default:
       break;
     }
-      
+
     if ( axisId >= 0 ) {
       QwtScaleMap map = canvasMap(axisId);
       double aDist = fabs(map.s2()-map.s1()) / (axisMaxMajor(axisId)*axisMaxMinor(axisId));
@@ -1866,12 +3060,40 @@ void Plot2d_Plot2d::onScaleDivChanged()
 
       QwtScaleDraw* aQwtSD = axisScaleDraw(axisId);
       Plot2d_ScaleDraw* aPlot2dSD = dynamic_cast<Plot2d_ScaleDraw*>(aQwtSD);
-      if ( !aPlot2dSD && aPrecision > 6 || aPlot2dSD && aPlot2dSD->precision() != aPrecision )
-       setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) );
+      if ( ( !aPlot2dSD && aPrecision > 6 ) || ( aPlot2dSD && aPlot2dSD->precision() != aPrecision ) )
+        setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) );
     }
   }
 }
 
+/*!
+  Updates identifiers of Y axis type in the legend.
+*/
+void Plot2d_Plot2d::updateYAxisIdentifiers()
+{
+  bool enableYLeft = false, enableYRight = false;
+  const QwtPlotItemList& items = itemList();
+  QwtPlotItemIterator it;
+  for ( it = items.begin(); it != items.end(); it++ ) {
+    QwtPlotItem* item = *it;
+    if ( item ) {
+      enableYLeft  |= item->yAxis() == QwtPlot::yLeft;
+      enableYRight |= item->yAxis() == QwtPlot::yRight;
+    }
+  }
+
+  // if several curves are attached to different axes
+  // display corresponding identifiers in the legend,
+  // otherwise hide them
+  for ( it = items.begin(); it != items.end(); it++ ) {
+    QwtPlotItem* item = *it;
+    if ( Plot2d_QwtPlotCurve* aPCurve = dynamic_cast<Plot2d_QwtPlotCurve*>( item ) )
+      aPCurve->setYAxisIdentifierEnabled( enableYLeft && enableYRight );
+    if ( item && item->isVisible() && legend() )
+      item->updateLegend( legend() );
+  }
+}
+
 /*!
   Sets the flag saying that QwtPlot geometry has been fully defined.
 */
@@ -1881,6 +3103,209 @@ void Plot2d_Plot2d::polish()
   myIsPolished = true;
 }
 
+// Methods to manage axis graduations
+
+/* Create definition and graduations of axes
+ */
+void Plot2d_Plot2d::createAxisScaleDraw()
+{
+  myScaleDraw = new Plot2d_AxisScaleDraw( this);
+}
+
+
+/* Stock X axis's ticks in the drawing zone
+*/
+void Plot2d_Plot2d::applyTicks()
+{
+  myScaleDraw->applyTicks();
+}
+
+
+/* Unactivate automatic ticks drawing (call to method Plot2d_AxisScaleDraw::draw() )
+ * Parameters :
+ * - number call to ticks drawing (for information) : numcall
+ */
+void Plot2d_Plot2d::unactivAxisScaleDraw( int numcall)
+{
+  // Memorize X axis (myScaleDraw already exists) in the drawing zone
+  //setAxisScaleDraw( QwtPlot::xBottom, myScaleDraw);  // heritage of QwtPlot
+
+  myScaleDraw->unactivTicksDrawing( numcall);
+}
+
+
+/* Draw ticks and labels on X axis of the drawing zone
+ * Draw systems' names under the X axis of the drawing zone
+ * Draw vertical segments between X axis's intervals of the systems
+ * Parameters :
+ * - left and right margins for ticks : XLeftMargin, XRightMargin
+ * - for each named system :
+ *     positions and labels for ticks on X axis : devicesPosLabelTicks
+ *
+ * The true drawings will be realized by the method Plot2d_AxisScaleDraw::draw()
+ * PB: who call il ?
+ */
+void Plot2d_Plot2d::displayXTicksAndLabels(
+                      double XLeftMargin, double XRightMargin,
+                      const QList< QPair< QString, QMap<double, QString> > > & devicesPosLabelTicks)
+                      //                    name        position  label
+                      //                   system         tick    tick
+{
+  //std::cout << "Plot2d_Plot2d::displayXTicksAndLabels() 1" << std::endl;
+
+  int nbDevices = devicesPosLabelTicks.size();
+  //
+  //std::cout << "  Nombre de systemes = " << nbDevices << std::endl;
+  if (nbDevices == 0)  return;
+
+  // For drawing systems' names, their positions must be in the allTicks list
+  // (cf class Plot2d_AxisScaleDraw)
+
+  // Liste of ticks' positions and systems' names
+  QList<double> allTicks;
+
+  double devXmin, devXmax;  // X interval of a system
+  double gapXmin, gapXmax;  // X interval between two systems
+  double devLabPos;         // Label's position of a system
+  double segmentPos;  // Position of the vertical segment between current system and the next
+
+  // 1)- Search for the system whose X interval is the most to the left
+
+  int ileftDev = 0;
+  double XminMin = 1.e+12;
+
+  if (nbDevices > 1)
+  {
+      for (int idev=0; idev < nbDevices; idev++)
+      {
+          QPair< QString, QMap<double,QString> > paire = devicesPosLabelTicks.at(idev);
+
+          QString deviceLabel = paire.first;
+
+          // Ticks' map of the system
+          QMap<double,QString> devPosLabelTicks = paire.second;
+
+          QList<double> posTicks = devPosLabelTicks.keys();
+
+          // List's items increasing sorting
+          qSort( posTicks.begin(), posTicks.end() );  // iterators
+
+          // X interval for the system
+          devXmin = posTicks.first();
+          devXmax = posTicks.last();
+
+          if (devXmin < XminMin)
+          {
+              XminMin = devXmin;
+              ileftDev = idev;
+          }
+      }
+  }
+
+  // 2)- Ticks, systems' names, verticals segments
+
+  for (int idev=0; idev < nbDevices; idev++)
+  {
+      QPair< QString, QMap<double,QString> > paire = devicesPosLabelTicks.at(idev);
+
+      QString deviceLabel = paire.first;
+
+      std::string std_label = deviceLabel.toStdString();
+      //const char *c_label = std_label.c_str();
+      //std::cout << "  deviceLabel: |" << c_label << "|" << std::endl;
+
+      // Ticks' map of the system
+      QMap<double,QString> devPosLabelTicks = paire.second;
+
+      int nbTicks = devPosLabelTicks.size();
+
+      QList<double> posTicks = devPosLabelTicks.keys();
+
+      // List's items increasing sorting
+      qSort( posTicks.begin(), posTicks.end() );  // iterators
+
+      // X interval for the system
+      devXmin = posTicks.first();
+      devXmax = posTicks.last();
+
+      // Stock ticks' positions and labels on X axis
+      double pos;
+      QString label;
+      //
+      for (int itic=0; itic < nbTicks; itic++)
+      {
+          pos   = posTicks.at(itic);
+          label = devPosLabelTicks[pos];
+
+          myScaleDraw->setLabelTick( pos, label, false);
+
+          std::string std_label = label.toStdString();
+          //const char *c_label = std_label.c_str();
+          //std::cout << "    tick " << itic << " : pos= " << pos << ", label= |" << c_label << "|" << std::endl;
+      }
+      allTicks.append( posTicks);
+
+      // Compute the position of the system's label
+      if (idev == ileftDev)
+      {
+          devLabPos = devXmin + 0.25*(devXmax - devXmin);
+      }
+      else
+      {
+          devLabPos = devXmin + 0.50*(devXmax - devXmin);
+      }
+      allTicks.append( devLabPos);
+
+      // Stock position and name of the system under X axis
+      myScaleDraw->setLabelTick( devLabPos, deviceLabel, true);
+
+      if (idev > 0)
+      {
+          // Create the vertical segment between the current system and the next
+          gapXmax = devXmin;
+          segmentPos = gapXmin + 0.5*(gapXmax - gapXmin);
+
+          createSeparationLine( segmentPos);
+      }
+      gapXmin = devXmax;
+  }
+
+  // List's items increasing sorting
+  qSort( allTicks.begin(), allTicks.end() );  // iterators
+
+  // Stock the interval of X's values
+  double lowerBound = allTicks.first() - XLeftMargin;
+  double upperBound = allTicks.last() + XRightMargin;
+  myScaleDraw->setInterval( lowerBound, upperBound);
+
+  // For each system, stock the position of the X's ticks and those of the name
+  myScaleDraw->setTicks( allTicks);  // do not draw the ticks
+
+  // Memorize the X axis in the drawing zone
+  setAxisScaleDraw( QwtPlot::xBottom, myScaleDraw);  // heritage of QwtPlot
+
+  //std::cout << "Plot2d_Plot2d::displayXTicksAndLabels() 1" << std::endl;
+}
+
+
+/* Create vertical segment between two curves
+ */
+void Plot2d_Plot2d::createSeparationLine( double Xpos)
+{
+  QwtPlotMarker* aPlotMarker = new QwtPlotMarker();
+
+  aPlotMarker->setLineStyle( QwtPlotMarker::VLine);
+  aPlotMarker->setXValue( Xpos);
+  aPlotMarker->setLinePen( QPen(Qt::black));
+  aPlotMarker->attach(this);  // Add to drawing zone
+  // To deallocate in EraseAll()
+  mySeparationLineList.append( aPlotMarker);
+}
+
+void Plot2d_Plot2d::clearSeparationLineList()
+{
+  mySeparationLineList.clear();
+}
 
 /*!
   Creates presentation of object
@@ -1936,57 +3361,76 @@ void Plot2d_ViewFrame::copyPreferences( Plot2d_ViewFrame* vf )
 #define BRACKETIZE(x) QString( "[ " ) + x + QString( " ]" )
 void Plot2d_ViewFrame::updateTitles() 
 {
-  CurveDict::iterator it = myPlot->getCurves().begin();
-  //QIntDictIterator<Plot2d_Curve> it( myCurves );
+  ObjectDict::iterator it = myObjects.begin();
   QStringList aXTitles;
   QStringList aYTitles;
+  QStringList aY2Titles;
   QStringList aXUnits;
   QStringList aYUnits;
+  QStringList aY2Units;
   QStringList aTables;
   int i = 0;
 
-  Plot2d_Curve* aCurve;
-  for ( ; it != myPlot->getCurves().end(); it++ ) {
+  Plot2d_Object* anObject;
+  for ( ; it != myObjects.end(); it++ ) {
     // collect titles and units from all curves...
-    aCurve = it.value();
-    QString xTitle = aCurve->getHorTitle().trimmed();
-    QString yTitle = aCurve->getVerTitle().trimmed();
-    QString xUnits = aCurve->getHorUnits().trimmed();
-    QString yUnits = aCurve->getVerUnits().trimmed();
+    anObject = it.value();
+    QString xTitle = anObject->getHorTitle().trimmed();
+    QString yTitle = anObject->getVerTitle().trimmed();
+    QString xUnits = anObject->getHorUnits().trimmed();
+    QString yUnits = anObject->getVerUnits().trimmed();
     
-    aYTitles.append( yTitle );
+    if ( anObject->getYAxis() == QwtPlot::yLeft ) {
+      if ( !aYTitles.contains( yTitle ) )
+        aYTitles.append( yTitle );
+      if ( !aYUnits.contains( yUnits ) )
+        aYUnits.append( yUnits );
+    }
+    else {
+      if ( !aY2Titles.contains( yTitle ) )
+        aY2Titles.append( yTitle );
+      if ( !aY2Units.contains( yUnits ) )
+        aY2Units.append( yUnits );
+    }
     if ( !aXTitles.contains( xTitle ) )
       aXTitles.append( xTitle );
     if ( !aXUnits.contains( xUnits ) )
       aXUnits.append( xUnits );
-    if ( !aYUnits.contains( yUnits ) )
-      aYUnits.append( yUnits );
 
-    QString aName = aCurve->getTableTitle();
+    QString aName = anObject->getTableTitle();
     if( !aName.isEmpty() && !aTables.contains( aName ) )
       aTables.append( aName );
     ++i;
   }
   // ... and update plot 2d view
-  QString xUnits, yUnits;
+  QString xUnits, yUnits, y2Units;
   if ( aXUnits.count() == 1 && !aXUnits[0].isEmpty() )
     xUnits = BRACKETIZE( aXUnits[0] );
   if ( aYUnits.count() == 1 && !aYUnits[0].isEmpty())
     yUnits = BRACKETIZE( aYUnits[0] );
-  QString xTitle, yTitle;
+  if ( aY2Units.count() == 1 && !aY2Units[0].isEmpty())
+    y2Units = BRACKETIZE( aY2Units[0] );
+  QString xTitle, yTitle, y2Title;
   if ( aXTitles.count() == 1 && aXUnits.count() == 1 )
     xTitle = aXTitles[0];
   if ( aYTitles.count() == 1 )
     yTitle = aYTitles[0];
+  if ( mySecondY && aY2Titles.count() == 1 )
+    y2Title = aY2Titles[0];
 
   if ( !xTitle.isEmpty() && !xUnits.isEmpty() )
     xTitle += " ";
   if ( !yTitle.isEmpty() && !yUnits.isEmpty() )
     yTitle += " ";
+  if ( !y2Title.isEmpty() && !y2Units.isEmpty() )
+    y2Title += " ";
 
   setTitle( myXTitleEnabled, xTitle + xUnits, XTitle, true );
   setTitle( myYTitleEnabled, yTitle + yUnits, YTitle, true );
-  setTitle( true, aTables.join("; "), MainTitle, true );
+  if ( mySecondY )
+    setTitle( myY2TitleEnabled, y2Title + y2Units, Y2Title, true );
+  if( myIsDefTitle ) 
+    setTitle( true, aTables.join("; "), MainTitle, true );
 }
 
 /*!
@@ -2024,17 +3468,74 @@ bool Plot2d_ViewFrame::print( const QString& file, const QString& format ) const
 #endif
 }
 
+/**
+ * Print Plot2d window
+ */
+void Plot2d_ViewFrame::printPlot( QPainter* p, const QRect& rect,
+                                  const QwtPlotPrintFilter& filter ) const
+{
+  myPlot->print( p, rect, filter );
+}
+
 /*!
   \return string with all visual parameters
 */
 QString Plot2d_ViewFrame::getVisualParameters()
 {
+
+  return getXmlVisualParameters();
+
+  /*
+  RNV: Old case, now visual parameters stored in the XML format.
+  //
   double xmin, xmax, ymin, ymax, y2min, y2max;
   getFitRanges( xmin, xmax, ymin, ymax, y2min, y2max );
   QString retStr;
-  retStr.sprintf( "%d*%d*%d*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", myXMode,
-                 myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max );
+  //Store font in the visual parameters string as:
+  //  
+  // ...*FontFamily|FontSize|B|I|U|r:g:b*...
+  
+  retStr.sprintf( "%d*%d*%d*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%s|%i|%i|%i|%i|%i:%i:%i",
+                 myXMode, myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max,
+                 qPrintable(myLegendFont.family()), myLegendFont.pointSize(),myLegendFont.bold(),
+                 myLegendFont.italic(), myLegendFont.underline(),myLegendColor.red(),
+                 myLegendColor.green(), myLegendColor.blue());
+  
+ //store all Analytical curves
+  //store each curve in the following format
+  // ...*Name|isActive|Expresion|NbInervals|isAutoAssign[|MarkerType|LineType|LineWidth|r:g:b]
+  // parameters in the [ ] is optional in case if isAutoAssign == true
+  AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+  Plot2d_AnalyticalCurve* c = 0;
+  bool isAuto; 
+  for( ; it != myAnalyticalCurves.end(); it++) {
+    c = (*it);
+    if(!c) continue;
+    QString curveString("");
+    isAuto = c->isAutoAssign();
+    curveString.sprintf("*%s|%i|%s|%i|%i",
+                       qPrintable(c->getName()),
+                       c->isActive(),
+                       qPrintable(c->getExpression()),
+                       c->getNbIntervals(),
+                       isAuto);
+
+    retStr+=curveString;
+    if(!isAuto) {
+      QString optCurveString("");
+      optCurveString.sprintf("|%i|%i|%i|%i:%i:%i",
+                            (int)c->getMarker(),
+                            (int)c->getLine(),
+                            c->getLineWidth(),
+                            c->getColor().red(),
+                            c->getColor().green(),
+                            c->getColor().blue());
+      retStr+=optCurveString;
+    }
+  }
+  retStr += QString( "*%1" ).arg( Qtx::colorToString( backgroundColor() ) );
   return retStr; 
+  */
 }
 
 /*!
@@ -2042,9 +3543,13 @@ QString Plot2d_ViewFrame::getVisualParameters()
 */
 void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
 {
+  if(setXmlVisualParameters(parameters))
+    return;
+
+  double xmin, xmax;
   QStringList paramsLst = parameters.split( '*' );
-  if ( paramsLst.size() == 9 ) {
-    double xmin, xmax, ymin, ymax, y2min, y2max;
+  if ( paramsLst.size() >= 9 ) {
+    double ymin, ymax, y2min, y2max;
     myXMode = paramsLst[0].toInt();
     myYMode = paramsLst[1].toInt();
     mySecondY = (bool)paramsLst[2].toInt();
@@ -2064,10 +3569,254 @@ void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
       QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
       myYDistance2 = yMap2.s2() - yMap2.s1();
     }
-
+    
     fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
     fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
-  }  
+  }
+
+  //Restore legend font
+  if(paramsLst.size() >= 10) {
+    QStringList fontList = paramsLst[9].split( '|' );
+    if(fontList.size() == 6) {
+      myLegendFont = QFont(fontList[0]);
+      myLegendFont.setPointSize(fontList[1].toInt());
+      myLegendFont.setBold(fontList[2].toInt());
+      myLegendFont.setItalic(fontList[3].toInt());
+      myLegendFont.setUnderline(fontList[4].toInt());
+      QStringList colorList = fontList[5].split(":");
+      setLegendFont( myLegendFont );
+
+      if(colorList.size() == 3) {
+             myLegendColor = QColor(colorList[0].toInt(),
+                                                colorList[1].toInt(),
+                                                colorList[2].toInt());
+             setLegendFontColor( myLegendColor );
+      }
+    }    
+  }
+
+  //Restore all Analytical curves
+  int startCurveIndex = 10;
+  if( paramsLst.size() >= startCurveIndex+1 ) {
+    for( int i=startCurveIndex; i<paramsLst.size() ; i++ ) {
+      QStringList curveLst = paramsLst[i].split("|");
+      if( curveLst.size() == 5 || curveLst.size() == 9 ) {
+       Plot2d_AnalyticalCurve* c = new Plot2d_AnalyticalCurve();
+       c->setName(curveLst[0]);
+       c->setActive(curveLst[1].toInt());
+       c->setExpression(curveLst[2]);
+       c->setNbIntervals(curveLst[3].toLong());
+       c->setAutoAssign(curveLst[4].toInt());
+       if( !c->isAutoAssign() ) {
+         c->setMarker((Plot2d::MarkerType)curveLst[5].toInt());
+         c->setLine((Plot2d::LineType)curveLst[6].toInt());
+         c->setLineWidth(curveLst[7].toInt());
+         QStringList colorList = curveLst[8].split(":");
+         if( colorList.size() == 3 ) {
+           c->setColor(QColor(colorList[0].toInt(),
+                              colorList[1].toInt(),
+                              colorList[2].toInt()));
+         }
+       } else {
+         c->autoFill( myPlot );
+       }
+       addAnalyticalCurve(c);
+       updateAnalyticalCurve(c);
+      }
+      else if( curveLst.size() == 1 ) {
+       // background color can be set here
+       QColor c;
+       if ( Qtx::stringToColor( paramsLst[i], c ) )
+         setBackgroundColor( c );
+      }
+    }
+    myPlot->replot();
+  }
+}
+
+/*!
+  Store visual parameters in xml format.
+*/
+QString Plot2d_ViewFrame::getXmlVisualParameters() {
+  QString retStr;
+  QXmlStreamWriter aWriter(&retStr);
+  aWriter.setAutoFormatting(true);
+
+  //Ranges
+  aWriter.writeStartDocument();
+  aWriter.writeStartElement("ViewState");
+  aWriter.writeStartElement("Range");
+  double xmin, xmax, ymin, ymax, y2min, y2max;
+  getFitRanges( xmin, xmax, ymin, ymax, y2min, y2max );
+  aWriter.writeAttribute("Xmin", QString("").sprintf("%.12e",xmin));
+  aWriter.writeAttribute("Xmax", QString("").sprintf("%.12e",xmax));
+  aWriter.writeAttribute("Ymin", QString("").sprintf("%.12e",ymin));
+  aWriter.writeAttribute("Ymax", QString("").sprintf("%.12e",ymax));
+  aWriter.writeAttribute("Y2min", QString("").sprintf("%.12e",y2min));
+  aWriter.writeAttribute("Y2max", QString("").sprintf("%.12e",y2max));
+  aWriter.writeEndElement();
+
+  //Display mode
+  aWriter.writeStartElement("DisplayMode");
+  aWriter.writeAttribute("SecondAxis", QString("").sprintf("%d",mySecondY));
+  aWriter.writeStartElement("ScaleMode");
+  aWriter.writeAttribute("Xscale", QString("").sprintf("%d",myXMode));
+  aWriter.writeAttribute("Yscale", QString("").sprintf("%d",myYMode));
+  aWriter.writeEndElement();
+  aWriter.writeStartElement("NormalizationMode");
+  aWriter.writeAttribute("LeftMin", QString("").sprintf("%d",myNormLMin));
+  aWriter.writeAttribute("LeftMax", QString("").sprintf("%d",myNormLMax));
+  aWriter.writeAttribute("RightMin", QString("").sprintf("%d",myNormRMin));
+  aWriter.writeAttribute("RightMax", QString("").sprintf("%d",myNormRMax));
+  aWriter.writeEndElement();
+  aWriter.writeEndElement();
+
+  //Legend
+  aWriter.writeStartElement("Legend");
+  aWriter.writeAttribute("Visibility", QString("").sprintf("%d", myShowLegend));
+  aWriter.writeStartElement("LegendFont");
+  aWriter.writeAttribute("Family", myLegendFont.family());
+  aWriter.writeAttribute("Size", QString("").sprintf("%d",myLegendFont.pointSize()));
+  aWriter.writeAttribute("Bold", QString("").sprintf("%d",myLegendFont.bold()));
+  aWriter.writeAttribute("Italic", QString("").sprintf("%d",myLegendFont.italic()));
+  aWriter.writeAttribute("Underline", QString("").sprintf("%d",myLegendFont.underline()));
+  aWriter.writeAttribute("R", QString("").sprintf("%d",myLegendColor.red()));
+  aWriter.writeAttribute("G", QString("").sprintf("%d",myLegendColor.green()));
+  aWriter.writeAttribute("B", QString("").sprintf("%d",myLegendColor.blue()));
+  aWriter.writeEndElement();
+  aWriter.writeEndElement();
+
+  //AnalyticalCurve
+  aWriter.writeStartElement("AnalyticalCurves");  
+  AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+  Plot2d_AnalyticalCurve* c = 0;
+  bool isAuto; 
+  int id = 1;
+  for( ; it != myAnalyticalCurves.end(); it++) {
+    c = (*it);
+    if(!c) continue;
+    aWriter.writeStartElement(QString("AnalyticalCurve_%1").arg(id));
+    isAuto = c->isAutoAssign();
+    aWriter.writeAttribute("Name",c->getName());
+    aWriter.writeAttribute("IsActive", QString("").sprintf("%d",       c->isActive()));
+               aWriter.writeAttribute("Expression", c->getExpression());
+    aWriter.writeAttribute("NbIntervals", QString("").sprintf("%d",    c->getNbIntervals()));
+    aWriter.writeAttribute("isAuto", QString("").sprintf("%d",isAuto));
+    if(!isAuto) {
+      aWriter.writeAttribute("Marker", QString("").sprintf("%d",(int)c->getMarker()));
+      aWriter.writeAttribute("Line", QString("").sprintf("%d",(int)c->getLine()));
+      aWriter.writeAttribute("LineWidth", QString("").sprintf("%d",c->getLineWidth()));
+      aWriter.writeAttribute("R", QString("").sprintf("%d",c->getColor().red()));
+      aWriter.writeAttribute("G", QString("").sprintf("%d",c->getColor().green()));
+      aWriter.writeAttribute("B", QString("").sprintf("%d",c->getColor().blue()));
+    }
+    aWriter.writeEndElement();
+    id++;
+  }
+  aWriter.writeEndElement(); //AnalyticalCurve
+
+  //Background
+  aWriter.writeStartElement(QString("Background").arg(id));
+  aWriter.writeStartElement(QString("BackgroundColor").arg(id));
+  aWriter.writeAttribute("R", QString("").sprintf("%d",backgroundColor().red()));
+  aWriter.writeAttribute("G", QString("").sprintf("%d",backgroundColor().green()));
+  aWriter.writeAttribute("B", QString("").sprintf("%d",backgroundColor().blue()));
+  aWriter.writeEndElement();
+  aWriter.writeEndElement();
+
+
+  aWriter.writeEndDocument();
+  return retStr;
+}
+/*!
+  Restore visual parameters from xml format.
+*/
+bool Plot2d_ViewFrame::setXmlVisualParameters(const QString& parameters) {
+  QXmlStreamReader aReader(parameters);
+  double xmin, xmax, ymin, ymax, y2min, y2max;
+  bool leftMin,leftMax,rightMin,rightMax;
+  leftMin = leftMax = rightMin = rightMax = false;
+  while(!aReader.atEnd()) {
+      aReader.readNext();
+      if (aReader.isStartElement()) {
+      QXmlStreamAttributes aAttr = aReader.attributes();
+        if(aReader.name() == "Range") {
+          xmin = aAttr.value("Xmin").toString().toDouble();
+          xmax = aAttr.value("Xmax").toString().toDouble();
+          ymin = aAttr.value("Ymin").toString().toDouble();
+          ymax = aAttr.value("Ymax").toString().toDouble();
+          y2min = aAttr.value("Y2min").toString().toDouble();
+          y2max = aAttr.value("Y2max").toString().toDouble();
+        } else if(aReader.name() == "DisplayMode") {
+          mySecondY = aAttr.value("Y2max").toString().toDouble();
+        } else if(aReader.name() == "ScaleMode") {
+           myXMode = aAttr.value("Xscale").toString().toInt();
+           myYMode = aAttr.value("Yscale").toString().toInt();
+        } else if(aReader.name() == "NormalizationMode") {
+            leftMin = (bool)aAttr.value("LeftMin").toString().toInt();
+            leftMax = (bool)aAttr.value("LeftMax").toString().toInt();
+            rightMin = (bool)aAttr.value("RightMin").toString().toInt();
+            rightMax = (bool)aAttr.value("RightMax").toString().toInt();
+        } else if(aReader.name() == "Legend") {
+          myShowLegend = (bool)aAttr.value("Visibility").toString().toInt();
+        } else if (aReader.name() == "LegendFont") {
+            myLegendFont = QFont(aAttr.value("Family").toString());
+            myLegendFont.setPointSize(aAttr.value("Size").toString().toInt());
+            myLegendFont.setBold((bool)aAttr.value("Bold").toString().toInt());
+            myLegendFont.setItalic((bool)aAttr.value("Italic").toString().toInt());
+            myLegendFont.setUnderline((bool)aAttr.value("Underline").toString().toInt());
+             myLegendColor = QColor(aAttr.value("R").toString().toInt(),
+                                                    aAttr.value("G").toString().toInt(),
+                                                    aAttr.value("B").toString().toInt());
+                 setLegendFontColor( myLegendColor );
+            setLegendFont(myLegendFont);
+        } else if(aReader.name().toString().indexOf("AnalyticalCurve_") >= 0) {
+            Plot2d_AnalyticalCurve* c = new Plot2d_AnalyticalCurve();
+                 c->setName(aAttr.value("Name").toString());
+                 c->setActive((bool)aAttr.value("IsActive").toString().toInt());
+                 c->setExpression(aAttr.value("Expression").toString());
+                 c->setNbIntervals(aAttr.value("NbIntervals").toString().toLong());
+                 c->setAutoAssign((bool)aAttr.value("isAuto").toString().toInt());
+                 if( !c->isAutoAssign() ) {
+                   c->setMarker((Plot2d::MarkerType)aAttr.value("Marker").toString().toInt());
+                   c->setLine((Plot2d::LineType)aAttr.value("Line").toString().toInt());
+                   c->setLineWidth(aAttr.value("LineWidth").toString().toInt());               
+                   c->setColor(QColor(aAttr.value("R").toString().toInt(),
+                                                  aAttr.value("G").toString().toInt(),
+                                                  aAttr.value("B").toString().toInt()));
+            } else {
+                   c->autoFill( myPlot );
+                 }
+                 addAnalyticalCurve(c);
+                 updateAnalyticalCurve(c);
+        } else if(aReader.name().toString() == "BackgroundColor") {
+          setBackgroundColor(QColor(aAttr.value("R").toString().toInt(),
+                                                     aAttr.value("G").toString().toInt(),
+                                                     aAttr.value("B").toString().toInt()));
+        }
+      }
+  }
+
+  if(aReader.hasError())
+    return false;
+
+  if (mySecondY)
+    setTitle( myY2TitleEnabled, myY2Title, Y2Title, false );
+  setHorScaleMode( myXMode, /*update=*/false );
+  setVerScaleMode( myYMode, /*update=*/false );    
+  if (mySecondY) {
+    QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+    myYDistance2 = yMap2.s2() - yMap2.s1();
+  }    
+  setNormLMinMode(leftMin);
+  setNormLMaxMode(leftMax);
+  setNormRMinMode(rightMin);
+  setNormRMaxMode(rightMax);
+
+  showLegend( myShowLegend, false );
+
+  fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );  
+  return true;
 }
 
 /*!
@@ -2078,16 +3827,16 @@ void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) {
   QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
   
   myPlot->setAxisScale( QwtPlot::yLeft, 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ), 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) );
+                        myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ), 
+                        myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) );
   myPlot->setAxisScale( QwtPlot::xBottom, 
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ),
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) ); 
+                        myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ),
+                        myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) ); 
   if (mySecondY) {
     QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
     myPlot->setAxisScale( QwtPlot::yRight,
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ), 
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) );
+                          myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ), 
+                          myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) );
   }
   myPlot->replot();
 }
@@ -2100,17 +3849,101 @@ void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) {
   QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
   
   myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), 
-                       myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) );
+                        myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) );
   myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), 
-                       myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) );
+                        myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) );
   if (mySecondY) {
     QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
     myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(),
-                         myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) );
+                          myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) );
   }
   myPlot->replot();
 }
 
+/*
+  Update plot item 
+*/
+void Plot2d_ViewFrame::updatePlotItem(Plot2d_Object* theObject, QwtPlotItem* theItem) {
+  theObject->updatePlotItem( theItem );
+  Plot2d_Curve* c = dynamic_cast<Plot2d_Curve*>(theObject);
+  QwtPlotCurve* cu = dynamic_cast<QwtPlotCurve*>(theItem);
+  Plot2d_NormalizeAlgorithm* aNormAlgo;
+  if(c && cu) {
+    if(c->getYAxis() == QwtPlot::yRight)
+      aNormAlgo = myRNormAlgo;
+    else
+      aNormAlgo = myLNormAlgo;
+    if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+      AlgoPlot2dOutputData aResultData =  aNormAlgo->getOutput();
+      AlgoPlot2dOutputData::iterator itTmp = aResultData.find(theObject);
+      double *xNew,*yNew;
+      int size = itTmp.value().size();
+      xNew = new double[size];
+      yNew = new double[size];
+      int j = 0;
+      for (; j < size; ++j) {
+        xNew[j] = itTmp.value().at(j).first;
+        yNew[j] = itTmp.value().at(j).second;
+      }
+      cu->setData(xNew, yNew,j);
+      delete [] xNew;
+      delete [] yNew;
+      if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+        QString name = c->getName().isEmpty() ? c->getVerTitle() : c->getName();
+        name = name + QString("(B=%1, K=%2)");
+        name = name.arg(aNormAlgo->getBkoef(c)).arg(aNormAlgo->getKkoef(c));
+        cu->setTitle(name);
+      }
+    }
+  }
+}
+
+/**
+ *
+ */
+QwtPlotCanvas* Plot2d_ViewFrame::getPlotCanvas() const
+{
+  return myPlot ? myPlot->canvas() : 0;
+}
+
+/*!
+  return closest curve if it exist, else 0
+*/
+Plot2d_Curve* Plot2d_ViewFrame::getClosestCurve( QPoint p, double& distance, int& index ) const
+{
+  CurveDict aCurves = getCurves();
+  CurveDict::iterator it = aCurves.begin();
+  QwtPlotCurve* aCurve;
+  for ( ; it != aCurves.end(); it++ ) {
+    aCurve = it.key();
+    if ( !aCurve )
+      continue;
+    index = aCurve->closestPoint( p, &distance );
+    if ( index > -1 )
+      return it.value();
+  }
+  return 0;
+}
+
+/*!
+ \brief  Deselect all analytical curves.
+*/
+void Plot2d_ViewFrame::deselectAnalyticalCurves() {
+  foreach(Plot2d_AnalyticalCurve* c, myAnalyticalCurves) {
+   c->setSelected(false);
+  }
+}
+
+/*!
+ \brief  Deselect all objects, except analytical curves.
+*/
+void Plot2d_ViewFrame::deselectObjects() {
+  ObjectDict::const_iterator it = myObjects.begin(), aLast = myObjects.end();
+  for ( ; it != aLast; it++ ) {
+         it.value()->setSelected(false);
+   }
+}
+
 #define INCREMENT_FOR_OP 10
 
 /*!
@@ -2119,6 +3952,7 @@ void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) {
 void Plot2d_ViewFrame::onPanLeft()
 {
   this->incrementalPan( -INCREMENT_FOR_OP, 0 );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2127,6 +3961,7 @@ void Plot2d_ViewFrame::onPanLeft()
 void Plot2d_ViewFrame::onPanRight()
 {
   this->incrementalPan( INCREMENT_FOR_OP, 0 );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2135,6 +3970,7 @@ void Plot2d_ViewFrame::onPanRight()
 void Plot2d_ViewFrame::onPanUp()
 {
   this->incrementalPan( 0, -INCREMENT_FOR_OP );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2143,6 +3979,7 @@ void Plot2d_ViewFrame::onPanUp()
 void Plot2d_ViewFrame::onPanDown()
 {
   this->incrementalPan( 0, INCREMENT_FOR_OP );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2151,6 +3988,7 @@ void Plot2d_ViewFrame::onPanDown()
 void Plot2d_ViewFrame::onZoomIn()
 {
   this->incrementalZoom( INCREMENT_FOR_OP, INCREMENT_FOR_OP );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2159,6 +3997,7 @@ void Plot2d_ViewFrame::onZoomIn()
 void Plot2d_ViewFrame::onZoomOut()
 {
   this->incrementalZoom( -INCREMENT_FOR_OP, -INCREMENT_FOR_OP );
+  updateAnalyticalCurves();
 }
 
 /*!
@@ -2172,6 +4011,22 @@ void Plot2d_ViewFrame::customEvent( QEvent* ce )
     fitAll();
 }
 
+
+/*!
+ * Return Plot2d_Object by the QwtPlotItem
+ *
+*/
+Plot2d_Object* Plot2d_ViewFrame::getPlotObject( QwtPlotItem* plotItem ) const {
+  
+  ObjectDict::const_iterator it = myObjects.begin();
+  for( ; it != myObjects.end(); ++it ) {
+    if ( it.key() == plotItem ) {
+      return it.value();
+    }
+  }
+  return 0;
+}
+
 Plot2d_ScaleDraw::Plot2d_ScaleDraw( char f, int prec )
   : QwtScaleDraw(),
     myFormat(f),
@@ -2190,5 +4045,300 @@ Plot2d_ScaleDraw::Plot2d_ScaleDraw( const QwtScaleDraw& scaleDraw, char f, int p
 
 QwtText Plot2d_ScaleDraw::label( double value ) const
 {
-  return QLocale::system().toString(value,myFormat,myPrecision);
+  QwtScaleMap m = map();
+  QString str1 = QwtScaleDraw::label( m.s1() ).text();
+  QString str2 = QwtScaleDraw::label( m.s2() ).text();
+  if ( str1 == str2 ) {
+    double aDist = fabs(map().s2()-map().s1())/5;
+    int precision = 0;
+    while (aDist < 1 ) {
+      precision++; 
+      aDist *= 10.; 
+    }
+    if ( precision > 0 && value > 0 )
+      return QLocale::system().toString( value,'f', precision );
+  }
+
+  return QwtScaleDraw::label( value );
+}
+
+Plot2d_YScaleDraw::Plot2d_YScaleDraw()
+  : QwtScaleDraw()
+{
+}
+
+QwtText Plot2d_YScaleDraw::label( double value ) const
+{
+  // Axis labels format
+  QString strD = QString( "%1").arg( value, 10, 'e', 3); // format 10.3e
+
+  return QwtText( strD);
+}
+
+/* Definition of X axis graduations
+ */
+const QString Plot2d_AxisScaleDraw::DEVICE_FONT = QString("Times");
+const int     Plot2d_AxisScaleDraw::DEVICE_FONT_SIZE = 12;
+const int     Plot2d_AxisScaleDraw::DEVICE_BY = 40;
+
+Plot2d_AxisScaleDraw::Plot2d_AxisScaleDraw( Plot2d_Plot2d* plot)
+: myPlot(plot)
+{
+  myLowerBound = -1;
+  myUpperBound = -1;
+  setLabelAlignment(Qt::AlignRight);
+  setLabelRotation(45.);
+
+  applyTicks();
+
+  myActivTicksDrawing   = true;
+  myNumTicksDrawingCall = 1;
+}
+
+
+Plot2d_AxisScaleDraw::~Plot2d_AxisScaleDraw()
+{
+}
+
+
+/* Unactivate automatic ticks drawing
+ */
+void Plot2d_AxisScaleDraw::unactivTicksDrawing( int numcall)
+{
+  myActivTicksDrawing   = false;
+  myNumTicksDrawingCall = numcall;
+}
+
+
+/* Draw X ticks and labels.
+ * Draw systems names under X axis.
+ * Overload the same name QwtScaleDraw method.
+ * (PB: who call automaticaly this method)
+ */
+void Plot2d_AxisScaleDraw::draw( QPainter* painter, const QPalette & palette) const
+{
+  //std::cout << "Plot2d_AxisScaleDraw::draw() : activ= " << myActivTicksDrawing
+  //                           << "  numcall= " << myNumTicksDrawingCall << std::endl;
+
+  if (!myActivTicksDrawing)  return;
+
+  //std::cout << "Plot2d_AxisScaleDraw::draw()" << std::endl;
+
+  QList<double> major_ticks  = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+  QList<double> medium_ticks = scaleDiv().ticks(QwtScaleDiv::MediumTick);
+  QList<double> minor_ticks  = scaleDiv().ticks(QwtScaleDiv::MinorTick);
+
+  medium_ticks.clear();
+  minor_ticks.clear();
+  major_ticks.clear();
+
+  major_ticks.append( myTicks);
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MajorTick,  major_ticks);
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MinorTick,  minor_ticks);
+  QwtScaleDraw *scale = myPlot->axisScaleDraw(QwtPlot::xBottom);
+  ((Plot2d_AxisScaleDraw*)(scale))->applyTicks();
+
+  QwtScaleDraw::draw( painter, palette);
+
+  for (int i = 0; i < myTicks.size(); i++)
+  {
+      drawLabel( painter, myTicks[i]);               
+  }      
+               
+  //std::cout << "Ok for Plot2d_AxisScaleDraw::draw()" << std::endl;
+}
+
+
+QwtText Plot2d_AxisScaleDraw::label( double value) const
+{
+  if (myLabelX.contains(value))
+          return myLabelX[value];
+
+  return QwtText(QString::number(value, 'f', 1));
+}
+
+
+/* Stock position and label of a X tick
+ */
+void Plot2d_AxisScaleDraw::setLabelTick( double value, QString label, bool isDevice)
+{
+  //qDebug()<< "setLabelTick ( " << value << ","<< label <<" )";
+  if ( isDevice )
+  {
+      // For systems names under X axis
+      myLabelDevice[value] = label;
+  }
+  else
+  {
+      // For X axis graduations
+      myLabelX[value] = label;
+  }
+}
+
+
+/* Stock ticks positions of a system, and draw them
+ */
+void Plot2d_AxisScaleDraw::setTicks(const QList<double> aTicks)
+{
+  //std::cout << "  Plot2d_AxisScaleDraw::setTicks()" << std::endl;
+  myTicks = aTicks;
+
+  applyTicks();
+}
+
+
+void Plot2d_AxisScaleDraw::setInterval(double lowerBound, double upperBound)
+{
+  myLowerBound = lowerBound;
+  myUpperBound = upperBound;
+  myPlot->setAxisScale( QwtPlot::xBottom, myLowerBound, myUpperBound );
+}
+
+
+/* Stock X ticks in drawing zone
+ */
+void Plot2d_AxisScaleDraw::applyTicks()
+{
+  //std::cout << "  Plot2d_AxisScaleDraw::applyTicks()" << std::endl;
+
+  QList<double> major_ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+  QList<double> medium_ticks = scaleDiv().ticks(QwtScaleDiv::MediumTick);
+  QList<double> minor_ticks = scaleDiv().ticks(QwtScaleDiv::MinorTick);
+
+  medium_ticks.clear();
+  minor_ticks.clear();
+
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MajorTick, myTicks);
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+  myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MinorTick, minor_ticks);
+
+  QwtScaleDiv* aScaleDiv = (QwtScaleDiv*) &scaleDiv();
+
+  aScaleDiv->setTicks(QwtScaleDiv::MajorTick, myTicks);
+  aScaleDiv->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+  aScaleDiv->setTicks(QwtScaleDiv::MinorTick, minor_ticks);
+
+  if (myLowerBound != -1 && myUpperBound != -1)
+              aScaleDiv->setInterval(myLowerBound, myUpperBound);
+               
+  //for (int i = 0; i < myTicks.size(); i++){
+  //  QPoint p = labelPosition( i );
+  //  qDebug() << i<< ") applyTicks -> LABEL" <<p;
+  //}
+}
+
+
+void Plot2d_AxisScaleDraw::drawLabel( QPainter* painter, double value) const
+{
+  //std::cout << "  Plot2d_AxisScaleDraw::drawLabel( " << value << " ) : "; //<< std::endl;
+
+  //qDebug() << "drawLabel  ( " <<value<<" )";
+  if ( myLabelDevice.contains(value) )
+  {
+      QString deviceLabel = myLabelDevice[value];
+      //
+      std::string std_label = deviceLabel.toStdString();
+      //const char *c_label = std_label.c_str();
+      //std::cout << "    deviceLabel= |" << c_label << "|" << std::endl;
+
+      QPoint p = labelPosition( value );
+      p += QPoint(0, DEVICE_BY);
+      QFont  prevf = painter->font();
+      //QColor prevc = (painter->pen()).color();
+                 
+      QFont devicef( DEVICE_FONT, DEVICE_FONT_SIZE, QFont::Bold);
+      //
+      //painter->setPen( QColor("blue") );
+      painter->setFont( devicef );
+      painter->drawText( p, myLabelDevice[value] );
+      //painter->setPen( prevc );
+      painter->setFont( prevf );
+  }
+  if ( myLabelX.contains(value) )
+  {
+      QString xLabel = myLabelX[value];
+      //
+      std::string std_label = xLabel.toStdString();
+      //const char *c_label = std_label.c_str();
+      //std::cout << "    xLabel= |" << c_label << "|" << std::endl;
+
+      QwtScaleDraw::drawLabel( painter, value );
+  }
+}
+    
+
+void Plot2d_AxisScaleDraw::drawTick( QPainter* painter, double value, int len) const
+{
+  //qDebug() << "drawTick  ( " <<value<<" , "<<len<<" )  " ;
+  //qDebug() << "myLabelX" << myLabelX;
+  //
+  if ( myLabelX.contains(value) )
+  {
+      QwtScaleDraw::drawTick( painter, value, len);
+  } 
+}
+
+
+/* Management of tooltips associated with markers for curves points or others points
+ */
+const double Plot2d_QwtPlotPicker::BOUND_HV_SIZE = 0.2;
+Plot2d_QwtPlotPicker::Plot2d_QwtPlotPicker( int            xAxis,
+                                            int            yAxis,
+                                            int            selectionFlags,
+                                            RubberBand     rubberBand,
+                                            DisplayMode    trackerMode,
+                                            QwtPlotCanvas *canvas)
+: QwtPlotPicker( xAxis,
+                 yAxis,
+                 selectionFlags,
+                 rubberBand,
+                 trackerMode,
+                 canvas)    // of drawing zone QwtPlot
+{
+}
+  
+Plot2d_QwtPlotPicker::Plot2d_QwtPlotPicker( int            xAxis,
+                                            int            yAxis,
+                                            QwtPlotCanvas *canvas)
+: QwtPlotPicker( xAxis,
+                 yAxis,
+                 canvas)
+{
+}
+
+Plot2d_QwtPlotPicker::~Plot2d_QwtPlotPicker()
+{
+}
+// http://www.qtcentre.org/threads/22751-How-do-i-select-a-QwtPlotMarker-using-a-QPlotPicker
+
+/* Return the tooltip associated with a point when the mouse cursor pass near
+ */
+QwtText Plot2d_QwtPlotPicker::trackerText( const QwtDoublePoint & pos ) const
+{
+  for (QList<QwtPlotMarker* >::const_iterator pMarkerIt = pMarkers.begin();
+                                              pMarkerIt != pMarkers.end();
+                                              ++pMarkerIt )
+  {
+      QwtPlotMarker* pMarker = *pMarkerIt;
+      if ( pMarker != NULL )
+      {
+          QwtDoubleRect  bound0        = pMarker->boundingRect();
+          QwtDoublePoint center_bound0 = bound0.center();
+          double left = center_bound0.x()-(BOUND_HV_SIZE/2.);
+          double top  = center_bound0.y()-(BOUND_HV_SIZE/2.);
+         
+          QwtDoubleRect  bound( left, top , BOUND_HV_SIZE, BOUND_HV_SIZE);
+         
+          if( bound.contains(pos) )
+          {
+            //QString toolTip =  "X="  + QString::number( pMarker->xValue() )
+            //                 + " Y=" + QString::number( pMarker->yValue() );
+            return pMarkersToolTip[pMarker];
+          }
+      }        
+  }
+      
+  return QwtText();      
 }
index e2e99e9e2b6c62b84d7a6470f2a67c57fe3116ce..a085e887b726f0d3b87738bf6328baf412bcde3a 100755 (executable)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef PLOT2D_VIEWFRAME_H
 #define PLOT2D_VIEWFRAME_H
 
+#include "Plot2d.h"
 #include "Plot2d_Curve.h"
+#include "Plot2d_AnalyticalCurve.h"
+#include "Plot2d_NormalizeAlgorithm.h"
+
 #include <QWidget>
 #include <QMultiHash>
+#include <QMap>
 #include <QList>
+#include <QPainter>
 #include <qwt_symbol.h>
 #include <qwt_scale_draw.h>
+#include <qwt_plot_marker.h>
+#include <qwt_plot_picker.h>
+
+#include <iostream>
+#include <ostream>
 
 class Plot2d_Plot2d;
 class Plot2d_Prs;
+class Plot2d_Curve;
+class Plot2d_Object;
 class QCustomEvent;
+class QwtPlotItem;
 class QwtPlotCurve;
 class QwtPlotGrid;
 class QwtPlotZoomer;
+class Plot2d_AxisScaleDraw;
+class Plot2d_QwtPlotPicker;
 
-typedef QMultiHash<QwtPlotCurve*, Plot2d_Curve*> CurveDict;
+typedef QMultiHash<QwtPlotCurve*, Plot2d_Curve*>  CurveDict;
+typedef QMultiHash<QwtPlotItem*,  Plot2d_Object*> ObjectDict;
 
-class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget
+class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget, public Plot2d_CurveContainer
 { 
   Q_OBJECT
-
+  
   enum { NoOpId, FitAreaId, ZoomId, PanId, GlPanId, DumpId, 
-   ModeXLinearId, ModeXLogarithmicId, ModeYLinearId, ModeYLogarithmicId,
-   LegendId, CurvePointsId, CurveLinesId, CurveSplinesId };
+        ModeXLinearId, ModeXLogarithmicId, ModeYLinearId, ModeYLogarithmicId,
+        LegendId, CurvePointsId, CurveLinesId, CurveSplinesId };
 public:
   /* Construction/destruction */
-  Plot2d_ViewFrame( QWidget* parent, const QString& title = "" );
+  Plot2d_ViewFrame( QWidget*, const QString& = "" );
   virtual ~Plot2d_ViewFrame();
 
   enum ObjectType { MainTitle, XTitle, YTitle, Y2Title, XAxis, YAxis, Y2Axis };
 
-public:
-  QWidget* getViewWidget();
+  QWidget*       getViewWidget();
 
   /* display */
-  void    DisplayAll();
-  void    EraseAll();
-  void    Repaint();
+  virtual void   DisplayAll();
+  virtual void   EraseAll();
+  void           Repaint();
 
-  void    Display( const Plot2d_Prs* );
-  void    Erase( const Plot2d_Prs*, const bool = false );
-  Plot2d_Prs* CreatePrs( const char* entry = 0 );
+  void           Display( const Plot2d_Prs* );
+  void           Erase( const Plot2d_Prs*, const bool = false );
+  Plot2d_Prs*    CreatePrs( const char* = 0 );
 
-  virtual bool eventFilter(QObject* watched, QEvent* e);
+  virtual bool   eventFilter( QObject*, QEvent* );
 
   /* operations */
-  void    updateTitles();
-  void    setTitle( const QString& title );
-  QString getTitle() const { return myTitle; }
-  void    displayCurve( Plot2d_Curve* curve, bool update = false );
-  void    displayCurves( const curveList& curves, bool update = false );
-  void    eraseCurve( Plot2d_Curve* curve, bool update = false );
-  void    eraseCurves( const curveList& curves, bool update = false );
-  int     getCurves( curveList& clist );
-  const   CurveDict& getCurves();
-  bool    isVisible( Plot2d_Curve* curve );
-  void    updateCurve( Plot2d_Curve* curve, bool update = false );
-  void    updateLegend( const Plot2d_Prs* prs );
-  void    fitAll();
-  void    fitArea( const QRect& area );
-  void    fitData(const int mode,
-                 const double xMin, const double xMax,
-                 const double yMin, const double yMax,
-                 const double y2Min = 0, const double y2Max = 0);
-
-  void    getFitRanges(double& xMin, double& xMax,
-                      double& yMin, double& yMax,
-                      double& y2Min, double& y2Max);
+  void           updateTitles();
+  void           setTitle( const QString& );
+  QString        getTitle() const;
+
+  /* addition MultiX */
+  void createCurveTooltips( Plot2d_Curve *curve,
+                            Plot2d_QwtPlotPicker *picker);
+
+  void displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
+                               Plot2d_QwtPlotPicker*         picker,
+                               bool                          displayLegend);
+  
+  void displayPlot2dCurveList( QList<Plot2d_Curve*>  curveList,
+                                                int  groupsize,
+                               Plot2d_QwtPlotPicker* picker,
+                                               bool  displayLegend);
+  
+  Plot2d_Curve* createPlot2dCurve( QString & title,
+                                   QString & unit,
+                                   QList<double> & xList,
+                                   QList<double> & yList,
+                                   QList<QString> & tooltipList,
+                                   Plot2d::LineType lineKind,
+                                   int lineWidth,
+                                   QColor & lineColor,
+                                   QwtSymbol::Style markerKind,
+                                   Plot2d_QwtPlotPicker* picker,
+                                   bool toDraw,
+                                   bool displayLegend=true);
+
+  QColor getPlot2dCurveColor( Plot2d_Curve* plot2dCurve);
+
+  void createSegment( double *X, double *Y, int nbPoint,
+                      Qt::PenStyle lineKind,
+                      int lineWidth,
+                      QColor & lineColor,
+                      QwtSymbol::Style markerKind);
+
+  /* curves operations [ obsolete ] */
+  void           displayCurve( Plot2d_Curve*, bool = false );
+  void           displayCurves( const curveList&, bool = false );
+  void           eraseCurve( Plot2d_Curve*, bool = false );
+  void           eraseCurves( const curveList&, bool = false );
+  int            getCurves( curveList& ) const;
+  CurveDict      getCurves() const;
+  void           updateCurve( Plot2d_Curve*, bool = false );
+  void           processFiltering(bool = false);
+
+  /* objects operations */
+  QwtPlotItem*   displayObject( Plot2d_Object*, bool = false );
+  void           displayObjects( const objectList&, bool = false );
+  void           eraseObject( Plot2d_Object*, bool = false );
+  void           eraseObjects( const objectList&, bool = false );
+  int            getObjects( objectList& ) const;
+  bool           isVisible( Plot2d_Object* ) const;
+  void           updateObject( Plot2d_Object*, bool = false );
+
+  void           updateLegend( const Plot2d_Prs* );
+  void           updateLegend();
+  void           fitAll();
+  void           fitArea( const QRect& );
+  void           fitData( const int, const double, const double,
+                         const double, const double,
+                         const double = 0, const double = 0 );
+  
+  void           getFitRanges( double&, double&, double&, double&,
+                              double&, double&);
+  
+  void           getFitRangeByCurves( double&, double&, double&, double&,
+                                     double&, double& );
+
+  void              addAnalyticalCurve( Plot2d_AnalyticalCurve* );
+  void              removeAnalyticalCurve( Plot2d_AnalyticalCurve* );
+  void              updateAnalyticalCurve( Plot2d_AnalyticalCurve*, bool = false );
+  void              updateAnalyticalCurves();
+  void              deselectAnalyticalCurves();        
+  void              deselectObjects(); 
+
+  AnalyticalCurveList getAnalyticalCurves() const;
+  Plot2d_AnalyticalCurve* getAnalyticalCurve(QwtPlotItem *);
 
   /* view parameters */
-  void    copyPreferences( Plot2d_ViewFrame* );
-  void    setCurveType( int curveType, bool update = true );
-  int     getCurveType() const { return myCurveType; }
-  void    setCurveTitle( Plot2d_Curve* curve, const QString& title );
-  void    showLegend( bool show, bool update = true );
-  void    setLegendPos( int pos );
-  int     getLegendPos() const { return myLegendPos; }
-  void    setMarkerSize( const int size, bool update = true  );
-  int     getMarkerSize() const { return myMarkerSize; }
-  void    setBackgroundColor( const QColor& color );
-  QColor  backgroundColor() const;
-  void    setXGrid( bool xMajorEnabled, const int xMajorMax,
-                    bool xMinorEnabled, const int xMinorMax, bool update = true );
-  void    setYGrid( bool yMajorEnabled, const int yMajorMax,
-                    bool yMinorEnabled, const int yMinorMax,
-                    bool y2MajorEnabled, const int y2MajorMax,
-                    bool y2MinorEnabled, const int y2MinorMax, bool update = true );
-  void    setTitle( bool enabled, const QString& title, ObjectType type, bool update = true );
-  QString getTitle( ObjectType type ) const;
-
-  void    setFont( const QFont& font, ObjectType type, bool update = true );
-  void    setHorScaleMode( const int mode, bool update = true );
-  int     getHorScaleMode() const { return myXMode; }
-  void    setVerScaleMode( const int mode, bool update = true );
-  int     getVerScaleMode() const { return myYMode; }
-
-  bool    isModeHorLinear();
-  bool    isModeVerLinear();
-  bool    isLegendShow() { return myShowLegend; };
+  void           copyPreferences( Plot2d_ViewFrame* );
+  void           setCurveType( int, bool = true );
+  int            getCurveType() const;
+  void           setCurveTitle( Plot2d_Curve*, const QString& );
+  void           setObjectTitle( Plot2d_Object*, const QString& );
+  void           showLegend( bool, bool = true );
+  void           setLegendPos( int );
+  int            getLegendPos() const;
+  void           setLegendFont( const QFont& );
+  QFont          getLegendFont() const;
+  void           setLegendFontColor( const QColor& );
+  QColor         getLegendFontColor() const;
+  void           setMarkerSize( const int, bool = true  );
+  int            getMarkerSize() const;
+  void           setBackgroundColor( const QColor& );
+  QColor         backgroundColor() const;
+  void           setXGrid( bool, const int, bool, const int, bool = true );
+  void           setYGrid( bool, const int, bool, const int,
+                          bool, const int, bool, const int, bool = true );
+  void           setTitle( bool, const QString&, ObjectType, bool = true );
+  QString        getTitle( ObjectType ) const;
+
+  void           setFont( const QFont&, ObjectType, bool = true );
+  void           setHorScaleMode( const int, bool = true );
+  int            getHorScaleMode() const;
+  void           setVerScaleMode( const int, bool = true );
+  int            getVerScaleMode() const;
+  void           setNormLMaxMode( bool, bool = true);
+  bool           getNormLMaxMode()const;
+  void           setNormLMinMode( bool, bool = true);
+  bool           getNormLMinMode()const;
+  void           setNormRMaxMode( bool, bool = true);
+  bool           getNormRMaxMode()const;
+  void           setNormRMinMode( bool, bool = true);
+  bool           getNormRMinMode()const;
+
+
+  bool           isModeHorLinear();
+  bool           isModeVerLinear();
+  bool           isNormLMaxMode();
+  bool           isNormLMinMode();
+  bool           isNormRMaxMode();
+  bool           isNormRMinMode();
+
+  bool           isLegendShow() const;
 
   // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x: 
   // it crashes if switched to X/Y logarithmic mode, when one or more points have
   // non-positive X/Y coordinate
-  bool    isXLogEnabled() const;
-  bool    isYLogEnabled() const;
+  bool           isXLogEnabled() const;
+  bool           isYLogEnabled() const;
+  void           setEnableAxis( QwtPlot::Axis, bool );
+
+  virtual bool   print( const QString&, const QString& ) const;
+  void           printPlot( QPainter*, const QRect&,
+                           const QwtPlotPrintFilter& = QwtPlotPrintFilter() ) const;
 
-  virtual bool print( const QString& file, const QString& format ) const;
+  QString        getVisualParameters();
+  void           setVisualParameters( const QString& );
 
-  QString getVisualParameters();
-  void    setVisualParameters( const QString& parameters );
+  void           incrementalPan ( const int, const int );
+  void           incrementalZoom( const int, const int );
 
-  void    incrementalPan ( const int incrX, const int incrY );
-  void    incrementalZoom( const int incrX, const int incrY );
+  QwtPlotCanvas* getPlotCanvas() const;
+  Plot2d_Curve*  getClosestCurve( QPoint, double&, int& ) const;
+  
+  Plot2d_Object* getPlotObject( QwtPlotItem* ) const;
+  QwtPlotItem*   getPlotObject( Plot2d_Object* ) const;
+  QwtPlotCurve*  getPlotCurve( Plot2d_Curve* ) const;
+  Plot2d_Plot2d* getPlot() const { return myPlot; }
 
+  void           updatePlotItem(Plot2d_Object*, QwtPlotItem*);
 protected:
-  int     testOperation( const QMouseEvent& );
-  void    readPreferences();
-  void    writePreferences();
-  QString getInfo( const QPoint& pnt );
-  virtual void wheelEvent( QWheelEvent* );
-  QwtPlotCurve* getPlotCurve( Plot2d_Curve* curve );
-  bool    hasPlotCurve( Plot2d_Curve* curve );
-  void    setCurveType( QwtPlotCurve* curve, int curveType );
+  int            testOperation( const QMouseEvent& );
+  void           readPreferences();
+  void           writePreferences();
+  QString        getInfo( const QPoint& );
+  virtual void   wheelEvent( QWheelEvent* );
+  bool           hasPlotCurve( Plot2d_Curve* ) const;
+  void           setCurveType( QwtPlotCurve*, int );
+  bool           hasPlotObject( Plot2d_Object* ) const;
+  QString        getXmlVisualParameters();
+  bool           setXmlVisualParameters(const QString&);
+
+
+  
+  
 
 public slots:
-  void    onViewPan(); 
-  void    onViewZoom();
-  void    onViewFitAll();
-  void    onViewFitArea();
-  void    onViewGlobalPan(); 
-  void    onSettings();
-  void    onFitData();
-  void    onChangeBackground();
-  void    onPanLeft();
-  void    onPanRight();
-  void    onPanUp();
-  void    onPanDown();
-  void    onZoomIn();
-  void    onZoomOut();
+  void           onViewPan(); 
+  void           onViewZoom();
+  void           onViewFitAll();
+  void           onViewFitArea();
+  void           onViewGlobalPan(); 
+  void           onSettings();
+  void           onAnalyticalCurve();
+  void           onFitData();
+  void           onChangeBackground();
+  void           onPanLeft();
+  void           onPanRight();
+  void           onPanUp();
+  void           onPanDown();
+  void           onZoomIn();
+  void           onZoomOut();
 
 protected:
-  virtual void customEvent( QEvent* );
-  void    plotMousePressed( const QMouseEvent& );
-  bool    plotMouseMoved( const QMouseEvent& );
-  void    plotMouseReleased( const QMouseEvent& );
+  virtual void   customEvent( QEvent* );
+  void           plotMousePressed( const QMouseEvent& );
+  bool           plotMouseMoved( const QMouseEvent& );
+  void           plotMouseReleased( const QMouseEvent& );
 
 signals:
-  void    vpModeHorChanged();
-  void    vpModeVerChanged();
-  void    vpCurveChanged();
-  void    contextMenuRequested( QContextMenuEvent *e );
-  void    legendClicked( QwtPlotItem* );
+  void           vpModeHorChanged();
+  void           vpModeVerChanged();
+  void           vpNormLModeChanged();
+  void           vpNormRModeChanged();
+  void           vpCurveChanged();
+  void           contextMenuRequested( QContextMenuEvent* );
+  void           legendClicked( QwtPlotItem* );
 
 protected:
-  Plot2d_Plot2d* myPlot;
-  int            myOperation;
-  QPoint         myPnt;
-
-  int            myCurveType;
-  bool           myShowLegend;
-  int            myLegendPos;
-  int            myMarkerSize;
-  QColor         myBackground;
-  QString        myTitle, myXTitle, myYTitle, myY2Title;
-  bool           myTitleEnabled, myXTitleEnabled, myYTitleEnabled, myY2TitleEnabled;
-  bool           myXGridMajorEnabled, myYGridMajorEnabled, myY2GridMajorEnabled;
-  bool           myXGridMinorEnabled, myYGridMinorEnabled, myY2GridMinorEnabled;
-  int            myXGridMaxMajor, myYGridMaxMajor, myY2GridMaxMajor;
-  int            myXGridMaxMinor, myYGridMaxMinor, myY2GridMaxMinor;
-  int            myXMode, myYMode;
-  double         myXDistance, myYDistance, myYDistance2;
-  bool           mySecondY;
+  Plot2d_Plot2d*      myPlot;
+  int                 myOperation;
+  QPoint              myPnt;
+
+  int                 myCurveType;
+  bool                myShowLegend;
+  int                 myLegendPos;
+  QFont               myLegendFont;
+  QColor              myLegendColor;
+  int                 myMarkerSize;
+  QColor              myBackground;
+  QString             myTitle, myXTitle, myYTitle, myY2Title;
+  bool                myTitleEnabled, myXTitleEnabled, myYTitleEnabled, myY2TitleEnabled;
+  bool                myXGridMajorEnabled, myYGridMajorEnabled, myY2GridMajorEnabled;
+  bool                myXGridMinorEnabled, myYGridMinorEnabled, myY2GridMinorEnabled;
+  int                 myXGridMaxMajor, myYGridMaxMajor, myY2GridMaxMajor;
+  int                 myXGridMaxMinor, myYGridMaxMinor, myY2GridMaxMinor;
+  int                 myXMode, myYMode;
+  bool                myNormLMin, myNormLMax, myNormRMin, myNormRMax;
+  double              myXDistance, myYDistance, myYDistance2;
+  bool                mySecondY;
+  ObjectDict          myObjects;
+  AnalyticalCurveList myAnalyticalCurves;
+  Plot2d_NormalizeAlgorithm* myLNormAlgo;
+  Plot2d_NormalizeAlgorithm* myRNormAlgo;
+  bool                myIsDefTitle;
+ private:
+  // List of QwtPlotCurve curves to draw (created by Plot2d_Curve::createPlotItem() )
+  QList<QwtPlotItem*> myQwtPlotCurveList;
+  
+  // List of intermittent segments to connect curves
+  QList<QwtPlotCurve*> myIntermittentSegmentList;
+
+  // List of markers associated with curves points
+  QList<QwtPlotMarker*> myMarkerList;
+
+  // List of curves Plot2d_Curve
+  QList<Plot2d_Curve*> myPlot2dCurveList;
 };
 
 class Plot2d_Plot2d : public QwtPlot 
 {
   Q_OBJECT
 public:
-  Plot2d_Plot2d( QWidget* parent );
-
-  void       setLogScale( int axisId, bool log10 );
-
-  void       replot();
-  void       getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine );
-  QwtLegend* getLegend() {
-#if QWT_VERSION < 0x040200
-     return d_legend;
-#else  
-     return legend(); /* mpv: porting to the Qwt 4.2.0 */
-#endif
-  }
-  virtual QSize       sizeHint() const;
-  virtual QSizePolicy sizePolicy() const;
-  virtual QSize       minimumSizeHint() const;
-  void                defaultPicker();
-  void                setPickerMousePattern( int button, int state = Qt::NoButton );
-
-  bool                polished() const { return myIsPolished; }
-  QwtPlotGrid*        grid() { return myGrid; };
-  CurveDict& getCurves() { return myCurves; }
-  Plot2d_Curve*       getClosestCurve( QPoint p, double& distance, int& index );
+  Plot2d_Plot2d( QWidget* );
+  virtual ~Plot2d_Plot2d();
+
+  void           setLogScale( int, bool );
+
+  void           replot();
+  QwtLegend*     getLegend();
+  QSize          sizeHint() const;
+  QSize          minimumSizeHint() const;
+  void           defaultPicker();
+  void           setPickerMousePattern( int, int = Qt::NoButton );
+  void           setPicker( Plot2d_QwtPlotPicker *picker);
+  Plot2d_QwtPlotPicker* getPicker() { return myPicker; }
+  Plot2d_AxisScaleDraw* getScaleDraw() { return myScaleDraw; }
+  QList<QwtPlotMarker*> getSeparationLineList() { return mySeparationLineList; }
+  void clearSeparationLineList();
+  QwtPlotMarker *createMarkerAndTooltip( QwtSymbol symbol,
+                               double    X,
+                               double    Y,
+                               QString & tooltip,
+                               Plot2d_QwtPlotPicker *picker);
+
+  bool           polished() const;
+  QwtPlotGrid*   grid() const;
+  QwtPlotZoomer* zoomer() const;
+
+  virtual void   updateYAxisIdentifiers();
+  
+  // Methods to deal with axes ticks
+
+  void createAxisScaleDraw();
+  void applyTicks();
+  void unactivAxisScaleDraw( int numcall);
+
+  void displayXTicksAndLabels(
+         double XLeftmargin, double XRightMargin,
+         const QList< QPair< QString, QMap<double,QString> > > & devicesPosLabelTicks);
+
+  void createSeparationLine( double Xpos);
+                                         
 
 public slots:
-  virtual void polish();
-
-protected:
-  bool       existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine );
+  virtual void   polish();
 
 protected slots:
-  void onScaleDivChanged();
+  void           onScaleDivChanged();
 
 protected:
-  CurveDict          myCurves;
-  QwtPlotGrid*       myGrid;
-  QList<QColor>      myColors;
-  bool               myIsPolished;
-  QwtPlotZoomer*     myPlotZoomer;
+  QwtPlotGrid*   myGrid;
+  QList<QColor>  myColors;
+  bool           myIsPolished;
+  QwtPlotZoomer* myPlotZoomer;
+  Plot2d_AxisScaleDraw* myScaleDraw;
+  // The point picker associated with the graphic view
+  Plot2d_QwtPlotPicker *myPicker;
+private:
+  // List of verticals segments between two curves
+  QList<QwtPlotMarker*> mySeparationLineList;
 };
 
 class Plot2d_ScaleDraw: public QwtScaleDraw
@@ -255,4 +406,95 @@ private:
   int  myPrecision;
 };
 
+class Plot2d_YScaleDraw: public QwtScaleDraw
+{
+public:
+  Plot2d_YScaleDraw();
+
+  virtual QwtText label( double value ) const;
+};
+
+/* Definition of X axis graduations
+ */
+class Plot2d_AxisScaleDraw: public QwtScaleDraw
+{
+public:
+  static const QString DEVICE_FONT;
+  static const int     DEVICE_FONT_SIZE;
+  static const int     DEVICE_BY;
+
+  Plot2d_AxisScaleDraw(Plot2d_Plot2d* plot);
+
+  virtual ~Plot2d_AxisScaleDraw();
+
+  void unactivTicksDrawing( int numcall);
+
+  virtual void draw( QPainter * painter, const QPalette & palette) const;
+
+  virtual QwtText label(double value) const;
+
+  void setLabelTick(double value, QString label, bool isDevice = false);
+    
+  void setTicks(const QList<double> aTicks);
+
+  void setInterval(double lowerBound, double upperBound);
+
+  void applyTicks();
+
+protected:
+
+  void drawLabel( QPainter* painter, double value) const;
+    
+  void drawTick( QPainter* painter, double value, int len) const;
+
+private:
+  bool myActivTicksDrawing;   // true => activate drawing ticks (with draw() )
+  int  myNumTicksDrawingCall; // call number to ticks drawing
+
+  // Ticks list to display on X axis
+  QMap<double, QString> myLabelX;  // position, label
+  //
+  QList<double> myTicks;  // positions
+    
+  // Systems names to display under X axis
+  QMap<double, QString> myLabelDevice;
+    
+  Plot2d_Plot2d* myPlot;  // Drawing zone QwtPlot
+
+  double myLowerBound;
+  double myUpperBound;
+};
+
+
+
+
+/* Management of tooltips associated with markers for curves points or others points
+ */
+class Plot2d_QwtPlotPicker : public QwtPlotPicker
+{
+public:
+  static const double BOUND_HV_SIZE;
+  
+  Plot2d_QwtPlotPicker( int            xAxis,
+                        int            yAxis,
+                        int            selectionFlags,
+                        RubberBand     rubberBand,
+                        DisplayMode    trackerMode,
+                        QwtPlotCanvas *canvas);
+    
+  Plot2d_QwtPlotPicker( int  xAxis,
+                        int  yAxis,
+                        QwtPlotCanvas *canvas);
+    
+  virtual ~Plot2d_QwtPlotPicker();
+    
+  QList<QwtPlotMarker*>             pMarkers;         // points markers
+  QMap<QwtPlotMarker*, QwtText>  pMarkersToolTip;  // associations (marker,tooltip)
+
+protected:
+
+  virtual QwtText trackerText( const QwtDoublePoint & pos ) const;
+
+};
+
 #endif
index 25280c5c94201bb4f1345d37cc334f412e29e7ce..8b91cf541a103efa43c75f1b0a53a571c1ed1047 100755 (executable)
@@ -1,29 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "Plot2d_ViewManager.h"
 #include "Plot2d_ViewModel.h"
 #include "Plot2d_ViewWindow.h"
 #include "Plot2d_ViewFrame.h"
 
+#include "SUIT_PreferenceMgr.h"
+#include "SUIT_ResourceMgr.h"
+
 /*!
   Constructor
 */
@@ -63,7 +67,7 @@ bool Plot2d_ViewManager::insertView( SUIT_ViewWindow* theView )
     Plot2d_ViewFrame* aViewFrame = view->getViewFrame();
     Plot2d_Viewer* aViewer = getPlot2dModel();
     connect( aViewFrame, SIGNAL( legendClicked( QwtPlotItem* ) ), 
-            aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) );
+             aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) );
   }
   return res;
 }
@@ -107,3 +111,78 @@ Plot2d_ViewWindow* Plot2d_ViewManager::cloneView( Plot2d_ViewWindow* srcWnd )
 
   return newWnd;
 }
+
+/*!
+  Fills preference manager for viewer
+*/
+int Plot2d_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+  int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_PLOT2DVIEWER" ), theId,
+                                   SUIT_PreferenceMgr::GroupBox );
+
+  thePrefMgr->addItem( tr( "PREF_SHOW_LEGEND" ), aGrpId,
+                      SUIT_PreferenceMgr::Bool, "Plot2d", "ShowLegend" );
+  
+  int legendPosition = thePrefMgr->addItem( tr( "PREF_LEGEND_POSITION" ), aGrpId,
+                                           SUIT_PreferenceMgr::Selector, "Plot2d", "LegendPos" );
+  QStringList aLegendPosList;
+  aLegendPosList.append( tr("PREF_LEFT") );
+  aLegendPosList.append( tr("PREF_RIGHT") );
+  aLegendPosList.append( tr("PREF_TOP") );
+  aLegendPosList.append( tr("PREF_BOTTOM") );
+
+  QList<QVariant> anIndexesList;
+  anIndexesList.append(0);
+  anIndexesList.append(1);
+  anIndexesList.append(2);
+  anIndexesList.append(3);
+
+  thePrefMgr->setItemProperty( "strings", aLegendPosList, legendPosition );
+  thePrefMgr->setItemProperty( "indexes", anIndexesList, legendPosition );
+
+  int curveType = thePrefMgr->addItem( tr( "PREF_CURVE_TYPE" ), aGrpId,
+                                      SUIT_PreferenceMgr::Selector, "Plot2d", "CurveType" );
+  QStringList aCurveTypesList;
+  aCurveTypesList.append( tr("PREF_POINTS") );
+  aCurveTypesList.append( tr("PREF_LINES") );
+  aCurveTypesList.append( tr("PREF_SPLINE") );
+
+  anIndexesList.clear();
+  anIndexesList.append(0);
+  anIndexesList.append(1);
+  anIndexesList.append(2);
+
+  thePrefMgr->setItemProperty( "strings", aCurveTypesList, curveType );
+  thePrefMgr->setItemProperty( "indexes", anIndexesList, curveType );
+
+  int markerSize = thePrefMgr->addItem( tr( "PREF_MARKER_SIZE" ), aGrpId,
+                                       SUIT_PreferenceMgr::IntSpin, "Plot2d", "MarkerSize" );
+
+  thePrefMgr->setItemProperty( "min", 0, markerSize );
+  thePrefMgr->setItemProperty( "max", 100, markerSize );
+
+  QStringList aScaleModesList;
+  aScaleModesList.append( tr("PREF_LINEAR") );
+  aScaleModesList.append( tr("PREF_LOGARITHMIC") );
+
+  anIndexesList.clear();
+  anIndexesList.append(0);
+  anIndexesList.append(1);
+
+  int horScale = thePrefMgr->addItem( tr( "PREF_HOR_AXIS_SCALE" ), aGrpId,
+                                     SUIT_PreferenceMgr::Selector, "Plot2d", "HorScaleMode" );
+
+  thePrefMgr->setItemProperty( "strings", aScaleModesList, horScale );
+  thePrefMgr->setItemProperty( "indexes", anIndexesList, horScale );
+
+  int verScale = thePrefMgr->addItem( tr( "PREF_VERT_AXIS_SCALE" ), aGrpId,
+                                     SUIT_PreferenceMgr::Selector, "Plot2d", "VerScaleMode" );
+
+  thePrefMgr->setItemProperty( "strings", aScaleModesList, verScale );
+  thePrefMgr->setItemProperty( "indexes", anIndexesList, verScale );
+
+  thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
+                      SUIT_PreferenceMgr::Color, "Plot2d", "Background" );
+
+  return aGrpId;
+}
index da494a26c8f062f3c657a036499dcd232cbb265c..8ea1e1eff364e7dbc0eb9b38dc6e0c5b972c10d2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef PLOT2D_VIEWMANAGER_H
 #define PLOT2D_VIEWMANAGER_H
 
@@ -26,6 +27,7 @@
 #include "SUIT_ViewManager.h"
 
 class SUIT_Desktop;
+class SUIT_PreferenceMgr;
 class Plot2d_ViewWindow;
 class Plot2d_Viewer;
 class Plot2d_ViewFrame;
@@ -41,6 +43,8 @@ public:
   Plot2d_Viewer*     getPlot2dModel() const;
   Plot2d_ViewWindow* cloneView( Plot2d_ViewWindow* srcWnd );
 
+  static int         fillPreferences( SUIT_PreferenceMgr*, const int );
+
 protected:
   bool         insertView(SUIT_ViewWindow* theView);
 
index 0786c6fa484822f1ab5f004ad66497e0bf8d9257..ac0853dc29833892d3cd127ad5f8e61ce9573c33 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // Plot2d_ViewModel.cxx: implementation of the Plot2d_ViewModel class.
 //
 #include "Plot2d_ViewModel.h"
@@ -39,6 +40,7 @@ Plot2d_Viewer::Plot2d_Viewer(bool theAutoDel)
 {
   myPrs = 0;
   myAutoDel = theAutoDel;
+  Plot2d_Object::initColors();
 }
 
 /*!
@@ -56,10 +58,11 @@ Plot2d_Viewer::~Plot2d_Viewer()
 */
 SUIT_ViewWindow* Plot2d_Viewer::createView(SUIT_Desktop* theDesktop)
 {
-  Plot2d_ViewWindow* aPlot2dView = new Plot2d_ViewWindow(theDesktop, this);
+  Plot2d_ViewWindow* aView = new Plot2d_ViewWindow(theDesktop, this);
+  aView->initLayout();
   if (myPrs)
-    aPlot2dView->getViewFrame()->Display(myPrs);
-  return aPlot2dView;
+    aView->getViewFrame()->Display(myPrs);
+  return aView;
 }
 
 /*!
@@ -120,7 +123,9 @@ void Plot2d_Viewer::update()
 void Plot2d_Viewer::clearPrs()
 {
   SUIT_ViewManager* aMgr = getViewManager();
-  QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
+  QVector<SUIT_ViewWindow*> aViews;
+  if ( aMgr )
+    aViews = aMgr->getViews();
   unsigned int aSize = aViews.size();
   for (uint i = 0; i < aSize; i++) {
     Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
@@ -229,6 +234,6 @@ void Plot2d_Viewer::setViewManager( SUIT_ViewManager* mgr )
   {
     Plot2d_ViewManager* pmgr = ( Plot2d_ViewManager* )mgr;
     connect( pmgr, SIGNAL( cloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ),
-            this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) );
+             this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) );
   }
 }
index ddb8ad35371ad4b26adc06a1aa5dd1902942c245..d594abb1c69e94a96ba287300e39b19ff32af190 100755 (executable)
@@ -1,30 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #if !defined(_PLOT2D_VIEWMODEL_H)
 #define _PLOT2D_VIEWMODEL_H
 
 #include "Plot2d.h"
 #include "SUIT_ViewModel.h"
-#include "qwt_plot.h"
+#include <qwt_plot_item.h>
 
 class SUIT_ViewWindow;
 class SUIT_Desktop;
@@ -39,7 +40,7 @@ class PLOT2D_EXPORT Plot2d_Viewer: public SUIT_ViewModel
 
 public:
   static QString Type() { return "Plot2d"; }
-
+  
   Plot2d_Viewer(bool theAutoDel = false);
   ~Plot2d_Viewer();
 
index 6fcdd26427612c1fb6fae3e3dce38fa7536eba1e..56424b9a1a96c7b68461b73538cd5d4a72c21af9 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_ViewWindow.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -29,7 +30,9 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
 
+#include <Qtx.h>
 #include <QtxAction.h>
 #include <QtxMultiAction.h>
 #include <QtxActionToolMgr.h>
 #include <QToolBar>
 #include <QPaintEvent>
 #include <QActionGroup>
+#include <QPainter>
+#include <QPrinter>
+#include <QPrintDialog>
+
+#include <qwt_plot_curve.h>
 
 /*!
   \class Plot2d_ViewWindow
@@ -57,8 +65,21 @@ Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* t
 : SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
-  myDumpImage = QImage();
+}
+
+/*!
+  \brief Destructor.
+*/
+Plot2d_ViewWindow::~Plot2d_ViewWindow()
+{
+}
 
+/*!
+  \brief Internal initialization.
+*/
+void Plot2d_ViewWindow::initLayout()
+{
+  myDumpImage = QImage();
   myViewFrame = new Plot2d_ViewFrame( this, "plotView" );
   setCentralWidget( myViewFrame );
 
@@ -67,20 +88,15 @@ Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* t
 
   connect( myViewFrame, SIGNAL( vpModeHorChanged() ), this, SLOT( onChangeHorMode() ) );
   connect( myViewFrame, SIGNAL( vpModeVerChanged() ), this, SLOT( onChangeVerMode() ) );
+  connect( myViewFrame, SIGNAL( vpNormLModeChanged() ), this, SLOT( onChangeNormLMode() ) );
+  connect( myViewFrame, SIGNAL( vpNormRModeChanged() ), this, SLOT( onChangeNormRMode() ) );
   connect( myViewFrame, SIGNAL( vpCurveChanged() ),   this, SLOT( onChangeCurveMode() ) );
   connect( myViewFrame, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ),
-          this,        SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
+           this,        SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
 
   myViewFrame->installEventFilter( this );
 }
 
-/*!
-  \brief Destructor.
-*/
-Plot2d_ViewWindow::~Plot2d_ViewWindow()
-{
-}
-
 /*!
   \brief Get view model.
   \return Plot2d view model
@@ -142,6 +158,15 @@ void Plot2d_ViewWindow::contextMenuPopup( QMenu* thePopup )
   curTypePopup->addAction( mgr->action( CurvLinesId ) );
   curTypePopup->addAction( mgr->action( CurvSplinesId ) );
 
+  //Normalization type
+  QMenu* normTypePopup = thePopup->addMenu( tr( "NORMALIZATION_TYPE_POPUP" ) );
+  normTypePopup->addAction( mgr->action( PModeNormLMinId ) );
+  normTypePopup->addAction( mgr->action( PModeNormLMaxId ) );
+  normTypePopup->addSeparator();
+  normTypePopup->addAction( mgr->action( PModeNormRMinId ) );
+  normTypePopup->addAction( mgr->action( PModeNormRMaxId ) );
+
+
   // legend
   thePopup->addAction( mgr->action( LegendId ) );
 
@@ -186,9 +211,9 @@ void Plot2d_ViewWindow::createActions()
 
   // 1. Dump View
   aAction = new QtxAction( tr( "MNU_DUMP_VIEW" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
                            tr( "MNU_DUMP_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_DUMP_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onDumpView() ) );
   mgr->registerAction( aAction, DumpId );
@@ -197,27 +222,27 @@ void Plot2d_ViewWindow::createActions()
 
   // 2.1. Fit All
   aAction = new QtxAction( tr( "MNU_FITALL" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
                            tr( "MNU_FITALL" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITALL" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitAll() ) );
   mgr->registerAction( aAction, FitAllId );
 
   // 2.2. Fit Rect
   aAction = new QtxAction( tr( "MNU_FITRECT" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
                            tr( "MNU_FITRECT" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITRECT" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitRect() ) );
   mgr->registerAction( aAction, FitRectId );
 
   // 2.3. Zoom
   aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
                            tr( "MNU_ZOOM_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onZoom() ) );
   mgr->registerAction( aAction, ZoomId );
@@ -233,18 +258,18 @@ void Plot2d_ViewWindow::createActions()
 
   // 3.1. Panning
   aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
-                          tr( "MNU_PAN_VIEW" ), 
-                          0, this);
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
+                           tr( "MNU_PAN_VIEW" ), 
+                           0, this);
   aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPanning() ) );
   mgr->registerAction( aAction, PanId );
 
   // 3.2. Global Panning
   aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
                            tr( "MNU_GLOBALPAN_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onGlobalPanning() ) );
   mgr->registerAction( aAction, GlobalPanId );
@@ -259,27 +284,27 @@ void Plot2d_ViewWindow::createActions()
   
   // 4.1. Points
   aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_POINTS" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ),
-                          tr( "MEN_PLOT2D_CURVES_POINTS" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ),
+                           tr( "MEN_PLOT2D_CURVES_POINTS" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_POINTS" ) );
   aAction->setCheckable( true );
   mgr->registerAction( aAction, CurvPointsId );
 
   // 4.2. Lines
   aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_LINES" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ),
-                          tr( "MEN_PLOT2D_CURVES_LINES" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ),
+                           tr( "MEN_PLOT2D_CURVES_LINES" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_LINES" ) );
   aAction->setCheckable( true );
   mgr->registerAction( aAction, CurvLinesId );
 
   // 4.3. Splines
   aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_SPLINES" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ),
-                          tr( "MEN_PLOT2D_CURVES_SPLINES" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ),
+                           tr( "MEN_PLOT2D_CURVES_SPLINES" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_SPLINES" ) );
   aAction->setCheckable( true );
   mgr->registerAction( aAction, CurvSplinesId );
@@ -295,9 +320,9 @@ void Plot2d_ViewWindow::createActions()
 
   // 5.1. Linear
   aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_HOR" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ),
-                          tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ),
+                           tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_HOR" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
   aAction->setCheckable( true );
@@ -305,9 +330,9 @@ void Plot2d_ViewWindow::createActions()
   
   // 5.2. Logarithmic
   aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ),
-                          tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ),
+                           tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
   aAction->setCheckable( true );
@@ -322,9 +347,9 @@ void Plot2d_ViewWindow::createActions()
 
   // 6.1. Linear
   aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_VER" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ),
-                          tr( "MEN_PLOT2D_MODE_LINEAR_VER" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ),
+                           tr( "MEN_PLOT2D_MODE_LINEAR_VER" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_VER" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
   aAction->setCheckable( true );
@@ -332,9 +357,9 @@ void Plot2d_ViewWindow::createActions()
 
   // 6.2. Logarithmic
   aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_VER" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ),
-                          tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ),
+                           tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
   aAction->setCheckable( true );
@@ -345,38 +370,104 @@ void Plot2d_ViewWindow::createActions()
   aVerGroup->addAction( mgr->action( PModeYLinearId ) );
   aVerGroup->addAction( mgr->action( PModeYLogarithmicId ) );
 
-  // 7. Legend
+  // 7. Normalization mode operations
+
+  // 7.1. Normalize to the global minimum by left Y axis
+  aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMIN" ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMIN" ) ),
+                           tr( "MEN_PLOT2D_NORMALIZE_MODE_LMIN" ),
+                           0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMIN" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeNormLMinId );
+
+  // 7.2. Normalize to the global maximum by right Y axis
+  aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMAX" ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMAX" ) ),
+                           tr( "MEN_PLOT2D_NORMALIZE_MODE_LMAX" ),
+                           0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMAX" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeNormLMaxId );
+
+    // 7.3. Normalize to the global minimum by right Y axis
+  aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMIN" ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMIN" ) ),
+                           tr( "MEN_PLOT2D_NORMALIZE_MODE_RMIN" ),
+                           0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMIN" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeNormRMinId );
+
+  // 7.4. Normalize to the global maximum by left Y axis
+  aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMAX" ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMAX" ) ),
+                           tr( "MEN_PLOT2D_NORMALIZE_MODE_RMAX" ),
+                           0, this );
+  aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMAX" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+  aAction->setCheckable( true );
+  mgr->registerAction( aAction, PModeNormRMaxId );
+
+  // 8. Legend
   aAction = new QtxAction( tr( "TOT_PLOT2D_SHOW_LEGEND" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
-                          tr( "MEN_PLOT2D_SHOW_LEGEND" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
+                           tr( "MEN_PLOT2D_SHOW_LEGEND" ),
+                           0, this );
   aAction->setStatusTip( tr( "PRP_PLOT2D_SHOW_LEGEND" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onLegend() ) );
   aAction->setCheckable( true );
   mgr->registerAction( aAction, LegendId );
 
-  // 8. Settings
+  // 9. Settings
   aAction = new QtxAction( tr( "TOT_PLOT2D_SETTINGS" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
-                          tr( "MEN_PLOT2D_SETTINGS" ),
-                          0, this );
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
+                           tr( "MEN_PLOT2D_SETTINGS" ),
+                           0, this );
+
   aAction->setStatusTip( tr( "PRP_PLOT2D_SETTINGS" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onSettings() ) );
   mgr->registerAction( aAction, CurvSettingsId );
 
-  // 9. Clone
+  // 9. Analytical curves
+#ifndef DISABLE_PYCONSOLE
+  aAction = new QtxAction( tr( "TOT_PLOT2D_ANALYTICAL_CURVES" ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ANALYTICAL_CURVES" ) ),
+                           tr( "MEN_PLOT2D_ANALYTICAL_CURVES" ),
+                           0, this );
+
+  aAction->setStatusTip( tr( "PRP_PLOT2D_ANALYTICAL_CURVES" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onAnalyticalCurve() ) );
+  mgr->registerAction( aAction, AnalyticalCurveId );
+#endif
+
+  // 10. Clone
   aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ),
-                          aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
+                           aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
                            tr( "MNU_CLONE_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_CLONE_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SIGNAL( cloneView() ) );
   mgr->registerAction( aAction, CloneId );
 
+  // 11. Print 
+  aAction = new QtxAction( tr( "MNU_PRINT_VIEW" ),
+                          aResMgr->loadPixmap( "STD", tr( "ICON_PLOT2D_PRINT" ) ),
+                           tr( "MNU_PRINT_VIEW" ),
+                          0, this);
+  aAction->setStatusTip( tr( "DSC_PRINT_VIEW" ) );
+  connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPrintView() ) );
+  mgr->registerAction( aAction, PrintId );
+
   // Set initial values
   onChangeCurveMode();
   onChangeHorMode();
   onChangeVerMode();
+  onChangeNormLMode();
+  onChangeNormRMode();
   onChangeLegendMode();
 }
 
@@ -386,7 +477,7 @@ void Plot2d_ViewWindow::createActions()
 void Plot2d_ViewWindow::createToolBar()
 {
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
   mgr->append( DumpId, myToolBar );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
@@ -395,6 +486,12 @@ void Plot2d_ViewWindow::createToolBar()
   mgr->append( CurvLinesId, myToolBar );
   mgr->append( CurvSplinesId, myToolBar );
   mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( PModeNormLMaxId, myToolBar );
+  mgr->append( PModeNormLMinId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
+  mgr->append( PModeNormRMaxId, myToolBar );
+  mgr->append( PModeNormRMinId, myToolBar );
+  mgr->append( toolMgr()->separator(), myToolBar );
   mgr->append( PModeXLinearId, myToolBar );
   mgr->append( PModeXLogarithmicId, myToolBar );
   mgr->append( toolMgr()->separator(), myToolBar );
@@ -403,7 +500,9 @@ void Plot2d_ViewWindow::createToolBar()
   mgr->append( toolMgr()->separator(), myToolBar );
   mgr->append( LegendId, myToolBar );
   mgr->append( CurvSettingsId, myToolBar );
+  mgr->append( AnalyticalCurveId, myToolBar );
   mgr->append( CloneId, myToolBar );
+  mgr->append( PrintId, myToolBar );
 }
 
 /*!
@@ -465,6 +564,42 @@ void Plot2d_ViewWindow::onChangeVerMode()
   toolMgr()->action( GlobalPanId )->setEnabled( aHorLinear && aVerLinear );
 }
 
+/*!
+  \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormLMode()
+{
+  bool aNormMax = myViewFrame->isNormLMaxMode();
+  bool aNormMin = myViewFrame->isNormLMinMode();
+
+  if ( aNormMax )
+    toolMgr()->action( PModeNormLMaxId )->setChecked( true );
+  else
+    toolMgr()->action( PModeNormLMaxId )->setChecked( false );
+  if ( aNormMin )
+    toolMgr()->action( PModeNormLMinId )->setChecked( true );
+  else
+    toolMgr()->action( PModeNormLMinId )->setChecked( false );
+}
+
+/*!
+  \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormRMode()
+{
+  bool aNormMax = myViewFrame->isNormRMaxMode();
+  bool aNormMin = myViewFrame->isNormRMinMode();
+
+  if ( aNormMax )
+    toolMgr()->action( PModeNormRMaxId )->setChecked( true );
+  else
+    toolMgr()->action( PModeNormRMaxId )->setChecked( false );
+  if ( aNormMin )
+    toolMgr()->action( PModeNormRMinId )->setChecked( true );
+  else
+    toolMgr()->action( PModeNormRMinId )->setChecked( false );
+}
+
 /*!
   \brief Called when the curve type is changed.
 */
@@ -549,6 +684,26 @@ void Plot2d_ViewWindow::onViewVerMode()
   myViewFrame->setVerScaleMode( toolMgr()->action( PModeYLinearId )->isChecked() ? 0 : 1 );
 }
 
+/*!
+  \brief Called when normalization mode action (by left Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormLMode()
+{
+  myViewFrame->setNormLMaxMode( toolMgr()->action( PModeNormLMaxId )->isChecked() ? true : false );
+  myViewFrame->setNormLMinMode( toolMgr()->action( PModeNormLMinId )->isChecked() ? true : false );
+}
+
+/*!
+  \brief Called when normalization mode action (by right Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormRMode()
+{
+  myViewFrame->setNormRMaxMode( toolMgr()->action( PModeNormRMaxId )->isChecked() ? true : false );
+  myViewFrame->setNormRMinMode( toolMgr()->action( PModeNormRMinId )->isChecked() ? true : false );
+}
+
 /*!
   \brief Called when the "Show legend" action is activated.
 */
@@ -601,8 +756,8 @@ QImage Plot2d_ViewWindow::dumpView()
   \param format image format ("BMP" [default], "JPEG", "JPG", "PNG")
 */
 bool Plot2d_ViewWindow::dumpViewToFormat( const QImage&  img,
-                                         const QString& fileName, 
-                                         const QString& format )
+                                          const QString& fileName, 
+                                          const QString& format )
 {
   bool res = myViewFrame ? myViewFrame->print( fileName, format ) : false;
   if( !res )
@@ -623,6 +778,151 @@ QString Plot2d_ViewWindow::filter() const
   return filters.join( ";;" );
 }
 
+/*!
+  \brief Called when the "Print view" action is activated.
+*/
+void Plot2d_ViewWindow::onPrintView()
+{
+  if ( !myViewFrame )
+    return;
+
+#if !defined(WIN32) && !defined(QT_NO_CUPS)
+#if QT_VERSION < 0x040303
+  if ( !Qtx::hasAnyPrinters() ) {
+    SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
+                              tr( "WRN_NO_PRINTERS" ) );
+    return;
+  }
+#endif
+#endif
+
+  // stored settings for further starts
+  static QString aPrinterName;
+  static int aColorMode = -1;
+  static int anOrientation = -1;
+
+  QPrinter aPrinter;
+
+  // restore settinds from previous launching
+
+  // printer name
+  if ( !aPrinterName.isEmpty() )
+    aPrinter.setPrinterName( aPrinterName );
+  else 
+  {
+    // Nothing to do for the first printing. aPrinter contains default printer name by default
+  }
+
+  // color mode
+  if ( aColorMode >= 0 )
+    aPrinter.setColorMode( (QPrinter::ColorMode)aColorMode );
+  else 
+  {
+    // Black-and-wight printers are often used
+    aPrinter.setColorMode( QPrinter::GrayScale );
+  }
+
+  if ( anOrientation >= 0 )
+    aPrinter.setOrientation( (QPrinter::Orientation)anOrientation );
+  else
+    aPrinter.setOrientation( QPrinter::Landscape );
+
+  QPrintDialog printDlg( &aPrinter, this );
+  printDlg.setPrintRange( QAbstractPrintDialog::AllPages );
+  if ( printDlg.exec() != QDialog::Accepted ) 
+    return;
+
+  // store printer settings for further starts
+  aPrinterName = aPrinter.printerName();
+  aColorMode = aPrinter.colorMode();
+  anOrientation = aPrinter.orientation();
+  
+  int W, H;
+  QPainter aPainter;
+
+  bool needColorCorrection = aPrinter.colorMode() == QPrinter::GrayScale;
+
+  // work arround for printing on real printer
+  if ( aPrinter.outputFileName().isEmpty() && aPrinter.orientation() == QPrinter::Landscape )
+  {
+    aPrinter.setFullPage( false );
+    // set paper orientation and rotate painter
+    aPrinter.setOrientation( QPrinter::Portrait );
+
+    W = aPrinter.height();
+    H = aPrinter.width();
+
+    aPainter.begin( &aPrinter );
+    aPainter.translate( QPoint( H, 0 ) );
+    aPainter.rotate( 90 );
+  }
+  else 
+  {
+    aPrinter.setFullPage( false );
+    aPainter.begin( &aPrinter );
+    W = aPrinter.width();
+    H = aPrinter.height();
+  }
+
+  QMap< QwtPlotCurve*, QPen > aCurvToPen;
+  QMap< QwtPlotCurve*, QwtSymbol > aCurvToSymbol;
+
+  if ( needColorCorrection )
+  {
+    // Iterate through, store temporary their parameters and assign 
+    // parameters proper for printing
+
+    CurveDict aCurveDict = myViewFrame->getCurves();
+    CurveDict::iterator it;
+    for ( it = aCurveDict.begin(); it != aCurveDict.end(); it++ ) 
+    {
+      QwtPlotCurve* aCurve = it.key();
+      if ( !aCurve )
+        continue;
+
+      // pen
+      QPen aPen = aCurve->pen();
+      aCurvToPen[ aCurve ] = aPen;
+
+      aPen.setColor( QColor( 0, 0, 0 ) );
+      aPen.setWidthF( 1.5 );
+
+      aCurve->setPen( aPen );
+
+      // symbol
+      QwtSymbol aSymbol = aCurve->symbol();
+      aCurvToSymbol[ aCurve ] = aSymbol;
+      aPen = aSymbol.pen();
+      aPen.setColor( QColor( 0, 0, 0 ) );
+      aPen.setWidthF( 1.5 );
+      aSymbol.setPen( aPen );
+
+      aCurve->setSymbol( aSymbol );
+    }
+  }
+
+  myViewFrame->printPlot( &aPainter, QRect( 0, 0, W, H ) );
+  aPainter.end();
+
+  // restore old pens and symbols
+  if ( needColorCorrection && !aCurvToPen.isEmpty() )
+  {
+    CurveDict aCurveDict = myViewFrame->getCurves();
+    CurveDict::iterator it;
+    for ( it = aCurveDict.begin(); it != aCurveDict.end(); it++ ) 
+    {
+      QwtPlotCurve* aCurve = it.key();
+      if ( !aCurve || 
+           !aCurvToPen.contains( aCurve ) ||
+           !aCurvToSymbol.contains( aCurve ) )
+        continue;
+
+      aCurve->setPen( aCurvToPen[ aCurve ] );
+      aCurve->setSymbol( aCurvToSymbol[ aCurve ] );
+    }
+  }
+}
+
 /*!
   \fn void Plot2d_ViewWindow::cloneView();
   \brief Emitted when the "Clone View" action is activated.
index 9ddd4c664214b978063467404b7434e40f46ff5d..8dee2d3bcd6d109f85ccfb4f4d7bfe9381a57dac 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Plot2d_ViewWindow.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -48,14 +49,17 @@ class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow
 
 public:
   enum { DumpId, 
-        ScaleOpId, FitAllId, FitRectId, ZoomId,
-        MoveOpId, PanId, GlobalPanId,
-        PModeXLinearId, PModeXLogarithmicId, 
+         ScaleOpId, FitAllId, FitRectId, ZoomId,
+         MoveOpId, PanId, GlobalPanId,
+         PModeXLinearId, PModeXLogarithmicId, 
          PModeYLinearId, PModeYLogarithmicId,
+         PModeNormLMaxId, PModeNormLMinId,
+         PModeNormRMaxId, PModeNormRMinId,
         CurvPointsId, CurvLinesId, CurvSplinesId, 
         LegendId,
         CurvSettingsId,
-        CloneId };
+        CloneId, PrintId,
+        AnalyticalCurveId };
 
 public:
   Plot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
@@ -65,6 +69,7 @@ public:
   void              putInfo( const QString&);
   Plot2d_ViewFrame* getViewFrame();
   QToolBar*         getToolBar();
+  virtual void      initLayout();
   void              contextMenuPopup( QMenu* );
 
   virtual bool      eventFilter( QObject*, QEvent* );
@@ -82,6 +87,9 @@ public slots:
   void              onChangeVerMode();
   void              onChangeCurveMode();
   void              onChangeLegendMode();
+  void              onChangeNormLMode();
+  void              onChangeNormRMode();
+
   
   void              onFitAll();
   void              onFitRect();
@@ -90,16 +98,19 @@ public slots:
   void              onGlobalPanning();
   void              onViewHorMode();
   void              onViewVerMode();
+  void              onViewNormLMode();
+  void              onViewNormRMode();
   void              onLegend();
   void              onCurves();
 
   void              onDumpView();
+  void              onPrintView();
 
 protected:
   virtual QImage    dumpView();
   virtual bool      dumpViewToFormat( const QImage&, 
-                                     const QString&, 
-                                     const QString& );
+                                      const QString&, 
+                                      const QString& );
   virtual QString   filter() const;
 
 signals:
diff --git a/src/Plot2d/resources/Plot2d_images.po b/src/Plot2d/resources/Plot2d_images.po
deleted file mode 100755 (executable)
index 03b863e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_PLOT2D_DUMP"
-msgstr "plot2d_camera_dump.png"
-
-msgid "ICON_PLOT2D_FIT_ALL"
-msgstr "plot2d_fitall.png"
-
-msgid "ICON_PLOT2D_FIT_AREA"
-msgstr "plot2d_fitarea.png"
-
-msgid "ICON_PLOT2D_ZOOM"
-msgstr "plot2d_zoom.png"
-
-msgid "ICON_PLOT2D_PAN"
-msgstr "plot2d_pan.png"
-
-msgid "ICON_PLOT2D_GLOBALPAN"
-msgstr "plot2d_glpan.png"
-
-msgid "ICON_PLOT2D_CLONE_VIEW"
-msgstr "plot2d_clone.png"
-
-msgid "ICON_PLOT2D_MODE_LINEAR_HOR"
-msgstr "plot2d_linear.png"
-
-msgid "ICON_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "plot2d_log.png"
-
-msgid "ICON_PLOT2D_MODE_LINEAR_VER"
-msgstr "plot2d_linear_y.png"
-
-msgid "ICON_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "plot2d_log_y.png"
-
-msgid "ICON_PLOT2D_SHOW_LEGEND"
-msgstr "plot2d_legend.png"
-
-msgid "ICON_PLOT2D_CURVES_POINTS"
-msgstr "plot2d_points.png"
-
-msgid "ICON_PLOT2D_CURVES_LINES"
-msgstr "plot2d_lines.png"
-
-msgid "ICON_PLOT2D_CURVES_SPLINES"
-msgstr "plot2d_splines.png"
-
-msgid "ICON_PLOT2D_SETTINGS"
-msgstr "plot2d_settings.png"
index 41d9904456d31a7ee6a3b8711611b0691b1ed507..33028818f22243c8a5ac4b4c15d20460975417d5 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>ICON_PLOT2D_MODE_LOGARITHMIC_VER</source>
         <translation>plot2d_log_y.png</translation>
     </message>
+    <message>
+        <source>ICON_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>plot2d_lmin_normalization.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>plot2d_lmax_normalization.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>plot2d_rmin_normalization.png</translation>
+    </message>
+    <message>
+        <source>ICON_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>plot2d_rmax_normalization.png</translation>
+    </message>
     <message>
         <source>ICON_PLOT2D_SETTINGS</source>
         <translation>plot2d_settings.png</translation>
     </message>
+    <message>
+        <source>ICON_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>plot2d_analytical_curve.png</translation>
+    </message>    
     <message>
         <source>ICON_PLOT2D_CURVES_LINES</source>
         <translation>plot2d_lines.png</translation>
@@ -88,5 +87,9 @@
         <source>ICON_PLOT2D_SHOW_LEGEND</source>
         <translation>plot2d_legend.png</translation>
     </message>
+    <message>
+        <source>ICON_PLOT2D_PRINT</source>
+        <translation>plot2d_print.png</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/Plot2d/resources/Plot2d_msg_en.po b/src/Plot2d/resources/Plot2d_msg_en.po
deleted file mode 100755 (executable)
index 2962b0c..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-# ------------------------------------
-# Plot2d_ViewFrame
-# ------------------------------------
-msgid "TOT_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Horizontal axis: linear"
-
-msgid "MEN_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Horizontal axis: linear"
-
-msgid "PRP_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Switches view to linear scaling mode along horizontal axis"
-
-msgid "TOT_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Horizontal axis: logarithmic"
-
-msgid "MEN_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Horizontal axis: logarithmic"
-
-msgid "PRP_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Switches view to logarithmic scaling mode along horizontal axis"
-
-msgid "TOT_PLOT2D_MODE_LINEAR_VER"
-msgstr "Vertical axis: linear"
-
-msgid "MEN_PLOT2D_MODE_LINEAR_VER"
-msgstr "Vertical axis: linear"
-
-msgid "PRP_PLOT2D_MODE_LINEAR_VER"
-msgstr "Switches view to linear scaling mode along vertical axis"
-
-msgid "TOT_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Vertical axis: logarithmic"
-
-msgid "MEN_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Vertical axis: logarithmic"
-
-msgid "PRP_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Switches view to logarithmic scaling mode along vertical axis"
-
-msgid "TOT_PLOT2D_SHOW_LEGEND"
-msgstr "Show Legend"
-
-msgid "MEN_PLOT2D_SHOW_LEGEND"
-msgstr "Show &Legend"
-
-msgid "PRP_PLOT2D_SHOW_LEGEND"
-msgstr "Enables/disables legend"
-
-msgid "TOT_PLOT2D_CURVES_POINTS"
-msgstr "Draw points"
-
-msgid "MEN_PLOT2D_CURVES_POINTS"
-msgstr "Draw points"
-
-msgid "PRP_PLOT2D_CURVES_POINTS"
-msgstr "Switches view to points mode"
-
-msgid "TOT_PLOT2D_CURVES_LINES"
-msgstr "Draw lines"
-
-msgid "MEN_PLOT2D_CURVES_LINES"
-msgstr "Draw lines"
-
-msgid "PRP_PLOT2D_CURVES_LINES"
-msgstr "Switches view to lines mode"
-
-msgid "TOT_PLOT2D_CURVES_SPLINES"
-msgstr "Draw splines"
-
-msgid "MEN_PLOT2D_CURVES_SPLINES"
-msgstr "Draw splines"
-
-msgid "PRP_PLOT2D_CURVES_SPLINES"
-msgstr "Switches view to splines mode"
-
-msgid "TOT_PLOT2D_SETTINGS"
-msgstr "Settings"
-
-msgid "MEN_PLOT2D_SETTINGS"
-msgstr "&Settings"
-
-msgid "PRP_PLOT2D_SETTINGS"
-msgstr "Setups view properties"
-
-msgid "TOT_PLOT2D_FITDATA"
-msgstr "Fit range"
-
-msgid "MEN_PLOT2D_FITDATA"
-msgstr "Fit &Range"
-
-msgid "PRP_PLOT2D_FITDATA"
-msgstr "Fits view to the given data range"
-
-msgid "TOT_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background"
-
-msgid "MEN_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background..."
-
-msgid "PRP_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background color"
-
-msgid "SCALING_POPUP"
-msgstr "Scaling"
-
-msgid "CURVE_TYPE_POPUP"
-msgstr "Curve type"
-
-msgid "INF_COORDINATES"
-msgstr "Coordinates: X : %1, Y : %2"
-
-msgid "WARNING"
-msgstr "Warning"
-
-msgid "WRN_XLOG_NOT_ALLOWED"
-msgstr "Some points with non-positive abscissa values have been detected.\nLogarithmic scale for abscissa axis is not allowed."
-
-msgid "WRN_YLOG_NOT_ALLOWED"
-msgstr "Some points with non-positive ordinate values have been detected.\nLogarithmic scale for ordinate axis is not allowed."
-
-msgid "INF_COORDINATES_SOME_Y"
-msgstr "Coordinates: X : %1, Y : %2 ( %3 )"
-
-#msgid "INF_READY"
-#msgstr "Ready"
-
-msgid "PLOT2D_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-#-------------------------------------
-# Plot2d_SetupViewDlg
-# ------------------------------------
-msgid "TLT_SETUP_PLOT2D_VIEW"
-msgstr "Plot 2d View Settings"
-
-msgid "PLOT2D_ENABLE_MAIN_TITLE"
-msgstr "Main title"
-
-msgid "PLOT2D_ENABLE_HOR_TITLE"
-msgstr "Horizontal axis title"
-
-msgid "INF_AXES_X"
-msgstr "Axis X"
-
-msgid "INF_AXES_Y_LEFT"
-msgstr "Axis Y Left"
-
-msgid "INF_AXES_Y_RIGHT"
-msgstr "Axis Y Right"
-
-msgid "PLOT2D_ENABLE_VER_TITLE"
-msgstr "Vertical axis title"
-
-msgid "PLOT2D_CURVE_TYPE_LBL"
-msgstr "Curve type:"
-
-msgid "PLOT2D_CURVE_TYPE_POINTS"
-msgstr "Points"
-
-msgid "PLOT2D_CURVE_TYPE_LINES"
-msgstr "Lines"
-
-msgid "PLOT2D_CURVE_TYPE_SPLINE"
-msgstr "Spline"
-
-msgid "PLOT2D_ENABLE_LEGEND"
-msgstr "Show legend"
-
-msgid "PLOT2D_LEGEND_POSITION_LEFT"
-msgstr "Left"
-
-msgid "PLOT2D_LEGEND_POSITION_RIGHT"
-msgstr "Right"
-
-msgid "PLOT2D_LEGEND_POSITION_TOP"
-msgstr "Top"
-
-msgid "PLOT2D_LEGEND_POSITION_BOTTOM"
-msgstr "Bottom"
-
-msgid "PLOT2D_MARKER_SIZE_LBL"
-msgstr "Marker size:"
-
-msgid "PLOT2D_BACKGROUND_COLOR_LBL"
-msgstr "Background color:"
-
-msgid "PLOT2D_SCALE_TLT"
-msgstr "Scale mode"
-
-msgid "PLOT2D_SCALE_MODE_HOR"
-msgstr "Horizontal axis:"
-
-msgid "PLOT2D_SCALE_MODE_VER"
-msgstr "Vertical axis:"
-
-msgid "PLOT2D_SCALE_MODE_LINEAR"
-msgstr "Linear"
-
-msgid "PLOT2D_SCALE_MODE_LOGARITHMIC"
-msgstr "Logarithmic"
-
-msgid "PLOT2D_GRID_TLT"
-msgstr "Grid / Axes marks"
-
-msgid "PLOT2D_GRID_ENABLE_HOR_MAJOR"
-msgstr "Horizontal major"
-
-msgid "PLOT2D_GRID_ENABLE_VER_MAJOR"
-msgstr "Vertical major"
-
-msgid "PLOT2D_GRID_ENABLE_HOR_MINOR"
-msgstr "Horizontal minor"
-
-msgid "PLOT2D_GRID_ENABLE_VER_MINOR"
-msgstr "Vertical minor"
-
-msgid "PLOT2D_MAX_INTERVALS"
-msgstr "Max intervals"
-
-msgid "PLOT2D_SET_AS_DEFAULT_CHECK"
-msgstr "Save settings as default"
-
-# ------------------------------------
-# Plot2d_FitDataDlg
-# ------------------------------------
-msgid "FIT_DATA_TLT"
-msgstr "Fit Data Range"
-
-msgid "Plot2d_FitDataDlg::FIT_ALL"
-msgstr "Fit both"
-
-msgid "Plot2d_FitDataDlg::FIT_HORIZONTAL"
-msgstr "Fit horizontally"
-
-msgid "Plot2d_FitDataDlg::FIT_VERTICAL"
-msgstr "Fit vertically"
-
-msgid "Plot2d_FitDataDlg::HORIZONTAL_AXIS"
-msgstr "Horizontal axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_AXIS"
-msgstr "Vertical axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_LEFT_AXIS"
-msgstr "Vertical left axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_RIGHT_AXIS"
-msgstr "Vertical right axis"
-
-msgid "Plot2d_FitDataDlg::MIN_VALUE_LAB"
-msgstr "Min:"
-
-msgid "Plot2d_FitDataDlg::MAX_VALUE_LAB"
-msgstr "Max:"
-
-# ------------------------------------
-# Plot2d_ViewWindow
-# ------------------------------------
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_CLONE_VIEW"
-msgstr "Create new OCC viewer for the active scene"
-
-msgid "MNU_CLONE_VIEW"
-msgstr "Clone View"
-
-
-msgid "TLT_SETUP_CURVE"
-msgstr "Setup Curve"
-
-msgid "CURVE_LINE_TYPE_LAB"
-msgstr "Line type:"
-
-msgid "CURVE_LINE_WIDTH_LAB"
-msgstr "Line width:"
-
-msgid "CURVE_MARKER_TYPE_LAB"
-msgstr "Marker type:"
-
-msgid "CURVE_COLOR_LAB"
-msgstr "Color:"
-
-msgid "NONE_LINE_LBL"
-msgstr "None"
-
-msgid "SOLID_LINE_LBL"
-msgstr "Solid"
-
-msgid "DASH_LINE_LBL"
-msgstr "Dash"
-
-msgid "DOT_LINE_LBL"
-msgstr "Dot"
-
-msgid "DASHDOT_LINE_LBL"
-msgstr "DashDot"
-
-msgid "DAHSDOTDOT_LINE_LBL"
-msgstr "DashDotDot"
-
-msgid "NONE_MARKER_LBL"
-msgstr "None"
-
-msgid "CIRCLE_MARKER_LBL"
-msgstr "Circle"
-
-msgid "RECTANGLE_MARKER_LBL"
-msgstr "Rectangle"
-
-msgid "DIAMOND_MARKER_LBL"
-msgstr "Diamond"
-
-msgid "DTRIANGLE_MARKER_LBL"
-msgstr "Downward triangle"
-
-msgid "UTRIANGLE_MARKER_LBL"
-msgstr "Upward triangle"
-
-msgid "LTRIANGLE_MARKER_LBL"
-msgstr "Leftward triangle"
-
-msgid "RTRIANGLE_MARKER_LBL"
-msgstr "Rightward triangle"
-
-msgid "CROSS_MARKER_LBL"
-msgstr "Cross"
-
-msgid "XCROSS_MARKER_LBL"
-msgstr "Diagonal cross"
-
-msgid "POSTSCRIPT_FILES"
-msgstr "PostScript files (*.ps)"
-
-msgid "Plot2d_ViewManager::PLOT2D_VIEW_TITLE"
-msgstr "Plot2d scene:%M - viewer:%V"
index c1a7aad83bb83d45b1f605177af69c58a2e63a0e..f512d87d97720d43783e090cc60b27ae1b7845c2 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>PLOT2D_SCALE_MODE_HOR</source>
         <translation>Horizontal axis:</translation>
     </message>
+    <message>
+        <source>PLOT2D_NORMALIZE_TLT</source>
+        <translation>Normalization</translation>
+    </message>
+    <message>
+        <source>PLOT2D_NORMALIZE_MODE_MIN</source>
+        <translation>Normalize to minimum</translation>
+    </message>
+    <message>
+        <source>PLOT2D_NORMALIZE_MODE_MAX</source>
+        <translation>Normalize to maximum</translation>
+    </message>
+    <message>
+        <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
+        <translation>Left Y Axis: </translation>
+    </message>
+    <message>
+        <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
+        <translation>Right Y Axis: </translation>
+    </message>
     <message>
         <source>PLOT2D_SCALE_MODE_VER</source>
         <translation>Vertical axis:</translation>
         <source>MNU_CLONE_VIEW</source>
         <translation>Clone View</translation>
     </message>
+    <message>
+        <source>MNU_PRINT_VIEW</source>
+        <translation>Print View</translation>
+    </message>
     <message>
         <source>POSTSCRIPT_FILES</source>
         <translation>PostScript files (*.ps)</translation>
         <source>CURVE_TYPE_POPUP</source>
         <translation>Curve type</translation>
     </message>
+    <message>
+        <source>NORMALIZATION_TYPE_POPUP</source>
+        <translation>Normalization</translation>
+    </message>
     <message>
         <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
         <translation>Vertical axis: linear</translation>
         <source>DSC_CLONE_VIEW</source>
         <translation>Create new OCC viewer for the active scene</translation>
     </message>
+    <message>
+        <source>DSC_PRINT_VIEW</source>
+        <translation>Print active view</translation>
+    </message>
     <message>
         <source>DASH_LINE_LBL</source>
         <translation>Dash</translation>
         <source>TOT_PLOT2D_SETTINGS</source>
         <translation>Settings</translation>
     </message>
+    <message>
+        <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Analytical curves</translation>
+    </message>    
+    <message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Left Y Axis: Normalize to global maximum</translation>
+    </message>    
+    <message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Left Y Axis: Normalize to global minimum</translation>
+    </message>    
+    <message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Right Y Axis: Normalize to global maximum</translation>
+    </message>    
+    <message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Right Y Axis: Normalize to global minimum</translation>
+    </message>    
     <message>
         <source>PLOT2D_CURVE_TYPE_LINES</source>
         <translation>Lines</translation>
         <source>PLOT2D_BACKGROUND_COLOR_LBL</source>
         <translation>Background color:</translation>
     </message>
+    <message>
+        <source>PLOT2D_DEVIATION_MARKER_TLT</source>
+        <translation>Deviation marker</translation>
+    </message>
+    <message>
+        <source>PLOT2D_DEVIATION_LW_LBL</source>
+        <translation>Line width</translation>
+    </message>
+    <message>
+        <source>PLOT2D_DEVIATION_TS_LBL</source>
+        <translation>Tick size</translation>
+    </message>
+    <message>
+        <source>PLOT2D_DEVIATION_CL_LBL</source>
+        <translation>Color</translation>
+    </message>
     <message>
         <source>WRN_XLOG_NOT_ALLOWED</source>
         <translation>Some points with non-positive abscissa values have been detected.
@@ -354,14 +401,38 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <source>PLOT2D_ENABLE_LEGEND</source>
         <translation>Show legend</translation>
     </message>
+    <message>
+        <source>PLOT2D_LEGEND_FONT</source>
+        <translation>Legend font</translation>
+    </message>
     <message>
         <source>DSC_ZOOM_VIEW</source>
         <translation>Zoom the view</translation>
     </message>
+    <message>
+        <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Setups analytical curves properties</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Switches view to maximum normalization mode by left Y axis</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Switches view to minimum normalization mode by left Y axis</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Switches view to maximum normalization mode by right Y axis</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Switches view to minimum normalization mode by right Y axis</translation>
+    </message>
     <message>
         <source>PRP_PLOT2D_SETTINGS</source>
         <translation>Setups view properties</translation>
-    </message>
+    </message>    
     <message>
         <source>INF_COORDINATES_SOME_Y</source>
         <translation>Coordinates: X : %1, Y : %2 ( %3 )</translation>
@@ -398,6 +469,22 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
         <translation>Vertical Axis: Logarithmic</translation>
     </message>
+    <message>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Left Y Axis: Minimum</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Left Y Axis: Maximum</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Right Y Axis: Minimum</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Right Y Axis: Maximum</translation>
+    </message>
     <message>
         <source>PRP_PLOT2D_FITDATA</source>
         <translation>Fits view to the given data range</translation>
@@ -450,6 +537,10 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <source>MEN_PLOT2D_SETTINGS</source>
         <translation>&amp;Settings</translation>
     </message>
+    <message>
+        <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Analytical curves</translation>
+    </message>
     <message>
         <source>CIRCLE_MARKER_LBL</source>
         <translation>Circle</translation>
@@ -528,5 +619,156 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <source>PLOT2D_VIEW_TITLE</source>
         <translation>Plot2d scene:%M - viewer:%V</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_PLOT2DVIEWER</source>
+        <translation>Plot2d Viewer</translation>
+    </message>
+    <message>
+        <source>PREF_SHOW_LEGEND</source>
+        <translation>Show legend</translation>
+    </message>
+    <message>
+        <source>PREF_LEGEND_POSITION</source>
+        <translation>Legend position:</translation>
+    </message>
+    <message>
+        <source>PREF_LEFT</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>PREF_RIGHT</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>PREF_TOP</source>
+        <translation>Top</translation>
+    </message>
+    <message>
+        <source>PREF_BOTTOM</source>
+        <translation>Bottom</translation>
+    </message>
+    <message>
+        <source>PREF_CURVE_TYPE</source>
+        <translation>Curve type:</translation>
+    </message>
+    <message>
+        <source>PREF_POINTS</source>
+        <translation>Points</translation>
+    </message>
+    <message>
+        <source>PREF_LINES</source>
+        <translation>Lines</translation>
+    </message>
+    <message>
+        <source>PREF_SPLINE</source>
+        <translation>Spline</translation>
+    </message>
+    <message>
+        <source>PREF_MARKER_SIZE</source>
+        <translation>Marker size:</translation>
+    </message>
+    <message>
+        <source>PREF_LINEAR</source>
+        <translation>Linear</translation>
+    </message>
+    <message>
+        <source>PREF_LOGARITHMIC</source>
+        <translation>Logarithmic</translation>
+    </message>
+    <message>
+        <source>PREF_HOR_AXIS_SCALE</source>
+        <translation>Horizontal axis scale:</translation>
+    </message>
+    <message>
+        <source>PREF_VERT_AXIS_SCALE</source>
+        <translation>Vertical axis scale:</translation>
+    </message>
+    <message>
+        <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Background color</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_AnalyticalCurveDlg</name>
+    <message>
+        <source>ANALYTICAL_CURVE_TLT</source>
+        <translation>Analytical curves properties</translation>
+    </message>
+    <message>
+        <source>AC_CURVE_PARAMS</source>
+        <translation>Curve parameters</translation>
+    </message>    
+    <message>
+        <source>AC_CURVE_PROPS</source>
+        <translation>Curve properties</translation>
+    </message>        
+    <message>
+        <source>AC_FORMULA</source>
+        <translation>y(x) = </translation>
+    </message>            
+    <message>
+        <source>AC_NB_INTERVALS</source>
+        <translation>Nb. intervals</translation>
+    </message>
+    <message>
+        <source>AC_AUTO_ASSIGN</source>
+        <translation>Auto assign</translation>
+    </message>
+    <message>
+        <source>AC_MARKER_TYPE</source>
+        <translation>Marker type</translation>
+    </message>
+    <message>
+        <source>AC_LINE_TYPE</source>
+        <translation>Line type</translation>
+    </message>
+    <message>
+        <source>AC_LINE_WIDTH</source>
+        <translation>Line Width</translation>
+    </message>
+    <message>
+        <source>AC_CURVE_COLOR</source>
+        <translation>Curve color</translation>
+    </message>
+    <message>
+        <source>AC_ADD_BTN</source>
+        <translation>Add curve</translation>
+    </message>                
+    <message>
+        <source>AC_REM_BTN</source>
+        <translation>Remove curve</translation>
+    </message>                    
+    <message>
+        <source>AC_OK_BTN</source>
+        <translation>Ok</translation>
+    </message>                    
+    <message>
+        <source>AC_APPLY_BTN</source>
+        <translation>Apply</translation>
+    </message>                                        
+    <message>
+        <source>AC_CANT_CALCULATE</source>
+        <translation>Can't calculate curve. 
+Please, check input parameters!!!</translation>
+    </message>
+    <message>
+        <source>AC_CLOSE_BTN</source>
+        <translation>&amp;Close</translation>
+    </message>
+    <message>
+        <source>AC_HELP_BTN</source>
+        <translation>Help</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_SetupCurveScaleDlg</name>
+    <message>
+        <source>TLT_SETUP_CURVE_SCALE</source>
+        <translation>Curve(s) scale</translation>
+    </message>
+    <message>
+        <source>CURVE_SCALE_FACTOR</source>
+        <translation>Scale factor</translation>
+    </message>
 </context>
-</TS>
+</TS>
\ No newline at end of file
index 06a0502045463569443a8039fdf982f455cfb8b3..4edf27789f3582fdd423b214c4b5e791004c54d5 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomePrs.la
diff --git a/src/Prs/Prs.pro b/src/Prs/Prs.pro
deleted file mode 100644 (file)
index a22aad1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SalomePrs
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PRS_EXPORTS
-
-HEADERS  = SALOME_Prs.h
-
-SOURCES  = SALOME_Prs.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 693c6e6d36812850d4309e28aecd95add87495ec..6c14108446edfc8dfeccd7cfc4ef2ed6b7afb1f8 100755 (executable)
@@ -1,34 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       SALOME_Prs.cxx
-// Created:    Wed Apr 28 15:03:43 2004
-// Author:     Sergey ANIKIN
-//             <san@startrex.nnov.opencascade.com>
-//
-#include "SALOME_Prs.h"
 
-//#include "utilities.h"
+// File:        SALOME_Prs.cxx
+// Author:      Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
 
-//using namespace std;
+#include "SALOME_Prs.h"
 
 /*!
   Dispatches display operation to proper Display() method of SALOME_View
@@ -46,6 +41,38 @@ void SALOME_OCCPrs::EraseIn( SALOME_View* v, const bool forced ) const
   if ( v ) v->Erase( this, forced );
 }
 
+/*!
+  Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeErase( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterErase( v, this );
+}
+
 /*!
   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
 */
@@ -78,6 +105,38 @@ void SALOME_VTKPrs::EraseIn( SALOME_View* v, const bool forced ) const
   if ( v ) v->Erase( this, forced );
 }
 
+/*!
+  Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeErase( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterErase( v, this );
+}
+
 /*!
   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
 */
@@ -110,6 +169,38 @@ void SALOME_Prs2d::EraseIn( SALOME_View* v, const bool forced ) const
   if ( v ) v->Erase( this, forced );
 }
 
+/*!
+  Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterDisplay( v, this );
+}
+
+/*!
+  Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->BeforeErase( v, this );
+}
+
+/*!
+  Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+  d->AfterErase( v, this );
+}
+
 /*!
   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
 */
@@ -242,6 +333,26 @@ void SALOME_View::GlobalSelection( const bool ) const
 //   Probably, selection is being activated in uncompatible viewframe." );
 }
 
+void SALOME_View::BeforeDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+  p->BeforeDisplayIn( d, this );
+}
+
+void SALOME_View::AfterDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+  p->AfterDisplayIn( d, this );
+}
+
+void SALOME_View::BeforeErase( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+  p->BeforeEraseIn( d, this );
+}
+
+void SALOME_View::AfterErase ( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+  p->AfterEraseIn( d, this );
+}
+
 /*!
   Gives control to SALOME_Prs object, so that it could perform double dispatch
 */
index 05aeb50bbc889bbfe3746fdd610472b3cb280813..b13eab075837d0cfa023e1e10c36036028eeaeab 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOME_PRS_H
 #define SALOME_PRS_H
 
 #ifdef WIN32
-#ifdef PRS_EXPORTS
+#if defined PRS_EXPORTS || defined SalomePrs_EXPORTS
 #define PRS_EXPORT __declspec(dllexport)
 #else
 #define PRS_EXPORT __declspec(dllimport)
@@ -34,6 +35,7 @@
 
 class SALOME_View;
 class SALOME_Displayer;
+class SALOME_ListIO;
 class Handle_SALOME_InteractiveObject;
 
 /*!
@@ -54,13 +56,25 @@ public:
   //! Key method for double dispatch of erase operation
   virtual void EraseIn( SALOME_View*, const bool = false ) const = 0;
 
+  //! Key method for double dispatch of pre-display operation
+  virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+  //! Key method for double dispatch of post-display operation
+  virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+  //! Key method for double dispatch of pre-erase operation
+  virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+  //! Key method for double dispatch of post-erase operation
+  virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
   //! Key method for double dispatch of update operation
   virtual void Update( SALOME_Displayer* ) = 0;
 
   //! Should return true, if this presentation contains a graphic object
   virtual bool IsNull() const = 0;
 
-  //! Key method for double dispatch of activation of subshapes selection
+  //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const = 0;
 };
 
@@ -73,19 +87,35 @@ public:
 class PRS_EXPORT SALOME_OCCPrs : public SALOME_Prs
 {
 public:
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
   //! invoke Display() method corresponding to the actual type of presentation.
   virtual void DisplayIn( SALOME_View* ) const;
 
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
   //! invoke Erase() method corresponding to the actual type of presentation.
   virtual void EraseIn( SALOME_View*, const bool = false ) const;
 
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
+  //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+  virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+  virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+  virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+  virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
   //! invoke Update() method corresponding to the actual type of presentation.
   virtual void Update( SALOME_Displayer* );
 
-  //! Key method for double dispatch of activation of subshapes selection
+  //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const;
 };
 
@@ -97,19 +127,35 @@ public:
 class PRS_EXPORT SALOME_VTKPrs : public SALOME_Prs
 {
 public:
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
   //! invoke Display() method corresponding to the actual type of presentation.
   virtual void DisplayIn( SALOME_View* ) const;
 
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
   //! invoke Erase() method corresponding to the actual type of presentation.
   virtual void EraseIn( SALOME_View*, const bool = false ) const;
 
-  //! It uses double dispatch in order to \n
+  //! It uses double dispatch in order to
+  //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+  virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+  virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+  virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+  virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
   //! invoke Update() method corresponding to the actual type of presentation.
   virtual void Update( SALOME_Displayer* );
 
-  //! Key method for double dispatch of activation of subshapes selection
+  //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const;
 };
 
@@ -128,11 +174,27 @@ public:
   //! invoke Erase() method corresponding to the actual type of presentation.
   virtual void EraseIn( SALOME_View*, const bool = false ) const;
 
+  //! It uses double dispatch in order to
+  //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+  virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+  virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+  virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+  //! It uses double dispatch in order to
+  //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+  virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
   //! It uses double dispatch in order to
   //! invoke Update() method corresponding to the actual type of presentation.
   virtual void Update( SALOME_Displayer* );
 
-  //! Key method for double dispatch of activation of subshapes selection
+  //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const;
 };
 
@@ -149,18 +211,18 @@ public:
   //! Destructor
   virtual ~SALOME_View() {}
 
-  //! This Display() method should be called to display given presentation \n
-  //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+  //! This Display() method should be called to display given presentation
+  //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
   void Display( const SALOME_Prs* );
 
-  //! This Erase() method should be called to erase given presentation \n
-  //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+  //! This Erase() method should be called to erase given presentation
+  //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
   void Erase( const SALOME_Prs*, const bool = false );
 
-  //! This LocalSelection() method should be called to activate sub-shapes selection \n
-  //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+  //! This LocalSelection() method should be called to activate sub-shapes selection
+  //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
   void LocalSelection( const SALOME_Prs*, const int );
 
@@ -169,13 +231,13 @@ public:
   // Display() methods for ALL kinds of presentation should appear here
   virtual void Display( const SALOME_OCCPrs* );//!< Display SALOME_OCCPrs presentation.
   virtual void Display( const SALOME_VTKPrs* );//!< Display SALOME_VTKPrs presentation.
-  virtual void Display( const SALOME_Prs2d* );//!< Display SALOME_Prs2d presentation.
+  virtual void Display( const SALOME_Prs2d*  );//!< Display SALOME_Prs2d  presentation.
   // Add new Display() methods here...
 
   // Erase() methods for ALL kinds of presentation should appear here
   virtual void Erase( const SALOME_OCCPrs*, const bool = false );//!< Erase SALOME_OCCPrs
   virtual void Erase( const SALOME_VTKPrs*, const bool = false );//!< Erase SALOME_VTKPrs
-  virtual void Erase( const SALOME_Prs2d*, const bool = false );//!< Erase SALOME_Prs2d
+  virtual void Erase( const SALOME_Prs2d*,  const bool = false );//!< Erase SALOME_Prs2d
   virtual void EraseAll( const bool = false );
   // Add new Erase() methods here...
 
@@ -191,23 +253,20 @@ public:
   virtual SALOME_Prs* CreatePrs( const char* /*entry*/ = 0 ) { return 0; }
 
   // Axiluary methods called before and after displaying of objects
-  virtual void BeforeDisplay( SALOME_Displayer* ) {} //!< Null body here
-  virtual void AfterDisplay ( SALOME_Displayer* ) {} //!< Null body here
+  virtual void BeforeDisplay( SALOME_Displayer*, const SALOME_Prs* );
+  virtual void AfterDisplay ( SALOME_Displayer*, const SALOME_Prs* );
+
+  // Axiluary methods called before and after erasing of objects
+  virtual void BeforeErase( SALOME_Displayer*, const SALOME_Prs* );
+  virtual void AfterErase ( SALOME_Displayer*, const SALOME_Prs* );
 
   // New methods (asv)
   //! \retval Return false.
   virtual bool isVisible( const Handle_SALOME_InteractiveObject& ){ return false; }
   virtual void Repaint() {} //!< Null body here.
+  virtual void GetVisible( SALOME_ListIO& theList ) {}
 };
 
-/*!
- \class SALOME_Displayer
- These classes are used to specify type of view VTK, OCC or Plot2d
-*/
-class PRS_EXPORT SALOME_OCCViewType    {};
-class PRS_EXPORT SALOME_VTKViewType    {};
-class PRS_EXPORT SALOME_Plot2dViewType {};
-
 /*!
  \class SALOME_Displayer
  Base class for SALOME displayers
@@ -218,8 +277,8 @@ public:
   //! Destructor
   virtual ~SALOME_Displayer() {/*! Null body here*/}
 
-  //! This Update() method should be called to update given presentation \n
-  //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+  //! This Update() method should be called to update given presentation
+  //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
   void UpdatePrs( SALOME_Prs* );
 
@@ -232,12 +291,21 @@ public:
   // Add new Update() methods here...
 
   // Axiluary methods called before and after displaying of objects
-  virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCViewType&    ){/*! Null body here*/};
-  virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCViewType&    ){/*! Null body here*/};
-  virtual void BeforeDisplay( SALOME_View*, const SALOME_VTKViewType&    ){/*! Null body here*/};
-  virtual void AfterDisplay ( SALOME_View*, const SALOME_VTKViewType&    ){/*! Null body here*/};
-  virtual void BeforeDisplay( SALOME_View*, const SALOME_Plot2dViewType& ){/*! Null body here*/};
-  virtual void AfterDisplay ( SALOME_View*, const SALOME_Plot2dViewType& ){/*! Null body here*/};
+  virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+  virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+  virtual void BeforeDisplay( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+  virtual void AfterDisplay ( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+  virtual void BeforeDisplay( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
+  virtual void AfterDisplay ( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
+
+  // Axiluary methods called before and after erasing of objects
+  virtual void BeforeErase( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+  virtual void AfterErase ( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+  virtual void BeforeErase( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+  virtual void AfterErase ( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+  virtual void BeforeErase( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
+  virtual void AfterErase ( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
+
 };
 
 #endif
index d6a0fc497efd33f3610b5f9d656b8179290af480..5cddb3f7462e627dd920e3dad08c9bcee8024ba3 100755 (executable)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : PyConsole
@@ -46,10 +44,11 @@ MOC_FILES =                         \
 nodist_libPyConsole_la_SOURCES = $(MOC_FILES)
 
 nodist_salomeres_DATA = \
-       PyConsole_msg_en.qm
+       PyConsole_msg_en.qm \
+       PyConsole_msg_fr.qm
 
 libPyConsole_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) \
        -I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 
-libPyConsole_la_LDFLAGS  = $(PYTHON_LIBS) $(QT_MT_LIBS)
+libPyConsole_la_LDFLAGS  = $(PYTHON_LIBS) $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSALOMELocalTrace
 libPyConsole_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../PyInterp/libPyInterp.la
index c2af7486a0d5bee8c5a11a8a517e1aa5ea0ea07e..9195225f295b92039690d7a9572eeb69761ad764 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : PyConsole.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -28,7 +29,7 @@
 // ========================================================
 // set dllexport type for Win platform 
 #ifdef WIN32
-#  ifdef PYCONSOLE_EXPORTS
+#  if defined PYCONSOLE_EXPORTS || defined PyConsole_EXPORTS
 #    define PYCONSOLE_EXPORT __declspec(dllexport)
 #  else
 #    define PYCONSOLE_EXPORT __declspec(dllimport)
diff --git a/src/PyConsole/PyConsole.pro b/src/PyConsole/PyConsole.pro
deleted file mode 100644 (file)
index aee086e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = PyConsole
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-PYTHONLIB=$${PYTHONHOME}/lib
-
-INCLUDEPATH += ../../include $${PYTHONINC}
-INCLUDEPATH += ../Qtx ../SUIT ../PyInterp
-unix:LIBS  += -L$${PYTHONLIB} -lpython$${PYTHONVER}
-win32:LIBS += /LIBPATH:$$(PYTHONLIB)
-LIBS += -L../../lib -lqtx -lsuit -lPyInterp
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PYCONSOLE_EXPORTS
-
-HEADERS  = PyConsole.h
-HEADERS += PyConsole_Console.h
-HEADERS += PyConsole_Editor.h
-HEADERS += PyConsole_Interp.h
-
-SOURCES  = PyConsole_Console.cxx
-SOURCES += PyConsole_Editor.cxx
-SOURCES += PyConsole_Interp.cxx
-
-TRANSLATIONS = resources/PyConsole_msg_en.ts
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index ccb7b835b4452d93eed820f24f7b66cfcfa03917..85edfbe70887af39df6804db3a66d8ca30c88977 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : PyConsole_Console.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -40,6 +41,8 @@
 #include <QMenu>
 #include <QVBoxLayout>
 
+#include <utilities.h>
+
 /*!
   \brief Constructor.
 
@@ -63,6 +66,12 @@ PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* interp
   QVBoxLayout* lay = new QVBoxLayout( this );
   lay->setMargin( 0 );
   myEditor = new PyConsole_Editor( myInterp, this );
+  char* synchronous = getenv("PYTHON_CONSOLE_SYNC");
+  if (synchronous && atoi(synchronous))
+  {
+      MESSAGE("Python console is synchronous");
+      myEditor->setIsSync(true);
+  }
   myEditor->viewport()->installEventFilter( this );
   lay->addWidget( myEditor );
 
@@ -127,6 +136,54 @@ void PyConsole_Console::setIsSync( const bool on )
   myEditor->setIsSync( on );
 }
 
+/*!
+  \brief Get suppress output flag value.
+  
+  \sa setIsSuppressOutput()
+  \return True if python console output is suppressed.
+*/
+bool PyConsole_Console::isSuppressOutput() const
+{
+  return myEditor->isSuppressOutput();
+}
+
+/*!
+  \brief Set suppress output flag value.
+
+  In case if suppress output flag is true, the python 
+  console output suppressed.
+
+  \param on suppress output flag
+*/
+void PyConsole_Console::setIsSuppressOutput( const bool on )
+{
+  myEditor->setIsSuppressOutput(on);
+}
+
+/*!
+  \brief Get 'show banner' flag value.
+  
+  \sa setIsShowBanner()
+  \return \c true if python console shows banner
+*/
+bool PyConsole_Console::isShowBanner() const
+{
+  return myEditor->isShowBanner();
+}
+
+/*!
+  \brief Set 'show banner' flag value.
+
+  The banner is shown in the top of the python console window.
+
+  \sa isShowBanner()
+  \param on 'show banner' flag
+*/
+void PyConsole_Console::setIsShowBanner( const bool on )
+{
+  myEditor->setIsShowBanner( on );
+}
+
 /*!
   \brief Change the python console's font.
   \param f new font
@@ -185,6 +242,8 @@ void PyConsole_Console::contextMenuPopup( QMenu* menu )
   menu->addAction( myActions[ClearId] );
   menu->addSeparator();
   menu->addAction( myActions[SelectAllId] );
+  menu->addSeparator();
+  menu->addAction( myActions[DumpCommandsId] );
 
   Qtx::simplifySeparators( menu );
 
@@ -205,6 +264,7 @@ void PyConsole_Console::setMenuActions( const int flags )
   myActions[PasteId]->setVisible( flags & PasteId );
   myActions[ClearId]->setVisible( flags & ClearId );
   myActions[SelectAllId]->setVisible( flags & SelectAllId );
+  myActions[DumpCommandsId]->setVisible( flags & DumpCommandsId );
 }
 
 /*!
@@ -219,6 +279,7 @@ int PyConsole_Console::menuActions() const
   ret = ret | ( myActions[PasteId]->isVisible() ? PasteId : 0 );
   ret = ret | ( myActions[ClearId]->isVisible() ? ClearId : 0 );
   ret = ret | ( myActions[SelectAllId]->isVisible() ? SelectAllId : 0 );
+  ret = ret | ( myActions[DumpCommandsId]->isVisible() ? DumpCommandsId : 0 );
   return ret;
 }
 
@@ -248,6 +309,11 @@ void PyConsole_Console::createActions()
   a->setStatusTip( tr( "EDIT_SELECTALL_CMD" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( selectAll() ) );
   myActions.insert( SelectAllId, a );
+  
+  a = new QAction( tr( "EDIT_DUMPCOMMANDS_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_DUMPCOMMANDS_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( dump() ) );
+  myActions.insert( DumpCommandsId, a );
 }
 
 /*!
index 790450c61b6e1e12e6aa7e44dfa7978c2d73887f..fd252acc92c386eb11d7d56235ad6b8f04281879 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : PyConsole_Console.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -42,11 +43,12 @@ public:
   //! Context popup menu actions flags
   enum
   {
-    CopyId      = 0x01,                            //!< "Copy" menu action
-    PasteId     = 0x02,                            //!< "Paste" menu action
-    ClearId     = 0x04,                            //!< "Clear" menu action
-    SelectAllId = 0x08,                            //!< "Select All" menu action
-    All = CopyId | PasteId | ClearId | SelectAllId //!< all menu actions
+    CopyId         = 0x01,                                           //!< "Copy" menu action
+    PasteId        = 0x02,                                           //!< "Paste" menu action
+    ClearId        = 0x04,                                           //!< "Clear" menu action
+    SelectAllId    = 0x08,                                           //!< "Select All" menu action
+    DumpCommandsId = 0x16,                                           //!< "DumpCommands" menu action
+    All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId  //!< all menu actions
   };
 
 public:
@@ -61,6 +63,12 @@ public:
   bool                isSync() const;
   void                setIsSync( const bool );
 
+  bool                isSuppressOutput() const;
+  void                setIsSuppressOutput( const bool );
+
+  bool                isShowBanner() const;
+  void                setIsShowBanner( const bool );
+
   void                exec( const QString& );
   void                execAndWait( const QString& );
 
index ae6563bb3fe11caff3d1b2d1086daafe44d7d25a..59e64093614efa2a3bf324f1c1c0c1f6c8ac5654 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 // File   : PyConsole_Editor.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@ -97,6 +98,9 @@
 #include <PyInterp_Dispatcher.h>
 
 #include <SUIT_Tools.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_FileValidator.h>
 
 #include <QApplication>
 #include <QClipboard>
 #include <QTextBlock>
 #include <QTextCursor>
 #include <QTextDocument>
+#include <QTextStream>
 
 static QString READY_PROMPT = ">>> ";
 static QString DOTS_PROMPT  = "... ";
@@ -115,6 +120,27 @@ static QString DOTS_PROMPT  = "... ";
 
 #define PRINT_EVENT 65432
 
+
+class DumpCommandsFileValidator : public SUIT_FileValidator
+{
+ public:
+  DumpCommandsFileValidator( QWidget* parent = 0 ) : SUIT_FileValidator ( parent ) {};
+  virtual ~DumpCommandsFileValidator() {};
+  virtual bool canSave( const QString& file, bool permissions );
+};
+
+bool DumpCommandsFileValidator::canSave(const QString& file, bool permissions)
+{
+  QFileInfo fi( file );
+  if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) {
+    SUIT_MessageBox::critical( parent(),
+                               QObject::tr("WRN_WARNING"),
+                               QObject::tr("WRN_FILE_NAME_BAD") );
+    return false;
+  }
+  return SUIT_FileValidator::canSave( file, permissions);
+}
+
 /*!
   \class ExecCommand
   \brief Python command execution request.
@@ -134,9 +160,9 @@ public:
     \param sync        if True the request is processed synchronously 
   */
   ExecCommand( PyInterp_Interp*        theInterp, 
-              const QString&          theCommand,
-              PyConsole_Editor*       theListener, 
-              bool                    sync = false )
+               const QString&          theCommand,
+               PyConsole_Editor*       theListener, 
+               bool                    sync = false )
     : PyInterp_LockRequest( theInterp, theListener, sync ),
       myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
   {}
@@ -150,11 +176,11 @@ protected:
   {
     if ( myCommand != "" )
     {
-      int ret = getInterp()->run( myCommand.toLatin1() );
+      int ret = getInterp()->run( myCommand.toUtf8().data() );
       if ( ret < 0 )
-       myState = PyInterp_Event::ES_ERROR;
+        myState = PyInterp_Event::ES_ERROR;
       else if ( ret > 0 )
-       myState = PyInterp_Event::ES_INCOMPLETE;
+        myState = PyInterp_Event::ES_INCOMPLETE;
     } 
   }
 
@@ -200,7 +226,8 @@ private:
 
 void staticCallback( void* data, char* c )
 {
-  QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) ); 
+  if(!((PyConsole_Editor*)data)->isSuppressOutput())
+    QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) ); 
 }
 
 /*!
@@ -211,12 +238,14 @@ void staticCallback( void* data, char* c )
   \param theParent parent widget
 */
 PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp, 
-                                   QWidget*          theParent )
+                                    QWidget*          theParent )
 : QTextEdit( theParent ),
   myInterp( 0 ),
   myCmdInHistory( -1 ),
   myEventLoop( 0 ),
-  myIsSync( false )
+  myShowBanner( true ),
+  myIsSync( false ),
+  myIsSuppressOutput( false )
 {
   QString fntSet( "" );
   QFont aFont = SUIT_Tools::stringToFont( fntSet );
@@ -270,13 +299,76 @@ void PyConsole_Editor::setIsSync( const bool on )
   myIsSync = on;
 }
 
+/*!
+  \brief Get suppress output flag value.
+  
+  \sa setIsSuppressOutput()
+  \return \c true if python console output is suppressed.
+*/
+bool PyConsole_Editor::isSuppressOutput() const
+{
+  return myIsSuppressOutput;
+}
+
+/*!
+  \brief Set suppress output flag value.
+
+  In case if suppress output flag is true, the python 
+  console output suppressed.
+
+  \param on suppress output flag
+*/
+void PyConsole_Editor::setIsSuppressOutput( const bool on )
+{
+  myIsSuppressOutput = on;
+}
+
+/*!
+  \brief Get 'show banner' flag value.
+  
+  \sa setIsShowBanner()
+  \return \c true if python console shows banner
+*/
+bool PyConsole_Editor::isShowBanner() const
+{
+  return myShowBanner;
+}
+
+/*!
+  \brief Set 'show banner' flag value.
+
+  The banner is shown in the top of the python console window.
+
+  \sa isShowBanner()
+  \param on 'show banner' flag
+*/
+void PyConsole_Editor::setIsShowBanner( const bool on )
+{
+  if ( myShowBanner != on ) {
+    myShowBanner = on;
+    clear();
+  }
+}
+
+/*!
+  \brief Get size hint for the Python console window
+  \return size hint value
+*/
+QSize PyConsole_Editor::sizeHint() const
+{
+  QFontMetrics fm( font() );
+  int nbLines = ( isShowBanner() ? myBanner.split("\n").count() : 0 ) + 1;
+  QSize s(100, fm.lineSpacing()*nbLines);
+  return s;
+}
+
 /*!
   \brief Put the string \a str to the python editor.
   \param str string to be put in the command line of the editor
   \param newBlock if True, then the string is printed on a new line
 */
 void PyConsole_Editor::addText( const QString& str, 
-                               const bool     newBlock )
+                                const bool     newBlock )
 {
   moveCursor( QTextCursor::End );
   if ( newBlock )
@@ -413,11 +505,11 @@ void PyConsole_Editor::dropEvent( QDropEvent* event )
   }
   // create new drop event and use it instead of the original
   QDropEvent de( pos,
-                event->possibleActions(),
-                event->mimeData(),
-                event->mouseButtons(),
-                event->keyboardModifiers(),
-                event->type() );
+                 event->possibleActions(),
+                 event->mimeData(),
+                 event->mouseButtons(),
+                 event->keyboardModifiers(),
+                 event->type() );
   QTextEdit::dropEvent( &de );
   // accept the original event
   event->acceptProposedAction();
@@ -434,7 +526,7 @@ void PyConsole_Editor::mouseReleaseEvent( QMouseEvent* event )
 {
   if ( event->button() == Qt::LeftButton ) {
     QTextEdit::mouseReleaseEvent( event );
-    copy();
+    //copy();
   }
   else if ( event->button() == Qt::MidButton ) {
     QString text;
@@ -495,7 +587,7 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
   // check if <Shift> is pressed
   bool shftPressed = event->modifiers() & Qt::ShiftModifier;
 
-  if ( aKey == Qt::Key_Escape || ctrlPressed && aKey == -1 ) {
+  if ( aKey == Qt::Key_Escape || ( ctrlPressed && aKey == -1 ) ) {
     // process <Ctrl>+<Break> key-binding and <Escape> key: clear current command
     myCommandBuffer.truncate( 0 );
     myPrompt = READY_PROMPT;
@@ -527,7 +619,7 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // any printed key: just print it
     {
       if ( curLine < endLine || curCol < PROMPT_SIZE ) {
-       moveCursor( QTextCursor::End );
+        moveCursor( QTextCursor::End );
       }
       QTextEdit::keyPressEvent( event );
       break;
@@ -547,35 +639,35 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row up
     {
       if ( ctrlPressed && shftPressed ) {
-       int value   = verticalScrollBar()->value();
-       int spacing = fontMetrics().lineSpacing();
-       verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 );
+        int value   = verticalScrollBar()->value();
+        int spacing = fontMetrics().lineSpacing();
+        verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 );
       }
       else if ( shftPressed || ctrlPressed ) {
-       if ( curLine > 0 )
-         moveCursor( QTextCursor::Up, 
-                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+        if ( curLine > 0 )
+          moveCursor( QTextCursor::Up, 
+                      shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
       }
       else { 
-       if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
-         // set history browsing mode
-         myCmdInHistory = myHistory.count();
-         // remember current command
-         QTextBlock par = document()->end().previous();
-         myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
-       }
-       if ( myCmdInHistory > 0 ) {
-         myCmdInHistory--;
-         // get previous command in the history
-         QString previousCommand = myHistory.at( myCmdInHistory );
-         // print previous command
-         moveCursor( QTextCursor::End );
-         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-         addText( myPrompt + previousCommand ); 
-         // move cursor to the end
-         moveCursor( QTextCursor::End );
-       }
+        if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+          // set history browsing mode
+          myCmdInHistory = myHistory.count();
+          // remember current command
+          QTextBlock par = document()->end().previous();
+          myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+        }
+        if ( myCmdInHistory > 0 ) {
+          myCmdInHistory--;
+          // get previous command in the history
+          QString previousCommand = myHistory.at( myCmdInHistory );
+          // print previous command
+          moveCursor( QTextCursor::End );
+          moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+          addText( myPrompt + previousCommand ); 
+          // move cursor to the end
+          moveCursor( QTextCursor::End );
+        }
       }
       break;
     }
@@ -587,40 +679,40 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: scroll one row down
     {
       if ( ctrlPressed && shftPressed ) {
-       int value   = verticalScrollBar()->value();
-       int maxval  = verticalScrollBar()->maximum();
-       int spacing = fontMetrics().lineSpacing();
-       verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval );
+        int value   = verticalScrollBar()->value();
+        int maxval  = verticalScrollBar()->maximum();
+        int spacing = fontMetrics().lineSpacing();
+        verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval );
       }
       else if ( shftPressed || ctrlPressed) {
-       if ( curLine < endLine )
-         moveCursor( QTextCursor::Down, 
-                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+        if ( curLine < endLine )
+          moveCursor( QTextCursor::Down, 
+                      shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
       }
       else { 
-       if ( myCmdInHistory >= 0 ) {
-         // get next command in the history
-         myCmdInHistory++;
-         QString nextCommand;
-         if ( myCmdInHistory < myHistory.count() ) {
-           // next command in history
-           nextCommand = myHistory.at( myCmdInHistory );
-         }
-         else {
-           // end of history is reached
-           // last printed command
-           nextCommand = myCurrentCommand;
-           // unset history browsing mode
-           myCmdInHistory = -1;
-         }
-         // print next or current command
-         moveCursor( QTextCursor::End );
-         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-         addText( myPrompt + nextCommand );
-         // move cursor to the end
-         moveCursor( QTextCursor::End );
-       }
+        if ( myCmdInHistory >= 0 ) {
+          // get next command in the history
+          myCmdInHistory++;
+          QString nextCommand;
+          if ( myCmdInHistory < myHistory.count() ) {
+            // next command in history
+            nextCommand = myHistory.at( myCmdInHistory );
+          }
+          else {
+            // end of history is reached
+            // last printed command
+            nextCommand = myCurrentCommand;
+            // unset history browsing mode
+            myCmdInHistory = -1;
+          }
+          // print next or current command
+          moveCursor( QTextCursor::End );
+          moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+          addText( myPrompt + nextCommand );
+          // move cursor to the end
+          moveCursor( QTextCursor::End );
+        }
       }
       break;
     }
@@ -633,11 +725,11 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     {
       QString txt = textCursor().block().text();
       if ( !shftPressed && isCommand( txt ) && curCol <= PROMPT_SIZE ) {
-       moveCursor( QTextCursor::Up );
-       moveCursor( QTextCursor::EndOfBlock );
+        moveCursor( QTextCursor::Up );
+        moveCursor( QTextCursor::EndOfBlock );
       }
       else {
-       QTextEdit::keyPressEvent( event );
+        QTextEdit::keyPressEvent( event );
       }
       break;
     }
@@ -650,21 +742,21 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     {
       QString txt = textCursor().block().text();
       if ( !shftPressed ) {
-       if ( curCol < txt.length() ) {
-         if ( isCommand( txt ) && curCol < PROMPT_SIZE ) {
-           cur.setPosition( cur.block().position() + PROMPT_SIZE );
-           setTextCursor( cur );
-           break;
-         }
-       }
-       else {
-         if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) {
-           cur.setPosition( cur.position() + PROMPT_SIZE+1 );
-           setTextCursor( cur );
-           horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
-           break;
-         }
-       }
+        if ( curCol < txt.length() ) {
+          if ( isCommand( txt ) && curCol < PROMPT_SIZE ) {
+            cur.setPosition( cur.block().position() + PROMPT_SIZE );
+            setTextCursor( cur );
+            break;
+          }
+        }
+        else {
+          if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) {
+            cur.setPosition( cur.position() + PROMPT_SIZE+1 );
+            setTextCursor( cur );
+            horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+            break;
+          }
+        }
       }
       QTextEdit::keyPressEvent( event );
       break;
@@ -677,49 +769,49 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page up
     {
       if ( ctrlPressed && shftPressed ) {
-       verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub);
+        verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub);
       }
       else if ( shftPressed || ctrlPressed ) {
-       bool moved = false;
-       qreal lastY = cursorRect( cur ).top();
-       qreal distance = 0;
-       // move using movePosition to keep the cursor's x
-       do {
-         qreal y = cursorRect( cur ).top();
-         distance += qAbs( y - lastY );
-         lastY = y;
-         moved = cur.movePosition( QTextCursor::Up, 
-                                   shftPressed ? QTextCursor::KeepAnchor : 
-                                                 QTextCursor::MoveAnchor );
-       } while ( moved && distance < viewport()->height() );
-       if ( moved ) {
-         cur.movePosition( QTextCursor::Down, 
-                           shftPressed ? QTextCursor::KeepAnchor : 
-                                         QTextCursor::MoveAnchor );
-         verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
-       }
-       setTextCursor( cur );
+        bool moved = false;
+        qreal lastY = cursorRect( cur ).top();
+        qreal distance = 0;
+        // move using movePosition to keep the cursor's x
+        do {
+          qreal y = cursorRect( cur ).top();
+          distance += qAbs( y - lastY );
+          lastY = y;
+          moved = cur.movePosition( QTextCursor::Up, 
+                                    shftPressed ? QTextCursor::KeepAnchor : 
+                                                  QTextCursor::MoveAnchor );
+        } while ( moved && distance < viewport()->height() );
+        if ( moved ) {
+          cur.movePosition( QTextCursor::Down, 
+                            shftPressed ? QTextCursor::KeepAnchor : 
+                                          QTextCursor::MoveAnchor );
+          verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+        }
+        setTextCursor( cur );
       }
       else { 
-       if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
-         // set history browsing mode
-         myCmdInHistory = myHistory.count();
-         // remember current command
-         QTextBlock par = document()->end().previous();
-         myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
-       }
-       if ( myCmdInHistory > 0 ) {
-         myCmdInHistory = 0;
-         // get very first command in the history
-         QString firstCommand = myHistory.at( myCmdInHistory );
-         // print first command
-         moveCursor( QTextCursor::End );
-         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-         addText( myPrompt + firstCommand ); 
-         // move cursor to the end
-         moveCursor( QTextCursor::End );
-       }
+        if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+          // set history browsing mode
+          myCmdInHistory = myHistory.count();
+          // remember current command
+          QTextBlock par = document()->end().previous();
+          myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+        }
+        if ( myCmdInHistory > 0 ) {
+          myCmdInHistory = 0;
+          // get very first command in the history
+          QString firstCommand = myHistory.at( myCmdInHistory );
+          // print first command
+          moveCursor( QTextCursor::End );
+          moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+          addText( myPrompt + firstCommand ); 
+          // move cursor to the end
+          moveCursor( QTextCursor::End );
+        }
       }
       break;
     }
@@ -731,41 +823,41 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: scroll one page down
     {
       if ( ctrlPressed && shftPressed ) {
-       verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd);
+        verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd);
       }
       else if ( shftPressed || ctrlPressed ) {
-       bool moved = false;
-       qreal lastY = cursorRect( cur ).top();
-       qreal distance = 0;
-       // move using movePosition to keep the cursor's x
-       do {
-         qreal y = cursorRect( cur ).top();
-         distance += qAbs( y - lastY );
-         lastY = y;
-         moved = cur.movePosition( QTextCursor::Down, 
-                                   shftPressed ? QTextCursor::KeepAnchor : 
-                                                 QTextCursor::MoveAnchor );
-       } while ( moved && distance < viewport()->height() );
-       if ( moved ) {
-         cur.movePosition( QTextCursor::Up, 
-                           shftPressed ? QTextCursor::KeepAnchor : 
-                                         QTextCursor::MoveAnchor );
-         verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
-       }
-       setTextCursor( cur );
+        bool moved = false;
+        qreal lastY = cursorRect( cur ).top();
+        qreal distance = 0;
+        // move using movePosition to keep the cursor's x
+        do {
+          qreal y = cursorRect( cur ).top();
+          distance += qAbs( y - lastY );
+          lastY = y;
+          moved = cur.movePosition( QTextCursor::Down, 
+                                    shftPressed ? QTextCursor::KeepAnchor : 
+                                                  QTextCursor::MoveAnchor );
+        } while ( moved && distance < viewport()->height() );
+        if ( moved ) {
+          cur.movePosition( QTextCursor::Up, 
+                            shftPressed ? QTextCursor::KeepAnchor : 
+                                          QTextCursor::MoveAnchor );
+          verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+        }
+        setTextCursor( cur );
       }
       else { 
-       if ( myCmdInHistory >= 0 ) {
-         // unset history browsing mode
-         myCmdInHistory = -1;
-         // print current command
-         moveCursor( QTextCursor::End );
-         moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-         addText( myPrompt + myCurrentCommand ); 
-         // move cursor to the end
-         moveCursor( QTextCursor::End );
-       }
+        if ( myCmdInHistory >= 0 ) {
+          // unset history browsing mode
+          myCmdInHistory = -1;
+          // print current command
+          moveCursor( QTextCursor::End );
+          moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+          addText( myPrompt + myCurrentCommand ); 
+          // move cursor to the end
+          moveCursor( QTextCursor::End );
+        }
       }
       break;
     }
@@ -777,29 +869,29 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very first symbol with selection
     {
       if ( ctrlPressed ) { 
-       moveCursor( QTextCursor::Start, 
-                   shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+        moveCursor( QTextCursor::Start, 
+                    shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
       }
       else {
-       QString txt = textCursor().block().text();
-       if ( isCommand( txt ) ) {
-         if ( shftPressed ) {
-           if ( curCol > PROMPT_SIZE ) {
-             cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor );
-             cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE );
-           }
-         }
-         else {
-           cur.movePosition( QTextCursor::StartOfLine );
-           cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE );
-         }
-         setTextCursor( cur );
-       }
-       else {
-         moveCursor( QTextCursor::StartOfBlock, 
-                     shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
-       }
-       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+        QString txt = textCursor().block().text();
+        if ( isCommand( txt ) ) {
+          if ( shftPressed ) {
+            if ( curCol > PROMPT_SIZE ) {
+              cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor );
+              cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE );
+            }
+          }
+          else {
+            cur.movePosition( QTextCursor::StartOfLine );
+            cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE );
+          }
+          setTextCursor( cur );
+        }
+        else {
+          moveCursor( QTextCursor::StartOfBlock, 
+                      shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+        }
+        horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
       }
       break;
     }
@@ -811,7 +903,7 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very last symbol with selection
     {
       moveCursor( ctrlPressed ? QTextCursor::End : QTextCursor::EndOfBlock, 
-                 shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+                  shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
       break;
     }  
   case Qt::Key_Backspace :
@@ -822,27 +914,27 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // works only for last (command) line
     {
       if ( cur.hasSelection() ) {
-       cut();
+        cut();
       }
       else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE ) {
-       if ( shftPressed ) {
-         moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-       }
-       else if ( ctrlPressed ) {
-         cur.setPosition( document()->end().previous().position() + PROMPT_SIZE, 
-                          QTextCursor::KeepAnchor );
-         setTextCursor( cur );
-         textCursor().removeSelectedText();
-       }
-       else {
-         QTextEdit::keyPressEvent( event );
-       }
+        if ( shftPressed ) {
+          moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+        }
+        else if ( ctrlPressed ) {
+          cur.setPosition( document()->end().previous().position() + PROMPT_SIZE, 
+                           QTextCursor::KeepAnchor );
+          setTextCursor( cur );
+          textCursor().removeSelectedText();
+        }
+        else {
+          QTextEdit::keyPressEvent( event );
+        }
       }
       else {
-       cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
-       setTextCursor( cur );
-       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+        cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+        setTextCursor( cur );
+        horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
       }
       break;
     }
@@ -854,25 +946,25 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // works only for last (command) line
     {
       if ( cur.hasSelection() ) {
-       cut();
+        cut();
       }
       else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE-1 ) {
-       if ( shftPressed ) {
-         moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-       }
-       else if ( ctrlPressed ) {
-         moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor );
-         textCursor().removeSelectedText();
-       }
-       else {
-         QTextEdit::keyPressEvent( event );
-       }
+        if ( shftPressed ) {
+          moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+        }
+        else if ( ctrlPressed ) {
+          moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor );
+          textCursor().removeSelectedText();
+        }
+        else {
+          QTextEdit::keyPressEvent( event );
+        }
       }
       else {
-       cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
-       setTextCursor( cur );
-       horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+        cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+        setTextCursor( cur );
+        horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
       }
       break;
     }
@@ -882,13 +974,13 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event )
     // - with <Shift> modifier key pressed: paste() to the command line
     {
       if ( ctrlPressed ) {
-       copy();
+        copy();
       }
       else if ( shftPressed ) {
-       paste();
+        paste();
       }
       else
-       QTextEdit::keyPressEvent( event );
+        QTextEdit::keyPressEvent( event );
       break;
     }
   }
@@ -984,7 +1076,8 @@ void PyConsole_Editor::onPyInterpChanged( PyConsole_Interp* interp )
     if ( myInterp ) {
       // print banner
       myBanner = myInterp->getbanner().c_str();
-      addText( myBanner );
+      if ( isShowBanner() )
+       addText( myBanner );
       // clear command buffer
       myCommandBuffer.truncate(0);
       // unset read-only state
@@ -997,7 +1090,7 @@ void PyConsole_Editor::onPyInterpChanged( PyConsole_Interp* interp )
       viewport()->unsetCursor();
       // stop event loop (if running)
       if( myEventLoop)
-       myEventLoop->exit();
+        myEventLoop->exit();
     }
     else {
       // clear contents
@@ -1071,7 +1164,33 @@ void PyConsole_Editor::paste()
 void PyConsole_Editor::clear()
 {
   QTextEdit::clear();
-  addText( myBanner );
+  if ( isShowBanner() )
+    addText( myBanner );
   myPrompt = READY_PROMPT;
   addText( myPrompt );
 }
+
+/*!
+  \brief "Dump commands" operation.
+ */
+void PyConsole_Editor::dump()
+{
+  QStringList aFilters;
+  aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
+  
+  QString fileName = SUIT_FileDlg::getFileName( this, QString(),
+                                    aFilters, tr( "TOT_DUMP_PYCOMMANDS" ),
+                                    false, true, new DumpCommandsFileValidator( this ) );
+  if ( fileName != "" ) {
+    QFile file( fileName ); 
+    if ( !file.open( QFile::WriteOnly ) )
+      return;
+
+    QTextStream out (&file);
+  
+    for( int i=0; i<myHistory.count(); i++ ) {
+         out<<myHistory[i]<<endl;
+    }
+    file.close();
+  }
+}
index 2f21fab6aac1e90774a22e6c775e75429fa75162..a7d720509f07a866a6495dd4c14d409978f0e4ba 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 // File   : PyConsole_Editor.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@ -51,6 +52,14 @@ public:
   bool           isSync() const;
   void           setIsSync( const bool );
 
+  bool           isSuppressOutput() const;
+  void           setIsSuppressOutput(const bool);
+
+  bool           isShowBanner() const;
+  void           setIsShowBanner( const bool );
+
+  virtual QSize  sizeHint() const;
+
 protected:
   virtual void   dropEvent( QDropEvent* event );
   virtual void   mouseReleaseEvent( QMouseEvent* event );
@@ -65,19 +74,22 @@ public slots:
   void           clear();
   void           handleReturn();
   void           onPyInterpChanged( PyConsole_Interp* );
+  void           dump();
   
 private:
   PyConsole_Interp* myInterp;           //!< python interpreter
 
-  QString           myCommandBuffer;    //!< python comman buffer
+  QString           myCommandBuffer;    //!< python command buffer
   QString           myCurrentCommand;   //!< currently being printed command
   QString           myPrompt;           //!< current command line prompt
   int               myCmdInHistory;     //!< current history command index
   QStringList       myHistory;          //!< commands history buffer
   QEventLoop*       myEventLoop;        //!< internal event loop
   QString           myBanner;           //!< current banner
+  bool              myShowBanner;       //!< 'show banner' flag
   QStringList       myQueue;            //!< python commands queue
   bool              myIsSync;           //!< synchronous mode flag
+  bool              myIsSuppressOutput; //!< suppress output flag
 };
 
 #endif // PYCONSOLE_EDITOR_H
index e915c185a3f84a3536e4cc4935945be162346dbb..444722ff533c817ab65f4902842d589e2e1e9178 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.cxx
 //  Author : Nicolas REJNERI
@@ -84,12 +85,14 @@ PyConsole_Interp::~PyConsole_Interp()
  
 /*!
   \brief Initialize internal Python interpreter state.
+
+  When calling initState the GIL is not held
+  It must not be held on exit
+
   \return \c true on success
 */
 bool PyConsole_Interp::initState()
 {
-  // The GIL is acquired and will be held on initState output
-  // It is the caller responsability to release the lock if needed
   PyEval_AcquireLock();
   _tstate = Py_NewInterpreter(); // create an interpreter and save current state
   PySys_SetArgv(PyInterp_Interp::_argc,PyInterp_Interp::_argv); // initialize sys.argv
@@ -120,8 +123,8 @@ bool PyConsole_Interp::initState()
   \brief Initialize python interpeter context.
 
   The GIL is assumed to be held.
-  It is the caller responsability caller to acquire the GIL.
-  It will still be held on initContext() exit.
+  It is the caller responsability to acquire the GIL.
+  It must still be held on initContext() exit.
 
   \return \c true on success
 */
index ec07b64b9e8e33239307d7d0092dccb2816dfe9c..5e803e4183445ad481d38ac0857f85b5e44452c4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.h
 //  Author : Nicolas REJNERI
index 3082168faedd27bd69d20789a46d5b0981875b63..85393a2bf43151b66038132a164f075b373c5955 100644 (file)
@@ -1,28 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>PyConsole_Console</name>
     <message>
         <source>EDIT_SELECTALL_CMD</source>
         <translation>Select &amp;All</translation>
     </message>
+    <message>
+        <source>EDIT_DUMPCOMMANDS_CMD</source>
+        <translation>D&amp;ump commands</translation>
+    </message>
+</context>
+<context>
+    <name>PyConsole_Editor</name>
+    <message>
+        <source>TOT_DUMP_PYCOMMANDS</source>
+        <translation>Dump commands</translation>
+    </message>
+    <message>
+        <source>PYTHON_FILES_FILTER</source>
+        <translation>PYTHON Files (*.py)</translation>
+    </message>
 </context>
 </TS>
index 0adfaf36488ec1c6842a218a6e6f0d7356f03747..03c7b0b143cbcd272b64d7382fa52c0db667d345 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOME PyInterp : implementation of base thread-safe Python services
 #  File   : Makefile.in
 #  Module : SALOME
index f75022fc84e013de97953af3678971c06c448238..d116426dac63d127e8894cba8840e52347cb4a5c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : PyInterp.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -28,7 +29,7 @@
 // ========================================================
 // set dllexport type for Win platform 
 #ifdef WIN32
-# ifdef PYINTERP_EXPORTS
+# if defined PYINTERP_EXPORTS || defined PyInterp_EXPORTS
 #  define PYINTERP_EXPORT __declspec(dllexport)
 # else
 #  define PYINTERP_EXPORT __declspec(dllimport)
diff --git a/src/PyInterp/PyInterp.pro b/src/PyInterp/PyInterp.pro
deleted file mode 100644 (file)
index eb36ba2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = PyInterp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-PYTHONLIB=$${PYTHONHOME}/lib
-
-INCLUDEPATH += ../../include $${PYTHONINC}
-unix:LIBS  += -L$${PYTHONLIB} -lpython$${PYTHONVER}
-win32:LIBS += /LIBPATH:$${PYTHONLIB}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PYINTERP_EXPORTS
-
-HEADERS  = PyInterp.h
-HEADERS += PyInterp_Dispatcher.h
-HEADERS += PyInterp_Watcher.h
-HEADERS += PyInterp_Interp.h
-
-SOURCES  = PyInterp_Dispatcher.cxx
-SOURCES += PyInterp_Interp.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index ff7881ee18f62c2a5dc9d0b170c778367ec31e18..70e04ed8dc18a8b1ba9f05d3ae3c7b80460c9f91 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : PyInterp_Dispatcher.cxx
 //  Author : Sergey ANIKIN, OCC
 //  Module : GUI
@@ -43,8 +44,6 @@ public:
   }
 };
 
-using namespace std;
-
 PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0;
 
 void PyInterp_Request::process()
index cd970dd0fc025c9ddcd5f458c4e2eff5b4bf7ba0..40b9f2fd3ff197e1dd9d29fb9f73fd68b3f2cf18 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : PyInterp_Dispatcher.h
 //  Author : Sergey Anikin, OCC
 //  Module : SALOME
index 3960bb8d9c405e8eee848f0e157b2c92c06e5a3e..663da5b5590e958f576d974ab19d13512b029c78 100644 (file)
@@ -1,40 +1,46 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : PyInterp_Interp.cxx
 //  Author : Christian CAREMOLI, Paul RASCLE, EDF
 //  Module : SALOME
 //
 #include "PyInterp_Interp.h"  // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include <pythread.h>
 
 #include <cStringIO.h>
 #include <structmember.h>
 
 #include <string>
 #include <vector>
+#include <map>
 #include <iostream>
 
 #define TOP_HISTORY_PY   "--- top of history ---"
 #define BEGIN_HISTORY_PY "--- begin of history ---"
 
+// a map to store python thread states that have been created for a given system thread (key=thread id,value=thread state)
+std::map<long,PyThreadState*> currentThreadMap;
+
 /*!
   \class PyLockWrapper
   \brief Python GIL wrapper.
@@ -55,7 +61,7 @@ PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState):
 }
 
 /*!
-  \brief Desstructor. Automatically releases GIL.
+  \brief Destructor. Automatically releases GIL.
 */
 PyLockWrapper::~PyLockWrapper()
 {
@@ -71,7 +77,39 @@ PyLockWrapper::~PyLockWrapper()
 */
 PyLockWrapper PyInterp_Interp::GetLockWrapper()
 {
-  return _tstate;
+  if (_tstate->interp == PyInterp_Interp::_interp)
+    return _tstate;
+
+  // If we are here, we have a secondary python interpreter. Try to get a thread state synchronized with the system thread
+  long currentThreadid=PyThread_get_thread_ident(); // the system thread id
+  PyThreadState* theThreadState;
+  if(currentThreadMap.count(currentThreadid) != 0)
+    {
+      //a thread state exists for this thread id
+      PyThreadState* oldThreadState=currentThreadMap[currentThreadid];
+      if(_tstate->interp ==oldThreadState->interp)
+        {
+          //The old thread state has the same python interpreter as this one : reuse the threadstate
+          theThreadState=oldThreadState;
+        }
+      else
+        {
+          //The old thread state has not the same python interpreter as this one : delete the old threadstate and create a new one
+          PyEval_AcquireLock();
+          PyThreadState_Clear(oldThreadState);
+          PyThreadState_Delete(oldThreadState);
+          PyEval_ReleaseLock();
+          theThreadState=PyThreadState_New(_tstate->interp);
+          currentThreadMap[currentThreadid]=theThreadState;
+        }
+    }
+  else
+    {
+      // no old thread state for this thread id : create a new one
+      theThreadState=PyThreadState_New(_tstate->interp);
+      currentThreadMap[currentThreadid]=theThreadState;
+    }
+  return theThreadState;
 }
 
 /*
@@ -105,15 +143,22 @@ PyStdOut_write(PyStdOut *self, PyObject *args)
   return Py_None;
 }
 
+static PyObject*
+PyStdOut_flush(PyStdOut *self)
+{
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
 static PyMethodDef PyStdOut_methods[] = {
-  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
-    PyDoc_STR("write(string) -> None")},
+  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS, PyDoc_STR("write(string) -> None")},
+  {"flush",  (PyCFunction)PyStdOut_flush,  METH_NOARGS,  PyDoc_STR("flush() -> None")},
   {NULL,    NULL}   /* sentinel */
 };
 
 static PyMemberDef PyStdOut_memberlist[] = {
-  {"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
-   "flag indicating that a space needs to be printed; used by print"},
+  {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+   (char*)"flag indicating that a space needs to be printed; used by print"},
   {NULL} /* Sentinel */
 };
 
@@ -185,7 +230,7 @@ static PyStdOut* newPyStdOut( bool iscerr )
 */
 
 int   PyInterp_Interp::_argc   = 1;
-char* PyInterp_Interp::_argv[] = {""};
+char* PyInterp_Interp::_argv[] = {(char*)""};
 PyObject*           PyInterp_Interp::builtinmodule = NULL;
 PyThreadState*      PyInterp_Interp::_gtstate      = NULL;
 PyInterpreterState* PyInterp_Interp::_interp       = NULL;
@@ -230,7 +275,7 @@ void PyInterp_Interp::initialize()
 
   initState();
 
-  PyLockWrapper aLock = GetLockWrapper();
+  PyEval_AcquireThread(_tstate);
 
   initContext();
 
@@ -238,6 +283,7 @@ void PyInterp_Interp::initialize()
   PyObjWrapper m(PyImport_ImportModule("codeop"));
   if(!m) {
     PyErr_Print();
+    PyEval_ReleaseThread(_tstate);
     return;
   }
 
@@ -247,6 +293,7 @@ void PyInterp_Interp::initialize()
 
   // All the initRun outputs are redirected to the standard output (console)
   initRun();
+  PyEval_ReleaseThread(_tstate);
 }
 
 /*!
@@ -333,7 +380,7 @@ static int compile_command(const char *command,PyObject *context)
     PyErr_Print();
     return -1;
   }
-  PyObjWrapper v(PyObject_CallMethod(m,"compile_command","s",command));
+  PyObjWrapper v(PyObject_CallMethod(m,(char*)"compile_command",(char*)"s",command));
   if(!v) {
     // Error encountered. It should be SyntaxError,
     //so we don't write out traceback
@@ -393,14 +440,14 @@ int PyInterp_Interp::simpleRun(const char *command, const bool addToHistory)
   //PyLockWrapper aLock(_tstate); // san - lock is centralized now
 
   // Reset redirected outputs before treatment
-  PySys_SetObject("stderr",_verr);
-  PySys_SetObject("stdout",_vout);
+  PySys_SetObject((char*)"stderr",_verr);
+  PySys_SetObject((char*)"stdout",_vout);
 
   int ier = compile_command(command,_g);
 
   // Outputs are redirected on standards outputs (console)
-  PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
-  PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
+  PySys_SetObject((char*)"stdout",PySys_GetObject((char*)"__stdout__"));
+  PySys_SetObject((char*)"stderr",PySys_GetObject((char*)"__stderr__"));
 
   return ier;
 }
index 32fadb60f3b12e2c8a46c9f64f044597b1963f49..8b4321f7388e817826b91609f3345d1fded01244 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : PyInterp_Interp.h
 //  Author : Christian CAREMOLI, Paul RASCLE, EDF
 //  Module : SALOME
index ffa8d8e9afd7c02ed789cb1a88bc137e38811e21..a1e10dc6766c609a2eb92ad9b7f37e4478df7110 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : PyInterp_Watcher.h
 //  Author : Sergey Anikin, OCC
 //  Module : SALOME
@@ -34,7 +35,7 @@
 
 // Private class that keeps track of destructions of request listeners
 class PYINTERP_EXPORT PyInterp_Watcher : public QObject
-{                                          
+{                                           
   Q_OBJECT
 
 public:
index c16f89d75989500ce52257dd54a1fca9c147fc2a..8fe75f8774117d9a10439788b80d2bc08d5a87d6 100755 (executable)
@@ -1,28 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Alexander SOLOVYOV (OCN)
 #  Module : QDS
-#  $Header: /home/server/cvs/GUI/GUI_SRC/src/QDS/Makefile.in
+#  $Header$
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -81,7 +82,7 @@ MOC_FILES =                   \
 
 nodist_libQDS_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = QDS_msg_en.qm
+nodist_salomeres_DATA = QDS_msg_en.qm QDS_msg_fr.qm
 
 libQDS_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) \
                    -I$(srcdir)/../Qtx -I$(srcdir)/../DDS
index 052e4a287f8e891883801428b2b09d4ee84fabef..9044dbbc5c471e797b850dc055969794e67fc66d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS.h"
 
 #include "QDS_Datum.h"
index 9472e53233e6a7b8cb335ff7991577822cf97529..1696a90a702a74bb83b12b67a93029484cbb5579 100644 (file)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_H
 #define QDS_H
 
 #ifdef WIN32
-#ifdef QDS_EXPORTS
+#if defined QDS_EXPORTS
 #define QDS_EXPORT __declspec(dllexport)
 #else
 #define QDS_EXPORT __declspec(dllimport)
@@ -52,13 +53,14 @@ public:
   //! Enum describes bit flags of the Qt datum view and behaviour
   typedef enum
   {
-    None = 0x00,                   //!< Non specified any flags (Default behaviour)
-    Label = 0x01,                  //!< Create subwidget for datum label
-    Control = 0x02,                //!< Create subwidget for datum input control
-    Units = 0x04,                  //!< Create subwidget for datum units of measure
-    NotFormat = 0x08,              //!< Don't format initial value
-    NotAccel = 0x10,               //!< Not support accelerators in datum label
-    UnitsWithLabel = 0x20,         //!< Display units of measure in label like "<label_text> (<units_text>) instead separate text"
+    None           = 0x00,         //!< Non specified any flags (Default behaviour)
+    Label          = 0x01,         //!< Create subwidget for datum label
+    Control        = 0x02,         //!< Create subwidget for datum input control
+    Units          = 0x04,         //!< Create subwidget for datum units of measure
+    NotFormat      = 0x08,         //!< Don't format initial value
+    NotAccel       = 0x10,         //!< Not support accelerators in datum label
+    NotConvert     = 0x20,         //!< Don't convert numeric value
+    UnitsWithLabel = 0x40,         //!< Display units of measure in label like "<label_text> (<units_text>) instead separate text"
     All = Label | Control | Units  //!< Create all subwidgets
   } DatumFlags;
 
diff --git a/src/QDS/QDS.pro b/src/QDS/QDS.pro
deleted file mode 100644 (file)
index fa9b02c..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = QDS
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../Qtx ../DDS
-LIBS += -L../../lib -lqtx -lDDS $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += QDS_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = QDS.h
-HEADERS += QDS_CheckBox.h
-HEADERS += QDS_ComboBox.h
-HEADERS += QDS_Datum.h
-HEADERS += QDS_LineEdit.h
-HEADERS += QDS_SpinBox.h
-HEADERS += QDS_SpinBoxDbl.h
-HEADERS += QDS_TextEdit.h
-HEADERS += QDS_Validator.h
-HEADERS += QDS_RadioBox.h
-#HEADERS += QDS_Table.h
-
-SOURCES  = QDS.cxx
-SOURCES += QDS_CheckBox.cxx
-SOURCES += QDS_ComboBox.cxx
-SOURCES += QDS_Datum.cxx
-SOURCES += QDS_LineEdit.cxx
-SOURCES += QDS_SpinBox.cxx
-SOURCES += QDS_SpinBoxDbl.cxx
-SOURCES += QDS_TextEdit.cxx
-SOURCES += QDS_Validator.cxx
-SOURCES += QDS_RadioBox.cxx
-#SOURCES += QDS_Table.cxx
-
-TRANSLATIONS = resources/QDS_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 862e7876ae38c3715e6ab90b06030af29b82fb4b..2622c927a38ebe190ef57e4f2a20101a03172515 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_CheckBox.h"
 
 #include <QCheckBox>
index d5bd69543e18d8fa7aeac3f488df3275451a886f..0d950ae8ac2140307f93b0b9430baf4e1ab1548a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_CHECKBOX_H
 #define QDS_CHECKBOX_H
 
index e7c2890272e98192e327af81eae9a4b527247e8f..b58bee9b70ae176098b0ae5ce9a34eb8909697ec 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_ComboBox.h"
 
 #include <QtxComboBox.h>
@@ -302,7 +303,7 @@ void QDS_ComboBox::setValues( const QList<int>& ids, const QStringList& names )
   myUserIds = ids;
   myUserNames = names;
 
-  unitSystemChanged( "" );
+  //unitSystemChanged( "" );
 }
 
 /*!
@@ -335,7 +336,6 @@ void QDS_ComboBox::setValues( const QStringList& names )
 */
 void QDS_ComboBox::reset()
 {
-  int id = -1;
   QString aDefValue = defaultValue();
   if ( !aDefValue.isEmpty() )
     setString( aDefValue );
@@ -410,11 +410,11 @@ void QDS_ComboBox::setString( const QString& txt )
   else if ( txt.isEmpty() )
   {
     if ( !cb->isEditable() )
-      cb->setItemText( cb->currentIndex(), txt );
+      cb->setCleared( true );
     else
       cb->lineEdit()->setText( txt );
   }
-  if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) )
+  if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) || isClear != cb->isCleared() )
   {
     onParamChanged();
     QString str = getString();
@@ -553,7 +553,11 @@ void QDS_ComboBox::onTextChanged( const QString& /*txt*/ )
 void QDS_ComboBox::onActivated( int idx )
 {
   if ( comboBox() )
-    comboBox()->setCurrentIndex( comboBox()->currentIndex() );
+  {
+    int ind = comboBox()->currentIndex();
+    comboBox()->setCurrentIndex( -1 );
+    comboBox()->setCurrentIndex( ind );
+  }
 
   int id = getId( idx );
   if ( id != -1 )
index 8bc0f1c58a69225d7a82b1560551f4fa7f981e26..31a45aee6d4eb9a5248c93213efe50f028c53141 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_COMBOBOX_H
 #define QDS_COMBOBOX_H
 
index 4394119f5e8f0cf4d9062a00da2d0e4d758810a3..9b7cae69d6334338599a8ee8d621d85c6e96585c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_Datum.h"
 
 #include <QLayout>
@@ -342,7 +343,7 @@ QString QDS_Datum::label() const
     if( labStr.isNull() )
       labStr = toQString( myDicItem->GetId() );
   }
-  if( myTr )
+  if( myTr && labStr.length()>0 )
   {
     QString dest = QApplication::translate( "QDS", labStr.toLatin1().constData() );
     if( labStr != dest )
@@ -587,7 +588,7 @@ double QDS_Datum::doubleValue() const
   else
   {
     res = getString().toDouble();
-    if ( !myDicItem.IsNull() )
+    if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
       res = myDicItem->ToSI( res );
   }
 
@@ -612,7 +613,7 @@ int QDS_Datum::integerValue() const
   else
   {
     double val = getString().toDouble();
-    if ( !myDicItem.IsNull() )
+    if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
       res = (int)myDicItem->ToSI( val );
   }
 
@@ -737,7 +738,7 @@ void QDS_Datum::setDoubleValue( const double num )
 
   mySourceValue = QString().setNum( num, 'g', 16 );
   double val = num;
-  if ( !myDicItem.IsNull() )
+  if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
     val = myDicItem->FromSI( val );
 
   QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val );
@@ -765,7 +766,7 @@ void QDS_Datum::setIntegerValue( const int num )
 
   mySourceValue = QString().setNum( num );
   double val = num;
-  if ( !myDicItem.IsNull() )
+  if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
     val = myDicItem->FromSI( val );
 
   QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val );
@@ -1297,7 +1298,7 @@ QValidator* QDS_Datum::validator( const bool limits ) const
 bool QDS_Datum::validate( const QString& txt ) const
 {
   if ( type() == DDS_DicItem::Unknown ||
-       type() == DDS_DicItem::String && isDoubleFormat( format() ) )
+       ( type() == DDS_DicItem::String && isDoubleFormat( format() ) ) )
     return true;
 
   QValidator* aValidator = validator( true );
index e438a4e17f2ebc9c3f49cd29d11588c8db0f9314..0217602e35498d5a1fd21b1c4b50af62822d307c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_DATUM_H
 #define QDS_DATUM_H
 
index aa00d7352ba70dba2b20cc1d6094e12d2eb074e3..88649b24fd9f19d62189a5ae4d580437fdf228aa 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_LineEdit.h"
 
 #include <QLineEdit>
index 332a2b948e1c1383204bad5e0a5fb4faaff2b3ca..f5ddfb0cfa91cdb2cf3cfaaf613a5e590077dd50 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_LINEEDIT_H
 #define QDS_LINEEDIT_H
 
index c2ae107ce6206115f1b3e45782053f206a410661..91c0a7e4cf005b2762587b4b9bab26435eb9541e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_RadioBox.h"
 
 #include <TColStd_HArray1OfInteger.hxx>
index 0d667d45c0f2ba7b4538a728c744b4a3923ff402..56b280dcb6160f0f97bae5e1a5b60a7f55d72289 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_RADIOBOX_H
 #define QDS_RADIOBOX_H
 
index 407cbe14e75cfc6f4058def30a94cba1ba6da6a5..27635f09f70ede76d7c8975b8109017c5ef4431d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_SpinBox.h"
 
 #include <QtxIntSpinBox.h>
index c313be8e01de6a2e15e6f89e08cacc4ea0bc7f80..d9030397af3662d8e2a080fbd729978ba643106d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_SPINBOX_H
 #define QDS_SPINBOX_H
 
index bc8def56a995dbfcd21045ef1289da285869acbc..5f642a53ca83417132471bc36bce56f3bdfa69c2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_SpinBoxDbl.h"
 
 #include <QtxDoubleSpinBox.h>
@@ -69,9 +70,9 @@ QString QDS_SpinBoxDbl::getString() const
   QtxDoubleSpinBox* sb = spinBox();
   if ( sb && !sb->isCleared() )
   {
-    bool hasFocus = sb->hasFocus();
+    /*bool hasFocus = sb->hasFocus();
     if ( hasFocus )
-      sb->clearFocus();
+      sb->clearFocus();*/
     
     res = sb->text();
     if ( !sb->suffix().isEmpty() )
@@ -79,8 +80,8 @@ QString QDS_SpinBoxDbl::getString() const
     if ( !sb->prefix().isEmpty() )
       res.remove( res.indexOf( sb->prefix() ), sb->prefix().length() );
     
-    if ( hasFocus )
-      sb->setFocus();
+    /*if ( hasFocus )
+      sb->setFocus();*/
   }
 
   return res;
index 0d7d2b1187b792b1c90411e77a9dd6d0e9255b65..47b7a0bfadbc612441c0cb59b7031f39388fef44 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_PINBOXDBL_H
 #define QDS_PINBOXDBL_H
 
index e17cca801db7b5fd8fa82cfaf5d577684a4e05d6..137e35e84384dc7c0a0543fe488d014ac6867fda 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_Table.h"
 
 class QDS_Table::DeleteFilter : public QObject
index 9384371aa1a6080ac8a76f457bf727131ae9a242..5670c6a959028c6c454667c8199bbba6cae4fdd2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_TABLE_H
 #define QDS_TABLE_H
 
index 61ff1044deb6f937730b0d409f0e607b8d3398b3..1149290099ba55ad8490db13b376c5b39f77f322 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_TextEdit.h"
 
 #include <QTextEdit>
index 19fec6269b3dbcc54d9c0b068dd4930e1d04d622..7f792c2a9faaa326f9bf0e62921a714ed842b0f8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_TEXTEEDIT_H
 #define QDS_TEXTEEDIT_H
 
index 16df1ba3a7d79c2ce86a0bf2d4db895facef5da1..3bbbd0540d231de5aedece0f54c03b2317c6a756 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QDS_Validator.h"
 
 /*!
index a8c70a7db4a6a24cd05aaccf82312712de97b1d6..c560ff5105f9c7274aa0c2d3f62011c7a9614424 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QDS_VALIDATOR_H
 #define QDS_VALIDATOR_H
 
diff --git a/src/QDS/resources/QDS_msg_en.po b/src/QDS/resources/QDS_msg_en.po
deleted file mode 100644 (file)
index 01adf51..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-# -------------------------------------------------------------
-
-msgid "QDS_Datum::DATA_ERR_TITLE"
-msgstr "Incorrect parameter value"
-
-msgid "QDS_Datum::DATA_INCORRECT_VALUE"
-msgstr "Value of parameter \"%1\" is incorrect."
-
-msgid "QDS_Datum::DATA_INPUT_VALUE"
-msgstr "Please, input correct value."
-
-msgid "QDS_Datum::DATA_SHOULD_BE_VALUE"
-msgstr "Should be%1 value"
-
-msgid "QDS_Datum::DATA_FLOAT"
-msgstr " real"
-
-msgid "QDS_Datum::DATA_INTEGER"
-msgstr " integer"
-
-msgid "QDS_Datum::DATA_STRING"
-msgstr " non-empty string"
-
-msgid "QDS_Datum::DATA_NON_EMPTY"
-msgstr " non-empty"
-
-msgid "QDS_Datum::DATA_MIN_LIMIT"
-msgstr " is greater than %1"
-
-msgid "QDS_Datum::DATA_MAX_LIMIT"
-msgstr " is less than %1"
-
-msgid "QDS_Datum::DATA_RANGE"
-msgstr " in range [%1, %2]"
-
-# -------------------------------------------------------------
index 10470e95620eeacbcaf87d61662ecf0c34359216..dbc68fed2cec8f7ea7aca24f1311e530bffd5116 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>QDS_Datum</name>
     <message>
@@ -38,7 +17,7 @@
     </message>
     <message>
         <source>DATA_MIN_LIMIT</source>
-        <translation> is greater than %1</translation>
+        <translation> greater than %1</translation>
     </message>
     <message>
         <source>DATA_FLOAT</source>
@@ -50,7 +29,7 @@
     </message>
     <message>
         <source>DATA_SHOULD_BE_VALUE</source>
-        <translation>Should be%1 value</translation>
+        <translation>Should be %1 value</translation>
     </message>
     <message>
         <source>DATA_INTEGER</source>
@@ -62,7 +41,7 @@
     </message>
     <message>
         <source>DATA_MAX_LIMIT</source>
-        <translation> is less than %1</translation>
+        <translation> less than %1</translation>
     </message>
     <message>
         <source>DATA_INPUT_VALUE</source>
index 9da7c3a3dac05a2a268d746fa390480aa99eb378..ec99c79c719989e8a2c6b2581cf96f357386149c 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suit
@@ -37,6 +38,8 @@ salomeinclude_HEADERS =               \
        QtxActionMgr.h          \
        QtxActionSet.h          \
        QtxActionToolMgr.h      \
+       QtxBackgroundTool.h     \
+       QtxBiColorTool.h        \
        QtxColorButton.h        \
        QtxColorScale.h         \
        QtxComboBox.h           \
@@ -66,6 +69,7 @@ salomeinclude_HEADERS =               \
        QtxResourceMgr.h        \
        QtxRubberBand.h         \
        QtxSearchTool.h         \
+       QtxShortcutEdit.h       \
        QtxSplash.h             \
        QtxToolBar.h            \
        QtxToolTip.h            \
@@ -74,7 +78,8 @@ salomeinclude_HEADERS =               \
        QtxWorkspace.h          \
        QtxWorkspaceAction.h    \
        QtxWorkstack.h          \
-       QtxWorkstackAction.h
+       QtxWorkstackAction.h    \
+       QtxWebBrowser.h
 
 #VSR: not yet migrated to Qt4 files
 #                              \
@@ -94,6 +99,8 @@ dist_libqtx_la_SOURCES =      \
        QtxActionMgr.cxx        \
        QtxActionSet.cxx        \
        QtxActionToolMgr.cxx    \
+       QtxBackgroundTool.cxx   \
+       QtxBiColorTool.cxx      \
        QtxColorButton.cxx      \
        QtxColorScale.cxx       \
        QtxComboBox.cxx         \
@@ -122,6 +129,7 @@ dist_libqtx_la_SOURCES =    \
        QtxResourceMgr.cxx      \
        QtxRubberBand.cxx       \
        QtxSearchTool.cxx       \
+       QtxShortcutEdit.cxx     \
        QtxSplash.cxx           \
        QtxToolBar.cxx          \
        QtxToolTip.cxx          \
@@ -130,7 +138,8 @@ dist_libqtx_la_SOURCES =    \
        QtxWorkspace.cxx        \
        QtxWorkspaceAction.cxx  \
        QtxWorkstack.cxx        \
-       QtxWorkstackAction.cxx
+       QtxWorkstackAction.cxx  \
+       QtxWebBrowser.cxx
 
 #VSR: not yet migrated to Qt4 files
 #                              \
@@ -145,6 +154,8 @@ MOC_FILES =                         \
        QtxActionMgr_moc.cxx            \
        QtxActionSet_moc.cxx            \
        QtxActionToolMgr_moc.cxx        \
+       QtxBackgroundTool_moc.cxx       \
+       QtxBiColorTool_moc.cxx          \
        QtxColorButton_moc.cxx          \
        QtxColorScale_moc.cxx           \
        QtxComboBox_moc.cxx             \
@@ -170,6 +181,7 @@ MOC_FILES =                         \
        QtxPopupMgr_moc.cxx             \
        QtxRubberBand_moc.cxx           \
        QtxSearchTool_moc.cxx           \
+       QtxShortcutEdit_moc.cxx         \
        QtxSplash_moc.cxx               \
        QtxToolBar_moc.cxx              \
        QtxToolTip_moc.cxx              \
@@ -177,7 +189,8 @@ MOC_FILES =                         \
        QtxWorkspace_moc.cxx            \
        QtxWorkspaceAction_moc.cxx      \
        QtxWorkstack_moc.cxx            \
-       QtxWorkstackAction_moc.cxx
+       QtxWorkstackAction_moc.cxx      \
+       QtxWebBrowser_moc.cxx
 
 #VSR: not yet migrated to Qt4 files
 #                                      \
@@ -187,4 +200,7 @@ MOC_FILES =                         \
 nodist_libqtx_la_SOURCES = $(MOC_FILES)
 
 libqtx_la_CPPFLAGS = $(QT_INCLUDES)
-libqtx_la_LDFLAGS  = $(QT_MT_LIBS)
+libqtx_la_LDFLAGS  = $(QT_MT_LIBS) $(OGL_LIBS)
+
+nodist_salomeres_DATA =                \
+       Qtx_msg_fr.qm
index c60344a4f3eb0477fe755372adb83727a1a88384..90dfb5620c79232b82ee39c8d2c7430ae64a7ef2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      Qtx.cxx
 // Author:    Sergey TELKOV
 //
 #include <QCompleter>
 #include <QApplication>
 #include <QDesktopWidget>
-#include <QLinearGradient>
-#include <QRadialGradient>
-#include <QConicalGradient>
+#include <QtDebug>
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <clocale>
+
+#define BICOLOR_CHANGE_HUE
+
+/*!
+  \brief Auxiliary function converting string \a str to the integer value.
+  Parameter \a defVal specifies default value that is returned if conversion can't be done.
+  Parameters \a minVal and \a maxVal limit the resulting value.
+  \param str string being converted
+  \param defVal default value
+  \param minVal minimum allowed value
+  \param maxVal maximum allowed value
+  \return integer value obtained from the string
+  \internal
+*/
+static int stringToInt( const QString& str, int defVal, int minVal, int maxVal )
+{
+  bool ok;
+  int v = str.toInt( &ok );
+  if ( !ok ) v = defVal;
+  return qMin( qMax( v, minVal ), maxVal );
+}
 
 /*!
   \class Qtx
@@ -434,7 +455,7 @@ QString Qtx::library( const QString& str )
 */
 QString Qtx::tmpDir()
 {
-  char* tmpdir = ::getenv( "TEMP" );
+  const char* tmpdir = ::getenv( "TEMP" );
   if ( !tmpdir )
     tmpdir = ::getenv ( "TMP" );
   if ( !tmpdir )
@@ -478,7 +499,7 @@ bool Qtx::rmDir( const QString& thePath )
     {
       QFileInfo inf = *it;
       if ( inf.fileName() == "." || inf.fileName() == ".." )
-       continue;
+        continue;
       stat = stat && rmDir( inf.absoluteFilePath() );
     }
     stat = stat && aDir.rmdir( thePath );
@@ -559,7 +580,7 @@ bool Qtx::dos2unix( const QString& absName )
     if ( nbwri != outcnt )
     {
       ::fclose( src );
-                       ::fclose( tgt );
+                        ::fclose( tgt );
       QFile::remove( QString( temp ) );
       return false;
     }
@@ -627,6 +648,99 @@ QCompleter* Qtx::pathCompleter( const PathType type, const QString& filter )
   return cmp;
 }
 
+/*!
+  \brief Parse given string to retrieve environment variable.
+
+  Looks through the string for the patterns: ${name} or $(name) or %name%.
+  If string contains variable satisfying any pattern, the variable name
+  is returned, start index of the variable is returned in the \a start parameter,
+  and length of the variable is returned in the \a len parameter.
+
+  \param str string being processed
+  \param start if variable is found, this parameter contains its starting 
+         position in the \a str
+  \param len if variable is found, this parameter contains its length 
+  \return first found variable or null QString if there is no ones
+*/
+QString Qtx::findEnvVar( const QString& str, int& start, int& len )
+{
+  QString varName;
+  len = 0;
+
+  QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
+
+  int pos = rx.indexIn( str, start );
+  if ( pos != -1 )
+  {
+    int i = 1;
+    while ( i <= rx.numCaptures() && varName.isEmpty() )
+    {
+      QString capStr = rx.cap( i );
+      if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
+        varName = capStr;
+      i++;
+    }
+
+    if ( !varName.isEmpty() )
+    {
+      int capIdx = i - 1;
+      start = rx.pos( capIdx );
+      int end = start + varName.length();
+      if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
+        start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
+      if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
+        end++;
+      len = end - start;
+    }
+  }
+  return varName;
+}
+
+/*!
+  \brief Substitute environment variables by their values.
+
+  Environment variable is substituted by its value.
+
+  \param str string to be processed
+  \return processed string (with all substitutions made)
+*/
+QString Qtx::makeEnvVarSubst( const QString& str, const SubstMode mode )
+{
+  QString res = str;
+  if ( mode != Never )
+  {
+    QMap<QString, int> ignoreMap;
+
+    int start( 0 ), len( 0 );
+    while ( true )
+    {
+      QString envName = findEnvVar( res, start, len );
+      if ( envName.isNull() )
+        break;
+
+      QString newStr;
+      if ( ::getenv( envName.toLatin1() ) || mode == Always )
+        newStr = QString( ::getenv( envName.toLatin1() ) );
+
+      if ( newStr.isNull() )
+      {
+        if ( ignoreMap.contains( envName ) )
+        {
+          start += len;
+          continue;
+        }
+        ignoreMap.insert( envName, 0 );
+      }
+      res.replace( start, len, newStr );
+    }
+
+    res.replace( "$$", "$" );
+    res.replace( "%%", "%" );
+  }
+
+  return res;
+}
+
 /*!
   \brief Pack the specified color into integer RGB set.
   \param c unpacked color
@@ -721,7 +835,7 @@ void Qtx::scaleColors( const int num, QColorList& lst )
 /*!
   \brief Scale the pixmap to the required size.
 
-  If \h is 0 (default) the value of \a w is used instead (to create
+  If \h is 0 (default) the value of \a w is used instead (to create
   square pixmap).
 
   \param icon pixmap to be resized
@@ -733,7 +847,7 @@ QPixmap Qtx::scaleIcon( const QPixmap& icon, const unsigned w, const unsigned h
 {
   QPixmap p;
   int aw = w, ah = h <= 0 ? w : h;
-  if ( icon.isNull() || aw <= 0 || ah <= 0 || aw == icon.width() && ah == icon.height() )
+  if ( icon.isNull() || aw <= 0 || ah <= 0 || ( aw == icon.width() && ah == icon.height() ) )
     p = icon;
   else
     p = icon.fromImage( icon.toImage().scaled( aw, ah, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
@@ -965,7 +1079,7 @@ QString Qtx::colorToString( const QColor& color )
   - "RR,GG,BB[,AA]" or "RR GG BB[ AA]" (\c RR, \c GG, \c BB
   and optional \c AA values represent red, green, blue and alpha
   components of the color in decimal form)
-  - #RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
+  - "#RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
   components of the color in hexadecimal form)
   - an integer value representing packed color components (see rgbSet())
   - a name from the list of colors defined in the list of SVG color keyword names
@@ -1016,6 +1130,106 @@ bool Qtx::stringToColor( const QString& str, QColor& color )
   return res;
 }
 
+/*!
+  \brief Convert bi-color value to the string representation.
+  
+  Bi-color value is specified as main color and integer delta
+  value that is used to calculate secondary color by changing
+  paremeters of the main color ("saturation" and "value"
+  components in HSV notation).
+
+  The resulting string consists of two sub-strings separated by
+  '|' symbol. The first part represents main color
+  (see colorToString() for more details), the second part is a
+  delta value.
+
+  Backward conversion can be done with stringToBiColor() method.
+
+  \param color color to be converted
+  \param delta delta value
+  \return string representation of the bi-color value
+
+  \sa stringToBiColor(), stringToColor()
+*/
+QString Qtx::biColorToString( const QColor& color, const int delta )
+{
+  return QString("%1|%2").arg( Qtx::colorToString( color ) ).arg( delta );
+}
+
+/*!
+  \brief Restore bi-color value from the string representation.
+
+  Bi-color value is specified as main color and integer delta
+  value that is used to calculate secondary color by changing
+  paremeters of the main color ("saturation" and "value"
+  components in HSV notation).
+
+  The parameter \a str should consist of two sub-strings separated
+  by '|' symbol. The first part represents main color
+  (see stringToColor() for more details), the second part is a
+  delta value.
+
+  Backward conversion can be done with biColorToString() method.
+
+  \param str string representation of the bi-color value
+  \param color resulting color value
+  \param delta resulting delta value
+  \return \c true if the conversion is successful and \c false otherwise
+
+  \sa biColorToString(), stringToColor(), rgbSet()
+*/
+bool Qtx::stringToBiColor( const QString& str, QColor& color, int& delta )
+{
+  QStringList data = str.split( "|", QString::KeepEmptyParts );
+  QColor c;
+  int d = 0;
+  bool ok = data.count() > 0 && Qtx::stringToColor( data[0], c );
+  bool dok = false;
+  if ( data.count() > 1 ) d = data[1].toInt( &dok );
+  ok = ok && dok;
+  color = ok ? c : QColor();
+  delta = ok ? d : 0;
+  return ok;
+}
+
+/*!
+  \brief Compute secondary color value from specified main color
+  and delta.
+
+  Secondary color is calculated by changing paremeters of the main
+  color ("saturation" and "value" components in HSV notation) using
+  specified delta.
+
+  If main color is invalid, result of the function is also invalid color.
+
+  \param color source main color
+  \param delta delta value
+  \return resulting secondary color
+  
+  \sa biColorToString(), stringToBiColor()
+*/
+QColor Qtx::mainColorToSecondary( const QColor& color, int delta )
+{
+  QColor cs = color;
+  if ( cs.isValid() ) {
+    int val = qMin( 255, qMax( cs.value() + delta, 0 ) );
+    int sat = qMin( 255, qMax( cs.saturation() + delta-(val-cs.value()), 0 ) );
+#ifdef BICOLOR_CHANGE_HUE
+    const int BICOLOR_HUE_MAXDELTA = 40;
+    int dh = delta-(val-cs.value())-(sat-cs.saturation());
+    dh = qMin( BICOLOR_HUE_MAXDELTA, qAbs( dh ) ) * ( dh > 0 ? 1 : -1 );
+    //int hue = qMin( 359, qMax( cs.hue() + delta-(val-cs.value())-(sat-cs.saturation()), 0 ) );
+    //int hue = qMin( 359, qMax( cs.hue() + delta-(val-cs.value())-ds, 0 ) );
+    int hue = cs.hue() + dh;
+    if ( hue < 0 ) hue = 360 - hue;
+#else
+    int hue = cs.hue();
+#endif
+    cs.setHsv( hue, sat, val );
+  }
+  return cs;
+}
+
 /*!
   \brief Dump linear gradient to the string description.
   \param gradient linear gradient to be converted
@@ -1156,25 +1370,25 @@ bool Qtx::stringToLinearGradient( const QString& str, QLinearGradient& gradient
       // spread type
       if ( vals.count() > 5 )
       {
-       QString spread = vals[ 5 ].trimmed().toLower();
-       if ( spread == "pad" || spread == "0" )
-         gradient.setSpread( QGradient::PadSpread );
-       else if ( spread == "repeat" || spread == "2" )
-         gradient.setSpread( QGradient::RepeatSpread );
-       else if ( spread == "reflect" || spread == "1" )
-         gradient.setSpread( QGradient::ReflectSpread );
+        QString spread = vals[ 5 ].trimmed().toLower();
+        if ( spread == "pad" || spread == "0" )
+          gradient.setSpread( QGradient::PadSpread );
+        else if ( spread == "repeat" || spread == "2" )
+          gradient.setSpread( QGradient::RepeatSpread );
+        else if ( spread == "reflect" || spread == "1" )
+          gradient.setSpread( QGradient::ReflectSpread );
       }
       // stop points
       QGradientStops stops;
       for ( int i = 6; i < vals.count(); i+=2 )
       {
-       bool bOk5, bOk6 = false;
-       QColor c;
-       double stop = vals[i].toDouble( &bOk5 );
-       if ( i+1 < vals.count() )
-         bOk6 = stringToColor( vals[ i+1 ], c );
-       if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
-         stops.append( QGradientStop( stop, c ) );
+        bool bOk5, bOk6 = false;
+        QColor c;
+        double stop = vals[i].toDouble( &bOk5 );
+        if ( i+1 < vals.count() )
+          bOk6 = stringToColor( vals[ i+1 ], c );
+        if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
+          stops.append( QGradientStop( stop, c ) );
       }
       gradient.setStops( stops );
       success = true;
@@ -1194,7 +1408,7 @@ bool Qtx::stringToRadialGradient( const QString& str, QRadialGradient& gradient
 {
   bool success = false;
   QStringList vals = str.split( "|", QString::SkipEmptyParts );
-  if ( vals.count() > 5 && vals[0] == "radial" || vals[0] == "rg" ) 
+  if ( vals.count() > 5 && ( vals[0] == "radial" || vals[0] == "rg" ) )
   {
     // center, radius and focal point
     double cx, cy, r, fx, fy;
@@ -1210,25 +1424,25 @@ bool Qtx::stringToRadialGradient( const QString& str, QRadialGradient& gradient
       // spread type
       if ( vals.count() > 6 )
       {
-       QString spread = vals[ 6 ].trimmed().toLower();
-       if ( spread == "pad" || spread == "0" )
-         gradient.setSpread( QGradient::PadSpread );
-       else if ( spread == "repeat" || spread == "2" )
-         gradient.setSpread( QGradient::RepeatSpread );
-       else if ( spread == "reflect" || spread == "1" )
-         gradient.setSpread( QGradient::ReflectSpread );
+        QString spread = vals[ 6 ].trimmed().toLower();
+        if ( spread == "pad" || spread == "0" )
+          gradient.setSpread( QGradient::PadSpread );
+        else if ( spread == "repeat" || spread == "2" )
+          gradient.setSpread( QGradient::RepeatSpread );
+        else if ( spread == "reflect" || spread == "1" )
+          gradient.setSpread( QGradient::ReflectSpread );
       }
       // stop points
       QGradientStops stops;
       for ( int i = 7; i < vals.count(); i+=2 )
       {
-       bool bOk7, bOk8 = false;
-       QColor c;
-       double stop = vals[i].toDouble( &bOk7 );
-       if ( i+1 < vals.count() )
-         bOk8 = stringToColor( vals[ i+1 ], c );
-       if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
-         stops.append( QGradientStop( stop, c ) );
+        bool bOk7, bOk8 = false;
+        QColor c;
+        double stop = vals[i].toDouble( &bOk7 );
+        if ( i+1 < vals.count() )
+          bOk8 = stringToColor( vals[ i+1 ], c );
+        if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
+          stops.append( QGradientStop( stop, c ) );
       }
       gradient.setStops( stops );
       success = true;
@@ -1248,7 +1462,7 @@ bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradien
 {
   bool success = false;
   QStringList vals = str.split( "|", QString::SkipEmptyParts );
-  if ( vals.count() > 3 && vals[0] == "conical" || vals[0] == "cg" ) 
+  if ( vals.count() > 3 && ( vals[0] == "conical" || vals[0] == "cg" ) )
   {
     // center and angle
     double cx, cy, a;
@@ -1262,25 +1476,25 @@ bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradien
       // spread type
       if ( vals.count() > 4 )
       {
-       QString spread = vals[ 4 ].trimmed().toLower();
-       if ( spread == "pad" || spread == "0" )
-         gradient.setSpread( QGradient::PadSpread );
-       else if ( spread == "repeat" || spread == "2" )
-         gradient.setSpread( QGradient::RepeatSpread );
-       else if ( spread == "reflect" || spread == "1" )
-         gradient.setSpread( QGradient::ReflectSpread );
+        QString spread = vals[ 4 ].trimmed().toLower();
+        if ( spread == "pad" || spread == "0" )
+          gradient.setSpread( QGradient::PadSpread );
+        else if ( spread == "repeat" || spread == "2" )
+          gradient.setSpread( QGradient::RepeatSpread );
+        else if ( spread == "reflect" || spread == "1" )
+          gradient.setSpread( QGradient::ReflectSpread );
       }
       // stop points
       QGradientStops stops;
       for ( int i = 5; i < vals.count(); i+=2 )
       {
-       bool bOk4, bOk5 = false;
-       QColor c;
-       double stop = vals[i].toDouble( &bOk4 );
-       if ( i+1 < vals.count() )
-         bOk5 = stringToColor( vals[ i+1 ], c );
-       if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
-         stops.append( QGradientStop( stop, c ) );
+        bool bOk4, bOk5 = false;
+        QColor c;
+        double stop = vals[i].toDouble( &bOk4 );
+        if ( i+1 < vals.count() )
+          bOk5 = stringToColor( vals[ i+1 ], c );
+        if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
+          stops.append( QGradientStop( stop, c ) );
       }
       gradient.setStops( stops );
       success = true;
@@ -1288,3 +1502,560 @@ bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradien
   }
   return success;
 }
+
+/*!
+  \brief Convert background data to the string representation.
+  The resulting string consists of several sub-strings separated by ';' symbol. 
+  These sub-strings represent:
+  1. background type (enumerator, see Qtx::BackgroundMode)
+  2. texture image file name (string)
+  3. texture mode (enumerator, see Qtx::TextureMode)
+  4. "show texture" flag (boolean)
+  5. first color (for simple gradient data) or solid color (for single-colored mode)
+  6. second color (for simple gradient data)
+  7. type of simple gradient (some integer identifier)
+  8. complex gradient data (for custom gradient mode)
+  Each sub-string consists of keyword/value couple, in form of "<keyword>=<value>".
+
+  Backward conversion can be done with stringToBackground() method.
+
+  \param bgData background data
+  \return string representation of the background data
+
+  \sa stringToBackground()
+*/
+QString Qtx::backgroundToString( const Qtx::BackgroundData& bgData )
+{
+  const QString dtSep         = ";";
+  const QString kwSep         = "=";
+  const QString kwBgType      = "bt";
+  const QString kwFileName    = "fn";
+  const QString kwTextureMode = "tm";
+  const QString kwShowTexture = "ts";
+  const QString kwFirstColor  = "c1";
+  const QString kwSecondColor = "c2";
+  const QString kwGrType      = "gt";
+  const QString kwGrData      = "gr";
+
+  Qtx::BackgroundMode bgMode       = bgData.mode();
+  QString             fileName;
+  Qtx::TextureMode    textureMode  = bgData.texture( fileName );
+  bool                showTexture  = bgData.isTextureShown();
+  QColor              c1, c2;
+  int                 gradientType = bgData.gradient( c1, c2 );
+  const QGradient*    gradient     = bgData.gradient();
+  QString             grString;
+  if ( gradient ) {
+    switch ( gradient->type() ) {
+    case QGradient::LinearGradient:
+      grString = gradientToString( *(static_cast<const QLinearGradient*>( gradient )) );
+      break;
+    case QGradient::RadialGradient:
+      grString = gradientToString( *(static_cast<const QRadialGradient*>( gradient )) );
+      break;
+    case QGradient::ConicalGradient:
+      grString = gradientToString( *(static_cast<const QConicalGradient*>( gradient )) );
+      break;
+    default:
+      break;
+    }
+  }
+  QStringList data;
+  data << QString( "%1%2%3" ).arg( kwBgType ).arg( kwSep ).arg( (int)bgMode );
+  data << QString( "%1%2%3" ).arg( kwFileName ).arg( kwSep ).arg( fileName );
+  data << QString( "%1%2%3" ).arg( kwTextureMode ).arg( kwSep ).arg( (int)textureMode );
+  data << QString( "%1%2%3" ).arg( kwShowTexture ).arg( kwSep ).arg( showTexture ? "true" : "false" );
+  data << QString( "%1%2%3" ).arg( kwFirstColor ).arg( kwSep ).arg( Qtx::colorToString( c1 ) );
+  data << QString( "%1%2%3" ).arg( kwSecondColor ).arg( kwSep ).arg( Qtx::colorToString( c2 ) );
+  data << QString( "%1%2%3" ).arg( kwGrType ).arg( kwSep ).arg( gradientType );
+  data << QString( "%1%2%3" ).arg( kwGrData ).arg( kwSep ).arg( grString );
+
+  return data.join( dtSep );
+}
+
+/*!
+  \brief Restore background data from the string representation.
+
+  The string should consist of several sub-strings separated by ';' symbol. 
+  Each sub-string consists of keyword/value couple, in form of "<keyword>=<value>".
+  The sub-strings can follow in arbitrary order, some keywords can be missing.
+  The background data is described by the following values:
+  - background type (enumerator, see Qtx::BackgroundMode), keyword "bt"
+  - texture image file name (string), keyword "fn"
+  - texture mode (enumerator, see Qtx::TextureMode), keyword "tm"
+  - "show texture" flag (boolean), keyword "ts"
+  - first color (for simple gradient data) or solid color (for single-colored mode), keyword "c1"
+  - second color (for simple gradient data), keyword "c2"
+  - name of gradient type (string), keyword "gt"
+  - complex gradient data (for custom gradient mode), keyword "gr"
+
+  Also, for backward compatibility, background data can be represented by
+  single color value, see stringToColor().
+
+  Backward conversion can be done with backgroundToString() method.
+  Returns invalid background if conversion could not be done.
+
+  \code
+  Qtx::BackgroundData bgData = Qtx::stringToBackground( str );
+  if ( bgData.isValid() ) ) doSomething( bgData );
+  \endcode
+
+  \param theString string representation of the background data
+  \return resulting background data (invalid if conversion has failed)
+
+  \sa backgroundToString()
+*/
+
+Qtx::BackgroundData Qtx::stringToBackground( const QString& str )
+{
+  const QString dtSep         = ";";
+  const QString kwSep         = "=";
+  const QString kwBgType      = "bt";
+  const QString kwFileName    = "fn";
+  const QString kwTextureMode = "tm";
+  const QString kwShowTexture = "ts";
+  const QString kwFirstColor  = "c1";
+  const QString kwSecondColor = "c2";
+  const QString kwGrType      = "gt";
+  const QString kwGrData      = "gr";
+
+  Qtx::BackgroundData bgData = BackgroundData();
+
+  QStringList data = str.split( dtSep, QString::KeepEmptyParts );
+  
+  QColor c;
+  if ( data.count() == 1 && !data.contains( kwSep ) && stringToColor( data[0], c ) ) {
+    // solid color mode, for backward compatibility
+    bgData.setColor( c );
+  }
+  else {
+    QMap<QString, QString> dmap;
+    // background data
+    foreach( QString d, data ) {
+      QStringList items = d.split( kwSep, QString::KeepEmptyParts );
+      if ( items.count() > 0 ) {
+       QString kw  = items.takeFirst().trimmed().toLower(); // keyword
+       QString val = items.join( kwSep ).trimmed(); // if value contains "=" symbol, we have to restore it
+       dmap[ kw ] = val;
+      }
+    }
+    QString bgMode       = dmap.value( kwBgType,      QString() );
+    QString fileName     = dmap.value( kwFileName,    QString() );
+    QString textureMode  = dmap.value( kwTextureMode, QString() );
+    QString showTexture  = dmap.value( kwShowTexture, QString() );
+    QString color1       = dmap.value( kwFirstColor,  QString() );
+    QString color2       = dmap.value( kwSecondColor, QString() );
+    QString gradientType = dmap.value( kwGrType,      QString() );
+    QString gradient     = dmap.value( kwGrData,      QString() );
+    
+    // texture data
+    if ( !fileName.isEmpty() || !textureMode.isEmpty() || !showTexture.isEmpty() ) {
+      Qtx::TextureMode m = (Qtx::TextureMode)( stringToInt( textureMode,        Qtx::CenterTexture, 
+                                                           Qtx::CenterTexture, Qtx::StretchTexture ) );
+      bgData.setTexture( fileName, m );
+      QStringList boolvars; boolvars << "true" << "yes" << "ok" << "1";
+      if ( boolvars.contains( showTexture.trimmed().toLower() ) )
+       bgData.setTextureShown( true );
+    }
+    QColor c1, c2;
+    // try color mode
+    bool ok = Qtx::stringToColor( color1, c1 );
+    if ( ok ) {
+      bgData.setColor( c1 );
+    }
+    // try simple gradient mode
+    ok = Qtx::stringToColor( color2, c2 );
+    if ( ok || !gradientType.isEmpty() ) {
+      int gt = gradientType.toInt( &ok );
+      bgData.setGradient( ok ? gt : -1, c1, c2 );
+    }
+    // try custom gradient mode
+    QLinearGradient  lg;
+    QConicalGradient cg;
+    QRadialGradient  rg;
+    ok = Qtx::stringToLinearGradient( gradient, lg );
+    if ( ok ) {
+      bgData.setGradient( lg );
+    }
+    ok = Qtx::stringToRadialGradient( gradient, rg );
+    if ( ok ) {
+      bgData.setGradient( rg );
+    }
+    ok = Qtx::stringToConicalGradient( gradient, cg );
+    if ( ok ) {
+      bgData.setGradient( cg );
+    }
+    
+    // finally set background mode
+    Qtx::BackgroundMode m = (Qtx::BackgroundMode)( stringToInt( bgMode,            Qtx::ColorBackground, 
+                                                               Qtx::NoBackground, Qtx::CustomGradientBackground ) );
+    bgData.setMode( m );
+  }
+
+  return bgData;
+}
+
+/*!
+  \class Qtx::Localizer
+  \brief Localization helper
+
+  This helper class can be used to solve the localization problems,
+  usually related to the textual files reading/writing, namely when
+  floating point values are read / written with API functions.
+  The problem relates to such locale specific settings as decimal point
+  separator, thousands separator, etc.
+  
+  To use the Localizer class, just create a local variable in the beginning
+  of the code where you need to read / write data from textual file(s).
+  The constructor of the class forces setting "C" locale temporariy.
+  The destructor switches back to the initial locale.
+
+  \code
+  Qtx::Localizer loc;
+  readSomething();
+  writeSomething();
+  \endcode
+*/
+
+/*!
+  \brief Constructor. Forces "C" locale to be set.
+*/
+Qtx::Localizer::Localizer()
+{
+  myCurLocale = setlocale( LC_NUMERIC, 0 );
+  setlocale( LC_NUMERIC, "C" );
+}
+
+/*!
+  \brief Destructor. Reverts back to the initial locale.
+*/
+Qtx::Localizer::~Localizer()
+{
+  setlocale( LC_NUMERIC, myCurLocale.toLatin1().constData() );
+}
+
+/*!
+  \class Qtx::BackgroundData
+  \brief Stores background data
+
+  This class is used to store background data. Depending on the mode,
+  the background can be specified by:
+  - image (by assigning the file name to be used as background texture), see setTexture(), setTextureShown()
+  - single color (by assigning any color), see setColor()
+  - simple two-color gradient (with the gradient type id and two colors), see setGradient( int, const QColor&, const QColor& )
+  - complex gradient (by assigning arbitrary gradient data), see setGradient( const QGradient& )
+
+  The class stores all the data passed to it, so switching between different modes can be done
+  just by calling setMode() function.
+
+  \note Texture is used with combination of the background mode.
+
+  \note Two-color gradient is specified by two colors and integer identifier. The interpretation of 
+  this identifier should be done in the calling code.
+
+  \code
+  Qtx::BackgroundData bg;
+  bg.setColor( QColor(100, 100, 100) );                  // bg is switched to Qtx::ColorBackground mode
+  bg.setGradient( Qt::Horizontal, Qt::gray, Qt::white ); // bg is switched to Qtx::ColorBackground mode
+  QLinearGradient grad( 0,0,1,1 ); 
+  grad.setColorAt( 0.0, Qt::gray ); 
+  grad.setColorAt( 0.5, Qt::white );
+  grad.setColorAt( 1.0, Qt::green );
+  grad.setSpread( QGradient::PadSpread );
+  bg.setGradient( grad );                                // bg is switched to Qtx::CustomGradientBackground mode
+  bg.setMode( Qtx::ColorBackground );                    // bg is switched back to Qtx::ColorBackground mode
+  bg.setTexture( "/data/images/background.png" );        // specify texture (in the centered mode by default)
+  bg.setTextureShown( true );                            // draw texture on the solid color background
+  \endcode
+*/
+
+/*!
+  \brief Default constructor.
+  Creates invalid background data.
+*/
+Qtx::BackgroundData::BackgroundData()
+  : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+  setMode( Qtx::NoBackground );
+}
+
+/*!
+  \brief Constructor.
+  Creates background data initialized with the specified color
+  \param c color
+*/
+Qtx::BackgroundData::BackgroundData( const QColor& c )
+  : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+  setColor( c );
+}
+
+/*!
+  \brief Constructor.
+  Creates background data initialized with the specified two-color gradient
+  \param type gradient type identifier
+  \param c1 first gradient color
+  \param c2 second gradient color
+  \note the interpretation of the gradient identifier should be done in the calling code
+*/
+Qtx::BackgroundData::BackgroundData( int type, const QColor& c1, const QColor& c2 )
+  : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+  setGradient( type, c1, c2 );
+}
+
+/*!
+  \brief Constructor.
+  Creates background data initialized with the arbirtary gradient data
+  \param grad gradient data
+*/
+Qtx::BackgroundData::BackgroundData( const QGradient& grad )
+  : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+  setGradient( grad );
+}
+
+/*!
+  \brief Destructor.
+*/
+Qtx::BackgroundData::~BackgroundData()
+{
+}
+
+/*!
+  \brief Compares two background data objects
+*/
+bool Qtx::BackgroundData::operator==( const Qtx::BackgroundData& other ) const
+{
+  return 
+    ( myMode         == other.myMode )         && 
+    ( myTextureMode  == other.myTextureMode )  &&
+    ( myFileName     == other.myFileName )     &&
+    ( myColors       == other.myColors )       &&
+    ( myGradientType == other.myGradientType ) &&
+    ( myGradient     == other.myGradient )     &&
+    ( myTextureShown == other.myTextureShown );
+}
+
+/*!
+  \brief Returns \c false if background data is not set (invalid)
+  \return \c true if background data is valid or \c false otherwise
+  \sa mode()
+*/
+bool Qtx::BackgroundData::isValid() const
+{
+  return myMode != Qtx::NoBackground;
+}
+
+/*!
+  \brief Get background mode
+  \return current background mode
+  \sa setMode()
+*/
+Qtx::BackgroundMode Qtx::BackgroundData::mode() const
+{
+  return myMode;
+}
+
+/*!
+  \brief Set background mode
+  \param m background mode being set
+  \sa mode()
+*/
+void Qtx::BackgroundData::setMode( const Qtx::BackgroundMode m )
+{
+  myMode = m;
+}
+
+/*!
+  \brief Get file name used as a texture image
+  \return path to the texture image file
+  \sa setTexture(), setTextureShown()
+*/
+Qtx::TextureMode Qtx::BackgroundData::texture( QString& fileName ) const
+{
+  fileName = myFileName;
+  return myTextureMode;
+}
+
+/*!
+  \brief Set file name to be used as a texture image.
+
+  \note To show texture image on the background it is necessary to call additionally
+  setTextureShown() method.
+
+  \param fileName path to the texture image file name
+  \param m texture mode (Qtx::CenterTexture by default)
+  \sa texture(), setTextureShown()
+*/
+void Qtx::BackgroundData::setTexture( const QString& fileName, const Qtx::TextureMode m )
+{
+  myFileName = fileName;
+  myTextureMode = m;
+}
+
+/*!
+  \brief Check if "show texture" flag is switched on
+  \return \c true if "show texture" flag is set or \c false otherwise
+  \sa setTextureShown(), texture()
+*/
+bool Qtx::BackgroundData::isTextureShown() const
+{
+  return myTextureShown;
+}
+
+/*!
+  \brief Specify if texture should be shown on the background or no.
+  \param on \c true if texture should be shown or \c false otherwise
+  \sa isTextureShown(), texture()
+*/
+void Qtx::BackgroundData::setTextureShown( bool on )
+{
+  myTextureShown = on;
+}
+
+/*!
+  \brief Get background color. Returns null QColor if color is not set
+  \return solid background color
+  \sa setColor(), mode()
+*/
+QColor Qtx::BackgroundData::color() const
+{
+  return myColors.count() > 0 ? myColors[0] : QColor();
+}
+
+/*!
+  \brief Set background color and switch to the Qtx::ColorBackground mode
+  \param c color
+  \sa color(), mode()
+*/
+void Qtx::BackgroundData::setColor( const QColor& c )
+{
+  myColors.clear();
+  myColors << c;
+  setMode( Qtx::ColorBackground );
+}
+
+/*!
+  \brief Get simple gradient data.
+  Returns -1 and null QColor for \a c1 and \a c2 if gradient data is not set
+  \param c1 first gradient color is returned via this parameter
+  \param c2 second gradient color is returned via this parameter
+  \return current two-colored gradient mode type identifier
+  \note the interpretation of the gradient identifier should be done in the calling code
+  \sa setGradient(int, const QColor&, const QColor&), mode()
+*/
+int Qtx::BackgroundData::gradient( QColor& c1, QColor& c2 ) const
+{
+  c1 = myColors.count() > 0 ? myColors[0] : QColor();
+  c2 = myColors.count() > 1 ? myColors[1] : ( myColors.count() > 0 ? myColors[0] : QColor() );
+  return myGradientType;
+}
+
+/*!
+  \brief Set simple background gradient data and switch to the Qtx::SimpleGradientBackground mode
+  \param type two-colored gradient mode type identifier
+  \param c1 first gradient color is returned via this parameter
+  \param c2 second gradient color is returned via this parameter
+  \note the interpretation of the gradient identifier should be done in the calling code
+  \sa gradient(QColor&, QColor&), mode()
+*/
+void Qtx::BackgroundData::setGradient( int type, const QColor& c1, const QColor& c2 )
+{
+  myColors.clear();
+  myColors << c1 << c2;
+  myGradientType = type;
+  setMode( Qtx::SimpleGradientBackground );
+}
+
+/*!
+  \brief Get complex gradient data.
+  Returns QGradient of QGradient::NoGradient if gradient data is not set
+  \note This function does not transform simple gradient data set with 
+  setGradient( const QString&, const QColor&, const QColor& ) to QGradient class
+  \return gradient data
+  \sa setGradient(const QGradient&), mode()
+*/
+const QGradient* Qtx::BackgroundData::gradient() const
+{
+  return &myGradient;
+}
+
+/*!
+  \brief Set complex background gradient data and switch to the Qtx::CustomGradientBackground mode
+  \param grad gradient data (QLinearGradient, QRadialGradient or QConicalGradient)
+  \sa gradient(), mode()
+*/
+void Qtx::BackgroundData::setGradient( const QGradient& grad )
+{
+  myGradient = grad;
+  setMode( Qtx::CustomGradientBackground );
+}
+  
+
+#ifndef WIN32
+
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+
+/*!
+  \brief Open the default X display and returns pointer to it.
+         This method is available on Linux only.
+  \return Pointer to X display.
+  \sa getVisual()
+*/
+void* Qtx::getDisplay()
+{
+  static Display* pDisplay = NULL;
+  if ( !pDisplay )
+    pDisplay = XOpenDisplay( NULL );
+  return pDisplay;
+}
+
+/*!
+  \brief Returns pointer to X visual suitable for 3D rendering.
+         This method is available on Linux only.
+  \return Pointer to X visual.
+  \sa getDisplay()
+*/
+Qt::HANDLE Qtx::getVisual()
+{
+  Qt::HANDLE res = (Qt::HANDLE)NULL;
+
+  Display* pDisplay = (Display*)getDisplay();
+  if ( !pDisplay )
+    return res;
+
+  int errorBase;
+  int eventBase;
+
+  // Make sure OpenGL's GLX extension supported
+  if( !glXQueryExtension( pDisplay, &errorBase, &eventBase ) ){
+    qCritical( "Could not find glx extension" );
+    return res;
+  }
+
+  // Find an appropriate visual
+
+  int doubleBufferVisual[]  = {
+    GLX_RGBA,           // Needs to support OpenGL
+    GLX_DEPTH_SIZE, 16, // Needs to support a 16 bit depth buffer
+    GLX_DOUBLEBUFFER,   // Needs to support double-buffering
+    None                // end of list
+  };
+
+  // Try for the double-bufferd visual first
+  XVisualInfo *visualInfo = NULL;
+  visualInfo = glXChooseVisual( pDisplay, DefaultScreen(pDisplay), doubleBufferVisual );
+
+  if( visualInfo == NULL ){
+    qCritical( "Could not find matching glx visual" );
+    return res;
+  }
+
+  qDebug() << "Picked visual 0x" << hex << XVisualIDFromVisual( visualInfo->visual );
+  res = (Qt::HANDLE)( visualInfo->visual );
+  return res;
+}
+#endif // WIN32
index 6960d4d96abcfc084eed45ff978f8fa1268729f6..402c9eadc28e880b7d14ed8891bdfc8a8a0d5125 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      Qtx.h
 // Author:    Sergey TELKOV
 //
@@ -26,7 +27,7 @@
 #define QTX_H
 
 #if defined WIN32
-#  if defined QTX_EXPORTS
+#  if defined QTX_EXPORTS || defined qtx_EXPORTS
 #    define QTX_EXPORT _declspec( dllexport )
 #  else
 #    define QTX_EXPORT _declspec( dllimport )
 #include <QColor>
 #include <QImage>
 #include <QPixmap>
+#include <QGradient>
 
 class QObject;
 class QWidget;
 class QCompleter;
-class QLinearGradient;
-class QRadialGradient;
-class QConicalGradient;
 
 typedef QList<int>    QIntList;       //!< list of int values
 typedef QList<short>  QShortList;     //!< list of short int values
@@ -100,11 +99,103 @@ public:
   };
 
   typedef enum {
-       Shown,   //!< column should be always visible
-       Hidden,  //!< column should be always hidden
-       Toggled  //!< it should be possible to show/hide the column with help of popup menu
+        Shown,   //!< column should be always visible
+        Hidden,  //!< column should be always hidden
+        Toggled  //!< it should be possible to show/hide the column with help of popup menu
   } Appropriate;  //!< appropriate status
 
+  //! Environment variables substitution mode
+  typedef enum {
+        Always, //!< substitute environment variable by it's value if variable exists, and "" otherwise
+        Never,  //!< keep environment variable as is without any substitution
+        Auto    //!< substitute environment variable by it's value if variable exists, and keep it as is otherwise
+  } SubstMode;
+
+  //! object visibility state
+  typedef enum {
+    ShownState,             //!< Object is shown in viewer
+    HiddenState,            //!< Object is hidden in viewer
+    UnpresentableState,     //!< Unpresentable object
+  } VisibilityState;
+
+  //! Header view flags
+  typedef enum {
+    ShowText = 0x001,                //!< Show only text in the header
+    ShowIcon = 0x010,                //!< Show only icon in the header
+    ShowAll  = ShowText | ShowIcon   //!< Show icon and text in the header
+  } HeaderViewFlags;
+
+  //! Type of the custom data (for custom tree model)
+  typedef enum {
+    IdType
+  } CustomDataType;
+  
+  //! Background mode
+  typedef enum { 
+    NoBackground,              // no (invalid) background data
+    ColorBackground,           // single color
+    SimpleGradientBackground,  // simple two-color gradient
+    CustomGradientBackground   // custom (complex) gradient
+  } BackgroundMode;
+
+  //! Texture mode
+  typedef enum { 
+    CenterTexture,             // center texture
+    TileTexture,               // tile texture
+    StretchTexture,            // stretch texture
+  } TextureMode;
+
+  class QTX_EXPORT Localizer
+  {
+  public:
+    Localizer();
+    ~Localizer();
+  private:
+    QString myCurLocale;
+  };
+
+  class QTX_EXPORT BackgroundData
+  {
+  public:
+    BackgroundData();
+    BackgroundData( const QColor& );
+    BackgroundData( int, const QColor&, const QColor& );
+    BackgroundData( const QGradient& );
+    virtual ~BackgroundData();
+
+    bool operator==( const BackgroundData&) const;
+    inline bool operator!=( const BackgroundData& other ) const
+    { return !operator==( other ); }
+
+    bool             isValid() const;
+    
+    BackgroundMode   mode() const;
+    void             setMode( const BackgroundMode );
+    
+    TextureMode      texture( QString& ) const;
+    void             setTexture( const QString&, TextureMode = Qtx::CenterTexture );
+    bool             isTextureShown() const;
+    void             setTextureShown( bool );
+
+    QColor           color() const;
+    void             setColor( const QColor& );
+
+    int              gradient( QColor&, QColor& ) const;
+    void             setGradient( int, const QColor&, const QColor& );
+
+    const QGradient* gradient() const;
+    void             setGradient( const QGradient& );
+  
+  private:
+    BackgroundMode   myMode;
+    TextureMode      myTextureMode;
+    QString          myFileName;
+    QColorList       myColors;
+    int              myGradientType;
+    QGradient        myGradient;
+    bool             myTextureShown;
+  };
+
   static QString     toQString( const char*, const int = -1 );
   static QString     toQString( const short*, const int = -1 );
   static QString     toQString( const unsigned char*, const int = -1 );
@@ -132,6 +223,8 @@ public:
   static QString     addSlash( const QString& );
 
   static QCompleter* pathCompleter( const PathType, const QString& = QString() );
+  static QString     findEnvVar( const QString&, int&, int& );
+  static QString     makeEnvVarSubst( const QString&, const SubstMode = Auto );
 
   static int         rgbSet( const QColor& );
   static int         rgbSet( const int, const int, const int );
@@ -151,6 +244,9 @@ public:
 
   static QString     colorToString( const QColor& );
   static bool        stringToColor( const QString&, QColor& );
+  static QString     biColorToString( const QColor&, const int );
+  static bool        stringToBiColor( const QString&, QColor&, int& );
+  static QColor      mainColorToSecondary( const QColor&, int );
 
   static QString     gradientToString( const QLinearGradient& );
   static QString     gradientToString( const QRadialGradient& );
@@ -158,6 +254,14 @@ public:
   static bool        stringToLinearGradient( const QString&, QLinearGradient& );
   static bool        stringToRadialGradient( const QString&, QRadialGradient& );
   static bool        stringToConicalGradient( const QString&, QConicalGradient& );
+
+  static QString        backgroundToString( const BackgroundData& );
+  static BackgroundData stringToBackground( const QString& );
+
+#ifndef WIN32
+  static void*       getDisplay();
+  static Qt::HANDLE  getVisual();
+#endif
 };
 
 #endif
diff --git a/src/Qtx/Qtx.pro b/src/Qtx/Qtx.pro
deleted file mode 100644 (file)
index a5b7c33..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = qtx
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT += xml
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += QTX_EXPORTS
-
-HEADERS  = Qtx.h
-HEADERS += QtxAction.h
-HEADERS += QtxActionMenuMgr.h
-HEADERS += QtxActionMgr.h
-HEADERS += QtxActionSet.h
-HEADERS += QtxActionToolMgr.h
-HEADERS += QtxColorScale.h
-HEADERS += QtxComboBox.h
-HEADERS += QtxDialog.h
-HEADERS += QtxDockAction.h
-HEADERS += QtxDockWidget.h
-HEADERS += QtxDoubleSpinBox.h
-HEADERS += QtxEvalExpr.h
-HEADERS += QtxGridBox.h
-HEADERS += QtxGroupBox.h
-HEADERS += QtxIntSpinBox.h
-HEADERS += QtxListAction.h
-HEADERS += QtxLogoMgr.h
-HEADERS += QtxMainWindow.h
-HEADERS += QtxMap.h
-HEADERS += QtxMRUAction.h
-HEADERS += QtxPathDialog.h
-HEADERS += QtxPopupMgr.h
-HEADERS += QtxResourceMgr.h
-HEADERS += QtxSplash.h
-HEADERS += QtxToolBar.h
-HEADERS += QtxToolTip.h
-HEADERS += QtxValidator.h
-HEADERS += QtxWorkspace.h
-HEADERS += QtxWorkspaceAction.h
-HEADERS += QtxWorkstack.h
-HEADERS += QtxWorkstackAction.h
-#HEADERS += QtxDirListEditor.h
-#HEADERS += QtxListBox.h
-#HEADERS += QtxListResourceEdit.h
-#HEADERS += QtxListView.h
-#HEADERS += QtxPopupMenu.h
-#HEADERS += QtxResourceEdit.h
-#HEADERS += QtxTable.h
-
-SOURCES  = Qtx.cxx
-SOURCES += QtxAction.cxx
-SOURCES += QtxActionMenuMgr.cxx
-SOURCES += QtxActionMgr.cxx
-SOURCES += QtxActionSet.cxx
-SOURCES += QtxActionToolMgr.cxx
-SOURCES += QtxColorScale.cxx
-SOURCES += QtxComboBox.cxx
-SOURCES += QtxDialog.cxx
-SOURCES += QtxDockAction.cxx
-SOURCES += QtxDockWidget.cxx
-SOURCES += QtxDoubleSpinBox.cxx
-SOURCES += QtxEvalExpr.cxx
-SOURCES += QtxGridBox.cxx
-SOURCES += QtxGroupBox.cxx
-SOURCES += QtxIntSpinBox.cxx
-SOURCES += QtxListAction.cxx
-SOURCES += QtxLogoMgr.cxx
-SOURCES += QtxMainWindow.cxx
-SOURCES += QtxMRUAction.cxx
-SOURCES += QtxPathDialog.cxx
-SOURCES += QtxPopupMgr.cxx
-SOURCES += QtxResourceMgr.cxx
-SOURCES += QtxSplash.cxx
-SOURCES += QtxToolBar.cxx
-SOURCES += QtxToolTip.cxx
-SOURCES += QtxValidator.cxx
-SOURCES += QtxWorkspace.cxx
-SOURCES += QtxWorkspaceAction.cxx
-SOURCES += QtxWorkstack.cxx
-SOURCES += QtxWorkstackAction.cxx
-#SOURCES += QtxDirListEditor.cxx
-#SOURCES += QtxListBox.cxx
-#SOURCES += QtxListResourceEdit.cxx
-#SOURCES += QtxListView.cxx
-#SOURCES += QtxPopupMenu.cxx
-#SOURCES += QtxResourceEdit.cxx
-#SOURCES += QtxTable.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 49102514222393f3ab651da2144ce6458db2e29b..e2fc767024b9077fd33855e2cb251889a4aadefb 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -66,14 +67,19 @@ private:
 
   Creates an action owned by \a parent. 
   Parameter \a toggle can be used to make the action checkable.
+  Parameter \a shortcutAction can be used to assign the shortcut from
+  preferences. This parameter value corresponds to shortcut action identifier
+  in shortcut preferences.
 
   \param parent parent object
   \param toggle if \c true the action will be a toggle action
+  \param shortcutAction shortcut action identifier
 */
-QtxAction::QtxAction( QObject* parent, bool toggle )
+QtxAction::QtxAction( QObject* parent, bool toggle, const QString& shortcutAction )
 : QWidgetAction( parent )
 {
   setCheckable( toggle );
+  setShortcutActionName(shortcutAction);
 
   QApplication::instance()->installEventFilter( this );
 }
@@ -84,6 +90,9 @@ QtxAction::QtxAction( QObject* parent, bool toggle )
   Creates an action owned by \a parent. Parameters \a text,
   \a icon, \a menuText and \a accel specify the action's attributes.
   Parameter \a toggle can be used to make the action checkable.
+  Parameter \a shortcutAction can be used to assign the shortcut from
+  preferences. This parameter value corresponds to shortcut action identifier
+  in shortcut preferences.
 
   \param text tooltip text
   \param icon iconset
@@ -91,9 +100,10 @@ QtxAction::QtxAction( QObject* parent, bool toggle )
   \param accel shortcut key sequence
   \param parent parent object
   \param toggle if \c true the action will be a toggle action
+  \param shortcutAction shortcut action identifier
 */
-QtxAction::QtxAction( const QString& text, const QIcon& icon,
-                      const QString& menuText, int accel, QObject* parent, bool toggle )
+QtxAction::QtxAction( const QString& text, const QIcon& icon, const QString& menuText, 
+                     int accel, QObject* parent, bool toggle, const QString& shortcutAction )
 : QWidgetAction( parent )
 {
   setIcon( icon );
@@ -101,6 +111,7 @@ QtxAction::QtxAction( const QString& text, const QIcon& icon,
   setToolTip( text );
   setShortcut( accel );
   setCheckable( toggle );
+  setShortcutActionName(shortcutAction);
 
   QApplication::instance()->installEventFilter( this );
 }
@@ -111,22 +122,27 @@ QtxAction::QtxAction( const QString& text, const QIcon& icon,
   Creates an action owned by \a parent. Parameters \a text,
   \a menuText and \a accel specify the action's attributes.
   Parameter \a toggle can be used to make the action checkable.
+  Parameter \a shortcutAction can be used to assign the shortcut from
+  preferences. This parameter value corresponds to shortcut action identifier
+  in shortcut preferences.
 
   \param text tooltip text
   \param menuText menu text
   \param accel shortcut key sequence
   \param parent parent object
   \param toggle if \c true the action is a toggle action
+  \param shortcutAction shortcut action identifier
 */
 QtxAction::QtxAction( const QString& text, const QString& menuText,
-                      int accel, QObject* parent, bool toggle )
+                      int accel, QObject* parent, bool toggle, const QString& shortcutAction )
 : QWidgetAction( parent )
 {
   setText( menuText );
   setToolTip( text );
   setShortcut( accel );
   setCheckable( toggle );
-
+  setShortcutActionName(shortcutAction);
+  
   QApplication::instance()->installEventFilter( this );
 }
 
@@ -207,3 +223,27 @@ void QtxAction::customEvent( QEvent* e )
   else
     removedFrom( ae->widget() );
 }
+
+/*!
+  \brief Return shortcut action name for the action.
+  
+  \return shortcut action name
+  \sa setShortcutActionName()
+*/
+QString QtxAction::shortcutActionName() const
+{
+  return myShortcutActionName;
+}
+
+/*!
+  \brief Set shortcut action name to the action.
+
+  Shortcut action name is used for shortcuts customization.
+
+  \param shortcutAction shortcut action name
+  \sa shortcutActionName()
+*/
+void QtxAction::setShortcutActionName( const QString& shortcutAction )
+{
+  myShortcutActionName = shortcutAction;
+}
index 4e5448002f129e6352f96cb21f23aa3a00aa77ea..aa2166ad150b0e82e551155db78fba53d0975e44 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxAction.h
 // Author:    Sergey TELKOV
 //
@@ -42,18 +43,24 @@ class QTX_EXPORT QtxAction : public QWidgetAction
   class ActionNotify;
 
 public:
-  QtxAction( QObject* = 0, bool = false );
-  QtxAction( const QString&, const QString&, int, QObject*, bool = false );
-  QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false );
+  QtxAction( QObject* = 0, bool = false, const QString& = QString() );
+  QtxAction( const QString&, const QString&, int, QObject*, bool = false, const QString& = QString() );
+  QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false, const QString& = QString() );
   virtual ~QtxAction();
 
   virtual bool eventFilter( QObject*, QEvent* );
 
+  QString shortcutActionName() const;
+  void setShortcutActionName( const QString& );
+
 protected:
   virtual void addedTo( QWidget* );
   virtual void removedFrom( QWidget* );
 
   virtual void customEvent( QEvent* );
+
+private:
+  QString myShortcutActionName;
 };
 
 #ifdef WIN32
index eeea9d7775c24d4358727ba93d5508a978b3e4c0..7b47de842fe7e422b1b32319cec15b0d933ac387 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionGroup.cxx
 // Author:    Sergey TELKOV
 //
@@ -203,7 +201,7 @@ void QtxActionGroup::onTriggered( QAction* a )
     {
       QtxComboBox* cb = ::qobject_cast<QtxComboBox*>( *it );
       if ( cb )
-       cb->setCurrentId( id );
+        cb->setCurrentId( id );
     }
   }
   
@@ -226,7 +224,7 @@ void QtxActionGroup::updateAction( QWidget* w )
       
       QList<QAction*> lst = actions();
       for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
-       w->removeAction( *it );
+        w->removeAction( *it );
     }
   }
   else
@@ -237,7 +235,7 @@ void QtxActionGroup::updateAction( QWidget* w )
     else {
       QList<QAction*> lst = actions();
       for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
-       w->removeAction( *it );
+        w->removeAction( *it );
     }
   }
 }
index 45a8067e0861a2a8764c1711da6de76f9100c0a0..dd1ee2741477f6b0ea7bb1ac133bdcac988341be 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionGroup.h
 // Author:    Sergey TELKOV
 //
index 8e29512927efab055ea5c0f6d8e709bdc0b02ee7..ef460e61e7d29cfb34357c8ad22589b4b954021b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionMenuMgr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -71,9 +72,9 @@ QtxActionMenuMgr::MenuNode::MenuNode()
   \param _group menu node group ID
 */
 QtxActionMenuMgr::MenuNode::MenuNode( MenuNode* p,
-                                     const int _id,
-                                     const int _idx,
-                                     const int _group )
+                                      const int _id,
+                                      const int _idx,
+                                      const int _group )
 : parent( p ), id( _id ), idx( _idx ), group( _group ), visible( true ), emptyEnabled( 0 )
 {
   if ( p )
@@ -491,8 +492,19 @@ void QtxActionMenuMgr::remove( const int id, const int pId, const int group )
       delNodes.append( *it );
   }
 
+  QWidget* mW = menuWidget( pNode );
   for ( NodeList::iterator itr = delNodes.begin(); itr != delNodes.end(); ++itr )
+  {
+    int id = (*itr)->id;
+    if( mW && menuAction( id ) )
+    {
+      mW->removeAction( menuAction( id ) );
+      myMenus.remove( id );
+    }
+    else if( mW && itemAction( id ) )
+      mW->removeAction( itemAction( id ) );
     pNode->children.removeAll( *itr );
+  }
 
   triggerUpdate( pNode->id, false );
 }
@@ -886,7 +898,7 @@ void QtxActionMenuMgr::updateMenu( MenuNode* startNode, const bool rec, const bo
     {
       a = foralit.next();
       if ( !mw->actions().contains( a ) )
-       foralit.remove();
+        foralit.remove();
     }
   }
   QList<QAction*> alist = mw->actions();
@@ -984,8 +996,10 @@ bool QtxActionMenuMgr::ownAction( QAction* a, MenuNode* node ) const
   for ( NodeList::const_iterator iter = node->children.begin(); iter != node->children.end(); ++iter )
   {
     QAction* mya = itemAction( (*iter)->id );
-    if ( !mya ) mya = menuAction( (*iter)->id );
-    if ( mya && mya == a ) return true;
+    if ( !mya )
+      mya = menuAction( (*iter)->id );
+    if ( mya && mya == a )
+      return true;
   }
   return false;
 }
@@ -1161,7 +1175,7 @@ void QtxActionMenuMgr::setEmptyEnabled( const int id, const bool enable )
   if ( node && menuAction( id ) ) {
     int old = node->emptyEnabled;
     node->emptyEnabled += enable ? 1 : -1;
-    if ( old <= 0 && enable || old > 0 && !enable ) // update menu only if enabled state has been changed
+    if ( ( old <= 0 && enable ) || ( old > 0 && !enable ) ) // update menu only if enabled state has been changed
       updateMenu( node, true, true );
   }
 }
index 071c34adb65ca8eacd615ddc27c8936bf307f27b..a3dc5872746234f54fa18bc12a47fa05f5bb1ed9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionMenuMgr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
index 3241ee76d426eae1bafd001738fc7510155bac83..30a3bbefc089f29098defdd6a8f643eeae60c1b7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionMgr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
index f80591374626a5ec154c4c37058a6f2406945c65..38487b3e8dc4b9c3a8680f2db94a9378cf9fce88 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionMgr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -113,7 +114,7 @@ public:
   Reader* reader() const;
 
   virtual int    append( const QString&, const bool,
-                        const ItemAttributes&, const int ) = 0;
+                         const ItemAttributes&, const int ) = 0;
   virtual void   connect( QAction* ) const;
 
   virtual bool   loadPixmap( const QString&, QPixmap& ) const;
@@ -121,7 +122,7 @@ public:
 protected:
   static int     intValue( const ItemAttributes&, const QString&, const int );
   static QString strValue( const ItemAttributes&, const QString&,
-                          const QString& = QString() );
+                           const QString& = QString() );
 private:
   QtxActionMgr::Reader*  myReader;  //!< actions reader
 };
index e43e700309bbacc89be5b779d1b17160235a7b60..8a2580b6e533abf88a8d57f9337bcacac1562559 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionSet.cxx
 // Author:    Sergey TELKOV
 //
index 952a849da9c75741744b88a498b5a9be22182de7..91d8e1c262554f6ab705aeda9e5271c913da5584 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionSet.h
 // Author:    Sergey TELKOV
 //
index 8f3b8804eb4af2b221e72503c9dee68fbb8e7a42..0d69da6adc7df4195a73a20dcd4c0f8986e154f8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionToolMgr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -27,6 +28,8 @@
 #include "QtxAction.h"
 #include "QtxToolBar.h"
 
+#include <QApplication>
+#include <QHideEvent>
 #include <QMainWindow>
 
 /*!
@@ -96,9 +99,30 @@ QMainWindow* QtxActionToolMgr::mainWindow() const
   \param title toolbar title
   \param tid requested toolbar ID
   \param mw parent main window; if it is null, the tool manager's main window is used
+  \param vis show toolbar visible immediately after creation (true by default)
   \return id of created/found toolbar
 */
-int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
+int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw, bool vis )
+{
+  return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw, vis );
+}
+
+/*!
+  \brief Create toolbar and assign \a id to it.
+
+  If \a tid is less than 0, the identifier is generated automatically.
+  If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+  \param title toolbar title
+  \param floatable if \c true, new toolbar is made floatable
+  \param dockAreas dock areas of the main window where the new toolbar can be situated
+  \param tid requested toolbar ID
+  \param mw parent main window; if it is null, the tool manager's main window is used
+  \param vis show toolbar visible immediately after creation (true by default)
+  \return id of created/found toolbar
+*/
+int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, 
+                                     int tid, QMainWindow* mw, bool vis )
 {
   static int _toolBarId = -1;
 
@@ -124,10 +148,16 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW
   if ( !tb )
   {
     tb = new QtxToolBar( true, tbw );
+    //tb->setVisible( false );  // VSR: create toolbar visible initially
+    tb->setFloatable( floatable );
+    tb->setAllowedAreas( dockAreas );
+    tb->setMovable( dockAreas & Qt::AllToolBarAreas );
     //mainWindow()->addToolBar( tb );
     tb->setWindowTitle( title );
     tb->setObjectName( title );
     tb->setToolTip( title );
+    if ( !vis )
+      QApplication::postEvent( tb, new QHideEvent());
    }
 
   tInfo.toolBar = tb;
@@ -386,6 +416,15 @@ QToolBar* QtxActionToolMgr::toolBar( const QString& title ) const
   return toolBar( find( title ) );
 }
 
+/*!
+  \bried Get all registered toolbars identifiers
+  \return list of toolbars ids
+*/
+QIntList QtxActionToolMgr::toolBarsIds() const
+{
+  return myToolBars.keys();
+}
+
 /*!
   \brief Check if toolbar with given \a id already registered.
   \param tid toolbar ID
@@ -420,13 +459,34 @@ bool QtxActionToolMgr::containsAction( const int id, const int tid ) const
     {
       const NodeList& list = it.value().nodes;
       for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit )
-       if ( (*nit).id == id )
-         return true;
+        if ( (*nit).id == id )
+          return true;
     }
   }
   return false;
 }
 
+/*!
+  \brief Get index of the action \a id within the toolbar \a tid
+  \param id action ID
+  \param tid toolbar ID
+  \return index of the action in the toolbar or -1 if action is not contained in the toolbar
+*/
+int QtxActionToolMgr::index( const int id, const int tid ) const
+{
+  for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end(); ++it )
+  {
+    if ( it.key() == tid )
+    {
+      const NodeList& list = it.value().nodes;
+      int idx = 0;
+      for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit, ++idx )
+        if ( (*nit).id == id ) return idx;
+    }
+  }
+  return -1;
+}
+
 /*!
   \brief Called when toolbar is destroyed.
 
index dd6b19cf4ebc9c6cc63ff93155e3d1df6d442c94..ccc42d57e6099b859a819c1bccb798f5091fddd1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxActionToolMgr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -64,7 +65,9 @@ public:
 
   QMainWindow*    mainWindow() const;
 
-  int             createToolBar( const QString&, int = -1, QMainWindow* = 0 );
+  int             createToolBar( const QString&, int = -1, QMainWindow* = 0, bool = true );
+  int             createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, 
+                                 int = -1, QMainWindow* = 0, bool = true );
   void            removeToolBar( const QString& );
   void            removeToolBar( const int );
 
@@ -96,11 +99,13 @@ public:
 
   QToolBar*       toolBar( const int ) const;
   QToolBar*       toolBar( const QString& ) const;
+  QIntList        toolBarsIds() const;
   
   bool            hasToolBar( const int ) const;
   bool            hasToolBar( const QString& ) const;
 
   bool            containsAction( const int, const int = -1 ) const;
+  int             index( const int, const int ) const;
 
   virtual bool    load( const QString&, QtxActionMgr::Reader& );
 
index d792cf506761398dee87eae80d483d6568cb32ab..b17bba7b25f9a2ad59b2df94404e86cdc724c648 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxColorButton.cxx
 // Author:    Sergey TELKOV
 //
@@ -56,7 +54,7 @@ QtxColorButton::QtxColorButton( QWidget* parent )
 : QToolButton( parent )
 {
   setCheckable( false );
-  setPopupMode( MenuButtonPopup );
+  setPopupMode( MenuButtonPopup ); // VSR 11/10/2010 temporarily roolback from InstantPopup (regressions)
 
   QMenu* pm = new QMenu( this );
   QGridLayout* grid = new QGridLayout( pm );
@@ -307,11 +305,13 @@ void QtxColorButton::paintEvent( QPaintEvent* e )
   pix.fill( palette().color( backgroundRole() ) );
 
   if ( color().isValid() )
-    drawColor( &pix, color() );
+    drawColor( &pix, isEnabled() ? color() : palette().mid().color(), isEnabled() ? Qt::black : palette().mid().color() );
   else {
     QPainter pixp( &pix );
+    pixp.setPen( palette().color( isEnabled() ? QPalette::WindowText : QPalette::Mid ) );
     pixp.drawRect( 2, 2, pix.width() - 4, pix.height() - 4 );
-    pixp.fillRect( 3, 3, pix.width() - 6, pix.height() - 6, QBrush( Qt::BDiagPattern ) );
+    pixp.fillRect( 3, 3, pix.width() - 6, pix.height() - 6, 
+                  QBrush( palette().color( isEnabled() ? QPalette::WindowText : QPalette::Mid ), Qt::BDiagPattern ) );
     pixp.end();
   }
 
@@ -382,13 +382,13 @@ QPixmap QtxColorButton::buttonIcon( const QColor& c ) const
   \param c color
   \param m margin
 */
-void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const int m ) const
+void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const QColor& bc, const int m ) const
 {
   if ( !pd )
     return;
 
   QPainter p( pd );
-  p.setPen( Qt::black );
+  p.setPen( bc );
   p.fillRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1, QBrush( c ) );
   p.drawRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1 );
   p.end();
index 0b73d3a48f9c5013e245754740c95fea1197f547..14dc294562820455205a4275caa70b18d3c94d95 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxColorButton.h
 // Author:    Sergey TELKOV
 //
@@ -74,7 +72,7 @@ private:
   void          updateState();
   void          updateButton( QToolButton* );
   QPixmap       buttonIcon( const QColor& ) const;
-  void          drawColor( QPaintDevice*, const QColor&, const int = 1 ) const;
+  void          drawColor( QPaintDevice*, const QColor&, const QColor& = Qt::black, const int = 1 ) const;
 
 private:
   typedef QMap<const QToolButton*, QColor> ColorMap;
index 40911008049c7aa08c1825231a59ec83c48c6c2c..8a6a4838e50254f9751e4b3bdfd4f2690a1b70a2 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxColorScale.cxx
 // Author:    Sergey TELKOV
 //
@@ -530,7 +531,7 @@ QSize QtxColorScale::sizeHint() const
   \return color scale size
 */
 QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool title,
-                                   const bool labels, const bool colors ) const
+                                    const bool labels, const bool colors ) const
 {
   int num = intervalsNumber();
   
@@ -585,7 +586,7 @@ QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool
     {
       QPainter p( (QtxColorScale*)this );
       if ( scaleWidth )
-       srt->setTextWidth( scaleWidth );
+        srt->setTextWidth( scaleWidth );
       
       titleHeight = (int)srt->size().height() + spacer;
       titleWidth = (int)srt->size().width() + 10;
@@ -615,9 +616,9 @@ QPixmap QtxColorScale::dump() const
     {
       bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
       bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
-       labelPosition() != None;
+        labelPosition() != None;
       bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
-       titlePosition() != None;
+        titlePosition() != None;
       QColor bgc = palette().color( backgroundRole() );
       QPainter p;
       p.begin( &aPix );
@@ -666,9 +667,9 @@ QPixmap QtxColorScale::dump( const QColor& bg, const int w, const int h ) const
       QSize sz = calculateSize( false, myFlags & ~WrapTitle, title, label, scale );
       
       if ( W < 0 )
-       W = sz.width();
+        W = sz.width();
       if ( H < 0 )
-       H = sz.height();
+        H = sz.height();
     }
     
     aPix = QPixmap( W, H );
@@ -724,8 +725,8 @@ void QtxColorScale::drawContents( QPainter* p )
   QRect aDrawRect = contentsRect();
   
   drawScale( p, false/*testFlags( Transparent )*/, aDrawRect.x(),
-            aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
-            titlePosition() != None, labelPosition() != None, true );
+             aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
+             titlePosition() != None, labelPosition() != None, true );
 }
 
 /*!
@@ -906,13 +907,13 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp,
       int pos2 = lab - 1 - i2;
       if ( filter && !( pos1 % filter ) )
       {
-       p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] );
-       last1 = i1;
+        p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] );
+        last1 = i1;
       }
       if ( filter && !( pos2 % filter ) )
       {
-       p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] );
-       last2 = i2;
+        p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] );
+        last2 = i2;
       }
       i1++;
       i2--;
@@ -922,8 +923,8 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp,
     while ( pos <= i2 && i0 == -1 )
     {
       if ( filter && !( pos % filter ) &&
-          qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter )
-       i0 = pos;
+           qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter )
+        i0 = pos;
       pos++;
     }
 
index 8b601adbf5d3f61b2076003a2f4b934a5bb9f325..dd10e9f77e425ae48ef65719c3cb80813fe5953a 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxColorScale.h
 // Author:    Sergey TELKOV
 //
@@ -137,12 +138,12 @@ private:
   double                getNumber( const int ) const;
   QTextDocument*        textDocument( const int ) const;
   void                  drawScale( QPainter*, const bool, const int, const int,
-                                  const int, const int, const bool, const bool, const bool ) const;
+                                   const int, const int, const bool, const bool, const bool ) const;
   void                  drawScale( QPainter*, const QColor&, const bool,
-                                  const int, const int, const int, const int,
-                                  const bool, const bool, const bool ) const;
+                                   const int, const int, const int, const int,
+                                   const bool, const bool, const bool ) const;
   QSize                 calculateSize( const bool, const int,
-                                      const bool, const bool, const bool ) const;
+                                       const bool, const bool, const bool ) const;
 
 private:
   double                myMin;             //!< lower limit
index 74425a78848b0d77fbbf7e4a6e243bd2d9448514..231c011e35949a20b5563eb329fce655b8f788aa 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxComboBox.cxx
 // Author:    Sergey TELKOV
 //
@@ -133,7 +134,6 @@ QtxComboBox::QtxComboBox( QWidget* parent )
 : QComboBox( parent ),
   myCleared( false )
 {
-  connect( this, SIGNAL( activated( int ) ),            this, SLOT( onActivated( int ) ) );
   connect( this, SIGNAL( currentIndexChanged( int ) ),  this, SLOT( onCurrentChanged( int ) ) );
   setModel( new Model( this ) );
 }
@@ -235,16 +235,6 @@ void QtxComboBox::customEvent( QEvent* e )
     lineEdit()->setText( "" );
 }
 
-/*!
-  \brief Called when any item is activated by the user.
-  \param idx activated item index
-*/
-void QtxComboBox::onActivated( int idx )
-{
-  resetClear();
-  emit activatedId( id( idx ) );
-}
-
 /*!
   \brief Called when current item is chaned (by the user or programmatically).
   \param idx item being set current
@@ -252,7 +242,10 @@ void QtxComboBox::onActivated( int idx )
 void QtxComboBox::onCurrentChanged( int idx )
 {
   if ( idx != -1 )
+  {
     resetClear();
+    emit activatedId( id( idx ) );
+  }
 }
 
 /*!
index 345881b325350650496d3f2556808cd5568aa3be..240bcc7b703bec9f65085b79636413ecb20e5ef0 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxComboBox.h
 // Author:    Sergey TELKOV
 //
@@ -61,7 +62,6 @@ signals:
   void         activatedId( int );
 
 private slots:
-  void         onActivated( int );
   void         onCurrentChanged( int );
 
 protected:
index 3200b78516ab5213c68eec21dadd1ab95cdade92..3a75ef02290343648661fccd3ac6c123ee9194ed 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDialog.cxx
 // Author:    Sergey TELKOV
 //
@@ -260,7 +261,7 @@ void QtxDialog::Area::layoutButtons()
     {
       buttonId[mit.value()] = mit.key();
       if ( mit.key() >= 0 )
-       src.append( mit.value() );
+        src.append( mit.value() );
     }
   }
 
@@ -321,7 +322,7 @@ void QtxDialog::Area::layoutButtons()
     {
       buttonLayout->addWidget( other[i] );
       if ( aPolicy == QtxDialog::Uniform && i < (int)other.count() - 1  )
-       buttonLayout->addStretch( 1 );
+        buttonLayout->addStretch( 1 );
     }
   }
 
@@ -440,16 +441,16 @@ QSize QtxDialog::Border::minimumSizeHint() const
   \param wf dialog box flags (Qt::WindowFlags)
 */
 QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f, Qt::WindowFlags wf )
-: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::Dialog |
+: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::Dialog |
 #ifdef WIN32
            ( allowResize ? 0 : Qt::FramelessWindowHint ) |
 #endif
            ( ( allowResize 
 #ifdef WIN32 
-              // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON
-              && !( wf & Qt::WindowContextHelpButtonHint )
+               // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON
+               && !( wf & Qt::WindowContextHelpButtonHint )
 #endif
-              ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ),
+               ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ),
   myInited( false ),
   mySender( 0 ),
   myAlignment( 0 ),
@@ -1051,7 +1052,7 @@ void QtxDialog::removeButton( const int id )
     for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
     {
       if ( it.key() < 0 )
-       map.insert( it.key(), it.value() );
+        map.insert( it.key(), it.value() );
     }
   }
   else if ( myButton.contains( id ) )
@@ -1212,7 +1213,7 @@ QtxDialog::ButtonMap QtxDialog::buttons( const int f ) const
   {
     for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
       if ( f == -1 || ( it.key() >= 0 && f & it.key() ) )
-       retmap.insert( it.key(), it.value() );
+        retmap.insert( it.key(), it.value() );
   }
   return retmap;
 }
@@ -1327,8 +1328,11 @@ void QtxDialog::keyPressEvent( QKeyEvent* e )
   if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier )
   {
     QObject* tab = qFindChild<QTabWidget*>( this );
-    if ( tab )
+    if ( tab && !property( "in_tab_event" ).toBool() ) {
+      setProperty( "in_tab_event", true );
       QApplication::sendEvent( tab, e );
+      setProperty( "in_tab_event", false );
+    }
   }
 }
 
@@ -1541,7 +1545,7 @@ void QtxDialog::adjustButtons()
     const QList<QAbstractButton*>& lst = aIt.value()->buttons();
     for ( QList<QAbstractButton*>::const_iterator bIt = lst.begin(); bIt != lst.end(); ++bIt )
       if ( (*bIt)->isVisibleTo( this ) )
-       minWidth = qMax( minWidth, (*bIt)->sizeHint().width() );
+        minWidth = qMax( minWidth, (*bIt)->sizeHint().width() );
   }
 
   for ( AreaMap::Iterator aItr = myArea.begin(); aItr != myArea.end(); ++aItr )
@@ -1549,7 +1553,7 @@ void QtxDialog::adjustButtons()
     const QList<QAbstractButton*>& lst = aItr.value()->buttons();
     for ( QList<QAbstractButton*>::const_iterator bItr = lst.begin(); bItr != lst.end(); ++bItr )
       if ( (*bItr)->isVisibleTo( this ) )
-       (*bItr)->setMinimumWidth( minWidth );
+        (*bItr)->setMinimumWidth( minWidth );
   }
 }
 
index bd5824924ab18bc7a6f9144ef79820927ff13cb7..366a79565d567a88bc0900ee071747e77356b15f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDialog.h
 // Author:    Sergey TELKOV
 //
@@ -48,41 +49,41 @@ class QTX_EXPORT QtxDialog : public QDialog
 public:
   //! Buttons alignment type
   typedef enum { Position,          //!< buttons are placed according their position
-                Expand,            //!< buttons occupy all available space
-                Uniform            //!< buttons are uniformly placed in the area
+                 Expand,            //!< buttons occupy all available space
+                 Uniform            //!< buttons are uniformly placed in the area
   } PlacePolicy;
   //! Buttons area
   typedef enum { TopArea,           //!< horizontal area at the top side of the dialog box
-                BottomArea,        //!< horizontal area at the bottom side of the dialog box
-                LeftArea,          //!< vertical area at the left side of the dialog box
-                RightArea          //!< vertical area at the right side of the dialog box
+                 BottomArea,        //!< horizontal area at the bottom side of the dialog box
+                 LeftArea,          //!< vertical area at the left side of the dialog box
+                 RightArea          //!< vertical area at the right side of the dialog box
   } ButtonArea;
   //! Button position
   typedef enum { Left,              //!< set button left-most
-                Right,             //!< set button right-most
-                Center,            //!< place button in the center
-                Top = Left,        //!< set button top-most
-                Bottom = Right     //!< set button bottom-most
+                 Right,             //!< set button right-most
+                 Center,            //!< place button in the center
+                 Top = Left,        //!< set button top-most
+                 Bottom = Right     //!< set button bottom-most
   } ButtonPosition;
   //! Button ID flags
   typedef enum { None      = 0x00000000,                      //!< no button used
-                OK        = 0x00000001,                      //!< OK button
-                Apply     = 0x00000002,                      //!< Apply button
-                Cancel    = 0x00000004,                      //!< Cancel button
-                Yes       = 0x00000008,                      //!< Yes button
-                No        = 0x00000010,                      //!< No button
-                Close     = 0x00000020,                      //!< Close button
-                Help      = 0x00000040,                      //!< Help button
-                OKCancel  = OK  | Cancel,                    //!< OK & Cancel button
-                YesNo     = Yes | No,                        //!< Yes & No buttons
-                Standard  = OK  | Cancel | Help,             //!< OK, Cancel & Help buttons
-                All       = Standard | YesNo | Apply | Close //!< all buttons
+                 OK        = 0x00000001,                      //!< OK button
+                 Apply     = 0x00000002,                      //!< Apply button
+                 Cancel    = 0x00000004,                      //!< Cancel button
+                 Yes       = 0x00000008,                      //!< Yes button
+                 No        = 0x00000010,                      //!< No button
+                 Close     = 0x00000020,                      //!< Close button
+                 Help      = 0x00000040,                      //!< Help button
+                 OKCancel  = OK  | Cancel,                    //!< OK & Cancel button
+                 YesNo     = Yes | No,                        //!< Yes & No buttons
+                 Standard  = OK  | Cancel | Help,             //!< OK, Cancel & Help buttons
+                 All       = Standard | YesNo | Apply | Close //!< all buttons
   } ButtonFlags;
   //! Dialog box flags
   typedef enum { Accept    = 0x000001, //!< allow dialog box accepting control
-                Reject    = 0x000002, //!< allow dialog box rejecting control
-                AlignOnce = 0x000004, //!< align dialog box only when it is first time shown
-                SetFocus  = 0x000008  //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)
+                 Reject    = 0x000002, //!< allow dialog box rejecting control
+                 AlignOnce = 0x000004, //!< align dialog box only when it is first time shown
+                 SetFocus  = 0x000008  //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)
   } DialogFlags;
   
 public:
index caba437b64980f2fcf94bf3b22abd5876b1bed48..8ffe0c259fec4538668985402a3a7a401081fb49 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDockAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -86,6 +87,20 @@ QtxDockAction::QtxDockAction( const QString& text, const QIcon& icon, const QStr
 */
 QtxDockAction::~QtxDockAction()
 {
+  // to avoid memory leak
+  if( QMenu* aMenu = menu() )
+  {
+    delete aMenu;
+    aMenu = 0;
+  }
+}
+
+/*!
+  \brief Update associated menu
+*/
+void QtxDockAction::update()
+{
+  updateMenu();
 }
 
 /*!
index fbc1b2d39131c831ad3251bbb5dd50399bd07abe..081f3dd34ad5e2ae7d598f2c45de2f2c2c6d0a14 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDockAction.h
 // Author:    Sergey TELKOV
 //
@@ -46,8 +47,8 @@ class QTX_EXPORT QtxDockAction : public QtxAction
 public:
   //! Dock windows type.
   enum { ToolBar,      //!< list toolbars only
-        DockWidget,   //!< list dockable windows only
-        Both          //!< list toolbars and dockable windows
+         DockWidget,   //!< list dockable windows only
+         Both          //!< list toolbars and dockable windows
   } DockType;
 
 public:
@@ -56,6 +57,8 @@ public:
   QtxDockAction( const QString&, const QIcon&, const QString&, QMainWindow* );
   virtual ~QtxDockAction();
 
+  void         update();
+
   int          dockType() const;
   void         setDockType( const int );
 
index fcb52318d679a744fe383fc84c3c118d5c23b375..6ba5b4993b54eb347c6b4c7e6348c70e67cc794e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDockWidget.cxx
 // Author:    Sergey TELKOV
 //
@@ -218,13 +219,13 @@ void QtxDockWidget::Watcher::hideContainer()
 */
 void QtxDockWidget::Watcher::customEvent( QEvent* e )
 {
-  if ( e->type() == Update )
+  if ( e->type() == (QEvent::Type)Update )
   {
     updateIcon();
     updateCaption();
     updateVisibility();
   }
-  else if ( myCont && e->type() == Remove && !myCont->widget() )
+  else if ( myCont && e->type() == (QEvent::Type)Remove && !myCont->widget() )
   {
     myCont->deleteLater();
     myCont = 0;
@@ -269,7 +270,7 @@ void QtxDockWidget::Watcher::updateVisibility()
     if ( l )
     {
       for ( int i = 0; i < (int)l->count() && !vis; i++ )
-       vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont );
+        vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont );
     }
   }
 
@@ -377,7 +378,7 @@ QSize QtxDockWidget::sizeHint() const
 {
   QSize sz = QDockWidget::sizeHint();
 
-  printf( "----------------> QtxDockWidget::sizeHint()\n" );
+  // printf( "----------------> QtxDockWidget::sizeHint()\n" );
 
   return QSize( 500, 100 );
 
index ca55bfba57f61c75c46e78dfc127fd8fb1bb4629..1ab7777dd45a2b219b7014e8cdd0b4dd22ca5292 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDockWidget.h
 // Author:    Sergey TELKOV
 //
index 87d5b6008bcc823aa522d5c8faf72a87f4743016..00c5637fa91cd78a7138e08f2cfc49536fa5e8f0 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDoubleSpinBox.cxx
 // Author:    Sergey TELKOV
 //
 
 #include <QLineEdit>
 #include <QDoubleValidator>
+#include <QVariant>
+
+#include <limits>
+
+const double PSEUDO_ZERO = 1.e-20;
 
 /*!
   \class QtxDoubleSpinBox
     ... // process entered value
   }
   \endcode
+
+  Another useful feature is possibility to use scientific notation (e.g. 1.234e+18) 
+  for the widegt text. To enable this, negative precision should be specified either
+  through a constructor or using setPrecision() method.
+
+  Note that "decimals" property of QDoubleSpinBox is almost completely substituted
+  by "myPrecision" field of QtxDoubleSpinBox class. "decimals" is still used 
+  for proper size hint calculation and for rounding minimum and maximum bounds of
+  the spin box range.
 */
 
 /*!
 */
 QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent )
 : QDoubleSpinBox( parent ),
-  myCleared( false ),
-  myPrecision(0)
+  myCleared( false )
 {
+  // VSR 01/07/2010: Disable thousands separator for spin box
+  // (to avoid incosistency of double-2-string and string-2-double conversion)
+  QLocale loc;
+  loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+  setLocale(loc);
+
+  // Use precision equal to default Qt decimals
+  myPrecision = decimals();
+  
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
@@ -82,27 +102,38 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent )
 */
 QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget* parent )
 : QDoubleSpinBox( parent ),
-  myCleared( false ),
-  myPrecision( 0 )
+  myCleared( false )
 {
+  // VSR 01/07/2010: Disable thousands separator for spin box
+  // (to avoid incosistency of double-2-string and string-2-double conversion)
+  QLocale loc;
+  loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+  setLocale(loc);
+
+  // Use precision equal to default Qt decimals
+  myPrecision = decimals();
+  
   setMinimum( min );
   setMaximum( max );
   setSingleStep( step );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
   \brief Constructor.
 
   Constructs a spin box with specified minimum, maximum and step value.
-  The precision is set to 2 decimal places. 
+  The precision is set to <prec> decimal places. 
   The value is initially set to the minimum value.
 
   \param min spin box minimum possible value
   \param max spin box maximum possible value
   \param step spin box increment/decrement value
+  \param prec non-negative values means the number of digits after the decimal point, 
+              negative value means the maximum number of significant digits for the scientific notation
+  \param dec number of digits after the decimal point passed to base Qt class (used for correct control sizing only!)
   \param parent parent object
 */
 QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
@@ -110,13 +141,19 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int pre
   myCleared( false ),
   myPrecision( prec )
 {
+  // VSR 01/07/2010: Disable thousands separator for spin box
+  // (to avoid incosistency of double-2-string and string-2-double conversion)
+  QLocale loc;
+  loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+  setLocale(loc);
+
   setDecimals( dec );
   setMinimum( min );
   setMaximum( max );
   setSingleStep( step );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
@@ -202,7 +239,7 @@ double QtxDoubleSpinBox::valueFromText( const QString& text ) const
 */
 QString QtxDoubleSpinBox::textFromValue( double val ) const
 {
-  QString s = QLocale().toString( val, myPrecision >= 0 ? 'f' : 'g', myPrecision == 0 ? 6 : qAbs( myPrecision ) );
+  QString s = locale().toString( val, myPrecision >= 0 ? 'f' : 'g', qAbs( myPrecision ) );
   return removeTrailingZeroes( s );
 }
 
@@ -213,7 +250,7 @@ QString QtxDoubleSpinBox::textFromValue( double val ) const
 */
 QString QtxDoubleSpinBox::removeTrailingZeroes( const QString& src ) const
 {
-  QString delim( QLocale().decimalPoint() );
+  QString delim( locale().decimalPoint() );
 
   int idx = src.lastIndexOf( delim );
   if ( idx == -1 )
@@ -221,13 +258,19 @@ QString QtxDoubleSpinBox::removeTrailingZeroes( const QString& src ) const
 
   QString iPart = src.left( idx );
   QString fPart = src.mid( idx + 1 );
+  QString ePart = "";
+  int idx1 = fPart.lastIndexOf( QRegExp( "e[+|-]?[0-9]+" ) );
+  if ( idx1 >= 0 ) {
+    ePart = fPart.mid( idx1 );
+    fPart = fPart.left( idx1 );
+  }
 
-  while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
-    fPart.remove( fPart.length() - 1, 1 );
+  fPart.remove( QRegExp( "0+$" ) );
 
   QString res = iPart;
   if ( !fPart.isEmpty() )
     res += delim + fPart;
+  res += ePart;
 
   return res;
 }
@@ -246,6 +289,11 @@ void QtxDoubleSpinBox::stepBy( int steps )
   myCleared = false;
 
   QDoubleSpinBox::stepBy( steps );
+  double tmpval = value();
+  if ( qAbs( tmpval ) < PSEUDO_ZERO ) tmpval = 0.;
+  if ( tmpval < minimum() ) tmpval = minimum();
+  else if ( tmpval > maximum() ) tmpval = maximum();
+  setValue( tmpval );
 }
 
 /*!
@@ -256,50 +304,82 @@ void QtxDoubleSpinBox::stepBy( int steps )
 */
 QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const
 {
-  if (myPrecision >= 0)
-    return QDoubleSpinBox::validate(str, pos);
-
   QString pref = this->prefix();
   QString suff = this->suffix();
   uint overhead = pref.length() + suff.length();
   QValidator::State state = QValidator::Invalid;
-
+  
   QDoubleValidator v (NULL);
-  v.setDecimals( decimals() );
+  
+  // If 'g' format is used (myPrecision < 0), then
+  // myPrecision - 1 digits are allowed after the decimal point.
+  // Otherwise, expect myPrecision digits after the decimal point.
+  int decs = myPrecision < 0 ? qAbs( myPrecision ) - 1 : myPrecision;
+  v.setDecimals( decs );
   v.setBottom( minimum() );
   v.setTop( maximum() );
-  v.setNotation( QDoubleValidator::ScientificNotation );
+  v.setNotation( myPrecision >= 0 ? QDoubleValidator::StandardNotation : 
+                                    QDoubleValidator::ScientificNotation );
 
   if ( overhead == 0 )
     state = v.validate( str, pos );
   else
     {
       if ( str.length() >= overhead && str.startsWith( pref ) &&
-          str.right( suff.length() ) == suff )
-       {
-         QString core = str.mid( pref.length(), str.length() - overhead );
-         int corePos = pos - pref.length();
-         state = v.validate( core, corePos );
-         pos = corePos + pref.length();
-         str.replace( pref.length(), str.length() - overhead, core );
-       }
+           str.right( suff.length() ) == suff )
+        {
+          QString core = str.mid( pref.length(), str.length() - overhead );
+          int corePos = pos - pref.length();
+          state = v.validate( core, corePos );
+          pos = corePos + pref.length();
+          str.replace( pref.length(), str.length() - overhead, core );
+        }
       else
-       {
-         state = v.validate( str, pos );
-         if ( state == QValidator::Invalid )
-           {
-             QString special = this->specialValueText().trimmed();
-             QString candidate = str.trimmed();
-             if ( special.startsWith( candidate ) )
-               {
-                 if ( candidate.length() == special.length() )
-                   state = QValidator::Acceptable;
-                 else
-                   state = QValidator::Intermediate;
-               }
-           }
-       }
+        {
+          state = v.validate( str, pos );
+          if ( state == QValidator::Invalid )
+            {
+              QString special = this->specialValueText().trimmed();
+              QString candidate = str.trimmed();
+              if ( special.startsWith( candidate ) )
+                {
+                  if ( candidate.length() == special.length() )
+                    state = QValidator::Acceptable;
+                  else
+                    state = QValidator::Intermediate;
+                }
+            }
+        }
     }
+
+  // Treat values ouside (min; max) range as Invalid
+  // This check is enabled by assigning "strict_validity_check" dynamic property
+  // with value "true" to the spin box instance.
+  if ( state == QValidator::Intermediate ){
+    bool isOk;
+    double val = str.toDouble( &isOk );
+    if ( isOk ){
+      QVariant propVal = property( "strict_validity_check" );
+      if ( propVal.isValid() && propVal.canConvert( QVariant::Bool ) && propVal.toBool() ){
+        if ( val < minimum() || val > maximum() )
+          state = QValidator::Invalid;
+      }
+    }
+    else if ( myPrecision < 0 ){
+      // Consider too large negative exponent as Invalid
+      QChar e( locale().exponential() );
+      int epos = str.indexOf( e, 0, Qt::CaseInsensitive );
+      if ( epos != -1 ){
+        epos++; // Skip exponential symbol itself
+        QString exponent = str.right( str.length() - epos );
+        int expValue = exponent.toInt( &isOk );
+        if ( isOk && expValue < std::numeric_limits<double>::min_exponent10 )
+          state = QValidator::Invalid;
+      }
+    }
+  }
+
   return state;
 }
 
index 5c094e82ef09e3347ee47bb21e9b9e29e0155d80..6edd4649fd5262483a28f6e3aaddee3497879dbc 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxDoubleSpinBox.h
 // Author:    Sergey TELKOV
 //
@@ -53,7 +51,7 @@ public:
 
   virtual QValidator::State validate( QString&, int& ) const;
 
-private slots:
+protected slots:
   virtual void    onTextChanged( const QString& );
 
 protected:
index 3f8630d82d1a38d428e000b03b09ff1883139fa5..d2310faa08689b8afb2a8b45e1fee527da4a8ce5 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxEvalExpr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -445,7 +443,7 @@ bool QtxEvalParser::prepare( const QString& expr, Postfix& post )
       mLen = 0;
       if ( oPos != pos && cPos != pos )
       {
-             int i; 
+              int i; 
         for ( i = pos + 1; i < (int)expr.length(); i++ )
         {
           if ( expr[i].isSpace() )
@@ -2309,7 +2307,7 @@ QtxEvalExpr::Error QtxEvalSetSets::calculate( const QString& op, QVariant& v1, Q
         v1 = res;
       }
       else
-             v1 = QVariant( v2.toList().contains( v1 ) );
+              v1 = QVariant( v2.toList().contains( v1 ) );
     }
   }
   return err;
@@ -2417,8 +2415,8 @@ int QtxEvalSetConst::priority( const QString& /*op*/, bool /*isBin*/ ) const
   \return error code (QtxEvalExpr::Error)
 */
 QtxEvalExpr::Error QtxEvalSetConst::isValid( const QString&       /*op*/, 
-                                            const QVariant::Type /*t1*/,
-                                            const QVariant::Type /*t2*/ ) const
+                                             const QVariant::Type /*t1*/,
+                                             const QVariant::Type /*t2*/ ) const
 {
   return QtxEvalExpr::InvalidOperation;
 }
index d2fce8b1da975df03e451a8ed67b90d218c4f6e3..3fd72d2a938bc1be7622c9671881265f2c4bbcfa 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxEvalExpr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
index 30cacf8dbbc810cc21a24bc76aa7762830d5ccd2..6b91713171508f95d2ae5e6707abacb5a051babb 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxFontEdit.cxx
 // Author:    Sergey TELKOV
 //
@@ -74,7 +72,8 @@ QtxFontEdit::QtxFontEdit( const int feat, QWidget* parent )
 */
 QtxFontEdit::QtxFontEdit( QWidget* parent )
 : QFrame( parent ),
-  myFeatures( All )
+  myFeatures( All ),
+  myMode( Native )
 {
   initialize();
 }
index 8934f9cddf64161c50c505f2592ff535827486cd..bfca1344e6840b2e9f59aaab03822f74d38c3fe0 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxFontEdit.h
 // Author:    Sergey TELKOV
 //
index c2f04236a8716078b59646c2f834e7a1c68a868c..ef20020d25aee715cf885c045251a6a90191d32c 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxGridBox.cxx
 // Author:    Sergey TELKOV
 //
index 7ddf76bb7062988bf82a0fe675a79d55f3127b88..6fa29e95cb82e607e4e939b86fb540ba6a4ea7ee 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxGridBox.h
 // Author:    Sergey TELKOV
 //
index c6cccf4b363186e703808a4d7301ce7087ad8a5c..5db3910e705aaaa507890723627505a3de9776da 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxGroupBox.cxx
 // Author:    Sergey TELKOV
 //
index f37b8dd2248be7325e3fbe4fc8b7e0d98c5676fd..3b9ffadfd82d02d3dbe6adc5e2647800f15ab3d2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxGroupBox.h
 // Author:    Sergey TELKOV
 //
index 426e31bb91de721e45033baaf44829dc51c12296..a36a23a4fc55f87e2bda82c9d3205039d2c5996f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxIntSpinBox.cxx
 // Author:    Sergey TELKOV
 //
@@ -60,9 +61,15 @@ QtxIntSpinBox::QtxIntSpinBox( QWidget* parent )
 : QSpinBox( parent ),
   myCleared( false )
 {
+  // VSR 01/07/2010: Disable thousands separator for spin box
+  // (to avoid incosistency of double-2-string and string-2-double conversion)
+  QLocale loc;
+  loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+  setLocale(loc);
+
   setCorrectionMode( QSpinBox::CorrectToNearestValue );
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
@@ -80,13 +87,19 @@ QtxIntSpinBox::QtxIntSpinBox( int min, int max, int step, QWidget* parent )
 : QSpinBox( parent ),
   myCleared( false )
 {
+  // VSR 01/07/2010: Disable thousands separator for spin box
+  // (to avoid incosistency of double-2-string and string-2-double conversion)
+  QLocale loc;
+  loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+  setLocale(loc);
+
   setMinimum( min );
   setMaximum( max );
   setSingleStep( step );
   setCorrectionMode( QSpinBox::CorrectToNearestValue );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), 
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 }
 
 /*!
index 39230639ca36ae5f6e6dc3816c6d365a782cb065..b54c94f137b9f9ab98753e42f594b349019758a6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxIntSpinBox.h
 // Author:    Sergey TELKOV
 //
index b63f0fcd1bc197647dea9435745945944436a188..ab907b64ae64aaf411018dc0ee8fff59d25131a4 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxListAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -587,7 +588,7 @@ QtxListAction::QtxListAction( QObject* parent )
   \param parent parent object
 */
 QtxListAction::QtxListAction( const QIcon& icon, const QString& menuText, 
-                             int accel, QObject* parent )
+                              int accel, QObject* parent )
 : QtxAction( menuText, icon, menuText, accel, parent ),
   myFrame( 0 )
 {
@@ -615,7 +616,7 @@ QtxListAction::QtxListAction( const QString& menuText, int accel, QObject* paren
   \param parent parent object
 */
 QtxListAction::QtxListAction( const QString& text, const QString& menuText, 
-                             int accel, QObject* parent )
+                              int accel, QObject* parent )
 : QtxAction( text, menuText, accel, parent ),
   myFrame( 0 )
 {
@@ -631,7 +632,7 @@ QtxListAction::QtxListAction( const QString& text, const QString& menuText,
   \param parent parent object
 */
 QtxListAction::QtxListAction( const QString& text, const QIcon& icon, 
-                             const QString& menuText, int accel, QObject* parent )
+                              const QString& menuText, int accel, QObject* parent )
 : QtxAction( text, icon, menuText, accel, parent ),
   myFrame( 0 )
 {
index bcbf744944e81499bd44a20630dc150394f2b0b3..1f919097417e64b551baeac805972a36e0c86f36 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxListAction.h
 // Author:    Sergey TELKOV
 //
index 21a286c11f2bab8a796c751036bfa01689f35ca7..6150260ba2354b5c523bc7d915a4e1387b0eea2a 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxListBox.cxx
 // Author:    Sergey TELKOV
 //
index 74b4887289cbe8633701caa37c386d26f374afcd..88f9a127e5df767bac83c21f56379516521e9e5c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxListBox.h
 // Author:    Sergey TELKOV
 //
index bed55bebccb3219d47c68a457b8a4e63c09633f1..af68defd50c7e251278ef1f96c544c374132f782 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxLogoMgr.cxx
 // Author:    Sergey TELKOV
 //
@@ -392,7 +393,7 @@ void QtxLogoMgr::generate()
     {
       logoLab->setPixmap( (*it).pix );
 //      if ( !pix.mask().isNull() )
-//         logoLab->setMask( pix.mask() );
+//          logoLab->setMask( pix.mask() );
     }
 
     logoLab->setScaledContents( false );
index 2aa6941e251be3512dcec962d0348debc3068b57..f90db2050ff14fcd8b4931a140313fa88f8a6f65 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxLogoMgr.h
 // Author:    Sergey TELKOV
 //
index d6f6f3d11f7972467e2ede927e7fccebb733948f..1273eb22dc0a5316e0adb8731ca5cc705fecbb15 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMRUAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -378,7 +379,7 @@ void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, co
     for ( QStringList::const_iterator it = items.begin(); it != items.end(); ++it )
     {
       if ( (*it).startsWith( itemPrefix ) )
-       resMgr->remove( section, *it );
+        resMgr->remove( section, *it );
     }
   }
 
@@ -408,8 +409,8 @@ void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, co
 
   int counter = 0;
   for ( QStringList::const_iterator iter = lst.begin();
-       iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount );
-       ++iter, counter++ )
+        iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount );
+        ++iter, counter++ )
     resMgr->setValue( section, itemPrefix + QString().sprintf( "%03d", counter ), *iter );
 }
 
@@ -467,9 +468,9 @@ void QtxMRUAction::updateMenu()
     {
       QString shortName = Qtx::file( myLinks[i] );
       if ( map.contains( shortName ) )
-       map[shortName]++;
+        map[shortName]++;
       else
-       map.insert( shortName, 0 );
+        map.insert( shortName, 0 );
     }
   }
 
@@ -482,7 +483,7 @@ void QtxMRUAction::updateMenu()
     case LinkAuto:
       linkName = Qtx::file( *it );
       if ( map.contains( linkName ) && map[linkName] )
-       linkName = *it;
+        linkName = *it;
       break;
     case LinkShort:
       linkName = Qtx::file( *it );
index 2611593d5ce07eabbba08077784ecf50a2c55345..e8999fdbdd444c6842661ec216c542e65a6d6f3a 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMRUAction.h
 // Author:    Sergey TELKOV
 //
@@ -42,14 +43,14 @@ class QTX_EXPORT QtxMRUAction : public QtxAction
 public:
   //! Items insertion policy
   typedef enum { MoveFirst,   //!< put the specified item to the beginning
-                MoveLast,    //!< put the specified item to the end
-                AddFirst,    //!< if specified item doesn't exist, add it to the beginning
-                AddLast      //!< if specified item doesn't exist, add it to the end
+                 MoveLast,    //!< put the specified item to the end
+                 AddFirst,    //!< if specified item doesn't exist, add it to the beginning
+                 AddLast      //!< if specified item doesn't exist, add it to the end
   } InsertionMode;
 
   typedef enum { LinkAuto,    //!< put the full path of link into the menu if link file names of severals link are same
-                LinkShort,   //!< put the only file name of link into the menu
-                LinkFull     //!< put the full path of link into the menu
+                 LinkShort,   //!< put the only file name of link into the menu
+                 LinkFull     //!< put the full path of link into the menu
   } LinkType;
 
 public:
index ac0053e5bf841666d21f717a541a8e019105b803..d8aa1e33f99d82cd82435a4666f04d8a7bd7b83c 100644 (file)
@@ -1,38 +1,42 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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:      QtxMainWindow.cxx
-// Author:    Sergey TELKOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File:      QtxMainWindow.cxx
+//  Author:    Sergey TELKOV
+
 #include "QtxMainWindow.h"
 
 #include "QtxToolBar.h"
-#include "QtxResourceMgr.h"
 
 #include <QEvent>
+#include <QPoint>
+#include <QTimer>
+#include <QLayout>
 #include <QMenuBar>
 #include <QStatusBar>
+#include <QRubberBand>
+#include <QMouseEvent>
 #include <QApplication>
 #include <QDesktopWidget>
-
+#include <cstdio>
 /*!
   \class QtxMainWindow::Filter
   \internal
@@ -92,6 +96,133 @@ bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e )
   return QObject::eventFilter( o, e );
 }
 
+/*!
+  \class QtxMainWindow::Resizer
+  \internal
+  \brief Internal object used to resize dock widgets.
+*/
+
+class QtxMainWindow::Resizer : public QObject
+{
+public:
+  Resizer( const QPoint&, const Qt::Orientation, QtxMainWindow* );
+  virtual ~Resizer();
+
+  QMouseEvent*    finalEvent() const;
+  void            setFinalEvent( QMouseEvent* );
+
+  void            setPosition( const QPoint& );
+  virtual bool    eventFilter( QObject*, QEvent* );
+
+private:
+  void            setFilters( bool );
+
+private:
+  QPoint          myPos;
+  QMainWindow*    myMain;
+  QRubberBand*    myRubber;
+  Qt::Orientation myOrient;
+  QMouseEvent*    myFinEvent;
+};
+
+/*!
+  \brief Constructor.
+  \param mw parent main window
+*/
+QtxMainWindow::Resizer::Resizer( const QPoint& p, const Qt::Orientation o, QtxMainWindow* mw )
+: QObject( mw ),
+  myMain( mw ),
+  myOrient( o ),
+  myFinEvent( 0 )
+{
+  setFilters( true );
+
+  myRubber = new QRubberBand( QRubberBand::Line, 0 );
+
+  setPosition( p );
+
+  myRubber->hide();
+};
+
+/*!
+  \brief Destructor.
+*/
+QtxMainWindow::Resizer::~Resizer()
+{
+  delete myRubber;
+
+  setFilters( false );
+}
+
+void QtxMainWindow::Resizer::setPosition( const QPoint& pos )
+{
+  myPos = pos;
+  if ( myRubber ) {
+    QRect r;
+    QPoint min = myMain->mapToGlobal( myMain->rect().topLeft() );
+    QPoint max = myMain->mapToGlobal( myMain->rect().bottomRight() );
+    if ( myOrient == Qt::Horizontal ) {
+      int p = qMax( qMin( myPos.y(), max.y() ), min.y() );
+      r = QRect( myMain->mapToGlobal( QPoint( 0, 0 ) ).x(), p - 1, myMain->width(), 3 );
+    }
+    else {
+      int p = qMax( qMin( myPos.x(), max.x() ), min.x() );
+      r = QRect( p - 1, myMain->mapToGlobal( QPoint( 0, 0 ) ).y(), 3, myMain->height() );
+    }
+    myRubber->setGeometry( r );
+    if ( !myRubber->isVisible() )
+      myRubber->show();
+  }
+}
+
+QMouseEvent* QtxMainWindow::Resizer::finalEvent() const
+{
+  return myFinEvent;
+}
+
+void QtxMainWindow::Resizer::setFinalEvent( QMouseEvent* e )
+{
+  myFinEvent = e;
+}
+
+/*!
+  \brief Event filter.
+
+  \param o recevier object
+  \param e event
+*/
+bool QtxMainWindow::Resizer::eventFilter( QObject* o, QEvent* e )
+{
+  if ( e->type() == QEvent::Timer ) {
+    if ( !finalEvent() )
+      return true;
+
+    setFilters( false );
+    QApplication::postEvent( myMain, finalEvent() );
+    myFinEvent = 0;
+    deleteLater();
+  }
+
+  return QObject::eventFilter( o, e );
+}
+
+void QtxMainWindow::Resizer::setFilters( bool on )
+{
+  if ( myMain ) {
+    if ( on )
+      myMain->layout()->installEventFilter( this );
+    else
+      myMain->layout()->removeEventFilter( this );
+  }
+
+  QTimer* t = qFindChild<QTimer*>( myMain->layout() );
+  if ( t ) {
+    if ( on )
+      t->installEventFilter( this );
+    else
+      t->removeEventFilter( this );
+  }
+}
 
 /*!
   \class QtxMainWindow
@@ -107,8 +238,15 @@ bool QtxMainWindow::Filter::eventFilter( QObject* o, QEvent* e )
 QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f )
 : QMainWindow( parent, f ),
   myMenuBar( 0 ),
-  myStatusBar( 0 )
+  myStatusBar( 0 ),
+  myOpaque( true ),
+  myResizer( 0 ),
+  myMouseMove( 0 ),
+  myFullScreenAllowed(true)
 {
+  //rnv: Enables tooltips for inactive windows.
+  //rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
+  setAttribute(Qt::WA_AlwaysShowToolTips);
 }
 
 /*!
@@ -216,6 +354,16 @@ void QtxMainWindow::setDockableStatusBar( const bool on )
   }
 }
 
+bool QtxMainWindow::isOpaqueResize() const
+{
+  return myOpaque;
+}
+
+void QtxMainWindow::setOpaqueResize( bool on )
+{
+  myOpaque = on;
+}
+
 /*!
   \brief Dump main window geometry to the string.
   \return string represenation of the window geometry
@@ -253,7 +401,7 @@ QString QtxMainWindow::storeGeometry() const
     state = QString( "min" );
     break;
   case Qt::WindowFullScreen:
-    state = QString( "full" );
+    state = isFullScreenAllowed() ? QString( "full" ) : QString( "max" );
     break;
   }
 
@@ -413,3 +561,86 @@ void QtxMainWindow::onDestroyed( QObject* obj )
   }
 }
 
+bool QtxMainWindow::event( QEvent* e )
+{
+//   if ( e->type() == QEvent::WindowDeactivate ) {
+//     printf( "----------------> Deactivated\n" );
+//   }
+
+  if ( myResizer ) {
+    QMouseEvent* me = static_cast<QMouseEvent*>( e );
+    if ( ( e->type() == QEvent::MouseButtonRelease && me->button() == Qt::LeftButton ) || 
+        ( e->type() == QEvent::MouseButtonPress && me->button() != Qt::LeftButton ) ) {
+      if ( me->button() == Qt::LeftButton ) {
+       if ( myMouseMove ) {
+         QMainWindow::event( myMouseMove );
+         delete myMouseMove;
+         myMouseMove = 0;
+       }
+
+       QMouseEvent* me = static_cast<QMouseEvent*>( e );
+       myResizer->setFinalEvent( new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), me->globalPos(),
+                                                  Qt::LeftButton, me->buttons(), me->modifiers() ) );
+       myResizer = 0;
+       return true;
+      }
+    }
+  }
+
+  if ( myResizer && e->type() == QEvent::MouseMove ) {
+    QMouseEvent* me = static_cast<QMouseEvent*>( e );
+    if ( myMouseMove )
+      delete myMouseMove;
+    myMouseMove = new QMouseEvent( me->type(), me->pos(), me->globalPos(),
+                                   me->button(), me->buttons(), me->modifiers() );
+    myResizer->setPosition( me->globalPos() );
+  }
+
+  bool ok = QMainWindow::event( e );
+
+  if ( !myResizer && e->type() == QEvent::MouseButtonPress ) {
+    QMouseEvent* me = static_cast<QMouseEvent*>( e );
+    if ( !isOpaqueResize() && ok && testAttribute( Qt::WA_SetCursor ) && me->button() == Qt::LeftButton ) {
+      bool status = true;
+      Qt::Orientation o;
+      switch ( cursor().shape() )
+       {
+       case Qt::SplitHCursor:
+         o = Qt::Vertical;
+         break;
+       case Qt::SplitVCursor:
+         o = Qt::Horizontal;
+         break;
+       default:
+         status = false;
+         break;
+       }
+      if ( status ) {
+       myResizer = new Resizer( me->globalPos(), o, this );
+       myMouseMove = new QMouseEvent( me->type(), me->pos(), me->globalPos(),
+                                      me->button(), me->buttons(), me->modifiers() );
+      }
+    }
+  }
+
+  return ok;
+}
+
+/*!
+  \brief FullScreenAllowed flag allowed dump in the main window geometry 
+         Qt::WindowFullScreen parameter.
+  \return \c fullScreenAllowed flag.
+*/
+bool QtxMainWindow::isFullScreenAllowed() const {
+  return myFullScreenAllowed;
+}
+
+
+/*!
+  \brief Set FullScreenAllowed flag.
+         The default value is true.
+  \param f value of the fullScreenAllowed flag.
+*/
+void QtxMainWindow::setFullScreenAllowed( const bool f ) {
+    myFullScreenAllowed = f;
+}
index a77e9959a0e96d5851793587b4a45649bb2fa8b9..5148f1d8e720ae18969c685e788828874b3cc42a 100644 (file)
@@ -1,27 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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:      QtxMainWindow.h
-// Author:    Sergey TELKOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File:      QtxMainWindow.h
+//  Author:    Sergey TELKOV
+
 #ifndef QTXMAINWINDOW_H
 #define QTXMAINWINDOW_H
 
@@ -36,11 +36,15 @@ class QTX_EXPORT QtxMainWindow : public QMainWindow
   Q_OBJECT
 
   class Filter;
+  class Resizer;
 
 public:
   QtxMainWindow( QWidget* = 0, Qt::WindowFlags = 0 );
   virtual ~QtxMainWindow();
 
+  bool              isOpaqueResize() const;
+  void              setOpaqueResize( bool );
+
   bool              isDockableMenuBar() const;
   void              setDockableMenuBar( const bool );
 
@@ -50,6 +54,12 @@ public:
   QString           storeGeometry() const;
   void              retrieveGeometry( const QString& );
 
+  bool              isFullScreenAllowed() const;
+  void              setFullScreenAllowed( const bool );
+
+protected:
+  virtual bool      event( QEvent* );
+
 private slots:
   void              onDestroyed( QObject* );
 
@@ -59,6 +69,12 @@ private:
 private:
   QToolBar*         myMenuBar;       //!< dockable menu bar
   QToolBar*         myStatusBar;     //!< dockable status bar
+
+  bool              myFullScreenAllowed;
+
+  bool              myOpaque;
+  Resizer*          myResizer;
+  QMouseEvent*      myMouseMove;
 };
 
 #endif // QTXMAINWINDOW_H
index 6545f5f3cefd89b5c307aacdd9b4c74242caa9b5..0e2121e0fbbc57d56542426df42cb37521b3b155 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : QtxMap.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index 6e146ef238a1bba86aa6768d111ef31f68c432a7..60f1f3e16c6e83bcb6cc74235512a8d9a861fe72 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMenu.cxx
 // Author:    Sergey TELKOV
 //
index a719802c1e713bbcb43a26164f66296c1bafb30c..d05c4ba739904a7ba430e67ac40ef2ae7364a243 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMenu.h
 // Author:    Sergey TELKOV
 //
index eb8bf5190d8c912b07f18aa28d10616b7f2bf851..4185701af8d124aeef0590e2b5ea6c8a0005b2a3 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMultiAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -53,7 +51,7 @@ public:
     if ( e->type() == QEvent::Leave ) {
       QToolButton* tb = qobject_cast<QToolButton*>( o );
       if ( tb )
-       tb->setDown( false );
+        tb->setDown( false );
     }
     return QObject::eventFilter( o, e );
   }
@@ -216,6 +214,12 @@ QtxMultiAction::QtxMultiAction( const QIcon& ico, const QString& txt, QObject* p
 */
 QtxMultiAction::~QtxMultiAction()
 {
+  // to avoid memory leak
+  if( QMenu* aMenu = menu() )
+  {
+    delete aMenu;
+    aMenu = 0;
+  }
 }
 
 /*!
index 52583819c799070e2db0b0f916d33ab2e6ae97dd..5f4703824140e2200e8b51a7ab1c2611fde9495d 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxMultiAction.h
 // Author:    Sergey TELKOV
 //
index 4d333f8845fb07f84a516213a8de93f6289fa47a..8ce69e23d949f06dd970531834fb2a1996e1c166 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPagePrefMgr.cxx
 // Author:    Sergey TELKOV
 //
 #include "QtxComboBox.h"
 #include "QtxIntSpinBox.h"
 #include "QtxColorButton.h"
+#include "QtxBiColorTool.h"
 #include "QtxDoubleSpinBox.h"
+#include "QtxShortcutEdit.h"
+#include "QtxBackgroundTool.h"
+#include "QtxResourceMgr.h"
 
 #include <QEvent>
 #include <QLayout>
@@ -44,6 +46,9 @@
 #include <QApplication>
 #include <QDateTimeEdit>
 #include <QStackedWidget>
+#include <QSlider>
+
+#include <stdio.h>
 
 /*!
   \class QtxPagePrefMgr
@@ -2050,6 +2055,36 @@ void QtxPagePrefCheckItem::retrieve()
   for string, integer and double values.
 */
 
+static void fixupAndSet( QLineEdit* le, const QString& txt )
+{
+  if ( le ) {
+    QString val = txt;
+    if ( le->validator() ) {
+      const QDoubleValidator* de = dynamic_cast<const QDoubleValidator*>( le->validator() );
+      if ( de ) {
+       int dec = de->decimals();
+       int idx = val.lastIndexOf( QRegExp( QString("[.|%1]").arg( le->locale().decimalPoint () ) ) );
+       if ( idx >= 0 ) {
+         QString tmp = val.mid( idx+1 );
+         QString exp;
+         val = val.left( idx+1 );
+         idx = tmp.indexOf( QRegExp( QString("[e|E]") ) );
+         if ( idx >= 0 ) {
+           exp = tmp.mid( idx );
+           tmp = tmp.left( idx );
+         }
+         tmp.truncate( dec );
+         val = val + tmp + exp;
+       }
+      }
+      int pos = 0;
+      if ( le->validator()->validate( val, pos ) == QValidator::Invalid )
+       val.clear();
+    }
+    le->setText( val );
+  }
+}
+
 /*!
   \brief Constructor.
 
@@ -2063,7 +2098,9 @@ void QtxPagePrefCheckItem::retrieve()
 QtxPagePrefEditItem::QtxPagePrefEditItem( const QString& title, QtxPreferenceItem* parent,
                                           const QString& sect, const QString& param )
 : QtxPageNamedPrefItem( title, parent, sect, param ),
-  myType( String )
+  myType( String ),
+  myDecimals( 1000 ),
+  myEchoMode( 0 )
 {
   setControl( myEditor = new QLineEdit() );
   updateEditor();
@@ -2083,9 +2120,11 @@ QtxPagePrefEditItem::QtxPagePrefEditItem( const QString& title, QtxPreferenceIte
 */
 QtxPagePrefEditItem::QtxPagePrefEditItem( const int type, const QString& title,
                                           QtxPreferenceItem* parent, const QString& sect,
-                                         const QString& param )
+                                          const QString& param )
 : QtxPageNamedPrefItem( title, parent, sect, param ),
-  myType( type )
+  myType( type ),
+  myDecimals( 1000 ),
+  myEchoMode( 0 )
 {
   setControl( myEditor = new QLineEdit() );
   updateEditor();
@@ -2122,6 +2161,54 @@ void QtxPagePrefEditItem::setInputType( const int type )
   updateEditor();
 }
 
+/*!
+  \brief Get number of digits after decimal point (for Double input type)
+  \return preference item decimals value
+  \sa setDecimals()
+*/
+int QtxPagePrefEditItem::decimals() const
+{
+  return myDecimals;
+}
+
+/*!
+  \brief Set number of digits after decimal point (for Double input type)
+  \param dec new preference item decimals value
+  \sa decimals()
+*/
+void QtxPagePrefEditItem::setDecimals( const int dec )
+{
+  if ( myDecimals == dec )
+    return;
+  
+  myDecimals = dec;
+  updateEditor();
+}
+
+/*!
+  \brief Get the line edit's echo mode
+  \return preference item echo mode value
+  \sa setEchoMode()
+*/
+int QtxPagePrefEditItem::echoMode() const
+{
+  return myEchoMode;
+}
+
+/*!
+  \brief Set the line edit's echo mode
+  \param echo new preference item echo mode value
+  \sa echoMode()
+*/
+void QtxPagePrefEditItem::setEchoMode( const int echo )
+{   
+  if ( myEchoMode == echo )
+    return;
+  
+  myEchoMode = echo;
+  updateEditor();
+}
+
 /*!
   \brief Store preference item to the resource manager.
   \sa retrieve()
@@ -2138,13 +2225,7 @@ void QtxPagePrefEditItem::store()
 void QtxPagePrefEditItem::retrieve()
 {
   QString txt = getString();
-  if ( myEditor->validator() )
-  {
-    int pos = 0;
-    if ( myEditor->validator()->validate( txt, pos ) == QValidator::Invalid )
-      txt.clear();
-  }
-  myEditor->setText( txt );
+  fixupAndSet( myEditor, txt );
 }
 
 /*!
@@ -2157,6 +2238,10 @@ QVariant QtxPagePrefEditItem::optionValue( const QString& name ) const
 {
   if ( name == "input_type" || name == "type" )
     return inputType();
+  else if ( name == "precision" || name == "prec" || name == "decimals" )
+    return decimals();
+  else if ( name == "echo" || name == "echo_mode" || name == "echomode")
+    return echoMode();
   else
     return QtxPageNamedPrefItem::optionValue( name );
 }
@@ -2174,6 +2259,14 @@ void QtxPagePrefEditItem::setOptionValue( const QString& name, const QVariant& v
     if ( val.canConvert( QVariant::Int ) )
       setInputType( val.toInt() );
   }
+  else if ( name == "precision" || name == "prec" || name == "decimals" ) {
+    if ( val.canConvert( QVariant::Int ) )
+      setDecimals( val.toInt() );
+  }
+  else if ( name == "echo" || name == "echo_mode" || name == "echomode") {
+    if ( val.canConvert( QVariant::Int ) )
+      setEchoMode( val.toInt() );
+  }
   else
     QtxPageNamedPrefItem::setOptionValue( name, val );
 }
@@ -2183,6 +2276,24 @@ void QtxPagePrefEditItem::setOptionValue( const QString& name, const QVariant& v
 */
 void QtxPagePrefEditItem::updateEditor()
 {
+  switch (myEchoMode)
+  {
+    case 0:
+      myEditor->setEchoMode(QLineEdit::Normal);
+      break;
+    case 1:
+      myEditor->setEchoMode(QLineEdit::NoEcho);
+      break;
+    case 2:
+      myEditor->setEchoMode(QLineEdit::Password);
+      break;
+    case 3:
+      myEditor->setEchoMode(QLineEdit::PasswordEchoOnEdit);
+      break;
+    default:
+      myEditor->setEchoMode(QLineEdit::Normal);
+  }
+  
   QValidator* val = 0;
   switch ( inputType() )
   {
@@ -2191,21 +2302,298 @@ void QtxPagePrefEditItem::updateEditor()
     break;
   case Double:
     val = new QDoubleValidator( myEditor );
+    dynamic_cast<QDoubleValidator*>( val )->setDecimals( myDecimals < 0 ? 1000 : myDecimals );
     break;
   default:
     break;
   }
 
-  if ( !myEditor->text().isEmpty() && val )
+  QString txt = myEditor->text();
+  delete myEditor->validator();
+  myEditor->setValidator( val );
+  fixupAndSet( myEditor, txt );
+}
+
+/*!
+  \class QtxPagePrefSliderItem
+*/
+
+/*!
+  \brief Constructor.
+
+  Creates preference item with slider widget
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSliderItem::QtxPagePrefSliderItem( const QString& title, QtxPreferenceItem* parent,
+                                              const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( mySlider = new QSlider( Qt::Horizontal ) );
+  widget()->layout()->addWidget( myLabel = new QLabel( ) );
+    
+  setMinimum( 0 );
+  setMaximum( 0 );
+  setSingleStep( 1 );
+  setPageStep( 1 );
+  
+  mySlider->setTickPosition( QSlider::TicksBothSides );
+  
+  connect (mySlider, SIGNAL(valueChanged(int)), this, SLOT(setIcon(int)));
+  updateSlider();
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefSliderItem::~QtxPagePrefSliderItem()
+{
+}
+
+/*!
+  \brief Get slider preference item step value.
+  \return slider single step value
+  \sa setSingleStep()
+*/
+int QtxPagePrefSliderItem::singleStep() const
+{
+  return mySlider->singleStep();
+}
+
+/*!
+  \brief Get slider preference item step value.
+  \return slider page step value
+  \sa setPageStep()
+*/
+int QtxPagePrefSliderItem::pageStep() const
+{
+  return mySlider->pageStep();
+}
+
+/*!
+  \brief Get slider preference item minimum value.
+  \return slider minimum value
+  \sa setMinimum()
+*/
+int QtxPagePrefSliderItem::minimum() const
+{
+    return mySlider->minimum();
+}
+
+/*!
+  \brief Get slider preference item maximum value.
+  \return slider maximum value
+  \sa setMaximum()
+*/
+int QtxPagePrefSliderItem::maximum() const
+{
+    return mySlider->maximum();
+}
+
+/*!
+  \brief Get the list of the icons associated with the selection widget items
+  \return list of icons
+  \sa setIcons()
+*/
+QList<QIcon> QtxPagePrefSliderItem::icons() const
+{
+  return myIcons;
+}
+
+/*!
+  \brief Set slider preference item step value.
+  \param step new slider single step value
+  \sa step()
+*/
+void QtxPagePrefSliderItem::setSingleStep( const int& step )
+{
+  mySlider->setSingleStep( step );
+}
+
+/*!
+  \brief Set slider preference item step value.
+  \param step new slider single step value
+  \sa step()
+*/
+void QtxPagePrefSliderItem::setPageStep( const int& step )
+{
+  mySlider->setPageStep( step );
+}
+
+/*!
+  \brief Set slider preference item minimum value.
+  \param min new slider minimum value
+  \sa minimum()
+*/
+void QtxPagePrefSliderItem::setMinimum( const int& min )
+{
+  mySlider->setMinimum( min );
+  setIcon( mySlider->value() );
+}
+
+/*!
+  \brief Set slider preference item maximum value.
+  \param max new slider maximum value
+  \sa maximum()
+*/
+void QtxPagePrefSliderItem::setMaximum( const int& max )
+{
+  mySlider->setMaximum( max );
+  setIcon( mySlider->value() );
+}
+
+/*!
+  \brief Set the list of the icons to the selection widget items
+  \param icns new list of icons
+  \sa icons()
+*/
+void QtxPagePrefSliderItem::setIcons( const QList<QIcon>& icns )
+{
+  if ( icns.isEmpty() ) 
+    return;
+  myIcons = icns;
+  
+  QSize maxsize(0, 0); 
+  for ( QList<QIcon>::const_iterator it = myIcons.begin(); it != myIcons.end(); ++it ) {
+    if ( (*it).isNull() ) continue;
+    maxsize = maxsize.expandedTo( (*it).availableSizes().first() );
+  }
+  myLabel->setFixedSize( maxsize );
+  
+  updateSlider();
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefSliderItem::store()
+{
+  setInteger( mySlider->value() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefSliderItem::retrieve()
+{
+  mySlider->setValue( getInteger( mySlider->value() ) );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null integer if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefSliderItem::optionValue( const QString& name ) const
+{
+  if ( name == "minimum" || name == "min" )
+    return minimum();
+  else if ( name == "maximum" || name == "max" )
+    return maximum();
+  else if ( name == "single_step" )
+    return singleStep();
+  else if ( name == "page_step" )
+    return pageStep();
+  else if ( name == "icons" || name == "pixmaps" )
+  {
+    QList<QVariant> lst;
+    QList<QIcon> ics = icons();
+    for ( QList<QIcon>::const_iterator it = ics.begin(); it != ics.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefSliderItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( val.canConvert( QVariant::Int ) )
   {
-    int pos = 0;
-    QString str = myEditor->text();
-    if ( val->validate( str, pos ) == QValidator::Invalid )
-      myEditor->clear();
+    if ( name == "minimum" || name == "min" )
+      setMinimum( val.toInt() );
+    else if ( name == "maximum" || name == "max" )
+      setMaximum( val.toInt() );
+    else if ( name == "single_step" )
+      setSingleStep( val.toInt() );
+    else if ( name == "page_step" )
+      setPageStep( val.toInt() );
+    else
+      QtxPageNamedPrefItem::setOptionValue( name, val );
   }
+  else if ( name == "icons" || name == "pixmaps" )
+    setIcons( val );
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
 
-  delete myEditor->validator();
-  myEditor->setValidator( val );
+void QtxPagePrefSliderItem::setIcon( int pos )
+{
+  int index = pos - mySlider->minimum();
+  if ( !myIcons.isEmpty() && index >= 0 && index < myIcons.size() && !myIcons[index].isNull() )
+    myLabel->setPixmap( myIcons[index].pixmap( myIcons[index].availableSizes().first() ) );
+  else
+    myLabel->clear();
+}
+
+/*!
+  \brief Update slider widget.
+*/
+void QtxPagePrefSliderItem::updateSlider()
+{
+  int val = mySlider->value();
+  int stp = singleStep();
+  int ptp = pageStep();
+  int min = minimum();
+  int max = maximum();
+
+  control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+  mySlider->setFocusPolicy(Qt::StrongFocus);
+  
+  mySlider->setValue( val );
+  setSingleStep( stp );
+  setPageStep( ptp );
+  setMinimum( min );
+  setMaximum( max );
+  
+  myLabel->setVisible( !myIcons.empty() );
+  widget()->layout()->setSpacing( !myIcons.empty() ? 6 : 0 );
+}
+
+/*!
+  \brief Set the list of the icons from the resource manager.
+  \param var new icons list
+  \internal
+*/
+void  QtxPagePrefSliderItem::setIcons( const QVariant& var )
+{
+  if ( var.type() != QVariant::List )
+    return;
+
+  QList<QIcon> lst;
+  QList<QVariant> varList = var.toList();
+  for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+  {
+    if ( (*it).canConvert<QIcon>() )
+      lst.append( (*it).value<QIcon>() );
+    else if ( (*it).canConvert<QPixmap>() )
+      lst.append( (*it).value<QPixmap>() );
+    else
+      lst.append( QIcon() );
+  }
+  setIcons( lst );
 }
 
 /*!
@@ -2296,7 +2684,7 @@ void QtxPagePrefSelectItem::setInputType( const int type )
 /*!
   \brief Get the list of the values from the selection widget.
   \return list of values
-  \sa numbers(), setStrings()
+  \sa numbers(), icons(), setStrings()
 */
 QStringList QtxPagePrefSelectItem::strings() const
 {
@@ -2309,7 +2697,7 @@ QStringList QtxPagePrefSelectItem::strings() const
 /*!
   \brief Get the list of the values identifiers from the selection widget.
   \return list of values IDs
-  \sa strings(), setNumbers()
+  \sa strings(), icons(), setNumbers()
 */
 QList<int> QtxPagePrefSelectItem::numbers() const
 {
@@ -2322,10 +2710,23 @@ QList<int> QtxPagePrefSelectItem::numbers() const
   return res;
 }
 
+/*!
+  \brief Get the list of the icons associated with the selection widget.items
+  \return list of icons
+  \sa strings(), numbers(), setIcons()
+*/
+QList<QIcon> QtxPagePrefSelectItem::icons() const
+{
+  QList<QIcon> res;
+  for ( uint i = 0; i < mySelector->count(); i++ )
+    res.append( mySelector->itemIcon( i ) );
+  return res;
+}
+
 /*!
   \brief Set the list of the values to the selection widget.
   \param lst new list of values
-  \sa strings(), setNumbers()
+  \sa strings(), setNumbers(), setIcons()
 */
 void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
 {
@@ -2334,15 +2735,34 @@ void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
 }
 
 /*!
-  \brief Set the list of the values identifiers to the selection widget.
+  \brief Set the list of the values identifiers to the selection widget
   \param ids new list of values IDs
-  \sa numbers(), setStrings()
+  \sa numbers(), setStrings(), setIcons()
 */
 void QtxPagePrefSelectItem::setNumbers( const QList<int>& ids )
 {
   uint i = 0;
-  for ( QList<int>::const_iterator it = ids.begin(); it != ids.end() && i < mySelector->count(); ++it, i++ )
+  for ( QList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it, i++ ) {
+    if ( i >= mySelector->count() )
+      mySelector->addItem(QString("") );
+    
     mySelector->setId( i, *it );
+  }
+}
+
+/*!
+  \brief Set the list of the icons to the selection widget items
+
+  Important: call this method after setStrings() or setNumbers()
+
+  \param icns new list of icons
+  \sa icons(), setStrings(), setNumbers()
+*/
+void QtxPagePrefSelectItem::setIcons( const QList<QIcon>& icns )
+{
+  uint i = 0;
+  for ( QList<QIcon>::const_iterator it = icns.begin(); it != icns.end() && i < mySelector->count(); ++it, i++ )
+    mySelector->setItemIcon( i, *it );
 }
 
 /*!
@@ -2422,6 +2842,14 @@ QVariant QtxPagePrefSelectItem::optionValue( const QString& name ) const
       lst.append( *it );
     return lst;
   }
+  else if ( name == "icons" || name == "pixmaps" )
+  {
+    QList<QVariant> lst;
+    QList<QIcon> ics = icons();
+    for ( QList<QIcon>::const_iterator it = ics.begin(); it != ics.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
   else
     return QtxPageNamedPrefItem::optionValue( name );
 }
@@ -2443,6 +2871,8 @@ void QtxPagePrefSelectItem::setOptionValue( const QString& name, const QVariant&
     setStrings( val );
   else if ( name == "numbers" || name == "ids" || name == "indexes" )
     setNumbers( val );
+  else if ( name == "icons" || name == "pixmaps" )
+    setIcons( val );
   else
     QtxPageNamedPrefItem::setOptionValue( name, val );
 }
@@ -2480,6 +2910,30 @@ void QtxPagePrefSelectItem::setNumbers( const QVariant& var )
   setNumbers( lst );
 }
 
+/*!
+  \brief Set the list of the icons from the resource manager.
+  \param var new icons list
+  \internal
+*/
+void QtxPagePrefSelectItem::setIcons( const QVariant& var )
+{
+  if ( var.type() != QVariant::List )
+    return;
+
+  QList<QIcon> lst;
+  QList<QVariant> varList = var.toList();
+  for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+  {
+    if ( (*it).canConvert<QIcon>() )
+      lst.append( (*it).value<QIcon>() );
+    else if ( (*it).canConvert<QPixmap>() )
+      lst.append( (*it).value<QPixmap>() );
+    else
+      lst.append( QIcon() );
+  }
+  setIcons( lst );
+}
+
 /*!
   \brief Update selector widget.
 */
@@ -2550,7 +3004,7 @@ QtxPagePrefSpinItem::QtxPagePrefSpinItem( const QString& title, QtxPreferenceIte
 */
 QtxPagePrefSpinItem::QtxPagePrefSpinItem( const int type, const QString& title,
                                           QtxPreferenceItem* parent, const QString& sect,
-                                         const QString& param )
+                                          const QString& param )
 : QtxPageNamedPrefItem( title, parent, sect, param ),
   myType( type )
 {
@@ -2603,6 +3057,19 @@ QVariant QtxPagePrefSpinItem::step() const
     return QVariant();
 }
 
+/*!
+  \brief Get double spin box preference item precision value.
+  \return double spin box precision
+  \sa setPrecision()
+*/
+QVariant QtxPagePrefSpinItem::precision() const
+{
+  if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+    return dsb->decimals();
+  else
+    return QVariant();
+}
+
 /*!
   \brief Get spin box preference item minimum value.
   \return spin box minimum value
@@ -2697,6 +3164,22 @@ void QtxPagePrefSpinItem::setStep( const QVariant& step )
   }
 }
 
+/*!
+  \brief Set double spin box preference item precision value.
+  \param step new double spin box precision value
+  \sa precision()
+*/
+void QtxPagePrefSpinItem::setPrecision( const QVariant& prec )
+{
+  if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+  {
+    if ( prec.canConvert( QVariant::Int ) ) {
+      dsb->setDecimals( qAbs( prec.toInt() ) );
+      dsb->setPrecision( prec.toInt() );
+    }
+  }
+}
+
 /*!
   \brief Set spin box preference item minimum value.
   \param min new spin box minimum value
@@ -2814,6 +3297,8 @@ QVariant QtxPagePrefSpinItem::optionValue( const QString& name ) const
     return maximum();
   else if ( name == "step" )
     return step();
+  else if ( name == "precision" )
+    return precision();
   else if ( name == "prefix" )
     return prefix();
   else if ( name == "suffix" )
@@ -2843,6 +3328,8 @@ void QtxPagePrefSpinItem::setOptionValue( const QString& name, const QVariant& v
     setMaximum( val );
   else if ( name == "step" )
     setStep( val );
+  else if ( name == "precision" )
+    setPrecision( val );
   else if ( name == "prefix" )
   {
     if ( val.canConvert( QVariant::String ) )
@@ -2869,6 +3356,7 @@ void QtxPagePrefSpinItem::updateSpinBox()
 {
   QVariant val;
   QVariant stp = step();
+  QVariant prec = precision();
   QVariant min = minimum();
   QVariant max = maximum();
 
@@ -2892,6 +3380,7 @@ void QtxPagePrefSpinItem::updateSpinBox()
   control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
 
   setStep( stp );
+  setPrecision( prec );
   setMinimum( min );
   setMaximum( max );
 
@@ -2920,7 +3409,7 @@ void QtxPagePrefSpinItem::updateSpinBox()
   \param param resource file parameter associated with the preference item
 */
 QtxPagePrefTextItem::QtxPagePrefTextItem( QtxPreferenceItem* parent, const QString& sect,
-                                         const QString& param )
+                                          const QString& param )
 : QtxPageNamedPrefItem( QString(), parent, sect, param )
 {
   myEditor = new QTextEdit();
@@ -3020,28 +3509,131 @@ void QtxPagePrefColorItem::retrieve()
 }
 
 /*!
-  \class QtxPagePrefFontItem
-  \brief GUI implementation of the resources font item.
+  \class QtxPagePrefBiColorItem
+  \brief GUI implementation of the resources item to store a bi-color value.
+
+  The main color is specified explicitly. The secondary color is calculated
+  by changing "value" and "saturation" parameters of the main color in the 
+  HSV notation using specified delta.
 */
 
 /*!
   \brief Constructor.
-  \param feat font editor widget features (QtxFontEdit::Features)
   \param title preference item title
   \param parent parent preference item
   \param sect resource file section associated with the preference item
   \param param resource file parameter associated with the preference item
 */
-QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title,
-                                          QtxPreferenceItem* parent, const QString& sect,
-                                         const QString& param )
+QtxPagePrefBiColorItem::QtxPagePrefBiColorItem( const QString& title, QtxPreferenceItem* parent,
+                                               const QString& sect, const QString& param )
 : QtxPageNamedPrefItem( title, parent, sect, param )
 {
-  setControl( myFont = new QtxFontEdit( feat ) );
+  setControl( myColors = new QtxBiColorTool( 0 ) );
 }
 
 /*!
-  \brief Constructor.
+  \brief Destructor.
+*/
+QtxPagePrefBiColorItem::~QtxPagePrefBiColorItem()
+{
+}
+
+/*!
+  \bried Get auxiliary text
+  \return text assigned to the item
+  \sa setText()
+*/
+QString QtxPagePrefBiColorItem::text() const
+{
+  return myColors->text();
+}
+
+/*!
+  \bried Set auxiliary text
+  \param t text being assigned to the item
+  \sa text()
+*/
+void QtxPagePrefBiColorItem::setText( const QString& t )
+{
+  myColors->setText( t );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefBiColorItem::store()
+{
+  setString( Qtx::biColorToString( myColors->mainColor(), myColors->delta() ) );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefBiColorItem::retrieve()
+{
+  QColor c;
+  int d;
+  Qtx::stringToBiColor( getString(), c, d );
+  myColors->setMainColor( c );
+  myColors->setDelta( d );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefBiColorItem::optionValue( const QString& name ) const
+{
+  if ( name == "text" )
+    return text();
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefBiColorItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "text" )
+  {
+    if ( val.canConvert( QVariant::String ) )
+      setText( val.toString() );
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \class QtxPagePrefFontItem
+  \brief GUI implementation of the resources font item.
+*/
+
+/*!
+  \brief Constructor.
+  \param feat font editor widget features (QtxFontEdit::Features)
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title,
+                                          QtxPreferenceItem* parent, const QString& sect,
+                                          const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myFont = new QtxFontEdit( feat ) );
+}
+
+/*!
+  \brief Constructor.
   \param title preference item title
   \param parent parent preference item
   \param sect resource file section associated with the preference item
@@ -3806,3 +4398,484 @@ void QtxPagePrefDateTimeItem::updateDateTime()
 
   myDateTime->setDisplayFormat( dispFmt );
 }
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefShortcutBtnsItem::QtxPagePrefShortcutBtnsItem( const QString& title, QtxPreferenceItem* parent, const QString& sect,
+                                                          const QString& param ): QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myShortcut = new QtxShortcutEdit() );
+}
+
+/*!
+  \brief Destructor.
+*/  
+QtxPagePrefShortcutBtnsItem::~QtxPagePrefShortcutBtnsItem()
+{
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefShortcutBtnsItem::store()
+{
+  setString( myShortcut->shortcut().toString() );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefShortcutBtnsItem::retrieve()
+{
+  myShortcut->setShortcut( QKeySequence::fromString( getString() ) );
+}
+
+/*!
+  \brief Constructor.
+
+  Creates preference item for editing of key bindings
+
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefShortcutTreeItem::QtxPagePrefShortcutTreeItem( const QString& title, QtxPreferenceItem* parent, const QString& sect, 
+                                                          const QString& param ): QtxPageNamedPrefItem( title, parent, sect, "" )
+{
+  mySection = sect;
+
+  myShortcutTree = new QtxShortcutTree();
+
+  // Retrieve shortcuts common sections from resources
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr ){
+    QString generalSections = resourceMgr()->stringValue( "shortcuts_settings", "general_sections", QString() );
+    QStringList sectionsList = generalSections.split( ";", QString::SkipEmptyParts );
+    myShortcutTree->setGeneralSections( sectionsList );
+  }
+  setControl( myShortcutTree );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefShortcutTreeItem::~QtxPagePrefShortcutTreeItem()
+{
+}
+                                                   
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefShortcutTreeItem::retrieve()
+{
+  QtxResourceMgr* resMgr = resourceMgr();
+  if ( resMgr ){
+    QStringList secLst = resMgr->subSections( mySection, false );
+    ShortcutMap aMap; QStringList paramLst;
+    for( int i = 0; i < secLst.size(); i++ ) {
+      paramLst = resMgr->parameters( QStringList() << mySection << secLst.at( i ) );
+      for( int j = 0; j < paramLst.size(); j++ )
+        resMgr->value( mySection + resMgr->sectionsToken() + secLst.at( i ), paramLst.at( j ),aMap[ paramLst.at( j ) ], false );
+      myShortcutTree->setBindings( secLst.at( i ), aMap );
+      aMap.clear();
+    }
+  }
+}
+             
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefShortcutTreeItem::store()
+{
+  QStringList lst = myShortcutTree->sections();
+  QString aSection;
+  QtxResourceMgr* resMgr = resourceMgr();
+  
+  if ( resMgr ) {
+    for( int i = 0; i < lst.size(); i++ ) {
+      ShortcutMap* aMap( myShortcutTree->bindings( lst.at( i ) ) );
+      aSection = mySection + resMgr->sectionsToken() + lst.at( i );
+      for( ShortcutMap::const_iterator it = aMap->constBegin(); it != aMap->constEnd(); ++it )
+       resMgr->setValue( aSection, it.key(), it.value() );
+    }
+  }
+}
+
+/*!
+  \class QtxPagePrefBackgroundItem
+  \brief GUI implementation of the resources item to store background data.
+
+  Preference item allows specifying background data in different ways:
+  - solid color
+  - texture image file
+  - simple two-color gradient
+  - complex custom gradient (NOT IMPLEMENTED YET)
+  
+  Allowed background modes can be specified using setModeAllowed() method.
+  Texture modes can be enabled/disabled using setTextureModeAllowed() method.
+  Also, showing texture controls can be enabled/disabled by means of
+  setTextureAllowed() method.
+  Verical or horizontal orientation of the widget can be chosen via setOrientation()
+  method (default orientation is horizontal).
+
+  Simple gradient types can be specified using setGradients() method.
+
+  \sa Qtx::BackgroundData, QtxBackgroundTool
+*/
+
+/*!
+  \brief Constructor.
+  \param title preference item title
+  \param parent parent preference item
+  \param sect resource file section associated with the preference item
+  \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefBackgroundItem::QtxPagePrefBackgroundItem( const QString& title, QtxPreferenceItem* parent,
+                                                     const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+  setControl( myBgTool = new QtxBackgroundTool( 0 ) );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxPagePrefBackgroundItem::~QtxPagePrefBackgroundItem()
+{
+}
+
+/*!
+  \brief Get allowed two-color gradients to the widget
+  \param gradients gradients names are returned via this parameter
+  \param ids gradients identifiers are returned via this parameter (empty list can be returned)
+*/
+void QtxPagePrefBackgroundItem::gradients( QStringList& gradList, QIntList& idList ) const
+{
+  myBgTool->gradients( gradList, idList );
+}
+
+/*!
+  \brief Set allowed two-color gradients to the widget
+  \param gradients gradients names
+  \param ids optional gradients identifiers; if not specified, gradients are automatically numbered starting from 0
+*/
+void QtxPagePrefBackgroundItem::setGradients( const QStringList& gradients, const QIntList& ids )
+{
+  myBgTool->setGradients( gradients, ids );
+}
+
+/*!
+  \brief Check if specific background mode is allowed
+  \param mode background mode
+  \return \c true if specified background mode is enabled or \c false otherwise
+  \sa setModeAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isModeAllowed( Qtx::BackgroundMode mode ) const
+{
+  return myBgTool->isModeAllowed( mode );
+}
+
+/*!
+  \brief Enable / disable specific background mode
+  \param mode background mode
+  \param on enable / disable flag
+  \sa isModeAllowed()
+*/
+void QtxPagePrefBackgroundItem::setModeAllowed( Qtx::BackgroundMode mode, bool on )
+{
+  myBgTool->setModeAllowed( mode, on );
+}
+
+/*!
+  \brief Check if specific texture mode is allowed
+  \param mode texture mode
+  \return \c true if specified texture mode is enabled or \c false otherwise
+  \sa setTextureModeAllowed(), setTextureAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isTextureModeAllowed( Qtx::TextureMode mode ) const
+{
+  return myBgTool->isTextureModeAllowed( mode );
+}
+
+/*!
+  \brief Enable / disable specific texture mode
+  \param mode texture mode
+  \param on enable / disable flag (\c true by default)
+  \sa isTextureModeAllowed(), setTextureAllowed()
+*/
+void QtxPagePrefBackgroundItem::setTextureModeAllowed( Qtx::TextureMode mode, bool on )
+{
+  myBgTool->setTextureModeAllowed( mode, on );
+}
+
+/*!
+  \brief Check if texture controls are allowed (shown)
+  \return \c true if texture controls are enabled or \c false otherwise
+  \sa setTextureAllowed(), setTextureModeAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isTextureAllowed() const
+{
+  return myBgTool->isTextureAllowed();
+}
+
+/*!
+  \brief Enable / disable texture controls
+  \param on enable / disable flag (\c true by default)
+  \sa isTextureAllowed(), setTextureModeAllowed()
+*/
+void QtxPagePrefBackgroundItem::setTextureAllowed( bool on )
+{
+  myBgTool->setTextureAllowed( on );
+}
+
+/*!
+  \brief Get allowed image formats
+  \return image formats
+*/
+QString QtxPagePrefBackgroundItem::imageFormats() const
+{
+  return myBgTool->imageFormats();
+}
+
+/*!
+  \brief Set allowed image formats
+  \param formats image formats
+*/
+void QtxPagePrefBackgroundItem::setImageFormats( const QString& formats )
+{
+  myBgTool->setImageFormats( formats );
+}
+
+/*!
+  \brief Get widget editor orientation
+  \return orientation
+*/
+Qt::Orientation QtxPagePrefBackgroundItem::orientation() const
+{
+  return myBgTool->orientation();
+}
+
+/*!
+  \brief Set widget editor orientation
+  \param o orientation
+*/
+void QtxPagePrefBackgroundItem::setOrientation( Qt::Orientation o )
+{
+  myBgTool->setOrientation( o );
+}
+
+/*!
+  \brief Store preference item to the resource manager.
+  \sa retrieve()
+*/
+void QtxPagePrefBackgroundItem::store()
+{
+  setString( Qtx::backgroundToString( myBgTool->data() ) );
+}
+
+/*!
+  \brief Retrieve preference item from the resource manager.
+  \sa store()
+*/
+void QtxPagePrefBackgroundItem::retrieve()
+{
+  myBgTool->setData( Qtx::stringToBackground( getString() ) );
+}
+
+/*!
+  \brief Get preference item option value.
+  \param name option name
+  \return property value or null QVariant if option is not set
+  \sa setOptionValue()
+*/
+QVariant QtxPagePrefBackgroundItem::optionValue( const QString& name ) const
+{
+  if ( name == "texture_enabled" )
+    return isTextureAllowed();
+  else if ( name == "color_enabled" )
+    return isModeAllowed( Qtx::ColorBackground );
+  else if ( name == "gradient_enabled" )
+    return isModeAllowed( Qtx::SimpleGradientBackground );
+  else if ( name == "custom_enabled" )
+    return isModeAllowed( Qtx::CustomGradientBackground );
+  else if ( name == "texture_center_enabled" )
+    return isTextureModeAllowed( Qtx::CenterTexture );
+  else if ( name == "texture_tile_enabled" )
+    return isTextureModeAllowed( Qtx::TileTexture );
+  else if ( name == "texture_stretch_enabled" )
+    return isTextureModeAllowed( Qtx::StretchTexture );
+  else if ( name == "orientation" )
+    return orientation();
+  else if ( name == "image_formats" )
+    return imageFormats();
+  else if ( name == "gradient_names" ) {
+    QStringList grList;
+    QIntList    idList;
+    gradients( grList, idList );
+    return grList;
+  }
+  else if ( name == "gradient_ids" ) {
+    QStringList grList;
+    QIntList    idList;
+    gradients( grList, idList );
+    QList<QVariant> lst;
+    for ( QIntList::const_iterator it = idList.begin(); it != idList.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
+  else
+    return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+  \brief Set preference item option value.
+  \param name option name
+  \param val new property value
+  \sa optionValue()
+*/
+void QtxPagePrefBackgroundItem::setOptionValue( const QString& name, const QVariant& val )
+{
+  if ( name == "texture_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setTextureAllowed( val.toBool() );
+  }
+  else if ( name == "color_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setModeAllowed( Qtx::ColorBackground, val.toBool() );
+  }
+  else if ( name == "gradient_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setModeAllowed( Qtx::SimpleGradientBackground, val.toBool() );
+  }
+  else if ( name == "custom_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setModeAllowed( Qtx::CustomGradientBackground, val.toBool() );
+  }
+  else if ( name == "texture_center_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setTextureModeAllowed( Qtx::CenterTexture, val.toBool() );
+  }
+  else if ( name == "texture_tile_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setTextureModeAllowed( Qtx::TileTexture, val.toBool() );
+  }
+  else if ( name == "texture_stretch_enabled" ) {
+    if ( val.canConvert( QVariant::Bool ) )
+      setTextureModeAllowed( Qtx::StretchTexture, val.toBool() );
+  }
+  else if ( name == "orientation" ) {
+    if ( val.canConvert( QVariant::Int ) )
+      setOrientation( (Qt::Orientation)val.toInt() );
+  }
+  else if ( name == "image_formats" ) {
+    if ( val.canConvert( QVariant::String ) )
+      setImageFormats( val.toString() );
+  }
+  else if ( name == "gradient_names" ) {
+    if ( val.canConvert( QVariant::StringList ) )
+      setGradients( val.toStringList() );
+  }
+  else if ( name == "gradient_ids" ) {
+    if ( val.canConvert( QVariant::List ) ) {
+      QStringList grList;
+      QIntList    idList;
+      gradients( grList, idList );
+      idList.clear();
+      QList<QVariant> varList = val.toList();
+      for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it ) {
+       if ( (*it).canConvert( QVariant::Int ) )
+         idList.append( (*it).toInt() );
+      }
+      setGradients( grList, idList );
+    }
+  }
+  else
+    QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+  \brief Constructor.
+
+  Creates preference item of user defined widget. The item widget has to be inherited from 
+  QtxUserDefinedContent class. An instance of this class has to be installed into the item
+  with help of setContent method. Methods optionValue and setOptionValue use pointer on the 
+  content widget an qint64 value.
+
+  \param parent parent preference item
+*/
+QtxUserDefinedItem::QtxUserDefinedItem( QtxPreferenceItem* parent )
+  : QtxPageNamedPrefItem(QString(), parent), myContent(0)
+{
+}
+  
+/*!
+  \brief Lets to Store preferences for content instance
+  \sa retrieve()
+*/
+void QtxUserDefinedItem::store()
+{
+  if (myContent) {
+    myContent->store( resourceMgr(), preferenceMgr());
+  }
+}
+
+/*!
+  \brief Lets to Retrieve preferences for content instance
+  \sa store()
+*/
+void QtxUserDefinedItem::retrieve()
+{
+  if (myContent) {
+    myContent->retrieve( resourceMgr(), preferenceMgr());
+  }
+}
+
+/*!
+ * \brief Returns option value
+ * \param theName is a string "content"
+ * \return pointer on QtxUserDefinedContent class instance as a qint64 value
+ */
+QVariant QtxUserDefinedItem::optionValue( const QString& theName ) const
+{
+  if ( theName == "content" )
+    return (qint64) myContent;
+  else
+    return QtxPreferenceItem::optionValue( theName );
+}
+
+/*!
+ * \brief Sets option value
+ * \param theName is a string "content" 
+ * \param theVal is a pointer on QtxUserDefinedContent class instance represented as qint64 value
+ */
+void QtxUserDefinedItem::setOptionValue( const QString& theName, const QVariant& theVal)
+{
+  if ( theName == "content" ) {
+    if ( theVal.canConvert( QVariant::ULongLong ) ) {
+      setContent( (QtxUserDefinedContent*)theVal.toULongLong() );
+    }
+  } else
+    QtxPreferenceItem::setOptionValue( theName, theVal );
+}
+  
+/*!
+ * \brief Defines content of the property item as a Widget which has to be inherited from 
+ * QtxUserDefinedContent class.
+ * \param theContent is an QtxUserDefinedContent class instance.
+ */
+void QtxUserDefinedItem::setContent( QtxUserDefinedContent* theContent ) 
+{ 
+  myContent = theContent; 
+  setControl(myContent);
+}
index 28fada6dcfce56f518b5659f5c2b6b287d0c0c9b..74cca6d3168a83ae720b856977093ac843739ffd 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPagePrefMgr.h
 // Author:    Sergey TELKOV
 //
 #include <QFrame>
 #include <QLabel>
 #include <QPointer>
+#include <QIcon>
 
 class QtxGridBox;
 class QtxFontEdit;
 class QtxGroupBox;
 class QtxComboBox;
 class QtxColorButton;
+class QtxBiColorTool;
+class QtxShortcutEdit;
+class QtxShortcutTree;
+class QtxBackgroundTool;
 
 class QToolBox;
 class QLineEdit;
@@ -50,6 +53,8 @@ class QListWidget;
 class QFileDialog;
 class QDateTimeEdit;
 class QStackedWidget;
+class QSlider;
+class QTreeWidget;
 
 class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
 {
@@ -402,6 +407,12 @@ public:
   int              inputType() const;
   void             setInputType( const int );
 
+  int              decimals() const;
+  void             setDecimals( const int );
+  
+  int              echoMode() const;
+  void             setEchoMode( const int );
+
   virtual void     store();
   virtual void     retrieve();
 
@@ -414,9 +425,52 @@ private:
 
 private:
   int              myType;
+  int              myDecimals;
+  int              myEchoMode;
   QLineEdit*       myEditor;
 };
 
+class QTX_EXPORT QtxPagePrefSliderItem : public QObject,public QtxPageNamedPrefItem
+{
+  Q_OBJECT
+
+public:
+  QtxPagePrefSliderItem( const QString&, QtxPreferenceItem* = 0,
+                         const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefSliderItem();
+
+  int              singleStep() const;
+  int              pageStep() const;
+  int              minimum() const;
+  int              maximum() const;
+  QList<QIcon>     icons() const; 
+
+  void             setSingleStep( const int& );
+  void             setPageStep( const int& );
+  void             setMinimum( const int& );
+  void             setMaximum( const int& );
+  void             setIcons( const QList<QIcon>& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private slots:
+  void             setIcon( int );
+
+private:
+  void             updateSlider();
+  void             setIcons( const QVariant& );
+
+private:
+  QSlider*         mySlider;
+  QLabel*          myLabel;
+  QList<QIcon>     myIcons;
+};
+
 class QTX_EXPORT QtxPagePrefSelectItem : public QtxPageNamedPrefItem
 {
 public:
@@ -434,9 +488,11 @@ public:
 
   QStringList      strings() const;
   QList<int>       numbers() const;
+  QList<QIcon>     icons() const;
 
   void             setStrings( const QStringList& );
   void             setNumbers( const QList<int>& );
+  void             setIcons( const QList<QIcon>& );
 
   virtual void     store();
   virtual void     retrieve();
@@ -449,6 +505,7 @@ private:
   void             updateSelector();
   void             setStrings( const QVariant& );
   void             setNumbers( const QVariant& );
+  void             setIcons( const QVariant& );
 
 private:
   int              myType;
@@ -468,6 +525,7 @@ public:
   virtual ~QtxPagePrefSpinItem();
 
   QVariant         step() const;
+  QVariant         precision() const;
   QVariant         minimum() const;
   QVariant         maximum() const;
 
@@ -476,6 +534,7 @@ public:
   QString          specialValueText() const;
 
   void             setStep( const QVariant& );
+  void             setPrecision( const QVariant& );
   void             setMinimum( const QVariant& );
   void             setMaximum( const QVariant& );
 
@@ -530,6 +589,27 @@ private:
   QtxColorButton*  myColor;
 };
 
+class QTX_EXPORT QtxPagePrefBiColorItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefBiColorItem( const QString&, QtxPreferenceItem* = 0,
+                          const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefBiColorItem();
+
+  virtual QString  text() const;
+  virtual void     setText( const QString& );
+
+  virtual void     store();
+  virtual void     retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& ) const;
+  virtual void     setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxBiColorTool*  myColors;
+};
+
 class QTX_EXPORT QtxPagePrefFontItem : public QObject, public QtxPageNamedPrefItem
 {
   Q_OBJECT
@@ -658,4 +738,96 @@ private:
   QDateTimeEdit*   myDateTime;
 };
 
+class QTX_EXPORT QtxPagePrefShortcutBtnsItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefShortcutBtnsItem( const QString&, QtxPreferenceItem* = 0,
+                               const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefShortcutBtnsItem();
+  virtual void     store();
+  virtual void     retrieve();
+
+private:
+  QtxShortcutEdit* myShortcut;
+};
+
+class QTX_EXPORT QtxPagePrefShortcutTreeItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxPagePrefShortcutTreeItem( const QString&, QtxPreferenceItem* = 0, 
+                               const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefShortcutTreeItem();
+  virtual void     store();
+  virtual void     retrieve();
+                                                                  
+private:
+  QtxShortcutTree* myShortcutTree;
+  QString          mySection;
+};
+
+class QTX_EXPORT QtxPagePrefBackgroundItem : public QObject, public QtxPageNamedPrefItem
+{
+  Q_OBJECT
+
+public:
+  QtxPagePrefBackgroundItem( const QString&, QtxPreferenceItem* = 0,
+                            const QString& = QString(), const QString& = QString() );
+  virtual ~QtxPagePrefBackgroundItem();
+
+  void               gradients( QStringList&, QIntList& ) const;
+  void               setGradients( const QStringList&, const QIntList& = QIntList() );
+
+  bool               isModeAllowed( Qtx::BackgroundMode ) const;
+  void               setModeAllowed( Qtx::BackgroundMode, bool );
+
+  bool               isTextureModeAllowed( Qtx::TextureMode ) const;
+  void               setTextureModeAllowed( Qtx::TextureMode, bool );
+
+  bool               isTextureAllowed() const;
+  void               setTextureAllowed( bool );
+
+  QString            imageFormats() const;
+  void               setImageFormats( const QString& );
+
+  Qt::Orientation    orientation() const;
+  void               setOrientation( Qt::Orientation );
+
+  virtual void       store();
+  virtual void       retrieve();
+
+protected:
+  virtual QVariant   optionValue( const QString& ) const;
+  virtual void       setOptionValue( const QString&, const QVariant& );
+
+private:
+  QtxBackgroundTool* myBgTool;
+};
+
+class QtxUserDefinedContent: public QWidget
+{
+ public:
+  QtxUserDefinedContent(QWidget* parent = 0, Qt::WindowFlags f = 0 ):QWidget(parent, f) {};
+  virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
+  virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
+};
+
+
+class QTX_EXPORT QtxUserDefinedItem : public QtxPageNamedPrefItem
+{
+public:
+  QtxUserDefinedItem( QtxPreferenceItem* parent );
+
+  void setContent( QtxUserDefinedContent* theContent );
+
+  virtual void store();
+  virtual void retrieve();
+
+protected:
+  virtual QVariant optionValue( const QString& theName ) const;
+  virtual void     setOptionValue( const QString& theName, const QVariant& theVal );
+
+private:
+  QtxUserDefinedContent* myContent;
+};
+
 #endif
index 684d0a40dbbc4198f7070680cbcf07bfb78c2efe..427a3d2f210fd557e8b49c34a18cbb2d75bcb465 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathDialog.cxx
 // Author:    Sergey TELKOV
 //
@@ -340,7 +341,7 @@ bool QtxPathDialog::isValid()
 bool QtxPathDialog::acceptData() const
 {
   bool ok = true;
-       
+        
   QWidget* parent = (QWidget*)this;
 
   FileEntryMap::ConstIterator it;
@@ -351,7 +352,7 @@ bool QtxPathDialog::acceptData() const
     if ( entry.edit->text().isEmpty() )
     {
       QMessageBox::critical( parent, windowTitle(), tr( "File name not specified" ),
-                            QMessageBox::Ok, QMessageBox::NoButton );
+                             QMessageBox::Ok, QMessageBox::NoButton );
       ok = false;
     }
     else switch ( entry.mode )
@@ -359,44 +360,44 @@ bool QtxPathDialog::acceptData() const
     case OpenFile:
       if ( !fileInfo.exists() )
       {
-       QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
-                              QMessageBox::Ok, QMessageBox::NoButton );
-       ok = false;
+        QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+                               QMessageBox::Ok, QMessageBox::NoButton );
+        ok = false;
       }
       break;
     case SaveFile:
       if ( fileInfo.exists() )
-       ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
-                                  QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+        ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
+                                   QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
       break;
     case OpenDir:
       if ( !fileInfo.exists() || !fileInfo.isDir() )
       {
-       QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
-                              QMessageBox::Ok, QMessageBox::NoButton );
-       ok = false;
+        QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+                               QMessageBox::Ok, QMessageBox::NoButton );
+        ok = false;
       }
       break;
     case SaveDir:
       if ( fileInfo.exists() && !fileInfo.isDir() )
       {
-       QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
-                              QMessageBox::Ok, QMessageBox::NoButton );
-       ok = false;
+        QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+                               QMessageBox::Ok, QMessageBox::NoButton );
+        ok = false;
       }
       break;
     case NewDir:
       if ( fileInfo.exists() )
       {
-       if ( !fileInfo.isDir() )
-       {
-         QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
-                                QMessageBox::Ok, QMessageBox::NoButton );
-         ok = false;
-       }
-       else if ( QDir( fileInfo.filePath() ).count() > 2 )
-         ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
-                                    QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+        if ( !fileInfo.isDir() )
+        {
+          QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+                                 QMessageBox::Ok, QMessageBox::NoButton );
+          ok = false;
+        }
+        else if ( QDir( fileInfo.filePath() ).count() > 2 )
+          ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
+                                     QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
       }
       break;
     default:
@@ -461,7 +462,7 @@ void QtxPathDialog::setFileName( const int id, const QString& txt, const bool au
 {
   int mode;
   QLineEdit* le = fileEntry( id, mode );
-       
+        
   if ( le )
   {
     if ( autoExt && ( mode == OpenFile || mode == SaveFile ) )
@@ -539,7 +540,7 @@ QLineEdit* QtxPathDialog::fileEntry( const int theId, int& theMode ) const
   \return created file entry ID
 */
 int QtxPathDialog::createFileEntry( const QString& lab, const int mode, 
-                                                           const QString& filter, const int id )
+                                                            const QString& filter, const int id )
 {
   int num = id;
   if ( num == -1 )
@@ -668,7 +669,7 @@ QStringList QtxPathDialog::filterWildCards( const QString& theFilter ) const
     for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
     {
       if ( (*it).indexOf( "." ) != -1 )
-       res.append( (*it).trimmed() );
+        res.append( (*it).trimmed() );
     }
   }
   return res;
@@ -720,7 +721,7 @@ bool QtxPathDialog::hasVisibleChildren( QWidget* wid ) const
     for ( QObjectList::const_iterator it = aChildren.begin(); it != aChildren.end() && !res; ++it )
     {
       if ( (*it)->isWidgetType() )
-       res = ((QWidget*)(*it))->isVisibleTo( wid );
+        res = ((QWidget*)(*it))->isVisibleTo( wid );
     }
   }
   return res;
index a963d9e0871eb5af1dfbb5d3206b8e3f18d30cc8..fa1cea2c98fc0f615da4bab6aeb07388deaa94bc 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathDialog.h
 // Author:    Sergey TELKOV
 //
@@ -95,7 +96,7 @@ private:
   void               initialize();
   void               updateVisibility();
   QStringList        prepareFilters( const QString& ) const;
-       bool               hasVisibleChildren( QWidget* ) const;
+        bool               hasVisibleChildren( QWidget* ) const;
   QStringList        filterWildCards( const QString& ) const;
   QString            autoExtension( const QString&, const QString& = QString() ) const;
 
index 1504448d6fa95cf970bbad99b853210ad996cdda..ae0dbfc69bb5a8c498871226827293ca13eecc32 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathEdit.cxx
 // Author:    Sergey TELKOV
 //
@@ -190,7 +188,7 @@ void QtxPathEdit::setPathFilter( const QString& f )
 void QtxPathEdit::onBrowse( bool /*on*/ )
 {
   QString path;
-  QString initial = QFileInfo( myPath->text() ).path();
+  QString initial = QFileInfo( Qtx::makeEnvVarSubst( myPath->text() ) ).filePath();
   switch ( pathType() )
   {
   case Qtx::PT_OpenFile:
@@ -229,7 +227,7 @@ void QtxPathEdit::initialize()
   base->setSpacing( 5 );
 
   base->addWidget( myPath = new QLineEdit( this ) );
-  myPath->setValidator( new QRegExpValidator( QRegExp( "^([\\w/]{2}|[A-Z]:)[^:;\\*\\?]*[\\w\\\\/\\.]$" ), myPath ) );
+  myPath->setValidator( new QRegExpValidator( QRegExp( "^([\\$]|[\\%]|[\\w/]{2}|[A-Z]:)[^:;\\*\\?]*[\\w\\\\/\\.]$" ), myPath ) );
 
   QToolButton* browse = new QToolButton( this );
   browse->setIcon( QPixmap( browse_icon ) );
index eea26b66541575ac1b271bbdd834775f3c69be0a..de991be8901b5ab1da3726a25e7d23ca3a430426 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathEdit.h
 // Author:    Sergey TELKOV
 //
index 37c33aa0ce1572b302760e580b93a0e4a29c8acf..17b3044f91db16417044bd53ed2be254e2c9f5db 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathListEdit.cxx
 // Author:    Sergey TELKOV
 //
@@ -505,24 +503,24 @@ bool QtxPathListEdit::validate( const bool quietMode )
       if (found) {
         if (found != myLastSelected) {
           // it is forbidden to add directory more then once
-         if ( !quietMode )
-           QMessageBox::critical(this, 
-                                 tr("Error"),
-                                 tr("Directory already specified."), 
-                                 tr("Ok"));
-         myEdit->setFocus();
+          if ( !quietMode )
+            QMessageBox::critical(this, 
+                                  tr("Error"),
+                                  tr("Directory already specified."), 
+                                  tr("Ok"));
+          myEdit->setFocus();
           return false;
         }
       }
       else {
         if (!dir.exists()) {
-         if ( !quietMode && QMessageBox::information(this, 
-                                                     tr("Warning"),
-                                                     tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
-                                                     tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
-           myEdit->setFocus();
+          if ( !quietMode && QMessageBox::information(this, 
+                                                      tr("Warning"),
+                                                      tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
+                                                      tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
+            myEdit->setFocus();
             return false;
-         }
+          }
         }
         // append
         appendDir(myLastSelected, dir.absPath());
@@ -764,22 +762,23 @@ bool QtxPathListEdit::checkExistance( const QString& str, const bool msg )
   if ( pathType() == Qtx::PT_SaveFile )
     return true;
 
-  bool ok = QFileInfo( str ).exists();
+  QFileInfo aFI = QFileInfo( Qtx::makeEnvVarSubst( str ) );
+  bool ok = aFI.exists();
   if ( !ok && msg )
     ok = QMessageBox::question( this, tr( "Warning" ), tr( "Path \"%1\" doesn't exist. Add it to list anyway?" ).arg( str ),
                                 QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
 
-  if ( ok && QFileInfo( str ).exists() )
+  if ( ok && aFI.exists() )
   {
     switch ( pathType() )
     {
     case Qtx::PT_OpenFile:
-      ok = QFileInfo( str ).isFile();
+      ok = aFI.isFile();
       if ( !ok && msg )
         QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to file" ).arg( str ) );
       break;
     case Qtx::PT_Directory:
-      ok = QFileInfo( str ).isDir();
+      ok = aFI.isDir();
       if ( !ok && msg )
         QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to directory" ).arg( str ) );
       break;
index 012a5adb85746a2bcf2220ade7eacd7ab6a7f3e1..5a6636a2ba6d8f5a4616de985748f9230d34d5c6 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPathListEdit.h
 // Author:    Sergey TELKOV
 //
index 343f09314a51a73d17f477d27903fd38d0061ea0..2710a09337c45da9f17b50b254e573e65b32507b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPopupMgr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -51,11 +52,11 @@ bool operator<( const QVariant& v1, const QVariant& v2 )
     {
       const QList<QVariant>& aList1 = v1.toList(), aList2 = v2.toList();
       QList<QVariant>::const_iterator anIt1 = aList1.begin(), aLast1 = aList1.end(),
-       anIt2 = aList2.begin(), aLast2 = aList2.end();
+        anIt2 = aList2.begin(), aLast2 = aList2.end();
       for ( ; anIt1 != aLast1 && anIt2 != aLast2;  anIt1++, anIt2++ )
       {
-       if ( (*anIt1) != (*anIt2) )
-         return (*anIt1)<(*anIt2);
+        if ( (*anIt1) != (*anIt2) )
+          return (*anIt1)<(*anIt2);
       }
       return anIt1 == aLast1 && anIt2 != aLast2;
     }
@@ -85,7 +86,7 @@ public:
                           const ItemAttributes&, const int );
 
   virtual QString rule( const ItemAttributes&, 
-                       const QtxPopupMgr::RuleType = VisibleRule ) const;
+                        const QtxPopupMgr::RuleType = VisibleRule ) const;
 
 private:
   QtxPopupMgr*    myMgr;
@@ -189,7 +190,7 @@ int QtxPopupMgr::PopupCreator::append( const QString& tag, const bool subMenu,
   \return rule for the menu item corresponding to the rule type
 */
 QString QtxPopupMgr::PopupCreator::rule( const ItemAttributes& /*attr*/, 
-                                        const QtxPopupMgr::RuleType /*ruleType*/ ) const
+                                         const QtxPopupMgr::RuleType /*ruleType*/ ) const
 {
   return QString();
 }
@@ -285,10 +286,13 @@ void QtxPopupMgr::setSelection( QtxPopupSelection* sel )
 
   mySelection = sel;
 
-  if ( mySelection )
+  if ( mySelection ) {
     mySelection->setParent( this );
+    mySelection->setPopupMgr( this );
+  }
+
   connect( mySelection, SIGNAL( destroyed( QObject* ) ), 
-          this,        SLOT( onSelectionDestroyed( QObject* ) ) );
+           this,        SLOT( onSelectionDestroyed( QObject* ) ) );
 
   QtxActionMgr::triggerUpdate();
 }
@@ -514,18 +518,18 @@ bool QtxPopupMgr::isSatisfied( QAction* act, const RuleType ruleType ) const
       for ( int i = 0; i < mySelection->count() && !res; i++ )
       {
         QList<QVariant> c;
-       for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 )
+        for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 )
           c.append( parameter( *anIt1, i ) );
         aCorteges.insert( c, 0 );
       }
       for ( QMap<QList<QVariant>, int>::const_iterator anIt = aCorteges.begin(); anIt  != aCorteges.end(); ++anIt )
       {
-       const QList<QVariant>& aCortege = anIt.key();
-       QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
-       QList<QVariant>::const_iterator anIt2 = aCortege.begin();
-       for ( ; anIt1 != aLast1; anIt1++, anIt2++ )
-         p->setParameter( *anIt1, *anIt2 );
-       res = res || result( p );
+        const QList<QVariant>& aCortege = anIt.key();
+        QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
+        QList<QVariant>::const_iterator anIt2 = aCortege.begin();
+        for ( ; anIt1 != aLast1; anIt1++, anIt2++ )
+          p->setParameter( *anIt1, *anIt2 );
+        res = res || result( p );
       }
     }
     else
@@ -675,7 +679,8 @@ void QtxPopupMgr::onSelectionDestroyed( QObject* o )
   \brief Constructor.
 */
 QtxPopupSelection::QtxPopupSelection()
-: QObject( 0 )
+  : QObject( 0 ),
+    myPopupMgr( 0 )
 {
 }
 
@@ -709,6 +714,16 @@ void QtxPopupSelection::setOption( const QString& optName, const QString& opt )
   myOptions.insert( optName, opt );
 }
 
+QtxPopupMgr* QtxPopupSelection::popupMgr() const
+{
+  return myPopupMgr;
+}
+
+void QtxPopupSelection::setPopupMgr( QtxPopupMgr* pm )
+{
+  myPopupMgr = pm;
+}
+
 /*!
   \brief Get the parameter value.
   \param str parameter name
@@ -722,13 +737,15 @@ QVariant QtxPopupSelection::parameter( const QString& str ) const
   {
     QtxEvalSetSets::ValueSet set;
     QString par = str.mid( equalityParam().length() );
+
+    QtxPopupMgr* pMgr = popupMgr();
     for ( int i = 0; i < (int)count(); i++ )
     {
-      QVariant v = parameter( i, par );
+      QVariant v = pMgr ? pMgr->parameter( par, i ) : parameter( i, par );
       if ( v.isValid() )
-       QtxEvalSetSets::add( set, v );
+        QtxEvalSetSets::add( set, v );
       else
-       return QVariant();
+        return QVariant();
     }
     return set;
   }
index 488c854411ac5d92bfc4ddd75a2e62034618dcd1..d61ab56bfeea442fb43eb72308c61db39ef8a04b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPopupMgr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -104,6 +105,8 @@ private:
   RuleMap            myRules;
   CacheMap           myCache;
   QtxPopupSelection* mySelection;
+
+  friend class QtxPopupSelection;
 };
 
 class QTX_EXPORT QtxPopupSelection : public QObject
@@ -121,15 +124,20 @@ public:
   QString            option( const QString& ) const;
   void               setOption( const QString&, const QString& );
 
+  QtxPopupMgr*       popupMgr() const;
+  void               setPopupMgr( QtxPopupMgr* );
+
 private:
   QString            equalityParam() const;
   QString            selCountParam() const;
 
 private:
   typedef QMap<QString, QString> OptionsMap;
+  typedef QPointer<QtxPopupMgr>  PopupMgrPtr;
 
 private:
   OptionsMap         myOptions;
+  PopupMgrPtr        myPopupMgr;
 };
 
 #endif // QTXPOPUPMGR_H
index 6758276d78b4424eae5dbf3cf020fce6493a9cdb..b10323df8c71d00166074d9199476916fef509eb 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPreferenceMgr.cxx
 // Author:    Sergey TELKOV
 //
index 8699d0bac77bd62c6d52f97baf985b409b916bca..2a780d4dd47c02f25080f9f7bc656897726e5cd4 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxPreferenceMgr.h
 // Author:    Sergey TELKOV
 //
index cf91632aaaad0f3e5c963fd8ba5fb2cf0d380f68..946374411e5de873e013bf6ff03337f659ada798 100644 (file)
@@ -1,35 +1,40 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxResourceMgr.cxx
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
 #include "QtxResourceMgr.h"
 #include "QtxTranslator.h"
 
+#include <QSet>
 #include <QDir>
 #include <QFile>
+#include <QFileInfo>
 #include <QRegExp>
 #include <QTextStream>
 #include <QApplication>
+#include <QLibraryInfo>
+#include <QtDebug>
 #ifndef QT_NO_DOM
 #include <QDomDocument>
 #include <QDomElement>
@@ -65,7 +70,6 @@ public:
   QPixmap                loadPixmap( const QString&, const QString&, const QString& ) const;
   QTranslator*           loadTranslator( const QString&, const QString&, const QString& ) const;
 
-  QString                environmentVariable( const QString&, int&, int& ) const;
   QString                makeSubstitution( const QString&, const QString&, const QString& ) const;
 
   void                   clear();
@@ -389,7 +393,7 @@ QPixmap QtxResourceMgr::Resources::loadPixmap( const QString& sect, const QStrin
 QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const
 {
   QTranslator* trans = new QtxTranslator( 0 );
-  QString fname = fileName( sect, prefix, name );
+  QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) );
   if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) )
   {
     delete trans;
@@ -398,54 +402,6 @@ QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, con
   return trans;
 }
 
-/*!
-  \brief Parse given string to retrieve environment variable.
-
-  Looks through the string for the patterns: ${name} or $(name) or %name%.
-  If string contains variable satisfying any pattern, the variable name
-  is returned, start index of the variable is returned in the \a start parameter,
-  and length of the variable is returned in the \a len parameter.
-
-  \param str string being processed
-  \param start if variable is found, this parameter contains its starting 
-         position in the \a str
-  \param len if variable is found, this parameter contains its length 
-  \return first found variable or null QString if there is no ones
-*/
-QString QtxResourceMgr::Resources::environmentVariable( const QString& str, int& start, int& len ) const
-{
-  QString varName;
-  len = 0;
-
-  QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
-
-  int pos = rx.indexIn( str, start );
-  if ( pos != -1 )
-  {
-    int i = 1;
-    while ( i <= rx.numCaptures() && varName.isEmpty() )
-    {
-      QString capStr = rx.cap( i );
-      if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
-        varName = capStr;
-      i++;
-    }
-
-    if ( !varName.isEmpty() )
-    {
-      int capIdx = i - 1;
-      start = rx.pos( capIdx );
-      int end = start + varName.length();
-      if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
-        start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
-      if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
-        end++;
-      len = end - start;
-    }
-  }
-  return varName;
-}
-
 /*!
   \brief Substitute variables by their values.
 
@@ -467,7 +423,7 @@ QString QtxResourceMgr::Resources::makeSubstitution( const QString& str, const Q
   int start( 0 ), len( 0 );
   while ( true )
   {
-    QString envName = environmentVariable( res, start, len );
+    QString envName = Qtx::findEnvVar( res, start, len );
     if ( envName.isNull() )
       break;
 
@@ -511,6 +467,9 @@ public:
 protected:
   virtual bool load( const QString&, QMap<QString, Section>& );
   virtual bool save( const QString&, const QMap<QString, Section>& );
+
+private:
+  bool         load( const QString&, QMap<QString, Section>&, QSet<QString>& );
 };
 
 /*!
@@ -536,9 +495,41 @@ QtxResourceMgr::IniFormat::~IniFormat()
 */
 bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Section>& secMap )
 {
-  QFile file( fname );
+  QSet<QString> importHistory;
+  return load( fname, secMap, importHistory );
+}
+
+
+/*!
+  \brief Load resources from xml-file.
+  \param fname resources file name
+  \param secMap resources map to be filled in
+  \param importHistory list of already imported resources files (to prevent import loops)
+  \return \c true on success or \c false on error
+*/
+bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Section>& secMap, QSet<QString>& importHistory )
+{
+  QString aFName = fname.trimmed();
+  if ( !QFileInfo( aFName ).exists() )
+  {
+    if ( QFileInfo( aFName + ".ini" ).exists() )
+      aFName += ".ini";
+    else if ( QFileInfo( aFName + ".INI" ).exists() )
+      aFName += ".INI";
+    else
+      return false; // file does not exist
+  }
+  QFileInfo aFinfo( aFName );
+  aFName = aFinfo.canonicalFilePath();
+
+  if ( !importHistory.contains( aFName ) )
+    importHistory.insert( aFName );
+  else
+    return true;   // already imported (prevent import loops)
+
+  QFile file( aFName );
   if ( !file.open( QFile::ReadOnly ) )
-    return false;
+    return false;  // file is not accessible
 
   QTextStream ts( &file );
 
@@ -577,26 +568,64 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Sectio
       if ( section.isEmpty() )
       {
         res = false;
-        qWarning( "Empty section in line %d", line );
+        qWarning() << "QtxResourceMgr: Empty section in line:" << line;
       }
     }
-    else if ( data.contains( "=" ) && !section.isEmpty() )
+    else if ( data.contains( separator ) && !section.isEmpty() )
     {
       int pos = data.indexOf( separator );
       QString key = data.left( pos ).trimmed();
       QString val = data.mid( pos + 1 ).trimmed();
       secMap[section].insert( key, val );
     }
+    else if ( section == "import" )
+    {
+      QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
+      QFileInfo impFInfo( impFile );
+      if ( impFInfo.isRelative() )
+             impFInfo.setFile( aFinfo.absoluteDir(), impFile );
+    
+      QMap<QString, Section> impMap;
+      if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) )
+      {
+        qDebug() << "QtxResourceMgr: Error with importing file:" << data;
+      }
+      else 
+      {
+             QMap<QString, Section>::const_iterator it = impMap.constBegin();
+             for ( ; it != impMap.constEnd() ; ++it )
+             { 
+                if ( !secMap.contains( it.key() ) )
+                {
+                   // insert full section
+                   secMap.insert( it.key(), it.value() );
+                }
+                else
+                {
+                   // insert all parameters from the section
+                   Section::ConstIterator paramIt = it.value().begin();
+                   for ( ; paramIt != it.value().end() ; ++paramIt )
+                   {
+                      if ( !secMap[it.key()].contains( paramIt.key() ) )
+                              secMap[it.key()].insert( paramIt.key(), paramIt.value() );
+                   }
+                }
+             }
+      }
+    }
     else
     {
       res = false;
-      section.isEmpty() ? qWarning( "Current section is empty" ) : qWarning( "Error in line: %d", line );
+      if ( section.isEmpty() )
+             qWarning() << "QtxResourceMgr: Current section is empty";
+      else
+             qWarning() << "QtxResourceMgr: Error in line:" << line;
     }
   }
 
   file.close();
 
-  return res;
+  return res; 
 }
 
 /*!
@@ -607,12 +636,19 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Sectio
 */
 bool QtxResourceMgr::IniFormat::save( const QString& fname, const QMap<QString, Section>& secMap )
 {
+  if ( !Qtx::mkDir( QFileInfo( fname ).absolutePath() ) )
+    return false;
+
   QFile file( fname );
   if ( !file.open( QFile::WriteOnly ) )
     return false;
 
   QTextStream ts( &file );
 
+  ts << "# This file is automatically created by SALOME application." << endl;
+  ts << "# Changes made in this file can be lost!" << endl;
+  ts << endl;
+
   bool res = true;
   for ( QMap<QString, Section>::ConstIterator it = secMap.begin(); it != secMap.end() && res; ++it )
   {
@@ -650,8 +686,11 @@ private:
   QString      docTag() const;
   QString      sectionTag() const;
   QString      parameterTag() const;
+  QString      importTag() const;
   QString      nameAttribute() const;
   QString      valueAttribute() const;
+
+  bool         load( const QString&, QMap<QString, Section>&, QSet<QString>& );
 };
 
 /*!
@@ -677,14 +716,45 @@ QtxResourceMgr::XmlFormat::~XmlFormat()
 */
 bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Section>& secMap )
 {
+  QSet<QString> importHistory;
+  return load( fname, secMap, importHistory );
+}
+
+/*!
+  \brief Load resources from xml-file.
+  \param fname resources file name
+  \param secMap resources map to be filled in
+  \param importHistory list of already imported resources files (to prevent import loops)
+  \return \c true on success and \c false on error
+*/
+bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Section>& secMap, QSet<QString>& importHistory )
+{
+  QString aFName = fname.trimmed();
+  if ( !QFileInfo( aFName ).exists() )
+  {
+    if ( QFileInfo( aFName + ".xml" ).exists() )
+      aFName += ".xml";
+    else if ( QFileInfo( aFName + ".XML" ).exists() )
+      aFName += ".XML";
+    else
+      return false; // file does not exist
+  }
+  QFileInfo aFinfo( aFName );
+  aFName = aFinfo.canonicalFilePath();
+
+  if ( !importHistory.contains(  aFName ) )
+    importHistory.insert( aFName );
+  else
+    return true;   // already imported (prevent import loops)
+
   bool res = false;
 
 #ifndef QT_NO_DOM
 
-  QFile file( fname );
+  QFile file( aFName );
   if ( !file.open( QFile::ReadOnly ) )
   {
-    qDebug( "File cannot be opened" );
+    qDebug() << "QtxResourceMgr: File is not accessible:" << aFName;
     return false;
   }
 
@@ -695,14 +765,14 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Sectio
 
   if ( !res )
   {
-    qDebug( "File is empty" );
+    qDebug() << "QtxResourceMgr: File is empty:" << aFName;
     return false;
   }
 
   QDomElement root = doc.documentElement();
   if ( root.isNull() || root.tagName() != docTag() )
   {
-    qDebug( "Invalid root" );
+    qDebug() << "QtxResourceMgr: Invalid root in file:" << aFName;
     return false;
   }
 
@@ -728,45 +798,79 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Sectio
             {
               QString paramName = paramElem.attribute( nameAttribute() );
               QString paramValue = paramElem.attribute( valueAttribute() );
-
               secMap[section].insert( paramName, paramValue );
             }
             else
-           {
-             qDebug( "Invalid parameter element" );
+            {
+              qDebug() << "QtxResourceMgr: Invalid parameter element in file:" << aFName;
               res = false;
-           }
+            }
+          }
+          else
+          {
+            res = paramNode.isComment();
+            if ( !res )
+              qDebug() << "QtxResourceMgr: Node is neither element nor comment in file:" << aFName;
           }
-         else
-         {
-           res = paramNode.isComment();
-           if( !res )
-             qDebug( "Node isn't element nor comment" );
-         }
 
           paramNode = paramNode.nextSibling();
         }
       }
+      else if ( sectElem.tagName() == importTag() && sectElem.hasAttribute( nameAttribute() ) )
+      {
+         QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
+             QFileInfo impFInfo( impFile );
+             if ( impFInfo.isRelative() )
+                impFInfo.setFile( aFinfo.absoluteDir(), impFile );
+
+        QMap<QString, Section> impMap;
+        if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) )
+            {
+            qDebug() << "QtxResourceMgr: Error with importing file:" << sectElem.attribute( nameAttribute() );
+            }
+            else
+            {
+                QMap<QString, Section>::const_iterator it = impMap.constBegin();
+                for ( ; it != impMap.constEnd() ; ++it )
+                {
+                   if ( !secMap.contains( it.key() ) )
+                   {
+                      // insert full section
+                      secMap.insert( it.key(), it.value() );
+                   }
+                   else
+                   {
+                      // insert all parameters from the section
+                      Section::ConstIterator paramIt = it.value().begin();
+                      for ( ; paramIt != it.value().end() ; ++paramIt )
+                      {
+                              if ( !secMap[it.key()].contains( paramIt.key() ) )
+                                 secMap[it.key()].insert( paramIt.key(), paramIt.value() );
+                      }
+                   }
+                }
+         }
+      }
       else
       {
-       qDebug( "Invalid section" );
-        res = false;
+         qDebug() << "QtxResourceMgr: Invalid section in file:" << aFName;
+         res = false;
       }
     }
     else
     {
       res = sectNode.isComment(); // if it's a comment -- let it be, pass it..
-      if( !res )
-       qDebug( "Node isn't element nor comment" );
+      if ( !res )
+        qDebug() << "QtxResourceMgr: Node is neither element nor comment in file:" << aFName;
     }
 
     sectNode = sectNode.nextSibling();
   }
 
 #endif
-
+  
   if ( res )
-    qDebug( "File '%s' is loaded successfully", (const char*)fname.toLatin1() );
+    qDebug() << "QtxResourceMgr: File" << fname << "is loaded successfully";
   return res;
 }
 
@@ -782,11 +886,16 @@ bool QtxResourceMgr::XmlFormat::save( const QString& fname, const QMap<QString,
 
 #ifndef QT_NO_DOM
 
+  if ( !Qtx::mkDir( QFileInfo( fname ).absolutePath() ) )
+    return false;
+
   QFile file( fname );
   if ( !file.open( QFile::WriteOnly ) )
     return false;
 
   QDomDocument doc( docTag() );
+  QDomComment comment = doc.createComment( "\nThis file is automatically created by SALOME application.\nChanges made in this file can be lost!\n" );
+  doc.appendChild( comment );
   QDomElement root = doc.createElement( docTag() );
   doc.appendChild( root );
 
@@ -852,6 +961,18 @@ QString QtxResourceMgr::XmlFormat::parameterTag() const
   return tag;
 }
 
+/*!
+  \brief Get import tag name
+  \return XML import tag name
+*/
+QString QtxResourceMgr::XmlFormat::importTag() const
+{
+  QString tag = option( "import_tag" );
+  if ( tag.isEmpty() )
+   tag = QString( "import" );
+  return tag;
+}
+
 /*!
   \brief Get parameter tag's "name" attribute name
   \return XML parameter tag's "name" attribute name
@@ -919,7 +1040,7 @@ QStringList QtxResourceMgr::Format::options() const
   \brief Get the value of the option with specified name.
 
   If option doesn't exist then null QString is returned.
-        
+         
   \param opt option name
   \return option value
 */
@@ -956,7 +1077,7 @@ bool QtxResourceMgr::Format::load( Resources* res )
   if ( status )
     res->mySections = sections;
   else
-    qDebug( "QtxResourceMgr: Could not load resource file \"%s\"", (const char*)res->myFileName.toLatin1() );
+    qDebug() << "QtxResourceMgr: Can't load resource file:" << res->myFileName;
 
   return status;
 }
@@ -1444,7 +1565,7 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QByteArray
   \brief Get linear gradient parameter value.
   \param sect section name
   \param name parameter name
-  \param gVal parameter to return resulting linear gradient value value
+  \param gVal parameter to return resulting linear gradient value
   \return \c true if parameter is found and \c false if parameter is not found
           (in this case \a gVal value is undefined)
 */
@@ -1461,7 +1582,7 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QLinearGra
   \brief Get radial gradient parameter value.
   \param sect section name
   \param name parameter name
-  \param gVal parameter to return resulting radial gradient value value
+  \param gVal parameter to return resulting radial gradient value
   \return \c true if parameter is found and \c false if parameter is not found
           (in this case \a gVal value is undefined)
 */
@@ -1478,7 +1599,7 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QRadialGra
   \brief Get conical gradient parameter value.
   \param sect section name
   \param name parameter name
-  \param gVal parameter to return resulting conical gradient value value
+  \param gVal parameter to return resulting conical gradient value
   \return \c true if parameter is found and \c false if parameter is not found
           (in this case \a gVal value is undefined)
 */
@@ -1491,6 +1612,24 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QConicalGr
   return Qtx::stringToConicalGradient( val, gVal );
 }
 
+/*!
+  \brief Get background parameter value.
+  \param sect section name
+  \param name parameter name
+  \param bgVal parameter to return resulting background value
+  \return \c true if parameter is found and \c false if parameter is not found
+          (in this case \a bgVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, Qtx::BackgroundData& bgVal ) const
+{
+  QString val;
+  if ( !value( sect, name, val, true ) )
+    return false;
+
+  bgVal = Qtx::stringToBackground( val );
+  return bgVal.isValid();
+}
+
 /*!
   \brief Get string parameter value (native format).
   \param sect section name
@@ -1705,6 +1844,24 @@ QConicalGradient QtxResourceMgr::conicalGradientValue( const QString& sect, cons
   return val;
 }
 
+/*!
+  \brief Get background parameter value.
+
+  If the specified parameter is not found, the specified default value is returned instead.
+
+  \param sect section name
+  \param name parameter name
+  \param def default value
+  \return parameter value (or default value if parameter is not found)
+*/
+Qtx::BackgroundData QtxResourceMgr::backgroundValue( const QString& sect, const QString& name, const Qtx::BackgroundData& def ) const
+{
+  Qtx::BackgroundData val;
+  if ( !value( sect, name, val ) )
+    val = def;
+  return val;
+}
+
 /*!
   \brief Check parameter existence.
   \param sect section name
@@ -1917,6 +2074,21 @@ void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Q
   setResource( sect, name, Qtx::gradientToString( val ) );
 }
 
+/*!
+  \brief Set background parameter value.
+  \param sect section name
+  \param name parameter name
+  \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Qtx::BackgroundData& val )
+{
+  Qtx::BackgroundData res;
+  if ( checkExisting() && value( sect, name, res ) && res == val )
+    return;
+
+  setResource( sect, name, Qtx::backgroundToString( val ) );
+}
+
 /*!
   \brief Remove resources section.
   \param sect section name
@@ -2144,6 +2316,63 @@ QStringList QtxResourceMgr::sections() const
   return map.keys();
 }
 
+/*!
+  \brief Get all sections names matching specified regular expression.
+  \param re searched regular expression
+  \return list of sections names
+*/
+QStringList QtxResourceMgr::sections(const QRegExp& re) const
+{
+  return sections().filter( re );
+}
+
+/*!
+  \brief Get all sections names with the prefix specified by passed
+  list of parent sections names. 
+
+  Sub-sections are separated inside the section name by the sections 
+  separator token, for example "splash:color:label".
+
+  \param names parent sub-sections names 
+  \return list of sections names
+*/
+QStringList QtxResourceMgr::sections(const QStringList& names) const
+{
+  QStringList nm = names;
+  nm << ".+";
+  QRegExp re( QString( "^%1$" ).arg( nm.join( sectionsToken() ) ) );
+  return sections( re );
+}
+
+/*!
+  \brief Get list of sub-sections names for the specified parent section name.
+
+  Sub-sections are separated inside the section name by the sections 
+  separator token, for example "splash:color:label".
+
+  \param section parent sub-section name
+  \param full if \c true return full names of child sub-sections, if \c false,
+         return only top-level sub-sections names
+  \return list of sub-sections names
+*/
+QStringList QtxResourceMgr::subSections(const QString& section, const bool full) const
+{
+  QStringList names = sections( QStringList() << section );
+  QMutableListIterator<QString> it( names );
+  while ( it.hasNext() ) {
+    QString name = it.next().mid( section.size() + 1 ).trimmed();
+    if ( name.isEmpty() ) {
+      it.remove();
+      continue;
+    }
+    if ( !full ) name = name.split( sectionsToken() ).first();
+    it.setValue( name );
+  }
+  names.removeDuplicates();
+  names.sort();
+  return names;
+}
+
 /*!
   \brief Get all parameters name in specified section.
   \param sec section name
@@ -2180,6 +2409,21 @@ QStringList QtxResourceMgr::parameters( const QString& sec ) const
   return pmap.keys();
 }
 
+/*!
+  \brief Get all parameters name in specified
+  list of sub-sections names. 
+
+  Sub-sections are separated inside the section name by the sections 
+  separator token, for example "splash:color:label".
+
+  \param names parent sub-sections names 
+  \return list of settings names
+*/
+QStringList QtxResourceMgr::parameters( const QStringList& names ) const
+{
+  return parameters( names.join( sectionsToken() ) );
+}
+
 /*!
   \brief Get absolute path to the file which name is defined by the parameter.
 
@@ -2211,7 +2455,7 @@ QString QtxResourceMgr::path( const QString& sect, const QString& prefix, const
   \brief Get application resources section name.
 
   By default, application resources section name is "resources" but
-  it can be changed by setting the corresponding resources manager option.
+  it can be changed by setting the "res_section_name" resources manager option.
   
   \return section corresponding to the resources directories
   \sa option(), setOption()
@@ -2228,7 +2472,7 @@ QString QtxResourceMgr::resSection() const
   \brief Get application language section name.
 
   By default, application language section name is "language" but
-  it can be changed by setting the corresponding resources manager option.
+  it can be changed by setting the "lang_section_name" resources manager option.
   
   \return section corresponding to the application language settings
   \sa option(), setOption()
@@ -2241,6 +2485,23 @@ QString QtxResourceMgr::langSection() const
   return res;
 }
 
+/*!
+  \brief Get sections separator token.
+
+  By default, sections separator token is colon symbol ":" but
+  it can be changed by setting the "section_token" resources manager option.
+  
+  \return string corresponding to the current section separator token
+  \sa option(), setOption()
+*/
+QString QtxResourceMgr::sectionsToken() const
+{
+  QString res = option( "section_token" );
+  if ( res.isEmpty() )
+    res = QString( ":" );
+  return res;
+}
+
 /*!
   \brief Get default pixmap.
   
@@ -2364,7 +2625,7 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   if ( lang.isEmpty() )
   {
     lang = QString( "en" );
-    qWarning( "Language not specified. Assumed: %s", (const char*)lang.toLatin1() );
+    qWarning() << "QtxResourceMgr: Language not specified. Assumed:" << lang;
   }
 
   substMap.insert( 'L', lang );
@@ -2386,7 +2647,7 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   if ( trList.isEmpty() )
   {
     trList.append( "%P_msg_%L.qm" );
-    qWarning( "Translators not defined. Assumed: %s", (const char*)trList[0].toLatin1() );
+    qWarning() << "QtxResourceMgr: Translators not defined. Assumed:" << trList[0];
   }
 
   QStringList prefixList;
@@ -2395,6 +2656,20 @@ void QtxResourceMgr::loadLanguage( const QString& pref, const QString& l )
   else
     prefixList = parameters( resSection() );
 
+  if ( pref.isEmpty() && lang != "en" ) {
+    // load Qt resources
+    QString qt_translations = QLibraryInfo::location( QLibraryInfo::TranslationsPath );
+    QString qt_dir_trpath;
+    if ( ::getenv( "QTDIR" ) )
+      qt_dir_trpath = QString( ::getenv( "QTDIR" ) );
+    if ( !qt_dir_trpath.isEmpty() )
+      qt_dir_trpath = QDir( qt_dir_trpath ).absoluteFilePath( "translations" );
+
+    QTranslator* trans = new QtxTranslator( 0 );
+    if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) || trans->load( QString("qt_%1").arg( lang ), qt_dir_trpath ) )
+      QApplication::instance()->installTranslator( trans );
+  }
+
   for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
   {
     QString prefix = *iter;
@@ -2569,7 +2844,7 @@ void QtxResourceMgr::setResource( const QString& sect, const QString& name, cons
   the configuration file from the previous versions of the application).
   
   \param appName application name
-  \param for_load boolean flag indicating that file is opened for loading or saving (not used) 
+  \param for_load boolean flag indicating that file is opened for loading or saving (not used in default implementation
   \return user configuration file name
   \sa globalFileName()
 */
@@ -2578,6 +2853,10 @@ QString QtxResourceMgr::userFileName( const QString& appName, const bool /*for_l
   QString fileName;
   QString pathName = QDir::homePath();
 
+  QString cfgAppName = QApplication::applicationName();
+  if ( !cfgAppName.isEmpty() )
+    pathName = Qtx::addSlash( Qtx::addSlash( pathName ) + QString( ".config" ) ) + cfgAppName;
+
 #ifdef WIN32
   fileName = QString( "%1.%2" ).arg( appName ).arg( currentFormat() );
 #else
index 626abe1f10c8da07901c8525f5a97f950433b981..7c89a51e53c495bd6b92165b25d15ed901a31569 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxResourceMgr.h
 // Author:    Alexander SOLOVYOV, Sergey TELKOV
 //
@@ -96,6 +97,7 @@ public:
   bool             value( const QString&, const QString&, QLinearGradient& ) const;  
   bool             value( const QString&, const QString&, QRadialGradient& ) const;  
   bool             value( const QString&, const QString&, QConicalGradient& ) const;  
+  bool             value( const QString&, const QString&, Qtx::BackgroundData& ) const;  
   bool             value( const QString&, const QString&, QString&, const bool = true ) const;
 
   int              integerValue( const QString&, const QString&, const int = 0 ) const;
@@ -108,6 +110,7 @@ public:
   QLinearGradient  linearGradientValue( const QString&, const QString&, const QLinearGradient& = QLinearGradient() ) const;
   QRadialGradient  radialGradientValue( const QString&, const QString&, const QRadialGradient& = QRadialGradient() ) const;
   QConicalGradient conicalGradientValue( const QString&, const QString&, const QConicalGradient& = QConicalGradient() ) const;
+  Qtx::BackgroundData backgroundValue( const QString&, const QString&, const Qtx::BackgroundData& = Qtx::BackgroundData() ) const;
 
   bool             hasSection( const QString& ) const;
   bool             hasValue( const QString&, const QString& ) const;
@@ -122,6 +125,7 @@ public:
   void             setValue( const QString&, const QString&, const QLinearGradient& );
   void             setValue( const QString&, const QString&, const QRadialGradient& );
   void             setValue( const QString&, const QString&, const QConicalGradient& );
+  void             setValue( const QString&, const QString&, const Qtx::BackgroundData& );
 
   void             remove( const QString& );
   void             remove( const QString&, const QString& );
@@ -142,6 +146,7 @@ public:
 
   QString          resSection() const;
   QString          langSection() const;
+  QString          sectionsToken() const;
 
   QPixmap          loadPixmap( const QString&, const QString& ) const;
   QPixmap          loadPixmap( const QString&, const QString&, const bool ) const;
@@ -160,7 +165,11 @@ public:
   bool             save();
 
   QStringList      sections() const;
+  QStringList      sections(const QRegExp&) const;
+  QStringList      sections(const QStringList&) const;
+  QStringList      subSections(const QString&, const bool = true) const;
   QStringList      parameters( const QString& ) const;
+  QStringList      parameters( const QStringList& ) const;
 
   void             refresh();
 
index 99f67f404c3776bbd8eebeb4b8a12b177afba7d6..3180263d201ee3207108b5d2df1dabc0aaa9bd87 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxRubberBand.cxx
 // Author:    Alexander A. BORODIN
 //
@@ -213,7 +211,7 @@ void QtxAbstractRubberBand::updateMask()
 
 
 QtxRectRubberBand::QtxRectRubberBand(QWidget* parent)
-  :QtxAbstractRubberBand( parent )     
+  :QtxAbstractRubberBand( parent )      
 {
   myPoints.resize( 4 );
   myIsClosed = true;
@@ -241,7 +239,7 @@ void QtxRectRubberBand::setStartPoint( const QPoint& thePoint )
 
 void QtxRectRubberBand::setEndPoint( const QPoint& thePoint)
 {
-  myPoints[2] = thePoint;      
+  myPoints[2] = thePoint;       
   myPoints[1].setX( thePoint.x() );
   myPoints[3].setY( thePoint.y() );
   updateMask();
index 0abf9bb8ed62fefb6c181617afd45675463c96b5..8005d81b6d056cf8ded31254fadbbc2ca45dfc19 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxRubberBand.h
 // Author:    Alexander A. BORODIN
 //
@@ -70,7 +68,7 @@ public:
   void            initGeometry( const QRect& );
   void            setStartPoint( const QPoint& );
   void            setEndPoint( const QPoint& );
-       
+        
   virtual void    clearGeometry();
 };
 
index b7f9444af832e9c6e77a3b17b0d0660de487a349..4c724bb72d25aa53806d96bdfe079c1408e76c10 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : QtxSearchTool.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 
 const char* const first_xpm[] = {
 "16 16 14 1",
-"      c None",
-".     c #111111",
-"+     c #0A0A0A",
-"@     c #161616",
-"#     c #ACACAC",
-"$     c #FC6D6E",
-"%     c #FB6364",
-"&     c #F25B5C",
-"*     c #EA5859",
-"=     c #C1494A",
-"-     c #B64545",
-";     c #AB4040",
-">     c #A03C3C",
-",     c #99393A",
+"       c None",
+".      c #111111",
+"+      c #0A0A0A",
+"@      c #161616",
+"#      c #ACACAC",
+"$      c #FC6D6E",
+"%      c #FB6364",
+"&      c #F25B5C",
+"*      c #EA5859",
+"=      c #C1494A",
+"-      c #B64545",
+";      c #AB4040",
+">      c #A03C3C",
+",      c #99393A",
 "           .    ",
 " +@+      ..#   ",
 " +$+#    .$.... ",
@@ -71,20 +69,20 @@ const char* const first_xpm[] = {
 
 const char* const last_xpm[] = {
 "16 16 14 1",
-"      c None",
-".     c #111111",
-"+     c #0A0A0A",
-"@     c #161616",
-"#     c #FC6D6E",
-"$     c #ACACAC",
-"%     c #FB6364",
-"&     c #F25B5C",
-"*     c #EA5859",
-"=     c #C1494A",
-"-     c #B64545",
-";     c #AB4040",
-">     c #A03C3C",
-",     c #99393A",
+"       c None",
+".      c #111111",
+"+      c #0A0A0A",
+"@      c #161616",
+"#      c #FC6D6E",
+"$      c #ACACAC",
+"%      c #FB6364",
+"&      c #F25B5C",
+"*      c #EA5859",
+"=      c #C1494A",
+"-      c #B64545",
+";      c #AB4040",
+">      c #A03C3C",
+",      c #99393A",
 "    .           ",
 "    ..      +@+ ",
 " ....#.     +#+$",
@@ -104,18 +102,18 @@ const char* const last_xpm[] = {
 
 const char* const prev_xpm[] = {
 "16 16 12 1",
-"      c None",
-".     c #111111",
-"+     c #ACACAC",
-"@     c #FC6D6E",
-"#     c #FB6364",
-"$     c #F25B5C",
-"%     c #EA5859",
-"&     c #C1494A",
-"*     c #B64545",
-"=     c #AB4040",
-"-     c #A03C3C",
-";     c #99393A",
+"       c None",
+".      c #111111",
+"+      c #ACACAC",
+"@      c #FC6D6E",
+"#      c #FB6364",
+"$      c #F25B5C",
+"%      c #EA5859",
+"&      c #C1494A",
+"*      c #B64545",
+"=      c #AB4040",
+"-      c #A03C3C",
+";      c #99393A",
 "        .       ",
 "       ..+      ",
 "      .@......  ",
@@ -135,18 +133,18 @@ const char* const prev_xpm[] = {
 
 const char* const next_xpm[] = {
 "16 16 12 1",
-"      c None",
-".     c #111111",
-"+     c #FC6D6E",
-"@     c #FB6364",
-"#     c #F25B5C",
-"$     c #EA5859",
-"%     c #C1494A",
-"&     c #B64545",
-"*     c #ACACAC",
-"=     c #AB4040",
-"-     c #A03C3C",
-";     c #99393A",
+"       c None",
+".      c #111111",
+"+      c #FC6D6E",
+"@      c #FB6364",
+"#      c #F25B5C",
+"$      c #EA5859",
+"%      c #C1494A",
+"&      c #B64545",
+"*      c #ACACAC",
+"=      c #AB4040",
+"-      c #A03C3C",
+";      c #99393A",
 "       .        ",
 "       ..       ",
 "  ......+.      ",
@@ -166,14 +164,14 @@ const char* const next_xpm[] = {
 
 const char* const close_xpm[] = {
 "16 16 8 1",
-"      c None",
-".     c #D73727",
-"+     c #E17765",
-"@     c #E7957F",
-"#     c #DE6F48",
-"$     c #DF7B4F",
-"%     c #FAE9E4",
-"&     c #FFFFFF",
+"       c None",
+".      c #D73727",
+"+      c #E17765",
+"@      c #E7957F",
+"#      c #DE6F48",
+"$      c #DF7B4F",
+"%      c #FAE9E4",
+"&      c #FFFFFF",
 "                ",
 "  ............  ",
 " .+@@@@@@@@@@+. ",
@@ -272,7 +270,7 @@ static QWidget* wrapWidget( QWidget* parent, QWidget* w )
   \param controls ORed controls flags (QtxSearchTool::Controls)
   \sa setWatchedWidget(), setControls()
 */
-QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls )
+QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls, Qt::Orientation orientation )
 : QFrame( parent ),
   myWatched( watched ? watched : parent ),
   mySearcher( 0 ),
@@ -281,7 +279,7 @@ QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls )
   myAutoHideTimer( 0 ),
   myAutoHideEnabled( true )
 {
-  init();
+  init( orientation );
 }
 
 /*!
@@ -296,7 +294,7 @@ QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls )
   \param controls ORed controls flags (QtxSearchTool::Controls)
   \sa setWatchedWidget(), setControls()
 */
-QtxSearchTool::QtxSearchTool( QWidget* parent, int controls )
+QtxSearchTool::QtxSearchTool( QWidget* parent, int controls, Qt::Orientation orientation )
 : QFrame( parent ),
   myWatched( parent ),
   mySearcher( 0 ),
@@ -305,7 +303,7 @@ QtxSearchTool::QtxSearchTool( QWidget* parent, int controls )
   myAutoHideTimer( 0 ),
   myAutoHideEnabled( true )
 {
-  init();
+  init( orientation );
 }
 
 /*!
@@ -498,7 +496,7 @@ int QtxSearchTool::addCustomWidget( QWidget* w, int id )
 
   wid = id < 0 ? --_wid : id;
 
-  QVBoxLayout* vbox = qobject_cast<QVBoxLayout*>( layout() );
+  QBoxLayout* vbox = qobject_cast<QBoxLayout*>( layout() );
   w->setParent( this );
   vbox->addWidget( w );
   myWidgets.insert( wid, w );
@@ -828,9 +826,9 @@ void QtxSearchTool::find( const QString& what, int where )
 
   QPalette p = myData->palette();
   p.setColor( QPalette::Active,
-             QPalette::Base,
-             QApplication::palette( myData ).color( QPalette::Active,
-                                                    QPalette::Base ) );
+              QPalette::Base,
+              QApplication::palette( myData ).color( QPalette::Active,
+                                                     QPalette::Base ) );
 
   bool found = true;
   if ( mySearcher && !what.isEmpty() )
@@ -873,25 +871,19 @@ void QtxSearchTool::modifierSwitched()
   \brief Initialize the search tool widget.
   \internal
 */
-void QtxSearchTool::init()
+void QtxSearchTool::init( Qt::Orientation orientation )
 {
   setFrameStyle( QFrame::StyledPanel | QFrame::Plain );
-  QVBoxLayout* vbox = new QVBoxLayout();
-  vbox->setSpacing( 0 );
-  vbox->setMargin( 5 );
-  setLayout( vbox );
 
   myBtnWidget = new QWidget( this );
   QHBoxLayout* myBtnWidget_layout = new QHBoxLayout( myBtnWidget );
   myBtnWidget_layout->setSpacing( 0 );
   myBtnWidget_layout->setMargin( 0 );
-  vbox->addWidget( myBtnWidget );
 
   myModWidget = new QWidget( this );
   QHBoxLayout* myModWidget_layout = new QHBoxLayout( myModWidget );
   myModWidget_layout->setSpacing( 0 );
   myModWidget_layout->setMargin( 0 );
-  vbox->addWidget( myModWidget );
 
   myClose = new QToolButton( myBtnWidget );
   myClose->setIcon( QIcon( close_xpm ) );
@@ -953,6 +945,14 @@ void QtxSearchTool::init()
 
   setShortcuts( QKeySequence( "Ctrl+S" ) );
   setActivators( Any );
+  
+  QBoxLayout* box = orientation == Qt::Vertical ? (QBoxLayout*)( new QVBoxLayout ) : (QBoxLayout*)( new QHBoxLayout );
+  box->setSpacing( 0 );
+  box->setMargin( 5 );
+  box->addWidget( myBtnWidget );
+  box->addWidget( myModWidget );
+  setLayout( box );
+
   updateControls();
 }
 
@@ -1040,8 +1040,8 @@ void QtxSearchTool::updateShortcuts()
   ShortcutList::Iterator it;
   for ( it = myShortcuts.begin(), i = 0; it != myShortcuts.end(); ++it, i++ )
   {
-    (*it)->setEnabled( isEnabled() && ( i < 3 && myActivators & StandardKey ||
-                                       i > 2 && myActivators & HotKey ) );
+    (*it)->setEnabled( isEnabled() && ( ( i < 3 && myActivators & StandardKey ) ||
+                                        ( i > 2 && myActivators & HotKey ) ) );
   }
 }
 
@@ -1408,8 +1408,8 @@ QModelIndexList QtxTreeViewSearcher::findItems( const QString& text, QtxSearchTo
 
   if ( myView->model() )
     return myView->model()->match( myView->model()->index( 0, myColumn ),
-                                  Qt::DisplayRole,
-                                  s, -1, fl );
+                                   Qt::DisplayRole,
+                                   s, -1, fl );
   return QModelIndexList();
 }
 
@@ -1422,8 +1422,8 @@ QModelIndexList QtxTreeViewSearcher::findItems( const QString& text, QtxSearchTo
   appropriate item
 */
 QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index,
-                                             const QModelIndexList& lst,
-                                             bool direction )
+                                              const QModelIndexList& lst,
+                                              bool direction )
 {
   if ( direction )
   {
@@ -1432,7 +1432,7 @@ QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index,
     {
       QModelIndex found = it.next();
       if ( compareIndices( found, index ) > 0 )
-       return found;
+        return found;
     }
   }
   else
@@ -1443,7 +1443,7 @@ QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index,
     {
       QModelIndex found = it.previous();
       if ( compareIndices( found, index ) < 0 )
-       return found;
+        return found;
     }
   }
   return QModelIndex();
@@ -1494,7 +1494,7 @@ QString QtxTreeViewSearcher::getId( const QModelIndex& index )
   and positive value otherwise
 */
 int QtxTreeViewSearcher::compareIndices( const QModelIndex& left,
-                                        const QModelIndex& right )
+                                         const QModelIndex& right )
 {
   QString leftId = getId( left );
   QString rightId = getId( right );
index 26afe3830f88b7cf95e99be2e3c263e828c6080b..cdef79dec98573d0ad822cac2e989a80f7c2b782 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : QtxSearchTool.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -81,8 +79,8 @@ public:
     Any         = HotKey | SlashKey | StandardKey | PrintKey  //!< search tool is activated by any of above mentioned ways
   } Activator;
 
-  QtxSearchTool( QWidget*, QWidget* = 0, int = All );
-  QtxSearchTool( QWidget*, int = All );
+  QtxSearchTool( QWidget*, QWidget* = 0, int = All, Qt::Orientation = Qt::Vertical );
+  QtxSearchTool( QWidget*, int = All, Qt::Orientation = Qt::Vertical );
   virtual ~QtxSearchTool();
 
   QWidget*            watchedWidget() const;
@@ -131,7 +129,7 @@ private slots:
   void                modifierSwitched();
 
 private:
-  void                init();
+  void                init( Qt::Orientation );
   bool                focused() const;
   void                clearShortcuts();
   void                initShortcuts( const QList<QKeySequence>& );
index e32a29aae24d7fae4a6032102565bb78e251ddbb..3afc3815827cd736db4a95adc1b948661031a81c 100644 (file)
@@ -1,29 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : QtxSplash.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #include "QtxSplash.h"
 #include "QtxResourceMgr.h"
+#include <cstdio>
 
 #include <QApplication>
 #include <QPainter>
@@ -265,9 +267,9 @@ void QtxSplash::setError( const QString& error, const QString& title, const int
   if ( mySplash ) {
     mySplash->setError( code );
     QMessageBox::critical( mySplash, 
-                          title.isEmpty() ? tr( "Error" ) : title,
-                          error,
-                          tr( "&OK" ) );
+                           title.isEmpty() ? tr( "Error" ) : title,
+                           error,
+                           tr( "&OK" ) );
   }
   else {
     printf( "QtxSplash::error: %s\n",error.toLatin1().constData() );
@@ -551,7 +553,7 @@ int QtxSplash::progressFlags() const
   \sa progressColors()
 */
 void QtxSplash::setProgressColors( const QColor&         startColor, 
-                                  const QColor&         endColor,
+                                   const QColor&         endColor,
                                    const Qt::Orientation orientation )
 {
   if ( !startColor.isValid() )
@@ -906,19 +908,19 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
       fl = 0;
       QStringList opts = pf.split( QRegExp( "," ), QString::SkipEmptyParts );
       for ( int i = 0; i < opts.count(); i++ ) {
-       QString opt = opts[i].trimmed().toLower();
-       if ( opt == "left" )
-         fl = fl | LeftSide;
-       else if ( opt == "right" )
-         fl = fl | RightSide;
-       else if ( opt == "top" )
-         fl = fl | TopSide;
-       else if ( opt == "bottom" )
-         fl = fl | BottomSide;
-       else if ( opt == "left_to_right" )
-         fl = fl | LeftToRight;
-       else if ( opt == "right_to_left" )
-         fl = fl | RightToLeft;
+        QString opt = opts[i].trimmed().toLower();
+        if ( opt == "left" )
+          fl = fl | LeftSide;
+        else if ( opt == "right" )
+          fl = fl | RightSide;
+        else if ( opt == "top" )
+          fl = fl | TopSide;
+        else if ( opt == "bottom" )
+          fl = fl | BottomSide;
+        else if ( opt == "left_to_right" )
+          fl = fl | LeftToRight;
+        else if ( opt == "right_to_left" )
+          fl = fl | RightToLeft;
       }
     }
     setProgressFlags( fl );
@@ -945,23 +947,23 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
       fl = 0;
       QStringList opts = al.split( QRegExp( "," ), QString::SkipEmptyParts );
       for ( int i = 0; i < opts.count(); i++ ) {
-       QString opt = opts[i].trimmed().toLower();
-       if ( opt == "left" )
-         fl = fl | Qt::AlignLeft;
-       else if ( opt == "right" )
-         fl = fl | Qt::AlignRight;
-       else if ( opt == "top" )
-         fl = fl | Qt::AlignTop;
-       else if ( opt == "bottom" )
-         fl = fl | Qt::AlignBottom;
-       else if ( opt == "hcenter" )
-         fl = fl | Qt::AlignHCenter;
-       else if ( opt == "vcenter" )
-         fl = fl | Qt::AlignVCenter;
-       else if ( opt == "justify" )
-         fl = fl | Qt::AlignJustify;
-       else if ( opt == "center" )
-         fl = fl | Qt::AlignCenter;
+        QString opt = opts[i].trimmed().toLower();
+        if ( opt == "left" )
+          fl = fl | Qt::AlignLeft;
+        else if ( opt == "right" )
+          fl = fl | Qt::AlignRight;
+        else if ( opt == "top" )
+          fl = fl | Qt::AlignTop;
+        else if ( opt == "bottom" )
+          fl = fl | Qt::AlignBottom;
+        else if ( opt == "hcenter" )
+          fl = fl | Qt::AlignHCenter;
+        else if ( opt == "vcenter" )
+          fl = fl | Qt::AlignVCenter;
+        else if ( opt == "justify" )
+          fl = fl | Qt::AlignJustify;
+        else if ( opt == "center" )
+          fl = fl | Qt::AlignCenter;
       }
     }
     setTextAlignment( fl );
@@ -977,17 +979,17 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
     setProgressColors( lgrad );
   }
   else if ( resMgr->value( resSection, "progress_color",  rgrad ) || 
-           resMgr->value( resSection, "progress_colors", rgrad ) ) {
+            resMgr->value( resSection, "progress_colors", rgrad ) ) {
     // radial gradient-colored progress bar
     setProgressColors( rgrad );
   }
   else if ( resMgr->value( resSection, "progress_color",  cgrad ) || 
-           resMgr->value( resSection, "progress_colors", cgrad ) ) {
+            resMgr->value( resSection, "progress_colors", cgrad ) ) {
     // conical gradient-colored progress bar
     setProgressColors( cgrad );
   }
   else if ( resMgr->value( resSection, "progress_color",  pc ) || 
-           resMgr->value( resSection, "progress_colors", pc ) ) {
+            resMgr->value( resSection, "progress_colors", pc ) ) {
     // one/two-colored progress bar
     QStringList colors = pc.split( "|", QString::SkipEmptyParts );
     QColor c1, c2;
@@ -999,12 +1001,12 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
       bool bOk;
       gt = colors[2].toInt( &bOk );
       if ( bOk ) {
-       if ( gt == 0 )
-         o = Qt::Horizontal;
+        if ( gt == 0 )
+          o = Qt::Horizontal;
       }
       else {
-       if ( colors[2].toLower().startsWith( "h" ) )
-         o = Qt::Horizontal;
+        if ( colors[2].toLower().startsWith( "h" ) )
+          o = Qt::Horizontal;
       }
     }
     setProgressColors( c1, c2, o );
@@ -1045,8 +1047,8 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section )
   \sa message(), constantInfo(), setConstantInfo()
 */
 void QtxSplash::setMessage( const QString& msg, 
-                           int            alignment,
-                           const QColor&  color )
+                            int            alignment,
+                            const QColor&  color )
 {
   myMessage   = msg;
   myAlignment = alignment;
@@ -1218,17 +1220,17 @@ void QtxSplash::drawProgressBar( QPainter* p )
       QLinearGradient lg;
       const QLinearGradient* other = static_cast<const QLinearGradient*>( progressColors() );
       if ( checkGradient( other ) ) {
-       // gradient is defined in relative coordinates [0.0 - 1.0]
-       lg.setStart( r.left() + r.width()  * other->start().x(), 
-                    r.top()  + r.height() * other->start().y() );
-       lg.setFinalStop( r.left() + r.width()  * other->finalStop().x(), 
-                        r.top()  + r.height() * other->finalStop().y() );
+        // gradient is defined in relative coordinates [0.0 - 1.0]
+        lg.setStart( r.left() + r.width()  * other->start().x(), 
+                     r.top()  + r.height() * other->start().y() );
+        lg.setFinalStop( r.left() + r.width()  * other->finalStop().x(), 
+                         r.top()  + r.height() * other->finalStop().y() );
       }
       else {
-       // gradient is defined in absolute coordinates
-       // according to its dimensions
-       lg.setStart( r.topLeft() + other->start() );
-       lg.setFinalStop( r.topLeft() + other->finalStop() );
+        // gradient is defined in absolute coordinates
+        // according to its dimensions
+        lg.setStart( r.topLeft() + other->start() );
+        lg.setFinalStop( r.topLeft() + other->finalStop() );
       }
       
       lg.setStops( other->stops() );
@@ -1243,17 +1245,17 @@ void QtxSplash::drawProgressBar( QPainter* p )
       QRadialGradient rg;
       const QRadialGradient* other = static_cast<const QRadialGradient*>( progressColors() );
       if ( checkGradient( other ) ) {
-       // gradient is defined in relative coordinates [0.0 - 1.0]
-       rg.setCenter( r.left() + r.width()  * other->center().x(),
-                     r.top()  + r.height() * other->center().y() );
-       rg.setFocalPoint( r.left() + r.width()  * other->focalPoint().x(),
-                         r.top()  + r.height() * other->focalPoint().y() );
+        // gradient is defined in relative coordinates [0.0 - 1.0]
+        rg.setCenter( r.left() + r.width()  * other->center().x(),
+                      r.top()  + r.height() * other->center().y() );
+        rg.setFocalPoint( r.left() + r.width()  * other->focalPoint().x(),
+                          r.top()  + r.height() * other->focalPoint().y() );
       }
       else {
-       // gradient is defined in absolute coordinates
-       // according to its dimensions
-       rg.setCenter( r.topLeft() + other->center() );
-       rg.setFocalPoint( r.topLeft() + other->focalPoint() );
+        // gradient is defined in absolute coordinates
+        // according to its dimensions
+        rg.setCenter( r.topLeft() + other->center() );
+        rg.setFocalPoint( r.topLeft() + other->focalPoint() );
       }
       
       // only width is taken into account for the radius in relative mode
@@ -1271,14 +1273,14 @@ void QtxSplash::drawProgressBar( QPainter* p )
       QConicalGradient cg;
       const QConicalGradient* other = static_cast<const QConicalGradient*>( progressColors() );
       if ( checkGradient( other ) ) {
-       // gradient is defined in relative coordinates [0.0 - 1.0]
-       cg.setCenter( r.left() + r.width()  * other->center().x(),
-                     r.top()  + r.height() * other->center().y() );
+        // gradient is defined in relative coordinates [0.0 - 1.0]
+        cg.setCenter( r.left() + r.width()  * other->center().x(),
+                      r.top()  + r.height() * other->center().y() );
       }
       else {
-       // gradient is defined in absolute coordinates
-       // according to its dimensions
-       cg.setCenter( r.topLeft() + other->center() );
+        // gradient is defined in absolute coordinates
+        // according to its dimensions
+        cg.setCenter( r.topLeft() + other->center() );
       }
 
       cg.setAngle( other->angle() );
index 07475c65a6688ff89ee19d53cfcb0efde8d361ce..27ada2051ab012fb8ab310e831a36ae4074ea4c9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : QtxSplash.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -95,8 +96,8 @@ public:
   int               progressFlags() const;
   
   void              setProgressColors( const QColor&, 
-                                      const QColor& = QColor(),
-                                      const Qt::Orientation = Qt::Vertical );
+                                       const QColor& = QColor(),
+                                       const Qt::Orientation = Qt::Vertical );
   void              setProgressColors( const QGradient& );
   const QGradient*  progressColors() const;
   
@@ -126,8 +127,8 @@ public:
 
 public slots:
   void              setMessage( const QString&, 
-                               const int,
-                               const QColor& = QColor() );
+                                const int,
+                                const QColor& = QColor() );
   void              setMessage( const QString& );
   void              clear();
   
index fe2ba2ed86736dfb8091558eb8b57b433e82d500..1710599706f3a00629fc65007d1ae3215aa9c7cb 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTable.cxx
 // Author:    Sergey TELKOV
 //
@@ -154,7 +155,7 @@ bool QtxTable::eventFilter( QObject* o, QEvent* e )
 
   if ( o == myHeaderEditor && e->type() == QEvent::KeyPress && isHeaderEditing() )
   {
-         QKeyEvent* ke = (QKeyEvent*)e;
+          QKeyEvent* ke = (QKeyEvent*)e;
     if ( ke->key() == Key_Escape )
     {
       endHeaderEdit( false );
@@ -173,8 +174,8 @@ bool QtxTable::eventFilter( QObject* o, QEvent* e )
   if ( o == myHeaderEditor && e->type() == QEvent::FocusOut &&
        isHeaderEditing() && ((QFocusEvent*)e)->reason() != QFocusEvent::Popup )
   {
-               endHeaderEdit();
-               return true;
+                endHeaderEdit();
+                return true;
   }
 
   if ( e->type() == QEvent::Wheel && isHeaderEditing() )
index 398b0305a11f209fd0b2268b6ba8b4e4f678f581..c39030182f70033432b086a3ddb67884b2b6fa36 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTable.h
 // Author:    Sergey TELKOV
 //
index 6154653feafdadf3a983c29347c00961c22cc698..bf03b7f33e785360f290dfc4df5f852e54d03909 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxToolBar.cxx
 // Author:    Sergey TELKOV
 //
@@ -100,9 +101,10 @@ bool QtxToolBar::Watcher::eventFilter( QObject* o, QEvent* e )
 
   bool updVis = ( o != myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
                                    e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
-                ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show ||
-                                  e->type() == QEvent::ShowToParent || e->type() == QEvent::ActionAdded ||
-                                  e->type() == QEvent::ActionRemoved ) );
+                ( o == myCont && ( e->type() == QEvent::ChildAdded   || e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show ||
+                                   e->type() == QEvent::ShowToParent || e->type() == QEvent::Hide ||
+                                  e->type() == QEvent::HideToParent || e->type() == QEvent::ActionAdded ||
+                                   e->type() == QEvent::ActionRemoved ) );
 
   if ( updVis )
   {
@@ -275,7 +277,7 @@ void QtxToolBar::Watcher::updateVisibility()
     }
   }
 
-  vis = !empty && isVisible();
+  vis = (!isEmpty() && isVisible());
   if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
     vis ? showContainer() : hideContainer();
 }
@@ -362,6 +364,7 @@ QtxToolBar::~QtxToolBar()
 */
 void QtxToolBar::setVisible( bool visible )
 {
+  if ( isVisible() == visible ) return;
   if ( myWatcher )
   {
     if ( visible )
index 8b3044272618f942fc5804213f0d1d6419bd05d7..02771cb5e9c9a42cf4efa0c91241df936c96e86a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxToolBar.h
 // Author:    Sergey TELKOV
 //
index 61007661b76411c1f33578563b0ff0b2b4804432..8751c811eecb0db32432128b44edd95630b928d1 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxToolTip.cxx
 // Author:    Sergey TELKOV
 //
@@ -48,21 +49,21 @@ QtxToolTip::QtxToolTip( QWidget* parent )
   palette.setColor( backgroundRole(), QColor( 255, 255, 231 ) );
   setPalette( palette );
 
-       myWidgetRegion = QRect( -1, -1, -1, -1 );
+        myWidgetRegion = QRect( -1, -1, -1, -1 );
 
-       setFrameShape( QFrame::Panel );
-       setFrameShadow( QFrame::Plain );
+        setFrameShape( QFrame::Panel );
+        setFrameShadow( QFrame::Plain );
 
   parent->setMouseTracking( true );
-       parent->installEventFilter( this );
-       installEventFilter( this );
+        parent->installEventFilter( this );
+        installEventFilter( this );
 
-       mySleepTimer = new QTimer( this );
+        mySleepTimer = new QTimer( this );
         mySleepTimer->setSingleShot( true );
-       myWakeUpTimer = new QTimer( this );
+        myWakeUpTimer = new QTimer( this );
         myWakeUpTimer->setSingleShot( true );
-       connect( mySleepTimer,  SIGNAL( timeout() ), this, SLOT( onSleepTimeOut()  ) );
-       connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) );
+        connect( mySleepTimer,  SIGNAL( timeout() ), this, SLOT( onSleepTimeOut()  ) );
+        connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) );
 
   myWakeUpDelayTime = 700;
   myShowDelayTime = 5000;
@@ -80,49 +81,49 @@ QtxToolTip::~QtxToolTip()
 */
 bool QtxToolTip::eventFilter( QObject* o, QEvent* e )
 {
-       if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) )
-       {
-               hideTip();
-       }
-       if ( e->type() == QEvent::Leave )
-       {
-               if ( isVisible() && ( o == this ) )
-                       hideTip();
-               myWakeUpTimer->stop();
-       }
-       if ( e->type() == QEvent::MouseMove )
-       {
-               QMouseEvent* me = (QMouseEvent*)e;
-               QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() );
-               if ( myWakeUpTimer->isActive() )
-               {
-                       myWakeUpTimer->stop();
-                       myWakeUpTimer->start( myWakeUpDelayTime );
-               }
-               if ( isVisible() )
-               {
-                       if ( !myWidgetRegion.contains( thePos ) )
+        if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) )
+        {
+                hideTip();
+        }
+        if ( e->type() == QEvent::Leave )
+        {
+                if ( isVisible() && ( o == this ) )
+                        hideTip();
+                myWakeUpTimer->stop();
+        }
+        if ( e->type() == QEvent::MouseMove )
+        {
+                QMouseEvent* me = (QMouseEvent*)e;
+                QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() );
+                if ( myWakeUpTimer->isActive() )
+                {
+                        myWakeUpTimer->stop();
+                        myWakeUpTimer->start( myWakeUpDelayTime );
+                }
+                if ( isVisible() )
+                {
+                        if ( !myWidgetRegion.contains( thePos ) )
       {
-                               hideTip();
+                                hideTip();
         myWidgetRegion = QRect( -1, -1, -1, -1 );
       }
-               }
-               else
-               {
-                       if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) )
-                               myWakeUpTimer->start( myWakeUpDelayTime );
-               }
-       }
-       if ( e->type() == QEvent::KeyPress )
-       {
-               hideTip();
-       }
-       if ( o == parent() && ( e->type() == QEvent::MouseButtonPress ||
+                }
+                else
+                {
+                        if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) )
+                                myWakeUpTimer->start( myWakeUpDelayTime );
+                }
+        }
+        if ( e->type() == QEvent::KeyPress )
+        {
+                hideTip();
+        }
+        if ( o == parent() && ( e->type() == QEvent::MouseButtonPress ||
                           e->type() == QEvent::MouseButtonRelease ) )
-       {
-               hideTip();
-       }
-       return false;
+        {
+                hideTip();
+        }
+        return false;
 }
 
 /*!
@@ -133,10 +134,10 @@ bool QtxToolTip::eventFilter( QObject* o, QEvent* e )
 */
 void QtxToolTip::showTip( const QPoint& aPos, const QString& text, const QRect& aWidgetRegion )
 {
-       QFontMetrics theFM = fontMetrics();
-       int theHeight = theFM.height();
-       int theWidth = theFM.width( text ) + 2;
-       showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion );
+        QFontMetrics theFM = fontMetrics();
+        int theHeight = theFM.height();
+        int theWidth = theFM.width( text ) + 2;
+        showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion );
 }
 
 /*!
@@ -147,12 +148,12 @@ void QtxToolTip::showTip( const QPoint& aPos, const QString& text, const QRect&
 */
 void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect& aWidgetRegion )
 {
-       setText( text );
-       myWidgetRegion = aWidgetRegion;
-       setGeometry( aRegion );
-       if ( myShowDelayTime != 0 )
-               mySleepTimer->start( myShowDelayTime );
-       show();
+        setText( text );
+        myWidgetRegion = aWidgetRegion;
+        setGeometry( aRegion );
+        if ( myShowDelayTime != 0 )
+                mySleepTimer->start( myShowDelayTime );
+        show();
 }
 
 /*!
@@ -160,9 +161,9 @@ void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect
 */
 void QtxToolTip::hideTip()
 {
-       hide();
+        hide();
   myWidgetRegion = QRect( -1, -1, -1, -1 );
-       mySleepTimer->stop();
+        mySleepTimer->stop();
 }
 
 /*!
@@ -172,23 +173,23 @@ void QtxToolTip::hideTip()
 */
 void QtxToolTip::maybeTip( const QPoint& pos )
 {
-       QString text;
-       QRect textRegion, theRegion( -1, -1, -1, -1 );
-       QFont theFnt = font();
+        QString text;
+        QRect textRegion, theRegion( -1, -1, -1, -1 );
+        QFont theFnt = font();
 
     emit maybeTip( pos, text, theFnt, textRegion, theRegion );
 
     if ( theRegion.isValid() )
-       {
-               setFont( theFnt );
-               int margin = lineWidth() + indent();
-               QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ),
-                                        QSize( textRegion.width() + 2 * margin, textRegion.height() ) );
-               QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() );
-               if ( tipRegion.left() < 0 )
-                       tipRegion.translate( -1 * tipRegion.left(), 0 );
-               showTip( tipRegion, text, theRegion );
-       }
+        {
+                setFont( theFnt );
+                int margin = lineWidth() + indent();
+                QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ),
+                                         QSize( textRegion.width() + 2 * margin, textRegion.height() ) );
+                QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() );
+                if ( tipRegion.left() < 0 )
+                        tipRegion.translate( -1 * tipRegion.left(), 0 );
+                showTip( tipRegion, text, theRegion );
+        }
 }
 
 /*!
@@ -196,8 +197,8 @@ void QtxToolTip::maybeTip( const QPoint& pos )
 */
 void QtxToolTip::onSleepTimeOut()
 {
-       mySleepTimer->stop();
-       hideTip();
+        mySleepTimer->stop();
+        hideTip();
 }
 
 /*!
@@ -205,7 +206,7 @@ void QtxToolTip::onSleepTimeOut()
 */
 void QtxToolTip::onWakeUpTimeOut()
 {
-       myWakeUpTimer->stop();
+        myWakeUpTimer->stop();
   QPoint pos = QCursor::pos();
   if ( parentWidget() )
     pos = parentWidget()->mapFromGlobal( pos );
@@ -217,12 +218,12 @@ void QtxToolTip::onWakeUpTimeOut()
 */
 void QtxToolTip::mousePressEvent( QMouseEvent* e )
 {
-       hideTip();
-       QWidget* reciever = parentWidget();
-       QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress,
-                                                                          reciever->mapFromGlobal( e->globalPos() ),
-                                                                          e->button(), e->buttons(), Qt::KeypadModifier );
-       QApplication::sendEvent( reciever, me );
+        hideTip();
+        QWidget* reciever = parentWidget();
+        QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress,
+                                                                           reciever->mapFromGlobal( e->globalPos() ),
+                                                                           e->button(), e->buttons(), Qt::KeypadModifier );
+        QApplication::sendEvent( reciever, me );
 }
 
 /*!
@@ -230,12 +231,12 @@ void QtxToolTip::mousePressEvent( QMouseEvent* e )
 */
 void QtxToolTip::mouseDoubleClickEvent( QMouseEvent* e )
 {
-       hideTip();
-       QWidget* reciever = parentWidget();
-       QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick,
-                                                                          reciever->mapFromGlobal( e->globalPos() ),
-                                                                          e->button(), e->buttons(), Qt::KeypadModifier );
-       QApplication::sendEvent( reciever, me );
+        hideTip();
+        QWidget* reciever = parentWidget();
+        QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick,
+                                                                           reciever->mapFromGlobal( e->globalPos() ),
+                                                                           e->button(), e->buttons(), Qt::KeypadModifier );
+        QApplication::sendEvent( reciever, me );
 }
 
 /*!
index 1af9afe9a3e674609e1a03959433c75760f505c6..b86f2cd85aaec7877f9992d466060e867f59576f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxToolTip.h
 // Author:    Sergey TELKOV
 //
@@ -33,20 +34,20 @@ class QTimer;
 
 class QTX_EXPORT QtxToolTip : public QLabel
 {
-       Q_OBJECT
+        Q_OBJECT
 
 public:
-       QtxToolTip( QWidget* = 0 );
-       virtual ~QtxToolTip();
+        QtxToolTip( QWidget* = 0 );
+        virtual ~QtxToolTip();
 
-       void          hideTip();
+        void          hideTip();
   
-       virtual void  showTip( const QPoint& aPos,
+        virtual void  showTip( const QPoint& aPos,
                          const QString& text, const QRect& aWidgetRegion );
-       virtual void  showTip( const QRect& aRegion,
+        virtual void  showTip( const QRect& aRegion,
                          const QString& text, const QRect& aWidgetRegion );
 
-       virtual bool  eventFilter( QObject* o, QEvent* e );
+        virtual bool  eventFilter( QObject* o, QEvent* e );
 
   void          setWakeUpDelayTime( int );
   void          setShowDelayTime( int );
@@ -58,21 +59,21 @@ signals:
   void          maybeTip( QPoint, QString&, QFont&, QRect&, QRect& );
 
 protected slots:
-       void          onSleepTimeOut();
-       void          onWakeUpTimeOut();
+        void          onSleepTimeOut();
+        void          onWakeUpTimeOut();
 
 protected:
-       virtual void  maybeTip( const QPoint& );
-       virtual void  mousePressEvent( QMouseEvent* );
-       virtual void  mouseDoubleClickEvent( QMouseEvent* );
+        virtual void  maybeTip( const QPoint& );
+        virtual void  mousePressEvent( QMouseEvent* );
+        virtual void  mouseDoubleClickEvent( QMouseEvent* );
 
   QTimer*       sleepTimer() const;
   QTimer*       wakeUpTimer() const;
 
 private:
-       QTimer*       myWakeUpTimer;
-       QTimer*       mySleepTimer;
-       QRect         myWidgetRegion;
+        QTimer*       myWakeUpTimer;
+        QTimer*       mySleepTimer;
+        QRect         myWidgetRegion;
 
   int           myShowDelayTime;
   int           myWakeUpDelayTime;
index 624dfba327a0391d45bf822c1110a27416b53ad6..2e7666d472df9ece6c12a8357307d90dd431b60e 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTranslator.cxx
 // Author:    Alexander SOLOVYOV
 //
index 99d1d78bacaf4cb499b8e2b8aed0b9a5d08f89c2..731b98b99da7b3af4341b13ef17c2f82091795ab 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTranslator.h
 // Author:    Alexander SOLOVYOV
 //
index 6e6ef8baf0ee362f6f700ccf6c061f313f68cdf8..b12d039e91efcc8420cf85087d53db5ab464bd4c 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTreeView.cxx
 // Author:    Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -110,13 +108,13 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e )
     QIcon icon;
     if ( iconData.isValid() ) {
       if ( qVariantCanConvert<QIcon>( iconData ) )
-       icon = qVariantValue<QIcon>( iconData );
+        icon = qVariantValue<QIcon>( iconData );
       else if ( qVariantCanConvert<QPixmap>( iconData ) )
-       icon = qVariantValue<QPixmap>( iconData );
+        icon = qVariantValue<QPixmap>( iconData );
     }
     if( ( !lab.isEmpty() || !icon.isNull() ) && 
-           appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
-       {
+            appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
+        {
       QAction* a = menu.addAction( icon, lab );
       a->setCheckable( true );
       a->setChecked( !isSectionHidden( i ) );
@@ -126,7 +124,7 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e )
   QAction* sortAction = 0;
   if ( count() > 0 && myEnableSortMenu ) {
     menu.addSeparator();
-    sortAction = menu.addAction( tr( "Enable sorting" ) );
+    sortAction = menu.addAction( QtxTreeView::tr( "Enable sorting" ) );
     sortAction->setCheckable( true );
     sortAction->setChecked( isSortIndicatorShown() );
   }
@@ -141,15 +139,15 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e )
       setClickable( a->isChecked() );
       QtxTreeView* view = qobject_cast<QtxTreeView*>( parent() );
       if ( view ) {
-       view->emitSortingEnabled( a->isChecked() );
-       if ( a->isChecked() ) {
-         connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
-         view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
-       }
-       else {
-         disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
-         view->sortByColumn( 0, Qt::AscendingOrder );
-       }
+        view->emitSortingEnabled( a->isChecked() );
+        if ( a->isChecked() ) {
+          connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+          view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
+        }
+        else {
+          disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+          view->sortByColumn( 0, Qt::AscendingOrder );
+        }
       }
     }
   }
@@ -315,7 +313,7 @@ void QtxTreeView::onHeaderClicked( int column )
   \param deselected previous selection
 */
 void QtxTreeView::selectionChanged( const QItemSelection& selected, 
-                                   const QItemSelection& deselected )
+                                    const QItemSelection& deselected )
 {
   QTreeView::selectionChanged( selected, deselected );
   emit( selectionChanged() );
@@ -329,7 +327,11 @@ void QtxTreeView::selectionChanged( const QItemSelection& selected,
 */
 void QtxTreeView::rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end )
 {
-  setCurrentIndex( QModelIndex() );
+  QModelIndex curIndex = currentIndex();
+  while ( curIndex.isValid() && curIndex.parent() != parent )
+    curIndex = curIndex.parent();
+  if ( curIndex.isValid() && curIndex.row() >= start && curIndex.row() <= end )
+    setCurrentIndex( QModelIndex() );
   QTreeView::rowsAboutToBeRemoved( parent, start, end );
 }
 
@@ -384,15 +386,15 @@ void QtxTreeView::setModel( QAbstractItemModel* m )
   QTreeView::setModel( m );
   if ( model() )
     connect( model(), SIGNAL( headerDataChanged( Qt::Orientation, int, int ) ),
-            this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
+             this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
 }
 
 void QtxTreeView::onAppropriate( Qt::Orientation orient, int first, int last )
 {
   if( orient==Qt::Horizontal )
     for( int i=first; i<=last; i++ )
-       {
-         int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt();
-         header()->setSectionHidden( i, appr==Qtx::Hidden );
-       }
+        {
+          int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt();
+          header()->setSectionHidden( i, appr==Qtx::Hidden );
+        }
 }
index 2a65382b2d8e65bd60d5d219e69d0035f5ce7e0e..ee70270afd3dd522b3175b979b84d152b5ce036f 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxTreeView.h
 // Author:    Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index 6529d9e2df7deb0b285521d9e9141cd42eee090b..4d3cf7d70b23a7dd86b589ca3219491e2bc7c6b5 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxValidator.cxx
 // Author:    Alexandre SOLOVYOV
 //
@@ -102,7 +100,7 @@ QtxDoubleValidator::QtxDoubleValidator( QObject* parent )
   \param parent parent object
 */
 QtxDoubleValidator::QtxDoubleValidator( const double bot, const double top,
-                                       const int dec, QObject* parent )
+                                        const int dec, QObject* parent )
 : QDoubleValidator( bot, top, dec, parent )
 {
 }
index 4f02deb6753230cd7a80f1c7ed435d36a365e78a..b612ef8748c70a8aa73d6af94af896f5022f5089 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxValidator.h
 // Author:    Alexandre SOLOVYOV
 //
index 90bef875b2d661216013c049289461e352577bf3..bcdb2998950c73c4e938eb0ade36b973f48e11de 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkspace.cxx
 // Author:    Sergey TELKOV
 //
index 85bab25c08da6518b884a23e4793f193219c92ee..a6422cc6439ac3bced659732bd8a191ba0ff76ee 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkspace.h
 // Author:    Sergey TELKOV
 //
index d2d517977ff91341659cb330944400bcaf73a98a..5ec40bc3693109bab0040581d7e4b65551c11469 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkspaceAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -251,12 +252,12 @@ void QtxWorkspaceAction::cascade()
 
   ws->cascade();
 
-       int w = ws->width();
-       int h = ws->height();
+        int w = ws->width();
+        int h = ws->height();
 
-       QWidgetList winList = ws->windowList();
+        QWidgetList winList = ws->windowList();
   for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
-               (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
+                (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
 }
 
 /*!
index 0f5d89360530a1c692c2a9636c1dbe58cc80a823..d6719f88e9cab1f32f006b1b5332273cdeab2dfe 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkspaceAction.h
 // Author:    Sergey TELKOV
 //
index f67e0cdb291380f5924448e6f4466eebd83f7cff..6607e2f1e07ef0e7aa8c3232113389837f6039f4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkstack.cxx
 // Author:    Sergey TELKOV
 //
@@ -31,7 +32,7 @@
 #include <QRegExp>
 #include <QLayout>
 #include <QPainter>
-#include <QSplitter>
+#include <QDataStream>
 #include <QFocusEvent>
 #include <QMouseEvent>
 #include <QRubberBand>
 class QtxWorkstackArea::WidgetEvent : public QEvent
 {
 public:
-  WidgetEvent( Type t, QWidget* w = 0 ) : QEvent( t ), myWidget( w ) {};
+  WidgetEvent( Type t, QtxWorkstackChild* w = 0 ) : QEvent( t ), myChild( w ) {};
+
+  QtxWorkstackChild* child() const { return myChild; }
+
+private:
+  QtxWorkstackChild* myChild;   // event receiver widget
+};
+
+/*!
+  \class QtxWorkstackArea::RestoreEvent
+  \internal
+  \brief Internal class used to forward restore info events to the workarea
+*/
+
+class QtxWorkstackArea::RestoreEvent : public QtxWorkstackArea::WidgetEvent
+{
+public:
+  RestoreEvent( Type t, int id, int f, QtxWorkstackChild* w )
+  : WidgetEvent( t, w ), myId( id ), myFlags( f ) {};
 
-  QWidget* widget() const { return myWidget; }
+  int                id() const { return myId; }
+  int                flags() const { return myFlags; }
 
 private:
-  QWidget* myWidget;   // event receiver widget
+  int                myId;
+  int                myFlags;
 };
 
 /*!
@@ -168,13 +189,13 @@ void QtxWorkstackDrag::setTarget( QtxWorkstackArea* area, const int tab )
 
 /*!
   \brief Called when drop operation is finished.
-  
+
   Inserts dropped widget to the target workarea.
 */
 void QtxWorkstackDrag::dropWidget()
 {
   if ( myArea )
-    myArea->insertWidget( myChild->widget(), myTab );
+    myArea->insertChild( myChild, myTab );
 }
 
 /*!
@@ -280,7 +301,7 @@ QSize CloseButton::sizeHint() const
 {
   ensurePolished();
   int dim = 0;
-  if( !icon().isNull() ) 
+  if( !icon().isNull() )
   {
     const QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ),
                                       QIcon::Normal );
@@ -295,8 +316,8 @@ QSize CloseButton::sizeHint() const
   \return minimum size value
 */
 QSize CloseButton::minimumSizeHint() const
-{ 
-  return sizeHint(); 
+{
+  return sizeHint();
 }
 
 /*!
@@ -352,11 +373,142 @@ void CloseButton::paintEvent( QPaintEvent* )
 
   QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), isEnabled() ?
                               underMouse() ? QIcon::Active : QIcon::Normal
-                             : QIcon::Disabled,
+                              : QIcon::Disabled,
                               isDown() ? QIcon::On : QIcon::Off );
   style()->drawItemPixmap( &p, r, Qt::AlignCenter, pm );
 }
 
+
+/*!
+  \class QtxWorkstackSplitter
+  \internal
+  \brief Workstack splitter.
+*/
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+*/
+QtxWorkstackSplitter::QtxWorkstackSplitter( QWidget* parent )
+: QSplitter( parent )
+{
+  setChildrenCollapsible( false );
+}
+
+/*!
+  \brief Destructor.
+*/
+QtxWorkstackSplitter::~QtxWorkstackSplitter()
+{
+}
+
+/*!
+  \brief Get parent workstack
+  \return workstack owning this workarea
+*/
+QtxWorkstack* QtxWorkstackSplitter::workstack() const
+{
+  QtxWorkstack* ws = 0;
+  QWidget* wid = parentWidget();
+  while ( wid && !ws )
+  {
+    ws = ::qobject_cast<QtxWorkstack*>( wid );
+    wid = wid->parentWidget();
+  }
+  return ws;
+}
+
+/*!
+  \brief Save the widget area configuration into data stream.
+*/
+void QtxWorkstackSplitter::saveState( QDataStream& stream ) const
+{
+  stream << QtxWorkstack::SplitMarker;
+
+  uchar flags = 0;
+  if ( orientation() == Qt::Horizontal )
+    flags |= QtxWorkstack::Horizontal;
+
+  stream << flags;
+  stream << count();
+
+  QList<int> sz = sizes();
+  for ( QList<int>::const_iterator it = sz.begin(); it != sz.end(); ++it )
+    stream << *it;
+
+  for ( int i = 0; i < count(); i++ )
+  {
+    QWidget* wid = widget( i );
+    QtxWorkstackSplitter* split = ::qobject_cast<QtxWorkstackSplitter*>( wid );
+    if ( split )
+      split->saveState( stream );
+    else
+    {
+      QtxWorkstackArea* area = ::qobject_cast<QtxWorkstackArea*>( wid );
+      if ( area )
+              area->saveState( stream );
+    }
+  }
+}
+
+/*!
+  \brief Restore the widget area configuration from data stream info.
+  \return \c true in successful case.
+*/
+bool QtxWorkstackSplitter::restoreState( QDataStream& stream, QMap<QString, QtxWorkstackChild*>& map )
+{
+  int num = 0;
+  uchar flags = 0;
+
+  stream >> flags;
+  stream >> num;
+
+  setOrientation( flags & QtxWorkstack::Horizontal ? Qt::Horizontal : Qt::Vertical );
+
+  QList<int> sz;
+  for ( int s = 0; s < num; s++ )
+  {
+    int sn = 0;
+    stream >> sn;
+    sz.append( sn );
+  }
+
+  bool ok = true;
+  for ( int i = 0; i < num && ok; i++ )
+  {
+    int marker;
+    stream >> marker;
+
+    if ( stream.status() != QDataStream::Ok )
+      return false;
+
+    if ( marker == QtxWorkstack::SplitMarker )
+    {
+      QtxWorkstackSplitter* split = new QtxWorkstackSplitter( this );
+      addWidget( split );
+      split->setVisible( true );
+
+      ok = split->restoreState( stream, map );
+    }
+    else if ( marker == QtxWorkstack::AreaMarker )
+    {
+      QtxWorkstack* ws = workstack();
+      QtxWorkstackArea* area = ws->createArea( this );
+      addWidget( area );
+      area->setVisible( true );
+
+      ok = area->restoreState( stream, map );
+    }
+    else
+      return false;
+  }
+
+  if ( ok )
+    setSizes( sz );
+
+  return ok;
+}
+
 /*!
   \class QtxWorkstackArea
   \internal
@@ -430,8 +582,8 @@ bool QtxWorkstackArea::isNull() const
 bool QtxWorkstackArea::isEmpty() const
 {
   bool res = false;
-  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !res; ++it )
-    res = it.value().vis;
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !res; ++it )
+    res = (*it)->visibility();
   return !res;
 }
 
@@ -442,28 +594,49 @@ bool QtxWorkstackArea::isEmpty() const
   \param f widget flags
   \return child widget container object (or 0 if index is invalid)
 */
-QWidget* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::WindowFlags f )
+QtxWorkstackChild* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::WindowFlags f )
 {
   if ( !wid )
     return 0;
 
-  int pos = myList.indexOf( wid );
+  QtxWorkstackChild* c = child( wid );
+  if ( !c )
+    c = new QtxWorkstackChild( wid, myStack, f );
+
+  insertChild( c, idx );
+
+  return c;
+}
+
+void QtxWorkstackArea::insertChild( QtxWorkstackChild* child, const int idx )
+{
+  if ( !child )
+    return;
+
+  QtxWorkstackArea* a = child->area();
+  if ( a && a != this )
+    a->removeChild( child, false );
+
+  int pos = myList.indexOf( child );
   if ( pos != -1 && ( pos == idx || ( idx < 0 && pos == (int)myList.count() - 1 ) ) )
-    return 0;
+    return;
+
+  bool found = myList.contains( child );
 
-  myList.removeAll( wid );
+  myList.removeAll( child );
   pos = idx < 0 ? myList.count() : idx;
-  myList.insert( qMin( pos, (int)myList.count() ), wid );
-  if ( !myInfo.contains( wid ) )
+  myList.insert( qMin( pos, (int)myList.count() ), child );
+
+  if ( !found )
   {
-    QtxWorkstackChild* child = new QtxWorkstackChild( wid, myStack, f );
-    myChild.insert( wid, child );
-    myInfo.insert( wid, WidgetInfo() );
-    myInfo[wid].id = generateId();
-    myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() );
+    bool hasId = false;
+    for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !hasId; ++it )
+      hasId = (*it)->id() == child->id();
+
+    if ( hasId || child->id() < 0 )
+      child->setId( generateId() );
 
     connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
-    connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) );
     connect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
     connect( child, SIGNAL( hidden( QtxWorkstackChild* ) ), this, SLOT( onChildHidden( QtxWorkstackChild* ) ) );
     connect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
@@ -472,10 +645,8 @@ QWidget* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::Window
 
   updateState();
 
-  setWidgetActive( wid );
-  wid->setFocus();
-
-  return myChild[wid];
+  setWidgetActive( child->widget() );
+  child->widget()->setFocus();
 }
 
 /*!
@@ -497,37 +668,42 @@ void QtxWorkstackArea::onContextMenuRequested( QPoint p )
 }
 
 /*!
-  \brief Called when area's child widget is destroyed.
-
-  Removes child widget from the area.
+  \brief Remove widget from workarea.
+  \param wid widget to be removed
+  \param del if \c true the widget should be also deleted
 */
-void QtxWorkstackArea::onWidgetDestroyed()
+void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
 {
-  if ( sender() )
-    removeWidget( (QWidget*)sender(), false );
+  removeChild( child( wid ), del );
 }
 
 /*!
-  \brief Remove widget from workarea.
-  \param wid widget to be removed
+  \brief Remove child from workarea.
+  \param child child to be removed
   \param del if \c true the widget should be also deleted
 */
-void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
+void QtxWorkstackArea::removeChild( QtxWorkstackChild* child, const bool del )
 {
-  if ( !myList.contains( wid ) )
+  if ( !myList.contains( child ) )
     return;
 
-  if ( myBar->indexOf( widgetId( wid ) ) != -1 )
-    myBar->removeTab( myBar->indexOf( widgetId( wid ) ) );
+  myStack->removeWidget( child );
 
-  myStack->removeWidget( child( wid ) );
+  if ( myBar->indexOf( child->id() ) != -1 )
+    myBar->removeTab( myBar->indexOf( child->id() ) );
 
-  myList.removeAll( wid );
-  myInfo.remove( wid );
-  myChild.remove( wid );
+  myList.removeAll( child );
 
   if ( del )
-    delete child( wid );
+    delete child;
+  else if ( child->widget() )
+  {
+    disconnect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
+    disconnect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
+    disconnect( child, SIGNAL( hidden( QtxWorkstackChild* ) ), this, SLOT( onChildHidden( QtxWorkstackChild* ) ) );
+    disconnect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
+    disconnect( child, SIGNAL( captionChanged( QtxWorkstackChild* ) ), this, SLOT( onChildCaptionChanged( QtxWorkstackChild* ) ) );
+  }
 
   if ( isNull() )
     deleteLater();
@@ -535,6 +711,11 @@ void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
     updateState();
 }
 
+QList<QtxWorkstackChild*> QtxWorkstackArea::childList() const
+{
+  return myList;
+}
+
 /*!
   \brief Get all visible child widgets.
   \return list of visible child widgets
@@ -542,10 +723,11 @@ void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
 QWidgetList QtxWorkstackArea::widgetList() const
 {
   QWidgetList lst;
-  for ( QWidgetList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
   {
-    if ( widgetVisibility( *it ) )
-      lst.append( *it );
+    QtxWorkstackChild* c = *it;
+    if ( c->visibility() )
+      lst.append( c->widget() );
   }
   return lst;
 }
@@ -575,26 +757,7 @@ void QtxWorkstackArea::setActiveWidget( QWidget* wid )
 */
 bool QtxWorkstackArea::contains( QWidget* wid ) const
 {
-  return myList.contains( wid );
-}
-
-/*!
-  \brief Show/hide workarea.
-  \param on new visibility state
-*/
-void QtxWorkstackArea::setVisible( bool on )
-{
-  QMap<QWidget*, bool> map;
-  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
-  {
-    map.insert( *it, isBlocked( *it ) );
-    setBlocked( *it, true );
-  }
-
-  QFrame::setVisible( on );
-
-  for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
-    setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
+  return child( wid );
 }
 
 /*!
@@ -628,8 +791,7 @@ QtxWorkstack* QtxWorkstackArea::workstack() const
   QWidget* wid = parentWidget();
   while ( wid && !ws )
   {
-    if ( wid->inherits( "QtxWorkstack" ) )
-      ws = (QtxWorkstack*)wid;
+    ws = ::qobject_cast<QtxWorkstack*>( wid );
     wid = wid->parentWidget();
   }
   return ws;
@@ -664,6 +826,82 @@ bool QtxWorkstackArea::eventFilter( QObject* o, QEvent* e )
   return false;
 }
 
+/*!
+  \brief Save the own widgets configuration into data stream.
+*/
+void QtxWorkstackArea::saveState( QDataStream& stream ) const
+{
+  stream << QtxWorkstack::AreaMarker;
+  stream << myList.count();
+  stream << myBar->tabId( myBar->currentIndex() );
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+  {
+    QtxWorkstackChild* c = *it;
+
+    stream << QtxWorkstack::WidgetMarker;
+
+    stream << c->widget()->objectName();
+    stream << c->id();
+
+    uchar flags = 0;
+    if ( c->visibility() )
+      flags |= QtxWorkstack::Visible;
+
+    stream << flags;
+  }
+}
+
+/*!
+  \brief Restore the widgets configuration from data stream info.
+  \return \c true in successful case.
+*/
+bool QtxWorkstackArea::restoreState( QDataStream& stream, QMap<QString, QtxWorkstackChild*>& map )
+{
+  int num = 0;
+  int cur = -1;
+
+  stream >> num;
+  stream >> cur;
+
+  QtxWorkstackChild* curChild = 0;
+  for ( int i = 0; i < num; i++ )
+  {
+    int marker;
+    stream >> marker;
+
+    if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::WidgetMarker )
+      return false;
+
+    QString name;
+    stream >> name;
+
+    int id = -1;
+    stream >> id;
+
+    uchar flags = 0;
+    stream >> flags;
+
+    QtxWorkstackChild* c = map.contains( name ) ? map[name] : 0;
+    if ( !c )
+    {
+      qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toLatin1() );
+      return false;
+    }
+
+    map.remove( name );
+
+    if ( id == cur )
+      curChild = c;
+
+    QApplication::postEvent( this, new RestoreEvent( (QEvent::Type)RestoreWidget, id, flags, c ) );
+  }
+
+  if ( curChild )
+    QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)MakeCurrent, curChild ) );
+
+  return true;
+}
+
 /*!
   \brief Get rectangle to be drawn when highlighting drop area.
   \return area drop rectangle
@@ -727,17 +965,30 @@ void QtxWorkstackArea::customEvent( QEvent* e )
         if ( activeWidget()->focusWidget()->hasFocus() )
         {
           QFocusEvent in( QEvent::FocusIn );
-         QApplication::sendEvent( this, &in );
-       }
-        else {
+                QApplication::sendEvent( this, &in );
+              }
+        else
+        {
           activeWidget()->focusWidget()->setFocus();
-         myBar->updateActiveState();
-       }
+                myBar->updateActiveState();
+              }
       }
     }
     break;
-  case RemoveWidget:
-    removeWidget( we->widget() );
+  case MakeCurrent:
+    if ( we->child()->widget() )
+      setActiveWidget( we->child()->widget() );
+    break;
+  case RestoreWidget:
+    if ( we->child() )
+    {
+      QtxWorkstackChild* c = we->child();
+      RestoreEvent* re = (RestoreEvent*)we;
+      if ( c->widget() )
+        c->widget()->setVisible( re->flags() & QtxWorkstack::Visible );
+      c->setId( re->id() );
+      insertChild( c );
+    }
     break;
   default:
     break;
@@ -807,19 +1058,7 @@ void QtxWorkstackArea::onDragActiveTab()
 */
 void QtxWorkstackArea::onChildDestroyed( QObject* obj )
 {
-  QtxWorkstackChild* child = (QtxWorkstackChild*)obj;
-  myStack->removeWidget( child );
-
-  QWidget* wid = 0;
-  for ( ChildMap::ConstIterator it = myChild.begin(); it != myChild.end() && !wid; ++it )
-  {
-    if ( it.value() == child )
-      wid = it.key();
-  }
-
-  myChild.remove( wid );
-
-  QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)RemoveWidget, wid ) );
+  removeChild( (QtxWorkstackChild*)obj, false );
 }
 
 /*!
@@ -828,7 +1067,7 @@ void QtxWorkstackArea::onChildDestroyed( QObject* obj )
 */
 void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c )
 {
-  setWidgetShown( c->widget(), true );
+  updateState();
 }
 
 /*!
@@ -837,7 +1076,7 @@ void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c )
 */
 void QtxWorkstackArea::onChildHidden( QtxWorkstackChild* c )
 {
-  setWidgetShown( c->widget(), false );
+  updateState();
 }
 
 /*!
@@ -865,19 +1104,9 @@ void QtxWorkstackArea::onChildCaptionChanged( QtxWorkstackChild* c )
 */
 void QtxWorkstackArea::updateCurrent()
 {
-  QMap<QWidget*, bool> map;
-  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
-  {
-    map.insert( *it, isBlocked( *it ) );
-    setBlocked( *it, true );
-  }
-
   QWidget* cur = child( widget( myBar->tabId( myBar->currentIndex() ) ) );
   if ( cur )
     myStack->setCurrentWidget( cur );
-
-  for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
-    setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
 }
 
 /*!
@@ -901,13 +1130,9 @@ void QtxWorkstackArea::updateTab( QWidget* wid )
 */
 QWidget* QtxWorkstackArea::widget( const int id ) const
 {
-  QWidget* wid = 0;
-  for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !wid; ++it )
-  {
-    if ( it.value().id == id )
-      wid = it.key();
-  }
-  return wid;
+  QtxWorkstackChild* c = child( id );
+
+  return c ? c->widget() : 0;
 }
 
 /*!
@@ -917,23 +1142,9 @@ QWidget* QtxWorkstackArea::widget( const int id ) const
 */
 int QtxWorkstackArea::widgetId( QWidget* wid ) const
 {
-  int id = -1;
-  if ( myInfo.contains( wid ) )
-    id = myInfo[wid].id;
-  return id;
-}
+  QtxWorkstackChild* c = child( wid );
 
-/*!
-  \brief Get child widget's visibility.
-  \param wid widget
-  \return \c true if widget is visible
-*/
-bool QtxWorkstackArea::widgetVisibility( QWidget* wid ) const
-{
-  bool res = false;
-  if ( myInfo.contains( wid ) )
-    res = myInfo[wid].vis;
-  return res;
+  return c ? c->id() : -1;
 }
 
 /*!
@@ -949,20 +1160,6 @@ void QtxWorkstackArea::setWidgetActive( QWidget* wid )
   myBar->setCurrentIndex( myBar->indexOf( id ) );
 }
 
-/*!
-  \brief Show/hide child widget.
-  \param wid widget
-  \param on new visibility state
-*/
-void QtxWorkstackArea::setWidgetShown( QWidget* wid, const bool on )
-{
-  if ( isBlocked( wid ) || !myInfo.contains( wid ) || myInfo[wid].vis == on )
-    return;
-
-  myInfo[wid].vis = on;
-  updateState();
-}
-
 /*!
   \brief Update internal state.
 */
@@ -979,15 +1176,16 @@ void QtxWorkstackArea::updateState()
   QWidget* prev = activeWidget();
 
   int idx = 0;
-  for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
+  for ( ChildList::iterator it = myList.begin(); it != myList.end(); ++it )
   {
-    QWidget* wid = *it;
-    int id = widgetId( wid );
+    QtxWorkstackChild* cont = *it;
+    QWidget* wid = cont->widget();;
+    int id = cont->id();
 
     if ( id < 0 )
       continue;
 
-    bool vis = widgetVisibility( wid );
+    bool vis = cont->visibility();
 
     int cIdx = myBar->indexOf( id );
     if ( cIdx != -1 && ( !vis || myBar->indexOf( id ) != idx ) )
@@ -998,11 +1196,6 @@ void QtxWorkstackArea::updateState()
 
     updateTab( wid );
 
-    bool block = isBlocked( wid );
-    setBlocked( wid, true );
-
-    QtxWorkstackChild* cont = child( wid );
-
     if ( !vis )
       myStack->removeWidget( cont );
     else if ( myStack->indexOf( cont ) < 0 )
@@ -1010,29 +1203,27 @@ void QtxWorkstackArea::updateState()
 
     if ( vis )
       idx++;
-
-    setBlocked( wid, block );
   }
 
   int curId = widgetId( prev );
   if ( myBar->indexOf( curId ) < 0 )
   {
-    QWidget* wid = 0;
-    int pos = myList.indexOf( prev );
-    for ( int i = pos - 1; i >= 0 && !wid; i-- )
+    QtxWorkstackChild* c = 0;
+    int pos = myList.indexOf( child( prev ) );
+    for ( int i = pos - 1; i >= 0 && !c; i-- )
     {
-      if ( widgetVisibility( myList.at( i ) ) )
-        wid = myList.at( i );
+      if ( myList.at( i )->visibility() )
+        c = myList.at( i );
     }
 
-    for ( int j = pos + 1; j < (int)myList.count() && !wid; j++ )
+    for ( int j = pos + 1; j < (int)myList.count() && !c; j++ )
     {
-      if ( widgetVisibility( myList.at( j ) ) )
-        wid = myList.at( j );
+      if ( myList.at( j )->visibility() )
+        c = myList.at( j );
     }
 
-    if ( wid )
-      curId = widgetId( wid );
+    if ( c )
+      curId = c->id();
   }
 
   myBar->setCurrentIndex( myBar->indexOf( curId ) );
@@ -1076,8 +1267,8 @@ int QtxWorkstackArea::generateId() const
 {
   QMap<int, int> map;
 
-  for ( WidgetInfoMap::const_iterator it = myInfo.begin(); it != myInfo.end(); ++it )
-    map.insert( it.value().id, 0 );
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+    map.insert( (*it)->id(), 0 );
 
   int id = 0;
   while ( map.contains( id ) )
@@ -1086,29 +1277,6 @@ int QtxWorkstackArea::generateId() const
   return id;
 }
 
-/*!
-  \brief Check if the child wiget is blocked.
-  \param wid widget
-  \return \c true if the widget is blocked
-*/
-bool QtxWorkstackArea::isBlocked( QWidget* wid ) const
-{
-  return myBlock.contains( wid );
-}
-
-/*!
-  \brief Block widget.
-  \param wid widget
-  \param on new blocked state
-*/
-void QtxWorkstackArea::setBlocked( QWidget* wid, const bool on )
-{
-  if ( on )
-    myBlock.insert( wid, 0 );
-  else
-    myBlock.remove( wid );
-}
-
 /*!
   \brief Get child widget container.
   \param wid child widget
@@ -1117,11 +1285,25 @@ void QtxWorkstackArea::setBlocked( QWidget* wid, const bool on )
 QtxWorkstackChild* QtxWorkstackArea::child( QWidget* wid ) const
 {
   QtxWorkstackChild* res = 0;
-  if ( myChild.contains( wid ) )
-    res = myChild[wid];
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !res; ++it )
+  {
+    if ( (*it)->widget() == wid )
+      res = *it;
+  }
   return res;
 }
 
+QtxWorkstackChild* QtxWorkstackArea::child( const int id ) const
+{
+  QtxWorkstackChild* c = 0;
+  for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !c; ++it )
+  {
+    if ( (*it)->id() == id )
+      c = *it;
+  }
+  return c;
+}
+
 /*!
   \fn void QtxWorkstackArea::activated( QWidget* w )
   \brief Emitted when child widget is activated.
@@ -1155,15 +1337,23 @@ QtxWorkstackChild* QtxWorkstackArea::child( QWidget* wid ) const
 */
 QtxWorkstackChild::QtxWorkstackChild( QWidget* wid, QWidget* parent, Qt::WindowFlags f )
 : QWidget( parent ),
+  myId( 0 ),
   myWidget( wid )
 {
-  myWidget->setParent( this, f );
-  myWidget->installEventFilter( this );
-  QVBoxLayout* base = new QVBoxLayout( this );
-  base->setMargin( 0 );
-  base->addWidget( myWidget );
+  if ( myWidget )
+  {
+    myWidget->setParent( this, f );
+    myWidget->installEventFilter( this );
+    if ( myWidget->focusProxy() )
+      myWidget->focusProxy()->installEventFilter( this );
+    myWidget->setVisible( myWidget->isVisibleTo( myWidget->parentWidget() ) );
+
+    QVBoxLayout* base = new QVBoxLayout( this );
+    base->setMargin( 0 );
+    base->addWidget( myWidget );
 
-  connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+    connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+  }
 }
 
 /*!
@@ -1180,6 +1370,8 @@ QtxWorkstackChild::~QtxWorkstackChild()
 
   widget()->hide();
   widget()->removeEventFilter( this );
+  if ( widget()->focusProxy() )
+    widget()->focusProxy()->removeEventFilter( this );
 
   widget()->setParent( 0 );
 }
@@ -1193,6 +1385,43 @@ QWidget* QtxWorkstackChild::widget() const
   return myWidget;
 }
 
+/*!
+  \brief Returns the id.
+*/
+int QtxWorkstackChild::id() const
+{
+  return myId;
+}
+
+/*!
+  \brief Sets the id.
+*/
+void QtxWorkstackChild::setId( const int id )
+{
+  myId = id;
+}
+
+/*!
+  \brief Returns true if this child window should be visible.
+*/
+bool QtxWorkstackChild::visibility()
+{
+  return myWidget ? myWidget->isVisibleTo( this ) : false;
+}
+
+QtxWorkstackArea* QtxWorkstackChild::area() const
+{
+  QtxWorkstackArea* a = 0;
+  QWidget* w = parentWidget();
+  while ( !a && w )
+  {
+    a = ::qobject_cast<QtxWorkstackArea*>( w );
+    w = w->parentWidget();
+  }
+
+  return a;
+}
+
 /*!
   \brief Custom event filter.
 
@@ -1227,10 +1456,6 @@ bool QtxWorkstackChild::eventFilter( QObject* o, QEvent* e )
 */
 void QtxWorkstackChild::onDestroyed( QObject* obj )
 {
-  if ( obj != widget() )
-    return;
-
-  myWidget = 0;
   deleteLater();
 }
 
@@ -1284,7 +1509,7 @@ void QtxWorkstackChild::childEvent( QChildEvent* e )
 */
 QtxWorkstackTabBar::QtxWorkstackTabBar( QWidget* parent )
 : QTabBar( parent ),
-  myId( -1 )
+  myId( -1 ),myActive(false)
 {
   setDrawBase( true );
   setElideMode( Qt::ElideNone );
@@ -1469,11 +1694,11 @@ void QtxWorkstackTabBar::paintLabel( QPainter* p, const QRect& br, QTab* t, bool
   \brief Workstack widget.
 
   Organizes the child widgets in the tabbed space.
-  Allows splitting the working area to arrange the child widgets in 
+  Allows splitting the working area to arrange the child widgets in
   arbitrary way. Any widgets can be moved to another working area with
   drag-n-drop operation.
 
-  This widget can be used as workspace of the application main window, 
+  This widget can be used as workspace of the application main window,
   for example, as kind of implementation of multi-document interface.
 */
 
@@ -1508,8 +1733,7 @@ QtxWorkstack::QtxWorkstack( QWidget* parent )
   QVBoxLayout* base = new QVBoxLayout( this );
   base->setMargin( 0 );
 
-  mySplit = new QSplitter( this );
-  mySplit->setChildrenCollapsible( false );
+  mySplit = new QtxWorkstackSplitter( this );
   base->addWidget( mySplit );
 }
 
@@ -1521,9 +1745,9 @@ QtxWorkstack::~QtxWorkstack()
 }
 
 /*!
-  \brief Get list of all widgets in all areas or in specified area which given 
+  \brief Get list of all widgets in all areas or in specified area which given
          widget belongs to
-  \param wid widget specifying area if it is equal to null when widgets of all 
+  \param wid widget specifying area if it is equal to null when widgets of all
          areas are retuned
   \return list of widgets
 */
@@ -1534,7 +1758,7 @@ QWidgetList QtxWorkstack::windowList( QWidget* wid ) const
   {
     areas( mySplit, lst, true );
   }
-  else 
+  else
   {
     QtxWorkstackArea* area = wgArea( wid );
     if ( area )
@@ -1643,7 +1867,6 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType
   QList<QtxWorkstackArea*> allAreas;
   areas(mySplit, allAreas, true);
 
-
   for ( QList<QtxWorkstackArea*>::iterator it = allAreas.begin(); it != allAreas.end() && !area; ++it )
   {
     if ( (*it)->contains( wid ) )
@@ -1653,6 +1876,10 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType
   if ( !area )
     return;
 
+  QWidget* curWid = area->activeWidget();
+  if ( !curWid )
+    return;
+
   QWidgetList wids = area->widgetList();
   if ( wids.count() < 2 )
     return;
@@ -1686,6 +1913,7 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType
       {
         area->removeWidget( wid_i );
         newArea->insertWidget( wid_i );
+        wid_i->showMaximized();
       }
     }
     break;
@@ -1699,16 +1927,21 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType
       {
         area->removeWidget( *itr );
         newArea->insertWidget( *itr );
+        (*itr)->showMaximized();
       }
     }
     break;
   case SplitMove:
     area->removeWidget( wid );
     newArea->insertWidget( wid );
+    wid->showMaximized();
     break;
   }
 
   distributeSpace( trg );
+
+  curWid->show();
+  curWid->setFocus();
 }
 
 /*!
@@ -1748,6 +1981,8 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
   if ( !area1 || !area2 )
     return;
 
+  QSplitter* s1 = splitter( area1 );
+
   QWidget* curWid = area1->activeWidget();
   if ( !curWid )
     return;
@@ -1759,6 +1994,8 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
       // Set wid1 at first position, wid2 at second
       area1->insertWidget( wid1 );
       area1->insertWidget( wid2, 1 );
+      wid1->showMaximized();
+      wid2->showMaximized();
     }
     else
     {
@@ -1768,6 +2005,7 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
       QWidgetList wids1 = area1->widgetList();
       for ( QWidgetList::iterator itr1 = wids1.begin(); itr1 != wids1.end() && *itr1 != wid1; ++itr1, ++wid1_ind );
       area1->insertWidget( wid2, wid1_ind + 1 );
+      wid2->showMaximized();
     }
   }
   else
@@ -1787,6 +2025,7 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
           area1->insertWidget( *itr2, wid1_ind + 1 );
         else
           area1->insertWidget( *itr2, ind );
+        (*itr2)->showMaximized();
       }
     }
     else
@@ -1794,10 +2033,18 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all )
       // Set wid2 right after wid1
       area2->removeWidget( wid2 );
       area1->insertWidget( wid2, wid1_ind + 1 );
+      wid2->showMaximized();
     }
   }
 
+  distributeSpace( s1 );
+
   area1->setActiveWidget( curWid );
+
+  wid2->show();
+  wid1->setFocus();
+  curWid->show();
+  curWid->setFocus();
 }
 
 /*!
@@ -1966,8 +2213,8 @@ void QtxWorkstack::setIcon( const int id, const QIcon& icon )
 
 /*!
   \brief Set actions to be visible in the context popup menu.
-  
-  Actions, which IDs are set in \a flags parameter, will be shown in the 
+
+  Actions, which IDs are set in \a flags parameter, will be shown in the
   context popup menu. Other actions will not be shown.
 
   \param flags ORed together actions flags
@@ -1982,8 +2229,8 @@ void QtxWorkstack::setMenuActions( const int flags )
 
 /*!
   \brief Set actions to be visible in the context popup menu.
-  
-  Actions, which IDs are set in \a flags parameter, will be shown in the 
+
+  Actions, which IDs are set in \a flags parameter, will be shown in the
   context popup menu. Other actions will not be shown.
 
   \param flags ORed together actions flags
@@ -2331,8 +2578,7 @@ QSplitter* QtxWorkstack::wrapSplitter( QtxWorkstackArea* area )
 
   QIntList szList = pSplit->sizes();
 
-  QSplitter* wrap = new QSplitter( 0 );
-  wrap->setChildrenCollapsible( false );
+  QSplitter* wrap = new QtxWorkstackSplitter( 0 );
   pSplit->insertWidget( pSplit->indexOf( area ) + 1, wrap );
   wrap->setVisible( true );
   wrap->addWidget( area );
@@ -2662,7 +2908,7 @@ QtxWorkstackArea* QtxWorkstack::createArea( QWidget* parent ) const
   connect( area, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
   connect( area, SIGNAL( activated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) );
   connect( area, SIGNAL( contextMenuRequested( QWidget*, QPoint ) ),
-          this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
+           this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
   connect( area, SIGNAL( deactivated( QtxWorkstackArea* ) ), this, SLOT( onDeactivated( QtxWorkstackArea* ) ) );
 
   return area;
@@ -2790,348 +3036,133 @@ void QtxWorkstack::updateState( QSplitter* split )
 
   if ( areaList.isEmpty() && splitList.isEmpty() )
     delete split;
-  else if ( vis )
-    split->show();
   else
-    split->hide();
+    split->setVisible( vis );
 }
 
 /*!
-  \brief Get splitter info (for debug purposes)
-  \param split splitter
-  \param info string to be filled with splitter data.
+  \brief Dump workstack configuration to the state description array.
+  \param version number
+  \return state byte array.
 */
-void QtxWorkstack::splitterInfo( QSplitter* split, QString& info ) const
+QByteArray QtxWorkstack::saveState( int version ) const
 {
-  if ( !split )
-    return;
-
-  /*const QObjectList& objs = */split->children(); // VSR: is it needed ???
-
-  QString sizesStr;
-  QList<int> sizes = split->sizes();
-  for ( QList<int>::iterator sIt = sizes.begin(); sIt != sizes.end(); ++sIt )
-  {
-    if ( *sIt > 1 ) // size 1 pixel usually means empty Workstack area, which will NOT be re-created,
-           sizesStr += QString( ":%1" ).arg( *sIt );  // so we don't need to store its size
-  }
-
-  if ( !sizesStr.isEmpty() ) // cut the first ':'
-    sizesStr = sizesStr.right( sizesStr.length() - 1 );
+  QByteArray data;
 
-  info += QString( "(splitter orientation=%1 sizes=%3 " ).arg( split->orientation() ).arg( sizesStr );
+  QDataStream stream( &data, QIODevice::WriteOnly );
+  stream << QtxWorkstack::VersionMarker;
+  stream << version;
+  saveState( stream );
 
-  for( int index = 0, count = split->count(); index < count; index++ )
-  {
-    QObject* obj = split->widget( index );
-    if ( obj->inherits( "QSplitter" ) )
-           splitterInfo( (QSplitter*)obj, info );
-    else if ( obj->inherits( "QtxWorkstackArea" ) )
-    {
-           QtxWorkstackArea* area = (QtxWorkstackArea*)obj;
-           if ( area->isEmpty() )
-             continue;
-           info += QString( "(views active='%1'" ).arg( area->activeWidget()->objectName() );
-           QWidgetList views = area->widgetList();
-      for ( QWidgetList::iterator wIt = views.begin(); wIt != views.end(); ++wIt )
-             info += QString( " '%1'" ).arg( (*wIt)->objectName() );
-           info += ')';
-    }
-  }
-
-  info += ')';
-  printf( (const char*)QString( info + '\n' ).toLatin1() );
+  return data;
 }
 
 /*!
-  \brief Remove round brackets symbols from the string.
-  \internal
-  \param parameters string to be processed
+  \brief Restore workstack configuration from the state description array.
+  \param version number
+  \return restore performing state
 */
-static void cutBrackets( QString& parameters )
+bool QtxWorkstack::restoreState( const QByteArray& state, int version )
 {
-  QChar c1 = parameters[0];
-  QChar c2 = parameters[int(parameters.length()-1)];
-  if ( !parameters.isEmpty() && c1 == '(' && c2 == ')' )
-    parameters = parameters.mid( 1, parameters.length()-2 );
-}
-
-/*!
-  \brief Parse string to get some parameter value.
-  \internal
-
-  String \a str can contain the parameters description of kind "<param>=<value> ...".
-  For example:
-  \code
-  QString s = "splitter orientation=0 children=2 sizes=332:478";
-  QString orient_val = getValue( s, "children" ); // orient_val contains "2"
-  QString size_val   = getValue( s, "sizes" );    // val contains "332:478"
-  \endcode
+  if ( state.isEmpty() )
+    return false;
 
-  \param str string to be processed
-  \param valName parameter name
-  \return parameter value (or null QStrinhg if parameter is not found)
-*/
-static QString getValue( const QString& str, const QString& valName )
-{
-  int i = str.indexOf( valName );
-  if ( i != -1 )
-  {
-    int equal_i = str.indexOf( '=', i );
-    if ( equal_i != -1 )
-    {
-      int space_i = str.indexOf( ' ', ++equal_i );
-      if ( space_i != -1 )
-             return str.mid( equal_i, space_i - equal_i );
-    }
-  }
-  return QString();
-}
+  QByteArray sd = state;
+  QDataStream stream( &sd, QIODevice::ReadOnly );
+  int marker, ver;
+  stream >> marker;
+  stream >> ver;
+  if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::VersionMarker || ver != version )
+    return false;
 
-/*!
-  \brief Check format of splitter parameters string.
-  \internal
-  \param parameters splitter parameters description
-  \return \c true on success and \c false on error
-*/
-static bool checkFormat( const QString& parameters )
-{
-  QString params( parameters );
-  // 1. begins and ends with brackets
-  QChar c1 = params[0];
-  QChar c2 = params[int(params.length()-1)];
-  bool ok = ( c1 == '(' && c2 == ')' );
-  if ( !ok ) return ok;
-  ::cutBrackets( params );
-  // 2. has splitter word
-  ok = ( params.left( 8 ) == "splitter" );
-  if ( !ok ) return ok;
-  // 3. has children?  = '(' is found
-  int i = params.indexOf( '(' );
-  ok = i != -1;
-  if ( !ok ) return ok;
-  params = params.left( i ); // cut all children, they will be checked later
-  // 4. has orientation word and correct value
-  ::getValue( params, "orientation" ).toInt( &ok );
-  if ( !ok ) return ok;
-  // 5. has sizes word and values
-  ok = ! ::getValue( params, "sizes" ).isEmpty();
-  if ( !ok ) return ok;
-  // 6. check children -> number of '(' == number of ')' in original string
-  ok = ( parameters.contains( '(' ) == parameters.contains( ')' ) );
-  return ok;
+  return restoreState( stream );
 }
 
-/*!
-  \brief Get splitter's children descriptions from the string.
-  \internal
-  
-  Child widgets descriptions are separated by '(' and ')' symbols.
-
-  \param str string to be processed
-  \return child widgets descriptions
-*/
-static QStringList getChildren( const QString& str )
+void QtxWorkstack::saveState( QDataStream& stream ) const
 {
-  QStringList lst;
-  if ( !str.startsWith( "(" ) )
-    return lst;
-
-  int i = 1,
-  nOpen = 1, // count brackets: '(' increments nOpen, ')' decrements
-  start = 0;
-  while ( i < (int)str.length() )
-  {
-    if ( str[i] == '(' )
-    {
-      nOpen++;
-      if ( nOpen == 1 )
-             start = i;
-    }
-    else if ( str[i] == ')' )
-    {
-      nOpen--;
-      if ( nOpen == 0 )
-             lst.append( str.mid( start, i-start+1 ) );
-    }
-    i++;
-  }
-
-  return lst;
+  mySplit->saveState( stream );
 }
 
-/*!
-  \brief Get view name by index.
-  \internal
-
-  Example:
-  \code
-  QString s  = "views active='AnotherView' 'GLView' 'AnotherView'";
-  QString a0 = getViewName( s, 0 ); // --> a0 contains "GLView"
-  QString a1 = getViewName( s, 1 ); // --> a1 contains "AnotherView"
-  \endcode
-
-  \param str string to be processed
-  \param i index
-  \return view name
-*/
-static QString getViewName( const QString& str, int i )
+bool QtxWorkstack::restoreState( QDataStream& stream )
 {
-  QRegExp exp( "\\s'\\w+'" );
-  int start = 0; // start index of view name in the string
-  int num = 0 ; // index of found match
-  while ( ( start = exp.indexIn( str, start ) ) != -1 && num < i )
+  QMap<QString, QtxWorkstackChild*> map;
+  QList<QtxWorkstackArea*> areaList;
+  areas( mySplit, areaList, true );
+  for ( QList<QtxWorkstackArea*>::const_iterator it = areaList.begin(); it != areaList.end(); ++it )
   {
-    start += exp.matchedLength();
-    num ++;
-  }
-  if ( start != -1 )      // +2 and -3 avoid starting space and starting and ending ' symbols
-    return str.mid( start + 2, exp.matchedLength() - 3 );
-
-  return QString();
-}
+    QtxWorkstackArea* area = *it;
+    QList<QtxWorkstackChild*> childList = area->childList();
+    for ( QList<QtxWorkstackChild*>::iterator itr = childList.begin(); itr != childList.end(); ++itr )
+    {
+      QtxWorkstackChild* c = *itr;
+      if ( !c->widget() )
+        continue;
 
-/*!
-  \brief Get child widget with specified name.
-  \internal
-  \param parent parent widget
-  \param aName child widget name
-  \return child widget or 0 if not found
-*/
-static QWidget* getView( const QWidget* parent, const QString& aName )
-{
-  QWidget* view = 0;
-  QList<QWidget*> l = qFindChildren<QWidget*>( parent->topLevelWidget(), aName );
-  if ( !l.isEmpty() )
-    view = ::qobject_cast<QWidget*>( l.first() );
-  return view;
-}
+      map.insert( c->widget()->objectName(), c );
 
-/*!
-  \brief Setup splitter according to the specified parameters string.
-  \param splitter splitter to be set up
-  \param parameters splitter parameters description
-  \param sMap map containing resulting child splitters sizes
-*/
-void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, QMap<QSplitter*, QList<int> >& sMap )
-{
-  printf( QString( parameters + '\n' ).toLatin1() );
-  if ( !::checkFormat( parameters ) ) {
-    printf( "\nInvalid format of workstack parameters.  Positions of viewers can not be restored.\n" );
-    return;
+      qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toLatin1() );
+    }
   }
 
-  QString params( parameters );
-  ::cutBrackets( params );
-
-  // get splitter sizes and store it in the map for future setting
-  QList<int> sizes;
-  QStringList sizesLst = ::getValue( params, "sizes" ).split( ':', QString::SkipEmptyParts );
-  QStringList::Iterator it;
-  for ( it = sizesLst.begin(); it != sizesLst.end(); ++it )
-    sizes.append( (*it).toInt() );
-  sMap[ splitter ] = sizes;
+  int marker;
+  stream >> marker;
+  if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::SplitMarker )
+    return false;
 
-  // set orientation of splitter
-  int orient = ::getValue( params, "orientation" ).toInt();
-  splitter->setOrientation( (Qt::Orientation)orient );
+  QtxWorkstackSplitter* split = new QtxWorkstackSplitter( this );
+  if ( layout() )
+    layout()->addWidget( split );
 
-  // get children
-  QString options = params.left( params.indexOf( '(' ) );
-  QString childrenStr = params.right( params.length()-options.length() );
-  QStringList children = ::getChildren( childrenStr );
+  bool ok = split->restoreState( stream, map );
+  if ( !ok )
+    delete split;
+  else
+  {
+    mySplit->deleteLater();
+    mySplit = split;
 
-  // debug output..
-  //  printf (" splitter orient=%d, sizes_count=%d, children=%d\n", orient, sizes.count(), children.count() );
-  //  for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit )
-  //    printf ("   |-> child = [%s]\n", (*tit).latin1() );
+    QList<QtxWorkstackArea*> aList;
+    areas( mySplit, aList, true );
 
-  for ( it = children.begin(); it != children.end(); ++it )
-  {
-    if ( (*it).startsWith( "(splitter" ) )
-    {
-      QSplitter* newSplitter = new QSplitter( splitter );
-      setSplitter( newSplitter, *it, sMap );
-    }
-    else if ( (*it).startsWith( "(views" ) )
+    QtxWorkstackArea* a = !aList.isEmpty() ? aList.first() : 0;
+    for ( QMap<QString, QtxWorkstackChild*>::const_iterator it = map.begin(); it != map.end(); ++it )
     {
-      QtxWorkstackArea* newArea = createArea( splitter );
-      QString activeViewName = ::getValue( *it, "active" );
-      QWidget* activeView = 0;
-      activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols
-      int i = 0;
-      QString viewName = ::getViewName( *it, i );
-      while ( !viewName.isEmpty() )
-      {
-             if ( QWidget* view = ::getView( splitter, viewName ) )
-        {
-               newArea->insertWidget( view );
-               if ( activeViewName == view->objectName() )
-                 activeView = view;
-             }
-             viewName = ::getViewName( *it, ++i );
-      }
-      if ( activeView )
-       newArea->setActiveWidget( activeView );
+      QtxWorkstackChild* c = it.value();
+      if ( c->widget() )
+        c->widget()->setVisible( false );
+      if ( a )
+        a->insertChild( c );
+      else
+        c->setVisible( false );
     }
   }
+
+  return ok;
 }
 
 /*!
-  \brief Restore workstack configuration from the state description string.
-  \param parameters workstack state description
-  \return reference to this workstack
+  \brief Set resize mode of all splitters opaque or transparent.
+  \param opaque opaque mode
 */
-QtxWorkstack& QtxWorkstack::operator<<( const QString& parameters )
+void QtxWorkstack::setOpaqueResize( bool opaque )
 {
-  // clear the main splitter - remove all child splitters and empty areas from it
   QList<QSplitter*> splitList;
-  QList<QtxWorkstackArea*> areaList;
-  splitters( mySplit, splitList, false );
-  areas( mySplit, areaList, false );
-  for ( QList<QSplitter*>::iterator iter = splitList.begin(); iter != splitList.end(); ++iter )
-    delete *iter;
-
-  for ( QList<QtxWorkstackArea*>::iterator it = areaList.begin(); it != areaList.end(); ++it )
-  {
-    if ( (*it)->isEmpty() )
-      delete *it;
-  }
-
-  // restore splitter recursively
-  QMap< QSplitter*, QList<int> > sMap;
-  setSplitter( mySplit, parameters, sMap );
-
-  // now mySplit may contains empty area (where all views were located before restoring)
-  // in order setSize to work correctly we have to exclude this area
-  areaList.clear();
-  areas( mySplit, areaList, false );
-  for ( QList<QtxWorkstackArea*>::iterator delIt = areaList.begin(); delIt != areaList.end(); ++delIt )
-  {
-    if ( (*delIt)->isEmpty() )
-      delete *delIt;
-  }
-
-  QApplication::instance()->processEvents();
-
-  // restore splitters' sizes (map of sizes is filled in setSplitters)
-  for ( QMap< QSplitter*, QList<int> >::iterator itm = sMap.begin(); itm != sMap.end(); ++itm )
-    itm.key()->setSizes( itm.value() );
-
-  return (*this);
+  splitters( mySplit, splitList, true );
+  splitList << mySplit;
+  foreach( QSplitter* split, splitList )
+    split->setOpaqueResize( opaque );
 }
 
 /*!
-  \brief Dump workstack configuration to the state description string.
-  \param parameters resulting workstack state description
-  \return reference to this workstack
+  \brief Get resize mode of all splitters: opaque (\c true) or transparent (\c false).
+  \return current opaque mode
 */
-QtxWorkstack& QtxWorkstack::operator>>( QString& outParameters )
+bool QtxWorkstack::opaqueResize() const
 {
-  splitterInfo( mySplit, outParameters );
-  return (*this);
+  return mySplit->opaqueResize();
 }
 
+
 /*!
   \fn void QtxWorkstack::windowActivated( QWidget* w )
   \brief Emitted when the workstack's child widget \w is activated.
@@ -3164,9 +3195,9 @@ QtxWorkstackArea* QtxWorkstack::wgArea( QWidget* wid ) const
   \brief Moves the first widget to the same area which the second widget belongs to
   \param wid widget to be moved
   \param wid_to widget specified the destination area
-  \param before specifies whether the first widget has to be moved before or after 
+  \param before specifies whether the first widget has to be moved before or after
          the second widget
-  \return TRUE if operation is completed successfully, FALSE otherwise 
+  \return TRUE if operation is completed successfully, FALSE otherwise
 */
 bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before )
 {
@@ -3201,7 +3232,7 @@ bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before )
 
 /*!
   \brief Group all windows in one area
-  \return TRUE if operation is completed successfully, FALSE otherwise 
+  \return TRUE if operation is completed successfully, FALSE otherwise
 */
 void QtxWorkstack::stack()
 {
@@ -3219,13 +3250,19 @@ void QtxWorkstack::stack()
       area_to = wgArea( *it );
       area_src = area_to;
     }
-    else 
+    else
       area_src = wgArea( *it );
 
     if ( area_src != area_to )
     {
       area_src->removeWidget( *it, true );
       area_to->insertWidget( *it, -1 );
+      (*it)->showMaximized();
     }
   }
 }
+
+QAction* QtxWorkstack::action( const int id ) const
+{
+  return myActionsMap.contains( id ) ? myActionsMap[id] : 0;
+}
index 9d0a16bd52a358d24b3f536c0ececed7d403f140..09babe484266ec9e7bb7a0a90ed0f912a002c1bb 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkstack.h
 // Author:    Sergey TELKOV
 //
 
 #include "Qtx.h"
 
-#include <QWidget>
+#include <QMap>
 #include <QFrame>
-#include <QTabBar>
 #include <QEvent>
-#include <QMap>
+#include <QWidget>
+#include <QTabBar>
+#include <QPointer>
+#include <QSplitter>
+#include <QByteArray>
 
 class QAction;
-class QSplitter;
-class QStackedWidget;
+class QDataStream;
 class QRubberBand;
+class QStackedWidget;
 class QAbstractButton;
 
 class QtxWorkstackArea;
 class QtxWorkstackDrag;
 class QtxWorkstackChild;
 class QtxWorkstackTabBar;
+class QtxWorkstackSplitter;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -55,13 +60,23 @@ class QTX_EXPORT QtxWorkstack : public QWidget
 public:
   //! Workstack actions (context menu items)
   enum { SplitVertical    = 0x01,  //!< "Split vertically" menu item
-        SplitHorizontal  = 0x02,  //!< "Split horizontally" menu item
-        Close            = 0x04,  //!< "Close" menu item
-        Rename           = 0x08,  //!< "Rename" menu item
-        All = SplitVertical | SplitHorizontal | 
-              Close | Rename      //!< all menu items
+         SplitHorizontal  = 0x02,  //!< "Split horizontally" menu item
+         Close            = 0x04,  //!< "Close" menu item
+         Rename           = 0x08,  //!< "Rename" menu item
+         All = SplitVertical | SplitHorizontal |
+               Close | Rename      //!< all menu items
+  };
+
+  enum { VersionMarker = 0x01,
+               SplitMarker   = 0x02,
+               AreaMarker    = 0x04,
+               WidgetMarker  = 0x08
   };
-    
+
+  enum { Horizontal = 0x01,
+               Visible    = 0x02
+  };
+
   //! Workstack splitting type
   enum SplitType
   {
@@ -88,28 +103,30 @@ public:
   void                setMenuActions( const int );
   int                 menuActions() const;
 
+  void                stack();
   void                split( const int );
   bool                move( QWidget* wid, QWidget* wid_to, const bool before );
-  void                stack();
 
   QWidget*            addWindow( QWidget*, Qt::WindowFlags = 0 );
 
+  QByteArray          saveState( int ) const;
+  bool                restoreState( const QByteArray&, int );
+  
+  void                setOpaqueResize( bool = true );
+  bool                opaqueResize() const;
+
   void Split( QWidget* wid, const Qt::Orientation o, const SplitType type );
   void Attract( QWidget* wid1, QWidget* wid2, const bool all );
   void SetRelativePosition( QWidget* wid, const Qt::Orientation o, const double pos );
   void SetRelativePositionInSplitter( QWidget* wid, const double pos );
 
-  // asv: Store/Restore visual parameters - geometry of inner windows
-  QtxWorkstack& operator<<( const QString& );
-  QtxWorkstack& operator>>( QString& );
-
 signals:
   void                windowActivated( QWidget* );
 
 public slots:
   void                splitVertical();
   void                splitHorizontal();
-  
+
 private slots:
   void                onRename();
   void                onCloseWindow();
@@ -121,6 +138,11 @@ private slots:
 protected:
   virtual void        customEvent( QEvent* );
 
+  QAction*            action( const int ) const;
+
+  void                saveState( QDataStream& ) const;
+  bool                restoreState( QDataStream& );
+
 private:
   QSplitter*          splitter( QtxWorkstackArea* ) const;
   void                splitters( QSplitter*, QList<QSplitter*>&, const bool = false ) const;
@@ -145,23 +167,37 @@ private:
   void                updateState( QSplitter* );
 
   void                distributeSpace( QSplitter* ) const;
+
   int                 setPosition( QWidget* wid, QSplitter* split, const Qt::Orientation o,
-                                                          const int need_pos, const int splitter_pos );
-  
-  void                splitterInfo( QSplitter*, QString& ) const;
-  void                setSplitter( QSplitter*, const QString&, QMap< QSplitter*, QList<int> >& );
-  
+                                                           const int need_pos, const int splitter_pos );
+
 private:
-  QWidget*            myWin;        //!< active widget
-  QtxWorkstackArea*   myArea;       //!< active workarea
-  QSplitter*          mySplit;      //!< tol-level splitter
-  QWidget*            myWorkWin;    //!< widget where popup menu is invoked (used internally)
-  QtxWorkstackArea*   myWorkArea;   //!< workarea where popup menu is invoked (used internally)
+  QPointer<QWidget>          myWin;        //!< active widget
+  QPointer<QtxWorkstackArea> myArea;       //!< active workarea
+  QtxWorkstackSplitter*      mySplit;      //!< tol-level splitter
+  QPointer<QWidget>          myWorkWin;    //!< widget where popup menu is invoked (used internally)
+  QPointer<QtxWorkstackArea> myWorkArea;   //!< workarea where popup menu is invoked (used internally)
 
   QMap<int, QAction*> myActionsMap; //!< actions map
 
   friend class QtxWorkstackArea;
   friend class QtxWorkstackDrag;
+  friend class QtxWorkstackAction;
+  friend class QtxWorkstackSplitter;
+};
+
+class QtxWorkstackSplitter : public QSplitter
+{
+  Q_OBJECT
+
+public:
+  QtxWorkstackSplitter( QWidget* = 0 );
+  virtual ~QtxWorkstackSplitter();
+
+  QtxWorkstack*       workstack() const;
+
+  void                saveState( QDataStream& ) const;
+  bool                restoreState( QDataStream&, QMap<QString, QtxWorkstackChild*>& );
 };
 
 class QtxWorkstackArea : public QFrame
@@ -169,6 +205,7 @@ class QtxWorkstackArea : public QFrame
   Q_OBJECT
 
   class WidgetEvent;
+  class RestoreEvent;
 
 public:
   QtxWorkstackArea( QWidget* );
@@ -177,15 +214,19 @@ public:
   bool                isNull() const;
   bool                isEmpty() const;
 
-  QWidget*            insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );
+  QtxWorkstackChild*  insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );
   void                removeWidget( QWidget*, const bool = true );
 
+  void                insertChild( QtxWorkstackChild*, const int = -1 );
+  void                removeChild( QtxWorkstackChild*, const bool = true );
+
   QWidget*            activeWidget() const;
   void                setActiveWidget( QWidget* );
 
   bool                contains( QWidget* ) const;
 
   QWidgetList         widgetList() const;
+  QList<QtxWorkstackChild*> childList() const;
 
   bool                isActive() const;
   void                updateActiveState();
@@ -199,20 +240,18 @@ public:
 
   int                 tabAt( const QPoint& ) const;
 
+  void                saveState( QDataStream& ) const;
+  bool                restoreState( QDataStream&, QMap<QString, QtxWorkstackChild*>& );
+
 signals:
   void                activated( QWidget* );
   void                contextMenuRequested( QWidget*, QPoint );
   void                deactivated( QtxWorkstackArea* );
 
-public slots:
-  virtual void        setVisible( bool );
-
 private slots:
   void                onClose();
   void                onCurrentChanged( int );
 
-  void                onWidgetDestroyed();
-
   void                onChildDestroyed( QObject* );
   void                onChildShown( QtxWorkstackChild* );
   void                onChildHidden( QtxWorkstackChild* );
@@ -230,8 +269,9 @@ protected:
 private:
   //! Custom events
   enum { ActivateWidget = QEvent::User,   //!< activate widget event
-        FocusWidget,                     //!< focus receiving widget event
-        RemoveWidget                     //!< widget removing event
+               FocusWidget,                     //!< focus receiving widget event
+         MakeCurrent,
+         RestoreWidget
   };
 
 private:
@@ -241,38 +281,22 @@ private:
 
   QWidget*            widget( const int ) const;
   int                 widgetId( QWidget* ) const;
-  bool                widgetVisibility( QWidget* ) const;
+
+  QtxWorkstackChild*  child( QWidget* ) const;
+  QtxWorkstackChild*  child( const int ) const;
 
   void                setWidgetActive( QWidget* );
-  void                setWidgetShown( QWidget*, const bool );
 
   int                 generateId() const;
 
-  bool                isBlocked( QWidget* ) const;
-  void                setBlocked( QWidget*, const bool );
-
-  QtxWorkstackChild*  child( QWidget* ) const;
-
 private:
-  struct WidgetInfo
-  {
-    WidgetInfo() : id( 0 ), vis( false ) {}
-    int id; bool vis;
-  };
-
-  typedef QMap<QWidget*, bool>               BlockMap;
-  typedef QMap<QWidget*, QtxWorkstackChild*> ChildMap;
-  typedef QMap<QWidget*, WidgetInfo>         WidgetInfoMap;
+  typedef QList<QtxWorkstackChild*> ChildList;
 
 private:
   QtxWorkstackTabBar* myBar;     //!< workarea tab bar header
+  ChildList           myList;    //!< child widgets list
   QAbstractButton*    myClose;   //!< close button
   QStackedWidget*     myStack;   //!< widget stack
-
-  QWidgetList         myList;    //!< child widgets list
-  WidgetInfoMap       myInfo;    //!< widgets states mp
-  ChildMap            myChild;   //!< child widget containers map
-  BlockMap            myBlock;   //!< blocked widgets
 };
 
 class QtxWorkstackChild : public QWidget
@@ -283,7 +307,15 @@ public:
   QtxWorkstackChild( QWidget*, QWidget* = 0, Qt::WindowFlags = 0 );
   virtual ~QtxWorkstackChild();
 
-  QWidget*            widget() const;
+  QWidget*            widget() const
+;
+
+  int                 id() const;
+  void                setId( const int );
+
+  bool                visibility();
+
+  QtxWorkstackArea*   area() const;
 
   virtual bool        eventFilter( QObject*, QEvent* );
 
@@ -300,7 +332,8 @@ protected:
   virtual void        childEvent( QChildEvent* );
 
 private:
-  QWidget*            myWidget;   //!< child widget
+  int                 myId;       //!< id
+  QPointer<QWidget>   myWidget;   //!< child widget
 };
 
 class QtxWorkstackTabBar : public QTabBar
@@ -328,13 +361,11 @@ private slots:
   void                onCurrentChanged( int );
 
 protected:
+  virtual void        changeEvent( QEvent* );
   virtual void        mouseMoveEvent( QMouseEvent* );
   virtual void        mousePressEvent( QMouseEvent* );
   virtual void        mouseReleaseEvent( QMouseEvent* );
   virtual void        contextMenuEvent( QContextMenuEvent* );
-  virtual void        changeEvent( QEvent* );
-
-//  virtual void        paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
 
 private:
   int                 myId;         //!< current tab page index
index 8e813797e170b5c77b4c5dc0cad842de40615ed2..339c5a7093f499181477eec25874f4a569ca4c80 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkstackAction.cxx
 // Author:    Sergey TELKOV
 //
@@ -45,10 +46,17 @@ QtxWorkstackAction::QtxWorkstackAction( QtxWorkstack* ws, QObject* parent )
   myWorkstack( ws ),
   myWindowsFlag( true )
 {
-  insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
-                               tr( "Split vertically" ), 0, this ), SplitVertical );
-  insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
-                               tr( "Split horizontally" ), 0, this ), SplitHorizontal );
+  if ( myWorkstack )
+    insertAction( myWorkstack->action( QtxWorkstack::SplitVertical ), SplitVertical );
+  else
+    insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
+                                 tr( "Split vertically" ), 0, this ), SplitVertical );
+
+  if ( myWorkstack )
+    insertAction( myWorkstack->action( QtxWorkstack::SplitHorizontal ), SplitHorizontal );
+  else
+    insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
+                                 tr( "Split horizontally" ), 0, this ), SplitHorizontal );
 
   connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
 
@@ -73,8 +81,8 @@ QtxWorkstack* QtxWorkstackAction::workstack() const
 
 /*!
   \brief Set actions to be visible in the menu.
-  
-  Actions, which IDs are set in \a flags parameter, will be shown in the 
+
+  Actions, which IDs are set in \a flags parameter, will be shown in the
   menu bar. Other actions will not be shown.
 
   \param flags ORed together actions flags
@@ -205,6 +213,7 @@ void QtxWorkstackAction::setStatusTip( const int id, const QString& txt )
 */
 void QtxWorkstackAction::perform( const int type )
 {
+  /*
   switch ( type )
   {
   case SplitVertical:
@@ -214,6 +223,7 @@ void QtxWorkstackAction::perform( const int type )
     splitHorizontal();
     break;
   }
+  */
 }
 
 /*!
@@ -356,7 +366,7 @@ void QtxWorkstackAction::activateItem( const int idx )
 
 /*!
   \brief Called when menu item is activated by the user.
-  
+
   Perform the corresponding action.
 
   \param id menu item identifier
index aaa61b7863f9554e93faa927fc5444939ca80112..6d991307a2e42d0c8be5188c02c76312d521bd6d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      QtxWorkstackAction.h
 // Author:    Sergey TELKOV
 //
index b684b26a77e1f38b07fbd075d2fbe890387eb981..051315fab700135a0a47ca9bea268164eea56d8d 100755 (executable)
@@ -1,23 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+##############################################################
+# VSR: WARNING! THIS PACKAGE IS OBSOLETE
+##############################################################
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -61,7 +63,8 @@ dist_salomeres_DATA =                 \
 
 nodist_salomeres_DATA =                \
        QxGraph_images.qm       \
-       QxGraph_msg_en.qm  
+       QxGraph_msg_en.qm       \
+       QxGraph_msg_fr.qm  
 
 libQxGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
                         -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
index f17edde9fa25ac91ebb58cb67ca3d1ecf47adc41..33057d4cb8359a89094cb011153105840597ebcd 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #ifdef WNT
-#ifdef QXGRAPH_EXPORTS
+#if defined QXGRAPH_EXPORTS || defined QxGraph_EXPORTS
 #define QXGRAPH_EXPORT __declspec(dllexport)
 #else
 #define QXGRAPH_EXPORT __declspec(dllimport)
diff --git a/src/QxGraph/QxGraph.pro b/src/QxGraph/QxGraph.pro
deleted file mode 100644 (file)
index deff370..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = QxGraph
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += QXGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = QxGraph_ActiveItem.h
-HEADERS += QxGraph_Prs.h
-HEADERS += QxGraph_Canvas.h
-HEADERS += QxGraph_CanvasView.h
-HEADERS += QxGraph_ViewWindow.h
-HEADERS += QxGraph_ViewManager.h
-HEADERS += QxGraph_ViewModel.h
-HEADERS += QxGraph_Def.h
-HEADERS += QxGraph.h
-
-SOURCES  = QxGraph_Prs.cxx
-SOURCES += QxGraph_Canvas.cxx
-SOURCES += QxGraph_CanvasView.cxx
-SOURCES += QxGraph_ViewWindow.cxx
-SOURCES += QxGraph_ViewManager.cxx
-SOURCES += QxGraph_ViewModel.cxx
-
-TRANSLATIONS = resources/QxGraph_images.ts \
-               resources/QxGraph_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index aecf9294c1a0482e56ac3100ad1b8dc4b72c6d29..30824f5751e943fc78cf13c0c31f09172bdb09a7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXGRAPH_ACTIVEITEM_H
 #define QXGRAPH_ACTIVEITEM_H
 
index 634f4d27d76a5ba6117766ef601e59bfbda5b165..e4b16056017b00b56953a421f2c11d2d9c961cf9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #include "QxGraph_Canvas.h"
index 7425b46de6c7ea45f8725018a745a82df5767791..5c90e3d6378ec139e10ee34e5714dbd6d73a0a85 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #ifndef QXGRAPH_CANVAS_H
index 54ebc3b49492e3821d73daaa89ac140804f72fa1..92b67b61b1edb2993028efb30923901915c595f5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #include "QxGraph_CanvasView.h"
@@ -194,15 +195,15 @@ void QxGraph_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent)
       int aCursorType;
       if ( anActItem && anActItem->isResizable(myPoint,aCursorType) )
       { // resize itself only active items if it is resizable
-       anActItem->beforeResizing(aCursorType);
-       myCurrentItem = *it;
-       return;
+        anActItem->beforeResizing(aCursorType);
+        myCurrentItem = *it;
+        return;
       }
       else if ( anActItem && anActItem->isMoveable() )
       { // move itself only active items if it is moveable
-       anActItem->beforeMoving();
-       myCurrentItem = *it;
-       return;
+        anActItem->beforeMoving();
+        myCurrentItem = *it;
+        return;
       }
     }
   }
@@ -218,7 +219,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
   if ( myOperation == PANVIEW )
   { // Panning
     scrollBy(myGlobalPoint.x() - aGlobalPoint.x(),
-            myGlobalPoint.y() - aGlobalPoint.y());
+             myGlobalPoint.y() - aGlobalPoint.y());
     myGlobalPoint = aGlobalPoint;
     myMovingDone = true;
     return;
@@ -282,7 +283,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
       if ( anActItem ) anActItem->setTMatrix(m);
       (*it)->show();
     }
-       
+        
     myGlobalPoint = aGlobalPoint;
     myMovingDone = true;
 
@@ -303,12 +304,12 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
     if ( myCurrentItem->x() && myCurrentItem->y() ) {
       double cx = myCurrentItem->x() - myPoint.x();
       double cy = myCurrentItem->y() - myPoint.y();
-       
+        
       if (aPoint.x()+cx < 0) aPoint.setX(-(int)cx);
       if (aPoint.y()+cy < 0) aPoint.setY(-(int)cy);
     }
     myCurrentItem->moveBy(aPoint.x() - myPoint.x(), 
-                         aPoint.y() - myPoint.y());
+                          aPoint.y() - myPoint.y());
     myMovingDone = true;
     myPoint = aPoint;
     canvas()->update();
@@ -339,53 +340,53 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
       QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
     
       if (!isHilightPerformed && anActItem) {
-       // hilight
-       anActItem->hilight(aPoint);
-       if (anActItem != myHilightedItem) {
-         if (myHilightedItem)
-           myHilightedItem->hilight(aPoint, false);
-         myHilightedItem = anActItem;
-       }
-       isHilightPerformed = true;
-       
-       // show tooltip
-       QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this);
-       aToolTip->maybeTip(aPoint);
+        // hilight
+        anActItem->hilight(aPoint);
+        if (anActItem != myHilightedItem) {
+          if (myHilightedItem)
+            myHilightedItem->hilight(aPoint, false);
+          myHilightedItem = anActItem;
+        }
+        isHilightPerformed = true;
+        
+        // show tooltip
+        QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this);
+        aToolTip->maybeTip(aPoint);
       }
       
       int aCursorType;
       if ( anActItem && anActItem->isResizable(aPoint,aCursorType) ) {
-       // set resize cursor
-       QCursor resizeCursor;
-       switch (aCursorType)
-         {
-         case 1: //left
-         case 3: //right
-           resizeCursor = QCursor(Qt::SizeHorCursor);
-           break;
-         case 2: //top
-         case 4: //bottom
-           resizeCursor = QCursor(Qt::SizeVerCursor); 
-           break;
-         case 5: //left-top
-         case 7: //right-bottom
-           resizeCursor = QCursor(Qt::SizeFDiagCursor);
-           break;
-         case 6: //right-top
-         case 8: //left-bottom
-           resizeCursor = QCursor(Qt::SizeBDiagCursor); 
-           break;
-         default : 
-           resizeCursor = QCursor(Qt::ArrowCursor);
-           break;
-         }
-       setCursor(resizeCursor);
-       return;
+        // set resize cursor
+        QCursor resizeCursor;
+        switch (aCursorType)
+          {
+          case 1: //left
+          case 3: //right
+            resizeCursor = QCursor(Qt::SizeHorCursor);
+            break;
+          case 2: //top
+          case 4: //bottom
+            resizeCursor = QCursor(Qt::SizeVerCursor); 
+            break;
+          case 5: //left-top
+          case 7: //right-bottom
+            resizeCursor = QCursor(Qt::SizeFDiagCursor);
+            break;
+          case 6: //right-top
+          case 8: //left-bottom
+            resizeCursor = QCursor(Qt::SizeBDiagCursor); 
+            break;
+          default : 
+            resizeCursor = QCursor(Qt::ArrowCursor);
+            break;
+          }
+        setCursor(resizeCursor);
+        return;
       }
       else {
-       // reset old cursor
-       setCursor(QCursor(Qt::ArrowCursor));
-       return;
+        // reset old cursor
+        setCursor(QCursor(Qt::ArrowCursor));
+        return;
       }
     }
     
@@ -396,7 +397,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
     }
 
     if ( cursor().shape() == Qt::SizeVerCursor || cursor().shape() == Qt::SizeHorCursor
-        || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor)
+         || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor)
       setCursor(QCursor(Qt::ArrowCursor));
   }
 }
@@ -530,20 +531,20 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
       QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
       if (!isSelectionPerformed && anActItem) 
       {
-       anActItem->select(aPoint);
-       if (anActItem != mySelectedItem) 
-       {
-         if (mySelectedItem && isSelectedItemInCanvas() &&
-             !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
-         mySelectedItem = anActItem;
-
-         // unhilight hilighted item if selection was performed
-         if (myHilightedItem) {
-           myHilightedItem->hilight(aPoint, false);
-           myHilightedItem = 0;
-         }
-       }
-       isSelectionPerformed = true;
+        anActItem->select(aPoint);
+        if (anActItem != mySelectedItem) 
+        {
+          if (mySelectedItem && isSelectedItemInCanvas() &&
+              !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
+          mySelectedItem = anActItem;
+
+          // unhilight hilighted item if selection was performed
+          if (myHilightedItem) {
+            myHilightedItem->hilight(aPoint, false);
+            myHilightedItem = 0;
+          }
+        }
+        isSelectionPerformed = true;
       }
     }
 
@@ -551,17 +552,17 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     { 
       if ( mySelectedItem )
       {
-       if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false);
-       mySelectedItem = 0;
+        if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false);
+        mySelectedItem = 0;
       }
       
       // Background popup
       printf("Background popup\n");
       QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
-                               theEvent->pos(), theEvent->globalPos(),
-                               theEvent->state() );
+                                theEvent->pos(), theEvent->globalPos(),
+                                theEvent->state() );
       if ( getViewWindow() )
-       getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent );
+        getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent );
     }
     else
     { // show context popup for the selected item
@@ -582,18 +583,18 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
     else
     {
       for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
-       QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
-       if (anActItem) 
-       {
-         anActItem->select(aPoint);
-         if (anActItem != mySelectedItem) 
-         {
-           if (mySelectedItem && isSelectedItemInCanvas() &&
-               !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
-           mySelectedItem = anActItem;
-         }
-         break;
-       }
+        QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+        if (anActItem) 
+        {
+          anActItem->select(aPoint);
+          if (anActItem != mySelectedItem) 
+          {
+            if (mySelectedItem && isSelectedItemInCanvas() &&
+                !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
+            mySelectedItem = anActItem;
+          }
+          break;
+        }
       }
     }
   }
@@ -743,17 +744,17 @@ void QxGraph_ToolTip::maybeTip(const QPoint& theMousePos) {
     QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
     if (anActItem)
       {
-       QRect aRect;
-       QString aText = anActItem->getToolTipText(theMousePos, aRect);
-       int avX, avY;
-       QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix();
-       ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()), 
-                                                          (int)(aRect.top()*aWM.m22()), 
-                                                          avX, avY);
-       QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22()));
-       if (!aText.isEmpty())
-         tip(aTipRect, aText);
-       return;
+        QRect aRect;
+        QString aText = anActItem->getToolTipText(theMousePos, aRect);
+        int avX, avY;
+        QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix();
+        ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()), 
+                                                           (int)(aRect.top()*aWM.m22()), 
+                                                           avX, avY);
+        QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22()));
+        if (!aText.isEmpty())
+          tip(aTipRect, aText);
+        return;
       }
   }
 }
index 6c3a26cdc2324bc02ce1440529103a47b68ece43..cc2554c6b59fb2f3b233fa7b1cf12df6bc4ad365 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #ifndef QXGRAPH_CANVASVIEW_H
@@ -40,7 +41,7 @@ class QXGRAPH_EXPORT QxGraph_CanvasView : public QCanvasView {
 
  public:
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, PANGLOBAL, 
-                     WINDOWFIT, FITALLVIEW, RESETVIEW };
+                      WINDOWFIT, FITALLVIEW, RESETVIEW };
   
   QxGraph_CanvasView(QxGraph_Canvas* theCanvas, QxGraph_ViewWindow* theViewWindow);
   virtual ~QxGraph_CanvasView();
index 948fd964708d1c5d8e1b415634a67ffc343b9502..53a32b11f1ebaece27d6b943e35b2f35f76bc169 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #ifndef QXGRAPH_DEF_H
index efe4687c0b8f79fc3f350793d5a94a8280d29814..0bd54fe3de89d81df269664cab90e2f1b193c54d 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #include "QxGraph_Prs.h"
@@ -45,12 +46,12 @@ QxGraph_Prs::QxGraph_Prs(QxGraph_Canvas* theCanvas):
 QxGraph_Prs::~QxGraph_Prs()
 {
   for ( DMode2ItemList::iterator it1 = myDisplayMap.begin();
-       it1 != myDisplayMap.end();
-       it1++ )
+        it1 != myDisplayMap.end();
+        it1++ )
   {
     for ( std::list<QCanvasItem*>::iterator it2 = (*it1).second.begin();
-         it2 != (*it1).second.end();
-         it2++ )
+          it2 != (*it1).second.end();
+          it2++ )
     {
       QCanvasItem* anItem = *it2;
       if ( anItem ) delete anItem;
@@ -91,8 +92,8 @@ void QxGraph_Prs::show()
     update();
 
   for ( std::list<QCanvasItem*>::iterator it = myDisplayMap[myDMode].begin();
-       it != myDisplayMap[myDMode].end();
-       it++ )
+        it != myDisplayMap[myDMode].end();
+        it++ )
   {
     QCanvasItem* anItem = *it;
     if ( anItem )
@@ -108,17 +109,17 @@ void QxGraph_Prs::show()
 void QxGraph_Prs::hide()
 {
   for ( DMode2ItemList::iterator it1 = myDisplayMap.begin();
-       it1 != myDisplayMap.end();
-       it1++ )
+        it1 != myDisplayMap.end();
+        it1++ )
   {
     for ( std::list<QCanvasItem*>::iterator it2 = (*it1).second.begin();
-         it2 != (*it1).second.end();
-         it2++ )
+          it2 != (*it1).second.end();
+          it2++ )
     {
       QCanvasItem* anItem = *it2;
       if ( anItem )
       {
-       anItem->setCanvas( 0 );
+        anItem->setCanvas( 0 );
       }
     }
   }
index 83e49559f408b9b7bca6425eed8ffcc1ee1db018..23f767fdd72d67d8d930c0c91a675610c421a691 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXGRAPH_PRS_H
 #define QXGRAPH_PRS_H
 
index 261a48429719a702e641ed3246529e9f673e2ff9..565de3bed4a1ac68e12f8d9f38b2a144ce5ba5b5 100644 (file)
@@ -1,32 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QxGraph_ViewManager.h"
 
 /*!
   Constructor
 */
 QxGraph_ViewManager::QxGraph_ViewManager( SUIT_Study* theStudy, 
-                                         SUIT_Desktop* theDesktop, 
-                                         SUIT_ViewModel* theViewModel )
+                                          SUIT_Desktop* theDesktop, 
+                                          SUIT_ViewModel* theViewModel )
   : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
 {
 }
index 4da3ef4fdb759d1b85e7a619e704cc60e8e2dbd3..da1dd08b9f670b0611dcc31357d83a2a853f6839 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXGRAPH_VIEWMANAGER_H
 #define QXGRAPH_VIEWMANAGER_H
 
index acaed5f410fdaefdcd1f21bfa29e65940d529ea8..4d7c6d5dc7c50cc55f1d893ce2a13c1acdde36e3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QxGraph_ViewModel.h"
 #include "QxGraph_ViewWindow.h"
 #include "QxGraph_Canvas.h"
index 91e0fdf835aab4346d15ed48fcbf5d6aec9994b0..ddba3d80a092cacbe378253703c24b0a38a0f9e5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXGRAPH_VIEWMODEL_H
 #define QXGRAPH_VIEWMODEL_H
 
index f6f9ed8cf65a7bdc2ea29a49a3df4b582231f713..a2b19c93cbd7b5f03606f568dbb63910630942dd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #include "QxGraph_ViewWindow.h"
@@ -33,9 +34,6 @@
 //QT Include
 #include <qlayout.h>
 #include <qcolor.h>
-//#include <qcolordialog.h>
-
-using namespace std;
 
 /*!
     Constructor
@@ -126,42 +124,42 @@ void QxGraph_ViewWindow::createActions()
 
   // FitAll
   aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITALL" ) ),
-                         tr( "MNU_FITALL" ), 0, this);
+                          tr( "MNU_FITALL" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITALL"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
   myActionsMap[ FitAllId ] = aAction;
 
   // FitRect
   aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITAREA" ) ),
-                         tr( "MNU_FITRECT" ), 0, this);
+                          tr( "MNU_FITRECT" ), 0, this);
   aAction->setStatusTip(tr("DSC_FITRECT"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
   myActionsMap[ FitRectId ] = aAction;
 
   // Zoom
   aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_ZOOM" ) ),
-                         tr( "MNU_ZOOM_VIEW" ), 0, this);
+                          tr( "MNU_ZOOM_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
   myActionsMap[ ZoomId ] = aAction;
 
   // Panning
   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_PAN" ) ),
-                         tr( "MNU_PAN_VIEW" ), 0, this);
+                          tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
   myActionsMap[ PanId ] = aAction;
 
   // Global Panning
   aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_GLOBALPAN" ) ),
-                         tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+                          tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
   myActionsMap[ GlobalPanId ] = aAction;
 
   // Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_RESET" ) ),
-                         tr( "MNU_RESET_VIEW" ), 0, this);
+                          tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
   myActionsMap[ ResetId ] = aAction;
index 2de18419a8b9cb7202eb9e109e003c4e2e01486f..12dc10fb01d25907ff449bf81c793ba2558cc192 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxGraph : build Supervisor viewer into desktop
 //
 #ifndef QXGRAPH_VIEWWINDOW_H
diff --git a/src/QxGraph/resources/QxGraph_images.po b/src/QxGraph/resources/QxGraph_images.po
deleted file mode 100644 (file)
index 3773805..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      QxGraph_images.po
-#  Created:   03/02/2007
-#  Author:    Margarita Karpunina
-
-
-msgid "ICON_QXGRAPH_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_QXGRAPH_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_QXGRAPH_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_QXGRAPH_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_QXGRAPH_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_QXGRAPH_RESET"
-msgstr "view_reset.png"
-
index 0d2e33a44e57f8d87139446bc4a09223ebee63a4..b2b6b360e46ac08092ac14a403d613b45dbf74dd 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
diff --git a/src/QxGraph/resources/QxGraph_msg_en.po b/src/QxGraph/resources/QxGraph_msg_en.po
deleted file mode 100644 (file)
index 6c16a4d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      QxGraph_msg_en.po
-#  Created:   03/02/2007
-#  Author:    Margarita Karpunina
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "MEN_CHANGE_BACKGROUND"
-msgstr "Change background..."
index ba4779838153bcaa6874a6fe5a2ca047e71e56a0..08f6833f9f87817567db907a969524f025d868c4 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index 6350ae559d5cb7b6399bef2521410d6d39bfee2b..c3db9d9ff802d8da717831061d4932bffd278e78 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef __DEBTRACE_HXX__
 #define __DEBTRACE_HXX__
 
index 86d9c2cafe364d27d10759ae2ed5cabb737e8fa8..f55df9fa2c094f0b6cfa03a7ba22b7dbbf3e3f2a 100755 (executable)
@@ -1,24 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  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 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.
 #
-#  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
 #
-#  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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libQxScene.la
@@ -57,7 +55,8 @@ dist_salomeres_DATA= \
 
 nodist_salomeres_DATA= \
        QxSceneViewer_images.qm \
-       QxSceneViewer_msg_en.qm  
+       QxSceneViewer_msg_en.qm \
+       QxSceneViewer_msg_fr.qm
 
 libQxScene_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
index 858889b613e2126662b33c482362620f45066f00..f21427fe1adeacd32b0340b32233a06b9447ebf4 100644 (file)
@@ -1,28 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxScene : build Supervisor viewer into desktop
 //
 #ifdef WNT
-#ifdef QXSCENE_EXPORTS
+#if defined QXSCENE_EXPORTS || defined QxScene_EXPORTS
 #define QXSCENE_EXPORT __declspec(dllexport)
 #else
 #define QXSCENE_EXPORT __declspec(dllimport)
index 369554a81df4c2b824a7327094742b1466872b47..563061b94baa9d39ac4c547ac45da2f9ebda9f1a 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxScene : build Supervisor viewer into desktop
 //
 #ifndef QXSCENE_DEF_H
index d6846a4d9d985486d31b6d2c66b2f33b6a640473..b64087ed4e485cacf71b78d6de719b06b5ded36f 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QxScene_ViewManager.h"
 #include "QxScene_ViewWindow.h"
 
@@ -29,8 +27,8 @@
   Constructor
 */
 QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy, 
-                                         SUIT_Desktop* theDesktop, 
-                                         SUIT_ViewModel* theViewModel )
+                                          SUIT_Desktop* theDesktop, 
+                                          SUIT_ViewModel* theViewModel )
   : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
 {
   DEBTRACE("QxScene_ViewManager::QxScene_ViewManager");
index 924084c74a1069396ea203c43143e8a27a0035a7..a524385dbe9202da4530d1f3fd58437c3faa00ef 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXSCENE_VIEWMANAGER_H
 #define QXSCENE_VIEWMANAGER_H
 
index 5d2e6755d22fc45e494c5052e2802fe5b7d2ee51..71cf2065d0c0e7cb5d56455648d10e2aa552b640 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "QxScene_ViewModel.h"
 #include "QxScene_ViewWindow.h"
 #include "QxScene_ViewManager.h"
index 565532c2b6e86e2ed0b4c60fbac535d98e36be7b..65329cee9e27cc10ab36713c7338852a79df4fcb 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef QXSCENE_VIEWMODEL_H
 #define QXSCENE_VIEWMODEL_H
 
index 169694bb27e7341629c817512ac97650030e15c1..63aec8dde2b37016ef6d222ea81d5ea444c58c8e 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxScene : build Supervisor viewer into desktop
 //
 #include "QxScene_ViewWindow.h"
@@ -39,8 +37,6 @@
 //#define _DEVDEBUG_
 #include "DebTrace.hxx"
 
-using namespace std;
-
 /*!
     Constructor
 */
@@ -88,7 +84,7 @@ void QxScene_ViewWindow::createActions()
   aAction = new QtxAction( tr( "MNU_FITALL" ),
                            aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ),
                            tr( "MNU_FITALL" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITALL" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) );
   mgr->registerAction( aAction, FitAllId );
@@ -97,16 +93,16 @@ void QxScene_ViewWindow::createActions()
   aAction = new QtxAction( tr( "MNU_FITRECT" ),
                            aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ),
                            tr( "MNU_FITRECT" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_FITRECT" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) );
   mgr->registerAction( aAction, FitRectId );
 
   // 2.3. Zoom
   aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
                            tr( "MNU_ZOOM_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) );
   mgr->registerAction( aAction, ZoomId );
@@ -122,18 +118,18 @@ void QxScene_ViewWindow::createActions()
 
   // 3.1. Panning
   aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
-                          tr( "MNU_PAN_VIEW" ), 
-                          0, this);
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
+                           tr( "MNU_PAN_VIEW" ), 
+                           0, this);
   aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) );
   mgr->registerAction( aAction, PanId );
 
   // 3.2. Global Panning
   aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
                            tr( "MNU_GLOBALPAN_VIEW" ),
-                          0, this);
+                           0, this);
   aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) );
   mgr->registerAction( aAction, GlobalPanId );
@@ -146,9 +142,9 @@ void QxScene_ViewWindow::createActions()
 
   // reset
   aAction = new QtxAction( tr( "MNU_RESET_VIEW" ),
-                          aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
-                          tr( "MNU_RESET_VIEW" ), 
-                          0, this);
+                           aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
+                           tr( "MNU_RESET_VIEW" ), 
+                           0, this);
   aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) );
   connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) );
   mgr->registerAction( aAction, ResetId );
@@ -161,7 +157,7 @@ void QxScene_ViewWindow::createToolBar()
 {
   DEBTRACE("QxScene_ViewWindow::createToolBar");
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
   mgr->append( ResetId, myToolBar );
@@ -276,7 +272,7 @@ SUIT_ResourceMgr* QxScene_ViewWindow::resMgr() const
 bool QxScene_ViewWindow::closeRequested()
 {
   DEBTRACE("QxScene_ViewWindow::closeRequested");
-  bool isClosed = false;
+  bool isClosed = true;
   emit tryClose(isClosed, this);
   DEBTRACE("isClosed=" << isClosed);
   return isClosed;
index dd1f8aa4eadf81a9abb495d0cccb5d932f0342df..631e5410aa6675c7449a8dbb1410155cabd5b083 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME QxScene : build Supervisor viewer into desktop
 //
 #ifndef QXSCENE_VIEWWINDOW_H
index 755bb16b0b30093cc367aa1b578638f3b1919ef9..a5744078f2b86dc9a4dbe5393b84876e9c8a7349 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index e8188cd71158e1762e5bead8361599b174673d45..fe62d243d54c5c46262edf2324167dce42f59c7c 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
diff --git a/src/QxScene/resources/QxScene_images.po b/src/QxScene/resources/QxScene_images.po
deleted file mode 100644 (file)
index 3ea39eb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      QxScene_images.po
-#  Created:   03/02/2007
-#  Author:    Margarita Karpunina
-
-
-msgid "ICON_QXSCENE_FITALL"
-msgstr "qx_view_fitall.png"
-
-msgid "ICON_QXSCENE_FITAREA"
-msgstr "qx_view_fitarea.png"
-
-msgid "ICON_QXSCENE_ZOOM"
-msgstr "qx_view_zoom.png"
-
-msgid "ICON_QXSCENE_PAN"
-msgstr "qx_view_pan.png"
-
-msgid "ICON_QXSCENE_GLOBALPAN"
-msgstr "qx_view_glpan.png"
-
-msgid "ICON_QXSCENE_RESET"
-msgstr "qx_view_reset.png"
-
diff --git a/src/QxScene/resources/QxScene_msg_en.po b/src/QxScene/resources/QxScene_msg_en.po
deleted file mode 100644 (file)
index 44fba1f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      QxScene_msg_en.po
-#  Created:   03/02/2007
-#  Author:    Margarita Karpunina
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "MEN_CHANGE_BACKGROUND"
-msgstr "Change background..."
index e2f33242633e88267028fed5d0f42e3bb84ae098..540483bb2271ebea75f1f0bea78a8aa0d722b35f 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 bin_PROGRAMS = ResourceExporter
diff --git a/src/ResExporter/ResExporter.pro b/src/ResExporter/ResExporter.pro
deleted file mode 100644 (file)
index 8d5157c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = 
-TARGET = ResourceExporter
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += 
-
-SOURCES  = ResourceExporter.cxx
-
index 597059bded6400c33831c30d10c69b635a644f91..fd07b3bea5e42694494780c8738ca53bce0f7516 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File    : ResourceExporter.cxx
 // Author  : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -42,6 +43,7 @@
  The number of parameters is limeted only by maximum possible length of the command line.
 */
 
+#include "GUI_version.h"
 #include "SUIT_ResourceMgr.h"
 #include <QFile>
 #include <QDir>
 */
 static QString salomeVersion()
 {
-  QString path( ::getenv( "GUI_ROOT_DIR" ) );
-  if ( !path.isEmpty() )
-    path += QDir::separator();
-  path += QString( "bin/salome/VERSION" );
-
-  QFile vf( path );
-  if ( !vf.open( QIODevice::ReadOnly ) )
-    return QString();
-
-  QString line( vf.readLine( 1024 ) );
-  vf.close();
-
-  if ( line.isEmpty() )
-    return QString();
-
-  while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
-    line.remove( line.length() - 1, 1 );
-
-  QString ver;
-  int idx = line.lastIndexOf( ":" );
-  if ( idx != -1 )
-    ver = line.mid( idx + 1 ).trimmed();
-
-  return ver;
+  return GUI_VERSION_STR;
 }
 
 /*!
@@ -119,48 +98,48 @@ int main( int argc, char** argv )
     for ( int i = 1; i < argc; i ++ ) {
       QString anArg = QString( argv[i] ).trimmed();
       if ( anArg.startsWith( "-" ) ) {
-       anArg.remove( 0, 1 );
-       if ( anArg.contains( ":" ) ) {
-         QStringList vals = anArg.split( ":", QString::SkipEmptyParts );
-         QString section  = vals[ 0 ].trimmed();
-         QString param    = vals[ 1 ].trimmed();
-         if ( section.isEmpty() || param.isEmpty() ) continue;
-         resMgr->remove( section, param );
-       }
+        anArg.remove( 0, 1 );
+        if ( anArg.contains( ":" ) ) {
+          QStringList vals = anArg.split( ":", QString::SkipEmptyParts );
+          QString section  = vals[ 0 ].trimmed();
+          QString param    = vals[ 1 ].trimmed();
+          if ( section.isEmpty() || param.isEmpty() ) continue;
+          resMgr->remove( section, param );
+        }
       }
       else if ( anArg.contains( "+=" ) ) {
-       QStringList vals = anArg.split( "+=", QString::SkipEmptyParts );
-       if ( vals[ 0 ].contains( ":" ) ) {
-         QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
-         QString section  = vals1[ 0 ].trimmed();
-         QString param    = vals1[ 1 ].trimmed();
-         QString newValue = vals [ 1 ].trimmed();
-         QString separ    = ","; // default separator
-         if ( newValue.contains( "|" ) ) {
-           QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts );
-           newValue = vals2[ 0 ].trimmed();
-           separ  = vals2[ 1 ].trimmed();
-         }
-         if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue;
-         QString value = resMgr->stringValue( section, param );
-         QStringList valsOld = value.split( separ, QString::SkipEmptyParts );
-         QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts );
-         for ( int i = 0; i < (int)valsNew.count(); i++ )
-           if ( !valsOld.contains( valsNew[i] ) )
-             valsOld.append( valsNew[i] );
-         resMgr->setValue( section, param, valsOld.join( separ ) );
-       }
+        QStringList vals = anArg.split( "+=", QString::SkipEmptyParts );
+        if ( vals[ 0 ].contains( ":" ) ) {
+          QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+          QString section  = vals1[ 0 ].trimmed();
+          QString param    = vals1[ 1 ].trimmed();
+          QString newValue = vals [ 1 ].trimmed();
+          QString separ    = ","; // default separator
+          if ( newValue.contains( "|" ) ) {
+            QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts );
+            newValue = vals2[ 0 ].trimmed();
+            separ  = vals2[ 1 ].trimmed();
+          }
+          if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue;
+          QString value = resMgr->stringValue( section, param );
+          QStringList valsOld = value.split( separ, QString::SkipEmptyParts );
+          QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts );
+          for ( int i = 0; i < (int)valsNew.count(); i++ )
+            if ( !valsOld.contains( valsNew[i] ) )
+              valsOld.append( valsNew[i] );
+          resMgr->setValue( section, param, valsOld.join( separ ) );
+        }
       }
       else if ( anArg.contains( "=" ) ) {
-       QStringList vals = anArg.split( "=", QString::SkipEmptyParts );
-       if ( vals[ 0 ].contains( ":" ) ) {
-         QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
-         QString section  = vals1[ 0 ].trimmed();
-         QString param    = vals1[ 1 ].trimmed();
-         QString value = vals [ 1 ].trimmed();
-         if ( section.isEmpty() || param.isEmpty() ) continue;
-         resMgr->setValue( section, param, value );
-       }
+        QStringList vals = anArg.split( "=", QString::SkipEmptyParts );
+        if ( vals[ 0 ].contains( ":" ) ) {
+          QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+          QString section  = vals1[ 0 ].trimmed();
+          QString param    = vals1[ 1 ].trimmed();
+          QString value = vals [ 1 ].trimmed();
+          if ( section.isEmpty() || param.isEmpty() ) continue;
+          resMgr->setValue( section, param, value );
+        }
       }
     }
     resMgr->save();
index 0b47543d3d7c639e77377bec45b333865a6e1426..c4b48bd4874a82207cfcabe62062ad8b6fc00bcc 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOME SALOME_PY : binding of VTK graphics and Python
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
@@ -32,12 +33,12 @@ dist_libSalomePy_la_SOURCES = SalomePy.cxx
 
 libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
        $(OGL_INCLUDES) $(CAS_CXXFLAGS) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ \
-       -DHAVE_CONFIG_H -I$(srcdir)/../SalomeApp -I$(srcdir)/../LightApp \
+       -DHAVE_CONFIG_H -I$(srcdir)/../LightApp                             \
        -I$(srcdir)/../Event -I$(srcdir)/../Session -I$(srcdir)/../SVTK \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../CAM \
        -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../OBJECT \
-       @CAS_CPPFLAGS@ \
-       -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+       @CAS_CPPFLAGS@ 
+
 libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
-       ../SalomeApp/libSalomeApp.la \
-       -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD
+       ../LightApp/libLightApp.la \
+       -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore
index d2812e8560bae86473fd73f273717526fd45b4bb..162ffd22e1fe6e013464cf50ec5d35a72c3e4ee6 100755 (executable)
@@ -1,28 +1,37 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOME_PY : binding of VTK graphics and Python
 //  File   : SalomePy.cxx
 //  Author : Paul RASCLE, EDF
 //
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
 #include <Python.h>
 #include <vtkPythonUtil.h>
 
 #include <SALOME_Event.h>
 
 #include <SUIT_Session.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_Study.h>
 
 #include <SVTK_ViewManager.h>
 #include <SVTK_ViewWindow.h>
 
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
 /*!
   \brief Python wrappings for VTK viewer of the SALOME desktop.
 
@@ -96,10 +107,13 @@ static PyObject* GetPyClass( const char* theClassName )
   static PyObject* aVTKModule = 0;
   PyObject* aPyClass = 0;
   if( !aVTKModule ) {
-    if ( VTK_MAJOR_VERSION > 3 )
-      aVTKModule = PyImport_ImportModule( "libvtkRenderingPython" ); 
-    else
-      aVTKModule = PyImport_ImportModule( "libVTKGraphicsPython" ); 
+#if VTK_XVERSION < 30000
+    aVTKModule = PyImport_ImportModule( "libVTKGraphicsPython" ); 
+#elif VTK_XVERSION < 50700
+    aVTKModule = PyImport_ImportModule( "vtk.libvtkRenderingPython" ); 
+#else
+    aVTKModule = PyImport_ImportModule( "vtkRenderingPython" ); 
+#endif
     if( PyErr_Occurred() ) {
       PyErr_Print();
     }
@@ -130,34 +144,34 @@ static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) {
   SVTK_ViewWindow* aVW = 0;
   if ( SUIT_Session::session() ) {
     // get application
-    SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+    LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
     if ( anApp ) {
       // get active study
-      SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+      LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() );
       if ( aStudy ) {
-       // find or create VTK view manager
-       if ( toCreate == __Create ) {
-         SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->createViewManager( "VTKViewer" ) );
-         if ( aVM ) {
-           aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
-           if ( !aVW )
-             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->createViewWindow() );
-           // VSR : When new view window is created it can be not active yet at this moment,
-           // so the following is a some workaround
-           if ( !aVW && !aVM->getViews().isEmpty() )
-             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
-         }
-       }
-       else {
-         SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) );
-         if ( aVM ) {
-           aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
-           // VSR : When new view window is created it can be not active yet at this moment,
-           // so the following is a some workaround
-           if ( !aVW && !aVM->getViews().isEmpty() )
-             aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
-         }
-       }
+        // find or create VTK view manager
+        if ( toCreate == __Create ) {
+          SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->createViewManager( "VTKViewer" ) );
+          if ( aVM ) {
+            aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
+            if ( !aVW )
+              aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->createViewWindow() );
+            // VSR : When new view window is created it can be not active yet at this moment,
+            // so the following is a some workaround
+            if ( !aVW && !aVM->getViews().isEmpty() )
+              aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
+          }
+        }
+        else {
+          SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) );
+          if ( aVM ) {
+            aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
+            // VSR : When new view window is created it can be not active yet at this moment,
+            // so the following is a some workaround
+            if ( !aVW && !aVM->getViews().isEmpty() )
+              aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
+          }
+        }
       }
     }
   }
@@ -197,7 +211,11 @@ public:
       ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
     if( aVTKViewWindow && aPyClass ) {
       vtkRenderer* aVTKObject = aVTKViewWindow->getRenderer();
+#if VTK_XVERSION < 50700
       myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+      myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
     }
   }
 };
@@ -246,7 +264,11 @@ public:
       ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
     if( aVTKViewWindow && aPyClass ) {
       vtkRenderWindow* aVTKObject = aVTKViewWindow->getRenderWindow();
+#if VTK_XVERSION < 50700
       myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+      myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
     }
   }
 };
@@ -295,7 +317,11 @@ public:
       ::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
     if( aVTKViewWindow && aPyClass ) {
       vtkRenderWindowInteractor* aVTKObject = aVTKViewWindow->getInteractor();
+#if VTK_XVERSION < 50700
       myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+      myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
     }
   }
 };
@@ -332,8 +358,8 @@ extern "C" PyObject* libSalomePy_showTrihedron( PyObject* self, PyObject* args )
     virtual void Execute()
     {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
-       if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
-         aVTKViewWindow->onViewTrihedron();
+        if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
+          aVTKViewWindow->onViewTrihedron();
       }
     }
   };
@@ -365,7 +391,7 @@ extern "C" PyObject* libSalomePy_fitAll( PyObject* self, PyObject* args )
     virtual void Execute()
     {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
-       aVTKViewWindow->onFitAll();
+        aVTKViewWindow->onFitAll();
       }
     }
   };
@@ -394,23 +420,23 @@ extern "C" PyObject* libSalomePy_setView( PyObject* self, PyObject* args )
     virtual void Execute()
     {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
-       switch( myType ) {
-       case ViewFront:
-         aVTKViewWindow->onFrontView();  break;
-       case ViewBack:
-         aVTKViewWindow->onBackView();   break;
-       case ViewTop:
-         aVTKViewWindow->onTopView();    break;
-       case ViewBottom:
-         aVTKViewWindow->onBottomView(); break;
-       case ViewRight:
-         aVTKViewWindow->onRightView();  break;
-       case ViewLeft:
-         aVTKViewWindow->onLeftView();   break;
-       default:
-         PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft );
-         break;
-       }
+        switch( myType ) {
+        case ViewFront:
+          aVTKViewWindow->onFrontView();  break;
+        case ViewBack:
+          aVTKViewWindow->onBackView();   break;
+        case ViewTop:
+          aVTKViewWindow->onTopView();    break;
+        case ViewBottom:
+          aVTKViewWindow->onBottomView(); break;
+        case ViewRight:
+          aVTKViewWindow->onRightView();  break;
+        case ViewLeft:
+          aVTKViewWindow->onLeftView();   break;
+        default:
+          PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft );
+          break;
+        }
       }
     }
   };
@@ -444,7 +470,7 @@ extern "C" PyObject* libSalomePy_resetView( PyObject* self, PyObject* args )
     virtual void Execute()
     {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
-       aVTKViewWindow->onResetView();
+        aVTKViewWindow->onResetView();
       }
     }
   };
@@ -471,7 +497,7 @@ static PyMethodDef Module_Methods[] =
 */
 extern "C" void initlibSalomePy()
 {
-  static char* modulename = "libSalomePy";
+  static char* modulename = (char*)"libSalomePy";
 
   // init module
   PyObject* aModule = Py_InitModule( modulename, Module_Methods );
index 8ef1904319623642eedfb45c18e1ed3d021ba073..f7ec51cb2e608dd2547d6b1e09160003f3050f2a 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Patrick GOLDBRONN (CEA)
 #  Module : SALOME
@@ -26,4 +27,8 @@
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-SUBDIRS = SALOME_PYQT_GUI SalomePyQt 
+SUBDIRS = SALOME_PYQT_GUILight SalomePyQt
+
+if GUI_ENABLE_CORBA
+  SUBDIRS += SALOME_PYQT_GUI
+endif
index a1561d992e5c7adcc06dabebbd60ebf4bfc44e95..02e68be2c7c1b253a85ac9a6018e6b6ae92357ec 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Nicolas REJNERI
 #  Module : SALOME
@@ -30,53 +31,33 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 # library target
 lib_LTLIBRARIES = libSalomePyQtGUI.la
 
-# extra source files (generated by sip)
-SIP_SRC   = sipAPISalomePyQtGUI.h      \
-           sipSalomePyQtGUIcmodule.cc
-
-# Sip definition file
-SIP_FILES = SALOME_PYQT_GUI.sip
-
-# extra dist files
-EXTRA_DIST += $(SIP_FILES)
-
-# extra clean files
-CLEANFILES = $(SIP_SRC)
-
 # moc files (generated my moc)
 MOC_FILES = SALOME_PYQT_Module_moc.cxx
 
 # exported header files
-salomeinclude_HEADERS =                \
-       SALOME_PYQT_GUI.h       \
-       SALOME_PYQT_PyInterp.h  \
-       SALOME_PYQT_Module.h
+salomeinclude_HEADERS =               \
+       SALOME_PYQT_GUI.h      \
+       SALOME_PYQT_Module.h   
 
 # library sources
 dist_libSalomePyQtGUI_la_SOURCES =     \
-       SALOME_PYQT_PyInterp.cxx        \
-       SALOME_PYQT_Module.cxx
-nodist_libSalomePyQtGUI_la_SOURCES = $(MOC_FILES) $(SIP_SRC)
+       SALOME_PYQT_Module.cxx          
+
+nodist_libSalomePyQtGUI_la_SOURCES = $(MOC_FILES)
 
 # compilation flags
 libSalomePyQtGUI_la_CPPFLAGS = $(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES)       \
        $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS)               \
        -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -DCALL_OLD_METHODS                            \
-       -I@builddir@ -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp             \
+       -I. -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp              \
        -I$(srcdir)/../../SUIT -I$(srcdir)/../../Qtx -I$(srcdir)/../../LightApp         \
+       -I$(srcdir)/../SALOME_PYQT_GUILight                                             \
        -I$(srcdir)/../../Plot2d -I$(srcdir)/../../OCCViewer                            \
        -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../CAM -I$(srcdir)/../../STD         \
-       -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+       @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
 
 # linkage flags
 libSalomePyQtGUI_la_LIBADD = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS)       \
        $(OGL_LIBS) ../../PyInterp/libPyInterp.la ../../SalomeApp/libSalomeApp.la       \
-       ../../OCCViewer/libOCCViewer.la ../../Plot2d/libPlot2d.la
-
-# Custom build step: generate C++ wrapping according to $(SIP_FILES)
-$(SIP_SRC): $(SIP_FILES)
-       $(SIP) $(PYQT_SIPFLAGS) $<
-
-# extra dependency (SALOME_PYQT_Module.cxx depends on header files generated by sip)
-$(dist_libSalomePyQtGUI_la_SOURCES): $(SIP_SRC)
-
+       ../../OCCViewer/libOCCViewer.la ../../Plot2d/libPlot2d.la                       \
+       ../SALOME_PYQT_GUILight/libSalomePyQtGUILight.la
index ee67032a5d2a04b5951bf4c2b317906cd1fc9821..129a1cc49821ab00c88650a2ff04de79bfc132da 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SALOME_PYQT_GUI.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -28,7 +29,7 @@
 // ========================================================
 // set dllexport type for Win platform 
 #ifdef WIN32
-#  ifdef SALOME_PYQT_EXPORTS
+#  if defined SALOME_PYQT_EXPORTS || defined SalomePyQtGUI_EXPORTS
 #    define SALOME_PYQT_EXPORT __declspec(dllexport)
 #  else
 #    define SALOME_PYQT_EXPORT __declspec(dllimport)
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.sip b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_GUI.sip
deleted file mode 100644 (file)
index cbfcf33..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  File   : SALOME_PYQT_GUI.sip
-//  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-%Module SalomePyQtGUI
-
-%Import QtGuimod.sip
-%Import QtXmlmod.sip
-
index 0c86c7ae1563506e7c9426b91d2ea0902da49a18..8213a19ce81539b0cab7c15ffde296f31da427bb 100644 (file)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : SALOME_PYQT_Module.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#include "SALOME_PYQT_Module.h"
 
 #include <PyInterp_Dispatcher.h>
 
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_ViewModel.h>
-#include <SUIT_ViewWindow.h>
-#include <SUIT_ViewManager.h>
-#include <STD_MDIDesktop.h>
-#include <STD_TabDesktop.h>
-#include <LightApp_Preferences.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-
-#include <QtxWorkstack.h>
-#include <QtxWorkspace.h>
-#include <QtxActionGroup.h>
-#include <QtxActionMenuMgr.h>
-#include <QtxActionToolMgr.h>
+#include "SALOME_PYQT_Module.h"
+#include "SalomeApp_Application.h"
+#include "SALOME_PYQT_ModuleLight.h"
 
 #include <SALOME_LifeCycleCORBA.hxx>
 #include <Container_init_python.hxx>
+#include <CORBA.h>
 
-#include <QFile>
-#include <QDomDocument>
-#include <QDomNode>
-#include <QDomElement>
-#include <QMenuBar>
-#include <QMenu>
-#include <QAction>
-
-#include "sipAPISalomePyQtGUI.h"
-
-#include <sip.h>
-#if SIP_VERSION < 0x040700
-#include "sipQtGuiQWidget.h"
-#include "sipQtGuiQMenu.h"
-#endif
-
-/*!
-  \brief Default name of the module, replaced at the moment
-  of module creation.
-  \internal
-*/
-const char* DEFAULT_NAME  = "SALOME_PYQT_Module";
-
-/*!
-  \brief Default menu group number.
-  \internal
-*/
-const int DEFAULT_GROUP = 40;
-
-/*!
-  \var IsCallOldMethods
-  \brief Allow calling obsolete callback methods.
-  \internal
-  
-  If the macro CALL_OLD_METHODS is not defined, the invoking
-  of obsolete Python module's methods like setSetting(), definePopup(), 
-  etc. is blocked.
-
-  CALL_OLD_METHODS macro can be defined for example by adding 
-  -DCALL_OLD_METHODS compilation option to the Makefile.
-*/
-#ifdef CALL_OLD_METHODS
-const bool IsCallOldMethods = true;
-#else
-const bool IsCallOldMethods = false;
-#endif
-
-/* Py_ssize_t for old Pythons */
-/* This code is as recommended by: */
-/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-#endif
-
-//
-// NB: Python requests.
-// General rule for Python requests created by SALOME_PYQT_Module:
-// all requests should be executed SYNCHRONOUSLY within the main GUI thread.
-// However, it is obligatory that ANY Python call is wrapped with a request object,
-// so that ALL Python API calls are serialized with PyInterp_Dispatcher.
-//
-
-/*!
-  \class SALOME_PYQT_Module::XmlHandler
-  \brief XML resource files parser.
-  \internal
-
-  This class is used to provide backward compatibility with
-  existing Python modules in which obsolete menu definition system
-  (via XML files) is used.
-*/
-
-class SALOME_PYQT_Module::XmlHandler
-{
-public:
-  XmlHandler( SALOME_PYQT_Module* module, const QString& fileName );
-  void createActions();
-  void createPopup  ( QMenu*         menu,
-                     const QString& context,
-                     const QString& parent,
-                     const QString& object );
-  void activateMenus( bool );
-
-protected:
-  void createToolBar   ( QDomNode&   parentNode );
-  void createMenu      ( QDomNode&   parentNode,
-                        const int   parentMenuId = -1,
-                        QMenu*      parentPopup = 0 );
-
-  void insertPopupItems( QDomNode&   parentNode,
-                        QMenu*      menu );
-
-private:
-  SALOME_PYQT_Module* myModule;
-  QDomDocument        myDoc;
-  QList<int>          myMenuItems;
-};
 
 //
 // NB: Library initialization
-// Since the SalomePyQtGUI library is not imported in Python it's initialization function
+// Since the SalomePyQtGUILight library is not imported in Python it's initialization function
 // should be called manually (and only once) in order to initialize global sip data
 // and to get C API from sip : sipBuildResult for example
 //
-#define INIT_FUNCTION initSalomePyQtGUI
+
+#define INIT_FUNCTION initSalomePyQtGUILight
 #if defined(SIP_STATIC_MODULE)
 extern "C" void INIT_FUNCTION();
 #else
@@ -173,325 +60,165 @@ PyMODINIT_FUNC INIT_FUNCTION();
 
 extern "C" {
   SALOME_PYQT_EXPORT CAM_Module* createModule() {
+
     static bool alreadyInitialized = false;
     if ( !alreadyInitialized ) {
       // call only once (see comment above) !
-      PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
+
+      PyEval_RestoreThread( KERNEL_PYTHON::_gtstate);
       INIT_FUNCTION();
-      PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate );
+      PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate);
       alreadyInitialized = !alreadyInitialized;
     }
     return new SALOME_PYQT_Module();
   }
 }
 
-/*!
-  \class FuncMsg
-  \brief Function call in/out tracer.
-  \internal
-*/
-
-class FuncMsg
-{
-public:
-  FuncMsg( const QString& funcName )
-  {
-    myName = funcName;
-    MESSAGE( myName.toLatin1().constData() << " [ begin ]" );
-  }
-  ~FuncMsg()
-  {
-    MESSAGE( myName.toLatin1().constData() << " [ end ]" );
-  }
-  void message( const QString& msg )
-  {
-    MESSAGE( myName.toLatin1().constData() << " : " << msg.toLatin1().constData() );
-  }
-private:
-  QString myName;
-};
-
-/*!
-  \class SALOME_PYQT_Module
-  \brief This class implements module API for all the Python-based 
-  SALOME modules.
-*/
-
-//
-// Static variables definition
-//
-SALOME_PYQT_Module::InterpMap SALOME_PYQT_Module::myInterpMap;
-SALOME_PYQT_Module* SALOME_PYQT_Module::myInitModule = 0;
 
 /*!
-  \brief Get the module being initialized.
-  
-  This is a little trick :) needed to provide an access from Python
-  (SalomePyQt) to the module being currently activated. The problem
-  that during the process of module initialization (initialize() 
-  function) it is not yet available via application->activeModule()
-  call.
-  
-  This method returns valid pointer only if called in scope of
-  initialize() function.
-
-  \return the module being currently initialized
+  \var __DEFAULT_NAME__ - Default name of the module, replaced at the moment of module creation
 */
-SALOME_PYQT_Module* SALOME_PYQT_Module::getInitModule()
-{
-  return myInitModule;
-}
+const char* __DEFAULT_NAME__  = "SALOME_PYQT_Module";
 
 /*!
 \brief Constructor
-*/
* Constructor
+ */
 SALOME_PYQT_Module::SALOME_PYQT_Module()
-: SalomeApp_Module( DEFAULT_NAME ),
-  myInterp( 0 ),
-  myModule( 0 ), 
-  myXmlHandler ( 0 ),
-  myLastActivateStatus( true )
+  : SalomeApp_Module(__DEFAULT_NAME__),
+    LightApp_Module(__DEFAULT_NAME__),
+    SALOME_PYQT_ModuleLight()
 {
 }
 
 /*!
 \brief Destructor
-*/
* Destructor
+ */
 SALOME_PYQT_Module::~SALOME_PYQT_Module()
 {
-  if ( myXmlHandler )
-    delete myXmlHandler;
 }
 
 /*!
-  \brief Initialization of the module.
-  
-  This method can be used for creation of the menus, toolbars and 
-  other such staff.
-  
-  There are two ways to do this:
-  - for obsolete modules this method first tries to read
-  <module>_<language>.xml resource file which contains a menu,
-  toolbars and popup menus description;
-  - new modules can create menus by direct calling of the
-  corresponding methods of SalomePyQt Python API in the Python
-  module's initialize() method which is called from here.
-
-  NOTE: SALOME supports two modes of modules loading:
-  - immediate (all the modules are created and initialized 
-  immediately when the application object is created;
-  - postponed modules loading (used currently); in this mode
-  the module is loaded only be request.
-  If postponed modules loading is not used, the active
-  study might be not yet defined at this stage, so initialize()
-  method should not perform any study-based initialization.
-
-  \param app parent application object
-*/
-void SALOME_PYQT_Module::initialize( CAM_Application* app )
+ * Get module engine, returns nil var if engine is not found in LifeCycleCORBA
+ */
+Engines::EngineComponent_var SALOME_PYQT_Module::getEngine() const
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::initialize()" );
-
-  // call base implementation
-  SalomeApp_Module::initialize( app );
-
-  // try to get XML resource file name
-  SUIT_ResourceMgr* aResMgr = getApp()->resourceMgr();
-  if ( !myXmlHandler && aResMgr ) {
-    // get current language
-    QString aLang = aResMgr->stringValue( "language", "language", QString() );
-    if ( aLang.isEmpty() ) 
-      aLang = "en";
-    // define resource file name
-    QString aFileName = name() + "_" + aLang + ".xml";
-    aFileName = aResMgr->path( "resources", name(), aFileName );
-    // create XML handler instance
-    if ( !aFileName.isEmpty() && QFile::exists( aFileName ) )
-      myXmlHandler = new SALOME_PYQT_Module::XmlHandler( this, aFileName );
-    // create menus & toolbars from XML file if required
-    if ( myXmlHandler )
-      myXmlHandler->createActions();
+  Engines::EngineComponent_var comp;
+  // temporary solution
+  try {
+    comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name().toLatin1() );
   }
+  catch (CORBA::Exception&) {
+  }
+  return comp;
+}
 
-  // perform internal initialization and call module's initialize() funtion
-  // InitializeReq: request class for internal init() operation
-  class InitializeReq : public PyInterp_Request
+/*!
+ * Get module engine IOR, returns empty string if engine is not found in LifeCycleCORBA
+ */
+QString SALOME_PYQT_Module::engineIOR() const
+{
+  class EngineIORReq : public PyInterp_LockRequest
   {
   public:
-    InitializeReq( CAM_Application*    _app,
-                  SALOME_PYQT_Module* _obj )
-      : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
-        myApp( _app ),
+    EngineIORReq( PyInterp_Interp*    _py_interp,
+                  SALOME_PYQT_Module* _obj )
+      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
         myObj( _obj ) {}
 
   protected:
     virtual void execute()
     {
-      myObj->init( myApp );
+      myObj->getEngineIOR();
     }
 
   private:
-    CAM_Application*    myApp;
     SALOME_PYQT_Module* myObj;
   };
 
   // post request
-  PyInterp_Dispatcher::Get()->Exec( new InitializeReq( app, this ) );
-}
+  PyInterp_Dispatcher::Get()->Exec( new EngineIORReq( myInterp, const_cast<SALOME_PYQT_Module*>( this ) ) );
 
-/*!
-  \brief Activation of the module.
+  return myIOR;
+}
 
-  This function is usually used in order to show the module's 
-  specific menus and toolbars, update actions state and perform
-  other such actions required when the module is activated.
-  
-  Note, that returning \c false in this function prevents the 
-  module activation.
 
-  \param theStudy parent study
-  \return \c true if activation is successful and \c false otherwise
-*/
+/*!
+ * Redefined to invokec correct version
+ */
 bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::activateModule()" );
-
   // call base implementation
   bool res = SalomeApp_Module::activateModule( theStudy );
 
   if ( !res )
     return res;
 
-  // reset the activation status to the default value
-  myLastActivateStatus = true;
-
-  // perform internal activation
-  // ActivateReq: request class for internal activate() operation
-  class ActivateReq : public PyInterp_Request
-  {
-  public:
-    ActivateReq( SUIT_Study*         _study,
-                SALOME_PYQT_Module* _obj )
-      : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
-        myStudy ( _study ),
-        myObj   ( _obj   ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->activate( myStudy );
-    }
-
-  private:
-    SUIT_Study*         myStudy;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request
-  PyInterp_Dispatcher::Get()->Exec( new ActivateReq( theStudy, this ) );
-
-  // check activation status (set by activate())
-  if ( !lastActivationStatus() )
-    return false;
-
-  // activate menus, toolbars, etc
-  if ( myXmlHandler ) myXmlHandler->activateMenus( true );
-  setMenuShown( true );
-  setToolShown( true );
+  // internal activation
+  return activateModuleInternal( theStudy );
+}
 
-  // connect preferences changing signal
-  connect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
-          this,     SLOT(   preferenceChanged( const QString&, const QString&, const QString& ) ) );
+/*!
+ * Tries to get engine IOR from the Python module using engineIOR() function.
+ * That function can load module engine using appropriate container if required.
+ * If this function is not available in Python module, the default implementation
+ * is used which loads engine to the default FactoryServerPy container.
+ */
+void SALOME_PYQT_Module::getEngineIOR()
+{
+  myIOR = "";
 
-  // perform custom activation actions
-  // CustomizeReq: request class for internal customize() operation
-  class CustomizeReq : public PyInterp_Request
-  {
-  public:
-    CustomizeReq( SUIT_Study*         _study,
-                 SALOME_PYQT_Module* _obj )
-      : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
-        myStudy ( _study ),
-        myObj   ( _obj   ) {}
+  // Python interpreter should be initialized and Python module should be
+  // import first
+  if ( !myInterp || !myModule )
+    return;
 
-  protected:
-    virtual void execute()
-    {
-      myObj->customize( myStudy );
+  if ( PyObject_HasAttrString( myModule , "engineIOR" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"engineIOR", (char*)"" ) );
+    if ( !res ) {
+      PyErr_Print();
     }
+    else {
+      // parse the return value, result chould be string
+      if ( PyString_Check( res ) ) {
+        myIOR = PyString_AsString( res );
+      }
+    }
+  }
+  else if ( !CORBA::is_nil( getEngine() ) )
+    myIOR = QString( getApp()->orb()->object_to_string( getEngine() ) );
+}
 
-  private:
-    SUIT_Study*         myStudy;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request
-  PyInterp_Dispatcher::Get()->Exec( new CustomizeReq( theStudy, this ) );
-
-  return true;
+CAM_DataModel* SALOME_PYQT_Module::createDataModel()
+{
+  MESSAGE( "SALOME_PYQT_Module::createDataModel()" );
+  CAM_DataModel * dm = SalomeApp_Module::createDataModel();
+  return dm;
 }
 
 /*!
-  \brief Deactivation of the module.
-
-  This function is usually used in order to hide the module's 
-  specific menus and toolbars and perform other such actions
-  required when the module is deactivated.
+  \brief Process GUI action (from main menu, toolbar or 
+  context popup menu action).
+*/
+void SALOME_PYQT_Module::onGUIEvent(){
+  SALOME_PYQT_ModuleLight::onGUIEvent();
+}
 
-  \param theStudy parent study
-  \return \c true if deactivation is successful and \c false otherwise
+/*!
+  \brief Signal handler closing(SUIT_ViewWindow*) of a view
+  \param pview view being closed
 */
-bool SALOME_PYQT_Module::deactivateModule( SUIT_Study* theStudy )
+void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::deactivateModule()" );
-
-  // disconnect preferences changing signal
-  disconnect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
-             this,     SLOT(   preferenceChanged( const QString&, const QString&, const QString& ) ) );
-
-  // perform internal deactivation
-  // DeactivateReq: request class for internal deactivate() operation
-  class DeactivateReq : public PyInterp_LockRequest
-  {
-  public:
-    DeactivateReq( PyInterp_Interp*    _py_interp,
-                  SUIT_Study*         _study,
-                  SALOME_PYQT_Module* _obj )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myStudy ( _study ),
-        myObj   ( _obj   ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->deactivate( myStudy );
-    }
-
-  private:
-    SUIT_Study*         myStudy;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request
-  PyInterp_Dispatcher::Get()->Exec( new DeactivateReq( myInterp, theStudy, this ) );
-
-  // deactivate menus, toolbars, etc
-  if ( myXmlHandler ) myXmlHandler->activateMenus( false );
-  setMenuShown( false );
-  setToolShown( false );
-
-  // call base implementation
-  return SalomeApp_Module::deactivateModule( theStudy );
+  SALOME_PYQT_ModuleLight::onViewClosed( pview );
 }
 
 /*!
- \brief Get last activation status.
- \return status of last module activation operation
- \sa activateModule()
+  \brief Signal handler tryClose(SUIT_ViewWindow*) of a view
+  \param pview view user tries to close
 */
-bool SALOME_PYQT_Module::lastActivationStatus() const
+void SALOME_PYQT_Module::onViewTryClose( SUIT_ViewWindow* pview )
 {
-  return myLastActivateStatus;
+  SALOME_PYQT_ModuleLight::onViewTryClose( pview );
 }
 
 /*!
@@ -504,1840 +231,26 @@ bool SALOME_PYQT_Module::lastActivationStatus() const
   \param setting preference resource name
 */
 void SALOME_PYQT_Module::preferenceChanged( const QString& module, 
-                                           const QString& section, 
-                                           const QString& setting )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::preferenceChanged()" );
-
-  // perform synchronous request to Python event dispatcher
-  class Event : public PyInterp_LockRequest
-  {
-  public:
-    Event( PyInterp_Interp*    _py_interp,
-          SALOME_PYQT_Module* _obj,
-          const QString&      _section,
-          const QString&      _setting )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myObj    ( _obj ),
-        mySection( _section ),
-        mySetting( _setting ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->prefChanged( mySection, mySetting );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-    QString mySection, mySetting;
-  };
-
-  if ( module != moduleName() ) {
-    // module's own preferences are processed by preferencesChanged() method
-    // ...
-    // post the request only if dispatcher is not busy!
-    // execute request synchronously
-    if ( !PyInterp_Dispatcher::Get()->IsBusy() )
-      PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
-  }
-}
-
-/*!
-  \brief Process study activation.
-  
-  Called when study desktop is activated. Used for notifying the Python
-  module about changing of the active study.
-*/
-void SALOME_PYQT_Module::studyActivated()
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::studyActivated()" );
-
-  // StudyChangedReq: request class for internal studyChanged() operation
-  class StudyChangedReq : public PyInterp_Request
-  {
-  public:
-    StudyChangedReq( SUIT_Study*         _study,
-                    SALOME_PYQT_Module* _obj )
-      : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
-        myStudy ( _study ),
-        myObj   ( _obj   ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->studyChanged( myStudy );
-    }
-
-  private:
-    SUIT_Study*         myStudy;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request
-  PyInterp_Dispatcher::Get()->Exec( new StudyChangedReq( application()->activeStudy(), this ) );
-}
-
-/*!
-  \brief Process GUI action (from main menu, toolbar or 
-  context popup menu action).
-*/
-void SALOME_PYQT_Module::onGUIEvent()
+                                            const QString& section, 
+                                            const QString& setting )
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::onGUIEvent()" );
-
-  // get sender action
-  QAction* action = qobject_cast<QAction*>( sender() );
-  if ( !action )
-    return;
-
-  // get action ID
-  int id = actionId( action );
-  fmsg.message( QString( "action id = %1" ).arg( id ) );
-
-  // perform synchronous request to Python event dispatcher
-  class GUIEvent : public PyInterp_LockRequest
-  {
-  public:
-    GUIEvent( PyInterp_Interp*    _py_interp,
-             SALOME_PYQT_Module* _obj,
-             int                 _id )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myId    ( _id  ),
-        myObj   ( _obj ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->guiEvent( myId );
-    }
-
-  private:
-    int                 myId;
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request
-  PyInterp_Dispatcher::Get()->Exec( new GUIEvent( myInterp, this, id ) );
+  SALOME_PYQT_ModuleLight::preferenceChanged(module,section,setting);
 }
 
 /*!
-  \brief Process context popup menu request.
-  
-  Called when user activates popup menu in some window
-  (view, object browser, etc).
-
-  \param theContext popup menu context (e.g. "ObjectBrowser")
-  \param thePopupMenu popup menu
-  \param title popup menu title (not used)
+  \brief Signal handler windowActivated(SUIT_ViewWindow*) of SUIT_Desktop
+  \param pview view being activated
 */
-void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext, 
-                                          QMenu*         thePopupMenu, 
-                                          QString&       /*title*/ )
+void SALOME_PYQT_Module::onActiveViewChanged( SUIT_ViewWindow* pview )
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::contextMenuPopup()" );
-  fmsg.message( QString( "context: %1" ).arg( theContext ) );
-
-  // perform synchronous request to Python event dispatcher
-  class PopupMenuEvent : public PyInterp_LockRequest
-  {
-  public:
-    PopupMenuEvent( PyInterp_Interp*    _py_interp,
-                   SALOME_PYQT_Module* _obj,
-                   const QString&      _context,
-                   QMenu*        _popup )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myContext( _context ),
-        myPopup  ( _popup  ),
-        myObj    ( _obj )   {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->contextMenu( myContext, myPopup );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-    QString             myContext;
-    QMenu*         myPopup;
-  };
-
-  // post request only if dispatcher is not busy!
-  // execute request synchronously
-  if ( !PyInterp_Dispatcher::Get()->IsBusy() )
-    PyInterp_Dispatcher::Get()->Exec( new PopupMenuEvent( myInterp, this, theContext, thePopupMenu ) );
+  SALOME_PYQT_ModuleLight::onActiveViewChanged(pview);
 }
 
 /*!
-  \brief Export preferences for the Python module.
-  
-  Called only once when the first instance of the module is created.
+  \brief Signal handler cloneView() of OCCViewer_ViewWindow
+  \param pview view being cloned
 */
-void SALOME_PYQT_Module::createPreferences()
+void SALOME_PYQT_Module::onViewCloned( SUIT_ViewWindow* pview )
 {
-  FuncMsg fmsg( "SALOME_PYQT_Module::createPreferences()" );
-
-  // perform synchronous request to Python event dispatcher
-  class Event : public PyInterp_LockRequest
-  {
-  public:
-    Event( PyInterp_Interp*    _py_interp,
-          SALOME_PYQT_Module* _obj )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myObj    ( _obj )   {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->initPreferences();
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-  };
-
-  // post request only if dispatcher is not busy!
-  // execute request synchronously
-  if ( !PyInterp_Dispatcher::Get()->IsBusy() )
-    PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this ) );
-}
-
-/*!
-  \brief Define the dockable windows associated with the module.
-  
-  To fill the list of windows the correspondind Python module's windows()
-  method is called from SALOME_PYQT_Module::init() method.
-
-  By default, ObjectBrowser, PythonConsole and LogWindow windows are 
-  associated to the module.
-
-  Allowed dockable windows:
-  - SalomeApp_Application::WT_ObjectBrowser : object browser
-  - SalomeApp_Application::WT_PyConsole : python console
-  - SalomeApp_Application::WT_LogWindow : log messages output window
-
-  Dock area is defined by Qt::DockWidgetArea enumeration:
-  - Qt::TopDockWidgetArea : top dock area
-  - Qt::BottomDockWidgetArea : bottom dock area
-  - Qt::LeftDockWidgetArea : left dock area
-  - Qt::RightDockWidgetArea : right dock area
-
-  \param mappa map of dockable windows: { <window_type> : <dock_area> }
-*/
-void SALOME_PYQT_Module::windows( QMap<int, int>& mappa ) const
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::windows()" );
-
-  mappa = myWindowsMap;
-}
-
-/*!
-  \brief Define the compatible view windows associated with the module.
-
-  The associated view windows are opened automatically when the module
-  is activated.
-
-  To fill the list of views the correspondind Python module's views()
-  method is called from SALOME_PYQT_Module::init() method.
-  By default, the list is empty.
-
-  \param listik list of view windows types
-*/
-void SALOME_PYQT_Module::viewManagers( QStringList& lst ) const
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::viewManagers()" );
-
-  lst = myViewMgrList;
-}
-
-/*!
-  \brief Process module's preferences changing.
-
-  Called when the module's preferences are changed.
-  
-  \param section setting section
-  \param setting setting name
-*/
-void SALOME_PYQT_Module::preferencesChanged( const QString& section, const QString& setting )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::preferencesChanged()" );
-
-  // perform synchronous request to Python event dispatcher
-  class Event : public PyInterp_LockRequest
-  {
-  public:
-    Event( PyInterp_Interp*    _py_interp,
-          SALOME_PYQT_Module* _obj,
-          const QString&      _section,
-          const QString&      _setting )
-      : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
-        myObj    ( _obj ),
-        mySection( _section ),
-        mySetting( _setting ) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->prefChanged( mySection, mySetting );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-    QString mySection, mySetting;
-  };
-
-  // post request only if dispatcher is not busy!
-  // execut request synchronously
-  if ( !PyInterp_Dispatcher::Get()->IsBusy() )
-    PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
-}
-
-/*!
-  \brief Internal module initialization:
-
-  Performs the following actions:
-  - initialize or get the Python interpreter (one per study)
-  - import the Python module
-  - pass the workspace widget to the Python module
-  - call Python module's initialize() method
-  - call Python module's windows() method
-  - call Python module's views() method
-
-  \param app parent application object
-*/
-void SALOME_PYQT_Module::init( CAM_Application* app )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::init()" );
-
-  // reset interpreter to NULL
-  myInterp = NULL;
-
-  // get study Id
-  SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( app );
-  if ( !anApp )
-    return;
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
-  if ( !aStudy )
-    return;
-  int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
-  // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
-  initInterp( aStudyId );
-  if ( !myInterp )
-    return; // Error
-
-  // import Python GUI module
-  importModule();
-  if ( !myModule )
-    return; // Error
-
-  // this module is being activated now!
-  myInitModule = this;
-
-  // then call Python module's initialize() method
-  // ... first get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-  // ... (the Python module is already imported)
-  // ... finally call Python module's initialize() method
-  if ( PyObject_HasAttrString( myModule , "initialize" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) );
-    if ( !res ) {
-      PyErr_Print();
-    }
-  }
-
-  // get required dockable windows list from the Python module 
-  // by calling windows() method
-  // ... first put default values
-  myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
-  myWindowsMap.insert( SalomeApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
-  myWindowsMap.insert( SalomeApp_Application::WT_LogWindow,     Qt::BottomDockWidgetArea );
-
-  if ( PyObject_HasAttrString( myModule , "windows" ) ) {
-    PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
-    if ( !res1 ) {
-      PyErr_Print();
-    }
-    else {
-      myWindowsMap.clear();
-      if ( PyDict_Check( res1 ) ) {
-        PyObject* key;
-        PyObject* value;
-        Py_ssize_t pos = 0;
-        while ( PyDict_Next( res1, &pos, &key, &value ) ) {
-         // parse the return value
-         // it should be a map: {integer:integer}
-         int aKey, aValue;
-         if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) {
-           aKey   = PyInt_AsLong( key );
-           aValue = PyInt_AsLong( value );
-           myWindowsMap[ aKey ] = aValue;
-         }
-        }
-      }
-    }
-  }
-
-  // get compatible view windows types from the Python module 
-  // by calling views() method
-  if ( PyObject_HasAttrString( myModule , "views" ) ) {
-    PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) );
-    if ( !res2 ) {
-      PyErr_Print();
-    }
-    else {
-      // parse the return value
-      // result can be one string...
-      if ( PyString_Check( res2 ) ) {
-        myViewMgrList.append( PyString_AsString( res2 ) );
-      }
-      // ... or list of strings
-      else if ( PyList_Check( res2 ) ) {
-        int size = PyList_Size( res2 );
-        for ( int i = 0; i < size; i++ ) {
-         PyObject* value = PyList_GetItem( res2, i );
-         if( value && PyString_Check( value ) ) {
-           myViewMgrList.append( PyString_AsString( value ) );
-         }
-        }
-      }
-    }
-  }
-  // module is already activated!
-  myInitModule = 0;
-}
-
-/*!
-  \brief Internal activation:
-
-  Performs the following actions:
-  - initialize or get the Python interpreter (one per study)
-  - import the Python GUI module
-  - call Python module's activate() method
-
-  \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::activate( SUIT_Study* theStudy )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::activate()" );
-
-  // get study Id
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
-  int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
-  // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
-  initInterp( aStudyId );
-  if ( !myInterp )
-    return; // Error
-
-  // import Python GUI module
-  importModule();
-  if ( !myModule )
-    return; // Error
-
-  // get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-
-  // call Python module's activate() method (for the new modules)
-  if ( PyObject_HasAttrString( myModule , "activate" ) ) {
-    PyObject* res1 = PyObject_CallMethod( myModule, "activate", "" );
-    if ( !res1 || !PyBool_Check( res1 ) ) {
-      PyErr_Print();
-      // always true for old modules (no return value)
-      myLastActivateStatus = true;
-    }
-    else {
-      // detect return status
-      myLastActivateStatus = PyObject_IsTrue( res1 );
-    }
-  } 
-  
-  // Connect the SUIT_Desktop signal windowActivated() to this->onActiveViewChanged()
-  SUIT_Desktop* aDesk = theStudy->application()->desktop();
-  if ( aDesk )
-  {
-    connect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-            this,  SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );
-    // If a active window exists send activeViewChanged
-    // If a getActiveView() in SalomePyQt available we no longer need this 
-    SUIT_ViewWindow* aView = aDesk->activeWindow();
-    if ( aView ) 
-      activeViewChanged( aView );
-    
-    // get all view currently opened in the study and connect their signals  to 
-    // the corresponding slots of the class.
-    QList<SUIT_ViewWindow*> wndList = aDesk->windows();
-    SUIT_ViewWindow* wnd;
-    foreach ( wnd, wndList )
-      connectView( wnd );
-  }
-}
-
-/*!
-  \brief Additional customization after module is activated:
-
-  Performs the following actions:
-  - get the Python interpreter (one per study)
-  - import the Python GUI module
-  - call Python module's setSettings() method (obsolete function, 
-  used for compatibility with old code)
-
-  \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::customize( SUIT_Study* theStudy )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::customize()" );
-
-  // get study Id
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
-  int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
-  // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
-  initInterp( aStudyId );
-  if ( !myInterp )
-    return; // Error
-
-  // import Python GUI module
-  importModule();
-  if ( !myModule )
-    return; // Error
-
-  if ( IsCallOldMethods ) {
-    // call Python module's setWorkspace() method
-    setWorkSpace();
-  }
-
-  // get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-
-  if ( IsCallOldMethods ) {
-    // call Python module's setSettings() method (obsolete)
-    if ( PyObject_HasAttrString( myModule , "setSettings" ) ) {
-      PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) );
-      if( !res ) {
-        PyErr_Print();
-      }
-    }
-  }
-}
-
-/*!
-  \brief Internal deactivation:
-
-  Performs the following actions:
-  - call Python module's deactivate() method
-
-  \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::deactivate( SUIT_Study* theStudy )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::deactivate()" );
-
-  // check if the subinterpreter is initialized and Python module is imported
-  if ( !myInterp || !myModule ) {
-    // Error! Python subinterpreter should be initialized and module should be imported first!
-    return;
-  }
-  // then call Python module's deactivate() method
-  if ( PyObject_HasAttrString( myModule , "deactivate" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-  
-  // Disconnect the SUIT_Desktop signal windowActivated()
-  SUIT_Desktop* aDesk = theStudy->application()->desktop();
-  if ( aDesk )
-  {
-    disconnect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
-                this,  SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );      
-  }
-}
-
-/*!
-  \brief Perform internal actions when active study is changed.
-
-  Called when active the study is actived (user brings its 
-  desktop to top):
-  - initialize or get the Python interpreter (one per study)
-  - import the Python GUI module
-  - call Python module's activeStudyChanged() method
-
-  \param theStudy study being activated
-*/
-void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::studyChanged()" );
-
-  // get study Id
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
-  int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
-  // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
-  initInterp( aStudyId );
-  if ( !myInterp )
-    return; // Error
-
-  // import Python GUI module
-  importModule();
-  if ( !myModule )
-    return; // Error
-
-  if ( IsCallOldMethods ) {
-    // call Python module's setWorkspace() method
-    setWorkSpace();
-  }
-
-  // get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-
-  // call Python module's activeStudyChanged() method
-  if ( PyObject_HasAttrString( myModule , "activeStudyChanged" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-}
-
-/*!
-  \brief Get module engine.
-
-  Returns nil var if engine is not found in LifeCycleCORBA.
-  
-  \return module's engine reference
-*/
-Engines::Component_var SALOME_PYQT_Module::getEngine() const
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::getEngine()" );
-
-  Engines::Component_var comp;
-  try {
-    comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name().toLatin1() );
-  }
-  catch ( CORBA::Exception& ) {
-  }
-  return comp;
-}
-
-/*!
-  \birief Get module engine IOR.
-
-  Returns empty string if engine is not found in LifeCycleCORBA.
-
-  \return module's engine IOR
-*/
-QString SALOME_PYQT_Module::engineIOR() const
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::engineIOR()" );
-
-  QString anIOR = "";
-  if ( !CORBA::is_nil( getEngine() ) )
-    anIOR = getApp()->orb()->object_to_string( getEngine() );
-  return anIOR;
-}
-
-/*!
-  \brief Process (internally) context popup menu request.
-
-  Performs the following actions:
-  - calls Python module's definePopup(...) method (obsolete function, 
-  used for compatibility with old code) to define the popup menu context
-  - parses XML resourses file (if exists) and fills the popup menu with the items)
-  - calls Python module's customPopup(...) method (obsolete function, 
-  used for compatibility with old code) to allow module to customize the popup menu
-  - for new modules calls createPopupMenu() function to allow the 
-  modules to build the popup menu by using insertItem(...) Qt functions.
-
-  \param theContext popup menu context
-  \param thePopupMenu popup menu
-*/
-void SALOME_PYQT_Module::contextMenu( const QString& theContext, QMenu* thePopupMenu )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::contextMenu()" );
-
-  // Python interpreter should be initialized and Python module should be
-  // import first
-  if ( !myInterp || !myModule )
-    return;
-
-  QString aContext( "" ), aObject( "" ), aParent( theContext );
-
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "definePopup" ) ) {
-    // call definePopup() Python module's function
-    // this is obsolete function, used only for compatibility reasons
-    PyObjWrapper res( PyObject_CallMethod( myModule,
-                                          "definePopup",
-                                          "sss",
-                                          aContext.toLatin1().constData(),
-                                          aObject.toLatin1().constData(),
-                                          aParent.toLatin1().constData() ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-    else {
-      // parse return value
-      char *co, *ob, *pa;
-      if( PyArg_ParseTuple( res, "sss", &co, &ob, &pa ) ) {
-        aContext = co;
-       aObject  = ob;
-       aParent  = pa;
-      }
-    }
-  } // if ( IsCallOldMethods ... )
-
-  // first try to create menu via XML parser:
-  // we create popup menus without help of QtxPopupMgr
-  if ( myXmlHandler )
-    myXmlHandler->createPopup( thePopupMenu, aContext, aParent, aObject );
-
-  PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QMenu ) );
-
-  // then call Python module's createPopupMenu() method (for new modules)
-  if ( PyObject_HasAttrString( myModule , "createPopupMenu" ) ) {
-    PyObjWrapper res1( PyObject_CallMethod( myModule,
-                                           "createPopupMenu",
-                                           "Os",
-                                           sipPopup.get(),
-                                           aContext.toLatin1().constData() ) );
-    if( !res1 ) {
-      PyErr_Print();
-    }
-  }
-
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "customPopup" ) ) {
-    // call customPopup() Python module's function
-    // this is obsolete function, used only for compatibility reasons
-    PyObjWrapper res2( PyObject_CallMethod( myModule,
-                                           "customPopup",
-                                           "Osss",
-                                           sipPopup.get(),
-                                           aContext.toLatin1().constData(),
-                                           aObject.toLatin1().constData(),
-                                           aParent.toLatin1().constData() ) );
-    if( !res2 ) {
-      PyErr_Print();
-    }
-  }
-}
-
-/*!
-  \brief Internal GUI event handling.
-
-  Performs the following actions:
-  - calls Python module's OnGUIEvent() method
-
-  \param theId GUI action ID
-*/
-void SALOME_PYQT_Module::guiEvent( const int theId )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::guiEvent()" );
-
-  // Python interpreter should be initialized and Python module should be
-  // import first
-  if ( !myInterp || !myModule )
-    return;
-
-  if ( PyObject_HasAttrString( myModule , "OnGUIEvent" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-}
-
-/*!
-  \brief Initialize (internally) preferences for the module.
-
-  Performs the following actions:
-  - calls Python module's createPreferences() method
-*/
-void SALOME_PYQT_Module::initPreferences()
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::initPreferences()" );
-
-  // Python interpreter should be initialized and Python module should be
-  // import first
-  if ( !myInterp || !myModule )
-    return;
-
-  // temporary set myInitModule because createPreferences() method
-  // might be called during the module intialization process
-  myInitModule = this;
-
-  if ( PyObject_HasAttrString( myModule , "createPreferences" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-
-  myInitModule = 0;
-}
-
-/*!
-  \brief Initialize python subinterpreter (one per study).
-  \param theStudyId study ID
-*/
-void SALOME_PYQT_Module::initInterp( int theStudyId )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::initInterp()" );
-
-  // check study Id
-  if ( !theStudyId ) {
-    // Error! Study Id must not be 0!
-    myInterp = NULL;
-    return;
-  }
-  // try to find the subinterpreter
-  if( myInterpMap.contains( theStudyId ) ) {
-    // found!
-    myInterp = myInterpMap[ theStudyId ];
-    return;
-  }
-  // not found - create a new one!
-  ///////////////////////////////////////////////////////////////////
-  // Attention: the creation of Python interpretor must be protected
-  // by a C++ Lock because of C threads
-  ///////////////////////////////////////////////////////////////////
-  myInterp = new SALOME_PYQT_PyInterp();
-  myInterp->initialize();
-  myInterpMap[ theStudyId ] = myInterp;
-
-  // import 'salome' module and call 'salome_init' method;
-  // do it only once on interpreter creation
-  // ... first get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-  // ... then import a module
-  PyObjWrapper aMod = PyImport_ImportModule( "salome" );
-  if( !aMod ) {
-    // Error!
-    PyErr_Print();
-    return;
-  }
-  // ... then call a method
-  int embedded = 1;
-  PyObjWrapper aRes( PyObject_CallMethod( aMod, "salome_init", "ii", theStudyId, embedded ) );
-  if( !aRes ) {
-    // Error!
-    PyErr_Print();
-    return;
-  }
-}
-
-/*!
-  \brief Import Python GUI module and remember the reference to the module.
-
-  Attention! initInterp() should be called first!!!
-*/
-void SALOME_PYQT_Module::importModule()
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::importModule()" );
-
-  // check if the subinterpreter is initialized
-  if ( !myInterp ) {
-    // Error! Python subinterpreter should be initialized first!
-    myModule = 0;
-    return;
-  }
-  // import Python GUI module and puts it in <myModule> attribute
-  // ... first get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-  // ... then import a module
-  QString aMod = name() + "GUI";
-  myModule = PyImport_ImportModule( aMod.toLatin1().data() );
-  if( !myModule ) {
-    // Error!
-    PyErr_Print();
-    return;
-  }
-}
-
-/*!
-  \brief Set study workspace to the Python module.
-
-  Calls setWorkSpace() method of the Pythohn module with 
-  PyQt QWidget object to use with interpreter.
-
-  Attention! initInterp() and importModule() should be called first!!!
-*/
-void SALOME_PYQT_Module::setWorkSpace()
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::setWorkSpace()" );
-
-  // check if the subinterpreter is initialized and Python module is imported
-  if ( !myInterp || !myModule ) {
-    // Error! Python subinterpreter should be initialized and module should be imported first!
-    return;
-  }
-
-  // call setWorkspace() method
-  // ... first get python lock
-  PyLockWrapper aLock = myInterp->GetLockWrapper();
-
-  // ... then try to import SalomePyQt module. If it's not possible don't go on.
-  PyObjWrapper aQtModule( PyImport_ImportModule( "SalomePyQt" ) );
-  if( !aQtModule ) {
-    // Error!
-    PyErr_Print();
-    return;
-  }
-
-  if ( IsCallOldMethods ) {
-    // ... then get workspace object
-    QWidget* aWorkspace = 0;
-    if ( getApp()->desktop()->inherits( "STD_MDIDesktop" ) ) {
-      STD_MDIDesktop* aDesktop = dynamic_cast<STD_MDIDesktop*>( getApp()->desktop() );
-      if ( aDesktop )
-        aWorkspace = aDesktop->workspace();
-    }
-    else if ( getApp()->desktop()->inherits( "STD_TabDesktop" ) ) {
-      STD_TabDesktop* aDesktop = dynamic_cast<STD_TabDesktop*>( getApp()->desktop() );
-      if ( aDesktop )
-        aWorkspace = aDesktop->workstack();
-    }
-    PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) );
-    // ... and finally call Python module's setWorkspace() method (obsolete)
-    if ( PyObject_HasAttrString( myModule , "setWorkSpace" ) ) {
-      PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) );
-      if( !res ) {
-        PyErr_Print();
-      }
-    }
-  }
-}
-
-/*!
-  \brief Preference changing callback function (internal).
-
-  Performs the following actions:
-  - call Python module's preferenceChanged() method
-
-  \param section setting section name
-  \param setting setting name
-*/
-void SALOME_PYQT_Module::prefChanged( const QString& section, const QString& setting )
-{
-  FuncMsg fmsg( "SALOME_PYQT_Module::prefChanged()" );
-
-  // Python interpreter should be initialized and Python module should be
-  // import first
-  if ( !myInterp || !myModule )
-    return;
-
-  if ( PyObject_HasAttrString( myModule , "preferenceChanged" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule,
-                                          "preferenceChanged", 
-                                          "ss", 
-                                          section.toLatin1().constData(), 
-                                          setting.toLatin1().constData() ) );
-    if( !res ) {
-      PyErr_Print();
-    }
-  }
-}
-
-/*!
-  \brief Get default menu group identifier
-  \return menu group ID (40 by default)
-*/
-int SALOME_PYQT_Module::defaultMenuGroup()
-{
-  return DEFAULT_GROUP; 
-}
-
-//
-// The next methods call the parent implementation.
-// This is done to open protected methods from CAM_Module class.
-//
-
-/*!
-  \brief Create toolbar with specified \a name.
-  \param name toolbar name
-  \return toolbar ID or -1 if toolbar creation is failed
-*/
-int SALOME_PYQT_Module::createTool( const QString& name )
-{
-  return SalomeApp_Module::createTool( name );
-}
-
-/*! 
-  \brief Insert action with specified \a id to the toolbar.
-  \param id action ID
-  \param tBar toolbar ID
-  \param idx required index in the toolbar
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( const int id, const int tBar, const int idx )
-{
-  return SalomeApp_Module::createTool( id, tBar, idx );
-}
-
-/*!
-  \brief Insert action with specified \a id to the toolbar.
-  \param id action ID
-  \param tBar toolbar name
-  \param idx required index in the toolbar
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( const int id, const QString& tBar, const int idx )
-{
-  return SalomeApp_Module::createTool( id, tBar, idx );
-}
-
-/*!
-  \brief Insert action to the toolbar.
-  \param a action
-  \param tBar toolbar ID
-  \param id required action ID
-  \param idx required index in the toolbar
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
-{
-  return SalomeApp_Module::createTool( a, tBar, id, idx );
-}
-
-/*!
-  \brief Insert action to the toolbar.
-  \param a action
-  \param tBar toolbar name
-  \param id required action ID
-  \param idx required index in the toolbar
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
-{
-  return SalomeApp_Module::createTool( a, tBar, id, idx );
-}
-
-/*!
-  \brief Create main menu.
-  \param subMenu menu name
-  \param menu parent menu ID
-  \param id required menu ID
-  \param group menu group ID
-  \param idx required index in the menu
-  \return menu ID or -1 if menu could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
-}
-
-/*!
-  \brief Create main menu.
-  \param subMenu menu name
-  \param menu parent menu name (list of menu names separated by "|")
-  \param id required menu ID
-  \param group menu group ID
-  \param idx required index in the menu
-  \return menu ID or -1 if menu could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
-}
-
-/*!
-  \brief Insert action to the main menu.
-  \param id action ID
-  \param menu parent menu ID
-  \param group menu group ID
-  \param idx required index in the menu
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const int id, const int menu, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( id, menu, group, idx );
-}
-
-/*!
-  \brief Insert action to the main menu.
-  \param id action ID
-  \param menu parent menu name (list of menu names separated by "|")
-  \param group menu group ID
-  \param idx required index in the menu
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( id, menu, group, idx );
-}
-
-/*!
-  \brief Insert action to the main menu.
-  \param a action
-  \param menu parent menu ID
-  \param group menu group ID
-  \param idx required index in the menu
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( a, menu, id, group, idx );
-}
-
-/*!
-  \brief Insert action to the main menu.
-  \param a action
-  \param menu parent menu name (list of menu names separated by "|")
-  \param group menu group ID
-  \param idx required index in the menu
-  \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
-{
-  return SalomeApp_Module::createMenu( a, menu, id, group, idx );
-}
-
-/*!
-  \brief Create separator action which can be used in the menu or toolbar.
-  \return new separator action
-*/
-QAction* SALOME_PYQT_Module::separator()
-{
-  return SalomeApp_Module::separator();
-}
-
-/*!
-  \brief Get action by specified \a id.
-  \return action or 0 if it is not found
-*/
-QAction* SALOME_PYQT_Module::action( const int id ) const
-{
-  QAction* a = SalomeApp_Module::action( id );
-  if ( !a ) {
-    // try menu
-    QMenu* m = menuMgr()->findMenu( id );
-    if ( m ) a = m->menuAction();
-  }
-  return a;
-}
-
-/*!
-  \brief Get action identifier.
-  \return action ID or -1 if action is not registered
-*/
-int SALOME_PYQT_Module::actionId( const QAction* a ) const
-{
-  return SalomeApp_Module::actionId( a );
-}
-
-/*!
-  \brief Create new action.
-  
-  If the action with specified identifier already registered
-  it is not created, but its attributes are only modified.
-
-  \param id action ID
-  \param text tooltip text
-  \param icon icon
-  \param menu menu text
-  \param tip status tip
-  \param key keyboard shortcut
-  \param toggle \c true for checkable action
-  \return created action
-*/
-QAction* SALOME_PYQT_Module::createAction( const int id, const QString& text, const QString& icon,
-                                          const QString& menu, const QString& tip, const int key,
-                                          const bool toggle, QObject* parent )
-{
-  QIcon anIcon = loadIcon( icon );
-  QAction* a = action( id );
-  if ( a ) {
-    if ( a->toolTip().isEmpty()   && !text.isEmpty() )  a->setToolTip( text );
-    if ( a->text().isEmpty()      && !menu.isEmpty() )  a->setText( menu );
-    if ( a->icon().isNull()       && !anIcon.isNull() ) a->setIcon( anIcon );
-    if ( a->statusTip().isEmpty() && !tip.isEmpty() )   a->setStatusTip( tip );
-    if ( a->shortcut().isEmpty()  && key )              a->setShortcut( key );
-    if ( a->isCheckable() != toggle )                   a->setCheckable( toggle );
-    disconnect( a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
-    connect(    a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
-  }
-  else {
-    a = SalomeApp_Module::createAction( id, 
-                                       text, 
-                                       anIcon, 
-                                       menu, 
-                                       tip, 
-                                       key, 
-                                       parent ? parent : this, 
-                                       toggle, 
-                                       this, 
-                                       SLOT( onGUIEvent() ) );
-  }
-  return a;
-}
-
-/*!
-  \brief Create new action group.
-  
-  If the action with specified identifier already registered
-  it is not created, but its attributes are only modified.
-
-  \param id action ID
-  \param text tooltip text
-  \param icon icon
-  \param menu menu text
-  \param tip status tip
-  \param key keyboard shortcut
-  \param toggle \c true for checkable action
-  \return created action
-*/
-QtxActionGroup* SALOME_PYQT_Module::createActionGroup(const int id, const bool exclusive)
-{
-  QtxActionGroup* a = qobject_cast<QtxActionGroup*>( action( id ) );
-  if ( !a ) {
-    a = new QtxActionGroup( this );
-    SalomeApp_Module::registerAction( id, a );
-  }
-  a->setExclusive( exclusive );
-  return a;
-}
-
-/*! 
-  \brief Load icon from resource file.
-  \param fileName icon file name
-  \return icon (null icon if loading failed)
-*/
-QIcon SALOME_PYQT_Module::loadIcon( const QString& fileName )
-{
-  QIcon anIcon;
-  if ( !fileName.isEmpty() ) {
-    QPixmap pixmap = getApp()->resourceMgr()->loadPixmap( name(), tr( fileName.toLatin1() ) );
-    if ( !pixmap.isNull() )
-      anIcon = QIcon( pixmap );
-  }
-  return anIcon;
-}
-
-/*!
-  \brief Add global application preference (for example, 
-  application specific section).
-  \param label preference name
-  \return preference ID
-*/
-int SALOME_PYQT_Module::addGlobalPreference( const QString& label )
-{
-  LightApp_Preferences* pref = preferences();
-  if ( !pref )
-    return -1;
-
-  return pref->addPreference( label, -1 );
-}
-
-/*!
-  \brief Add preference.
-  \param label preference name
-  \return preference ID
-*/
-int SALOME_PYQT_Module::addPreference( const QString& label )
-{
-  return SalomeApp_Module::addPreference( label );
-}
-                                      
-/*!
-  \brief Add preference.
-  \param label preference name
-  \param pId parent preference ID
-  \param type preference type
-  \param section resource file section name
-  \param param resource file setting name
-  \return preference ID
-*/
-int SALOME_PYQT_Module::addPreference( const QString& label, 
-                                      const int pId, const int type,
-                                      const QString& section,
-                                      const QString& param )
-{
-  return SalomeApp_Module::addPreference( label, pId, type, section, param );
-}
-
-/*!
-  \brief Get the preference property.
-  \param id preference ID
-  \param prop property name
-  \return property value (invalid QVariant() if property is not found)
-*/
-QVariant SALOME_PYQT_Module::preferenceProperty( const int id, 
-                                                const QString& prop ) const
-{
-  QVariant v = SalomeApp_Module::preferenceProperty( id, prop );
-  return v;
-}
-
-/*!
-  \brief Set the preference property.
-  \param id preference ID
-  \param prop property name
-  \param var property value
-*/
-void SALOME_PYQT_Module::setPreferenceProperty( const int id, 
-                                               const QString& prop, 
-                                               const QVariant& var )
-{
-  SalomeApp_Module::setPreferenceProperty( id, prop, var );
-}
-
-
-/*!
-  \brief Signal handler windowActivated(SUIT_ViewWindow*) of SUIT_Desktop
-  \param pview view being activated
-*/
-void SALOME_PYQT_Module::onActiveViewChanged( SUIT_ViewWindow* pview )
-{
-  class ActiveViewChange : public PyInterp_LockRequest
-  {
-  public:
-    ActiveViewChange( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
-      : PyInterp_LockRequest( _py_interp, 0, true ),
-        myObj(_obj),myView(_pview) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->activeViewChanged( myView );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-    const SUIT_ViewWindow * myView;
-  };
-  
-  PyInterp_Dispatcher::Get()->Exec( new ActiveViewChange( myInterp, this, pview ) ); 
-}
-
-/*!
-  \brief Processes the view changing, calls Python module's activeViewChanged() method 
-  \param pview view being activated
-*/
-void SALOME_PYQT_Module::activeViewChanged( const SUIT_ViewWindow* pview )
-{
-  if ( !myInterp || !myModule ) 
-    return;
-  
-  // Do not use SUIT_ViewWindow::closing() signal here. View manager reacts on 
-  // this signal and deletes view. So our slot does not works if it is connected 
-  // on this signal. SUIT_ViewManager::deleteView(SUIT_ViewWindow*) is used here
-  
-  connectView( pview );
-
-  if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) ) 
-  {
-    if ( !pview ) 
-      return;   
-
-    PyObjWrapper res( PyObject_CallMethod( myModule, "activeViewChanged", "i" , pview->getId() ) );
-    if( !res )
-      PyErr_Print();
-  }
-}
-
-/*!
-  \brief Signal handler cloneView() of OCCViewer_ViewWindow
-  \param pview view being cloned
-*/
-void SALOME_PYQT_Module::onViewCloned( SUIT_ViewWindow* pview )
-{
-  class ViewClone : public PyInterp_LockRequest
-  {
-  public:
-    ViewClone( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
-      : PyInterp_LockRequest( _py_interp, 0, true ),
-        myObj(_obj), myView(_pview) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->viewCloned( myView );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;    
-    const SUIT_ViewWindow* myView;
-  };
-  
-  PyInterp_Dispatcher::Get()->Exec( new ViewClone( myInterp, this, pview ) );
-}
-
-/*!
-  \brief Processes the view cloning, calls Python module's activeViewCloned() method
-  \param pview view being cloned
-*/
-void SALOME_PYQT_Module::viewCloned( const SUIT_ViewWindow* pview )
-{
-  if ( !myInterp || !myModule || !pview ) 
-    return;  
-
-  if ( PyObject_HasAttrString( myModule, "viewCloned" ) ) 
-  {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "viewCloned", "i", pview->getId() ) );
-    if( !res )
-      PyErr_Print();
-  }
-}
-
-/*!
-  \brief Signal handler closing(SUIT_ViewWindow*) of a view
-  \param pview view being closed
-*/
-void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
-{
-  class ViewClose : public PyInterp_LockRequest
-  {
-  public:
-    ViewClose( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
-      : PyInterp_LockRequest( _py_interp, 0, true ),
-        myObj(_obj),myView(_pview) {}
-
-  protected:
-    virtual void execute()
-    {
-      myObj->viewClosed( myView );
-    }
-
-  private:
-    SALOME_PYQT_Module* myObj;
-    const SUIT_ViewWindow * myView;    
-  };
-
-  PyInterp_Dispatcher::Get()->Exec( new ViewClose( myInterp, this, pview ) );
-}
-
-/*!
-  \brief Processes the view closing, calls Python module's viewClosed() method
-  \param pview view being closed
-*/
-void SALOME_PYQT_Module::viewClosed( const SUIT_ViewWindow* pview )
-{
-  if ( !myInterp || !myModule ) 
-    return;  
-
-  if ( PyObject_HasAttrString( myModule, "viewClosed" ) ) 
-  {
-    PyObjWrapper res( PyObject_CallMethod( myModule, "viewClosed", "i", pview->getId() ) );
-    if ( !res )
-    {
-      PyErr_Print();
-    }
-  }
-}
-
-/*!
-  \brief Connects or disconnects signals about activating and cloning view on the module slots
-  \param pview view which is connected/disconnected
-*/
-void SALOME_PYQT_Module::connectView( const SUIT_ViewWindow* pview )
-{
-  SUIT_ViewManager* viewMgr = pview->getViewManager();
-  SUIT_ViewModel* viewModel = viewMgr ? viewMgr->getViewModel() : 0;
-      
-  if ( viewMgr )
-  {
-    disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
-               this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
-  
-    connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
-             this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
-  }
-  
-  // Connect cloneView() signal of an OCC View
-  if ( pview->inherits( "OCCViewer_ViewWindow" ) )
-  {
-    disconnect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
-                this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
-    connect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
-             this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
-  }
-  // Connect cloneView() signal of Plot2d View manager
-  else if ( viewModel && viewModel->inherits( "Plot2d_Viewer" ) )
-  {
-    disconnect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
-                this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
-    connect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ), 
-             this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
-  }
-}
-
-/*!
-  \brief Get tag name for the DOM element.
-  \param element DOM element
-  \return empty string if the element does not have tag name
-  \internal
-*/
-static QString tagName( const QDomElement& element )
-{
-  return element.tagName().trimmed();
-}
-
-/*!
-  \brief Get DOM element's attribute by its name.
-  \param element DOM element
-  \param attName attribute name
-  \return empty string if the element does not have such attribute
-  \internal
-*/
-static QString attribute( const QDomElement& element, const QString& attName )
-{
-  return element.attribute( attName ).trimmed();
-}
-
-/*!
-  \brief Inspect specified string for the boolean value.
-  
-  This function returns \c true if string represents boolean value: 
-  - "true", "yes" or "1" for \c true
-  - "false", "no" or "0" for \c false
-  Second parameter allows to specify what boolean value is expected:
-  - 1: \c true
-  - 0: \c false
-  - other value is not taken into account (return represented value)
-
-  \param value inspected string
-  \param check expected boolean value
-  \return boolean value represented by the string (\a check is not 1 or 0)
-          or \c true if value correspond to the specified \a check
-*/
-static bool checkBool( const QString& value, const int check = -1 )
-{
-  QString v = value.toLower();
-  if ( ( v == "true"  || v == "yes" || v == "1" ) && ( check != 0 ) )
-    return true;
-  if ( ( v == "false" || v == "no"  || v == "0" ) && ( check == 0 ) )
-    return true;
-  return false;
-}
-
-/*!
-  \brief Inspect specified string for the integer value.
-  
-  This function returns returns -1 if item is empty or represents
-  an invalid number.
-  \param value inspected string
-  \param def default value
-  \param shift shift value (it is added to the integer value to produce shifted result)
-*/
-static int checkInt( const QString& value, const int def = -1, const int shift = -1 )
-{
-  bool bOk;
-  int val = value.toInt( &bOk );
-  if ( !bOk ) val = def;
-  if ( shift > 0 && bOk && val < 0 )
-    val += shift;
-  return val;
-}
-
-/*!
-  \brief Constructor
-  \internal
-  \param module parent module pointer
-  \param fileName XML file path
-*/
-SALOME_PYQT_Module::XmlHandler::XmlHandler( SALOME_PYQT_Module* module, 
-                                           const QString&      fileName )
-: myModule( module )
-{
-  if ( fileName.isEmpty() ) 
-    return;
-  QFile aFile( fileName );
-  if ( !aFile.open( QIODevice::ReadOnly ) )
-    return;
-  myDoc.setContent( &aFile );
-  aFile.close();
-}
-
-/*!
-  \brief Parse XML file and create actions.
-  \internal
-  
-  Called by SALOME_PYQT_Module::activate() in order to create actions
-  (menus, toolbars).
-*/
-void SALOME_PYQT_Module::XmlHandler::createActions()
-{
-  // get document element
-  QDomElement aDocElem = myDoc.documentElement();
-
-  // create main menu actions
-  QDomNodeList aMenuList = aDocElem.elementsByTagName( "menu-item" );
-  for ( int i = 0; i < aMenuList.count(); i++ ) {
-    QDomNode n = aMenuList.item( i );
-    createMenu( n );
-  }
-
-  // create toolbars actions
-  QDomNodeList aToolsList = aDocElem.elementsByTagName( "toolbar" );
-  for ( int i = 0; i < aToolsList.count(); i++ ) {
-    QDomNode n = aToolsList.item( i );
-    createToolBar( n );
-  }
-}
-
-/*!
-  \brief Create popup menu.
-  \internal
-  \param menu popup menu
-  \param context popup menu context
-  \param context popup menu parent object name
-  \param context popup menu object name
-*/
-void SALOME_PYQT_Module::XmlHandler::createPopup( QMenu*         menu,
-                                                 const QString& context,
-                                                 const QString& parent,
-                                                 const QString& object )
-{
-  // get document element
-  QDomElement aDocElem = myDoc.documentElement();
-
-  // get popup menus actions
-  QDomNodeList aPopupList = aDocElem.elementsByTagName( "popupmenu" );
-  for ( int i = 0; i < aPopupList.count(); i++ ) {
-    QDomNode n = aPopupList.item( i );
-    if ( !n.isNull() && n.isElement() ) {
-      QDomElement e = n.toElement();
-      // QString lab = attribute( e, "label-id" ); // not used // 
-      QString ctx = attribute( e, "context-id" );
-      QString prt = attribute( e, "parent-id"  );
-      QString obj = attribute( e, "object-id"  );
-      if ( ctx == context && prt == parent && obj == object )  {
-       insertPopupItems( n, menu );
-       break;
-      }
-    }
-  }
-}
-
-/*!
-  \brief Activate menus
-  \internal
-  \param enable if \c true menus are activated, otherwise menus are deactivated
-*/
-void SALOME_PYQT_Module::XmlHandler::activateMenus( bool enable )
-{
-  if ( !myModule )
-    return;
-
-  QtxActionMenuMgr* mgr = myModule->menuMgr();
-  int id;
-  foreach( id, myMenuItems ) mgr->setEmptyEnabled( id, enable );
-}
-
-/*!
-  \brief Create main menu item and insert actions to it.
-  \internal
-  \param parentNode XML node with menu description
-  \param parentMenuId parent menu ID (-1 for top-level menu)
-  \param parentPopup parent popup menu (0 for top-level menu)
-*/
-void SALOME_PYQT_Module::XmlHandler::createMenu( QDomNode& parentNode, 
-                                                const int parentMenuId, 
-                                                QMenu*    parentPopup )
-{
-  if ( !myModule || parentNode.isNull() )
-    return;
-  
-  QDomElement parentElement = parentNode.toElement();
-  if ( !parentElement.isNull() ) {
-    QString plabel = attribute( parentElement, "label-id" );
-    int     pid    = checkInt( attribute( parentElement, "item-id" ) );
-    int     ppos   = checkInt( attribute( parentElement, "pos-id" ) );
-    int     group  = checkInt( attribute( parentElement, "group-id" ), 
-                              myModule->defaultMenuGroup() );
-    if ( !plabel.isEmpty() ) {
-      QMenu* popup = 0;
-      int menuId = -1;
-      // create menu
-      menuId = myModule->createMenu( plabel,         // label
-                                    parentMenuId,   // parent menu ID, -1 for top-level menu
-                                    pid,            // ID
-                                    group,          // group ID
-                                    ppos );         // position
-      myMenuItems.append( menuId );
-      QDomNode node = parentNode.firstChild();
-      while ( !node.isNull() ) {
-       if ( node.isElement() ) {
-         QDomElement elem = node.toElement();
-         QString aTagName = tagName( elem );
-         if ( aTagName == "popup-item" ) {
-           int     id      = checkInt( attribute( elem, "item-id" ) );
-           int     pos     = checkInt( attribute( elem, "pos-id" ) );
-           int     group   = checkInt( attribute( elem, "group-id" ), 
-                                       myModule->defaultMenuGroup() );
-           QString label   = attribute( elem, "label-id" );
-           QString icon    = attribute( elem, "icon-id" );
-           QString tooltip = attribute( elem, "tooltip-id" );
-           QString accel   = attribute( elem, "accel-id" );
-           bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
-
-           // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
-           // also check if the action with given ID is already created
-           if ( id != -1 ) {
-             // create menu action
-             QAction* action = myModule->createAction( id,                     // ID
-                                                       tooltip,                // tooltip
-                                                       icon,                   // icon
-                                                       label,                  // menu text
-                                                       tooltip,                // status-bar text
-                                                       QKeySequence( accel ),  // keyboard accelerator
-                                                       toggle );               // toogled action
-             myModule->createMenu( action,   // action
-                                   menuId,   // parent menu ID
-                                   id,       // ID (same as for createAction())
-                                   group,    // group ID
-                                   pos );    // position
-           }
-         }
-         else if ( aTagName == "submenu" ) {
-           // create sub-menu
-           createMenu( node, menuId, popup );
-         }
-         else if ( aTagName == "separator" ) {
-           // create menu separator
-           int id    = checkInt( attribute( elem, "item-id" ) ); // separator can have ID
-           int pos   = checkInt( attribute( elem, "pos-id" ) );
-           int group = checkInt( attribute( elem, "group-id" ), 
-                                 myModule->defaultMenuGroup() );
-           QAction* action = myModule->separator();
-           myModule->createMenu( action,  // separator action
-                                 menuId,  // parent menu ID
-                                 id,      // ID
-                                 group,   // group ID
-                                 pos );   // position
-         }
-       }
-       node = node.nextSibling();
-      }
-    }
-  }
-}
-
-/*!
-  \brief Create a toolbar and insert actions to it.
-  \param parentNode XML node with toolbar description
-*/
-void SALOME_PYQT_Module::XmlHandler::createToolBar( QDomNode& parentNode )
-{
-  if ( !myModule || parentNode.isNull() )
-    return;
-
-  QDomElement parentElement = parentNode.toElement();
-  if ( !parentElement.isNull() ) {
-    QString aLabel = attribute( parentElement, "label-id" );
-    if ( !aLabel.isEmpty() ) {
-      // create toolbar
-      int tbId = myModule->createTool( aLabel );
-      QDomNode node = parentNode.firstChild();
-      while ( !node.isNull() ) {
-       if ( node.isElement() ) {
-         QDomElement elem = node.toElement();
-         QString aTagName = tagName( elem );
-         if ( aTagName == "toolbutton-item" ) {
-           int     id      = checkInt( attribute( elem, "item-id" ) );
-           int     pos     = checkInt( attribute( elem, "pos-id" ) );
-           QString label   = attribute( elem, "label-id" );
-           QString icon    = attribute( elem, "icon-id" );
-           QString tooltip = attribute( elem, "tooltip-id" );
-           QString accel   = attribute( elem, "accel-id" );
-           bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
-
-           // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
-           // also check if the action with given ID is already created
-            if ( id != -1 ) {
-             // create toolbar action
-             QAction* action = myModule->createAction( id,                    // ID
-                                                       tooltip,               // tooltip
-                                                       icon,                  // icon
-                                                       label,                 // menu text
-                                                       tooltip,               // status-bar text
-                                                       QKeySequence( accel ), // keyboard accelerator
-                                                       toggle );              // toogled action
-             myModule->createTool( action, tbId, -1, pos );
-           }
-         }
-         else if ( aTagName == "separatorTB" || aTagName == "separator" ) {
-           // create toolbar separator
-           int pos = checkInt( attribute( elem, "pos-id" ) );
-           QAction* action = myModule->separator();
-           myModule->createTool( action, tbId, -1, pos );
-         }
-       }
-       node = node.nextSibling();
-      }
-    }
-  }
-}
-
-/*!
-  \brief Fill popup menu with the items.
-  \param parentNode XML node with popup menu description
-  \param menu popup menu
-*/
-void SALOME_PYQT_Module::XmlHandler::insertPopupItems( QDomNode& parentNode, QMenu* menu )
-{
-  if ( !myModule && parentNode.isNull() )
-    return;
-
-  // we create popup menus without help of QtxPopupMgr
-  QDomNode node = parentNode.firstChild();
-  while ( !node.isNull() ) { 
-    if ( node.isElement() ) {
-      QDomElement elem = node.toElement();
-      QString aTagName = tagName( elem );
-      QList<QAction*> actions = menu->actions();
-      if ( aTagName == "popup-item" ) {
-       // insert a command item
-       int     id      = checkInt( attribute( elem, "item-id" ) );
-       int     pos     = checkInt( attribute( elem, "pos-id" ) );
-       QString label   = attribute( elem, "label-id" );
-       QString icon    = attribute( elem, "icon-id" );
-       QString tooltip = attribute( elem, "tooltip-id" );
-       QString accel   = attribute( elem, "accel-id" );
-       bool    toggle  = checkBool( attribute( elem, "toggle-id" ) );
-
-       // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
-       // also check if the action with given ID is already created
-       if ( id != -1 ) {
-         QAction* action = myModule->createAction( id,                     // ID
-                                                   tooltip,                // tooltip
-                                                   icon,                   // icon
-                                                   label,                  // menu text
-                                                   tooltip,                // status-bar text
-                                                   QKeySequence( accel ),  // keyboard accelerator
-                                                   toggle );               // toogled action
-         QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
-         menu->insertAction( before, action );
-       }
-      }
-      else if ( aTagName == "submenu" ) {
-       // create sub-menu
-       ////int     id    = checkInt( attribute( elem, "item-id" ) ); // not used //
-       int     pos   = checkInt( attribute( elem, "pos-id" ) );
-       QString label = attribute( elem, "label-id" );
-       QString icon  = attribute( elem, "icon-id" );
-
-       QIcon anIcon;
-       if ( !icon.isEmpty() ) {
-         QPixmap pixmap  = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(), icon );
-         if ( !pixmap.isNull() )
-           anIcon = QIcon( pixmap );
-        }
-
-       QMenu* newPopup = menu->addMenu( anIcon, label );
-       QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
-       menu->insertMenu( before, newPopup );
-       insertPopupItems( node, newPopup );
-      }
-      else if ( aTagName == "separator" ) {
-       // create menu separator
-       int pos = checkInt( attribute( elem, "pos-id" ) );
-       QAction* action = myModule->separator();
-       QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
-       menu->insertAction( before, action );
-      }
-    }
-    node = node.nextSibling();
-  }
+  SALOME_PYQT_ModuleLight::onViewCloned(pview);
 }
index 3283416ad10dbbed4373d0cdd62a07bab5751f53..f888a9dbcd9d8f6a0383054f41da0b6d1fe7e125 100644 (file)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : SALOME_PYQT_Module.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef SALOME_PYQT_MODULE_H
 #define SALOME_PYQT_MODULE_H
 
 #include "SALOME_PYQT_GUI.h"
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_Interp.h)!
-
-#include <SalomeApp_Module.h>
-
-#include <QStringList>
-#include <QList>
-#include <QMap>
-#include <QIcon>
-
+#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!*/
+#include "SALOME_PYQT_ModuleLight.h"
+#include "SalomeApp_Module.h"
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 
-class SALOME_PYQT_PyInterp;
-class SUIT_ViewWindow;
-class QAction;
-class QtxActionGroup;
-class QMenu;
 
-class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
+
+class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module,
+  public SALOME_PYQT_ModuleLight
 {
   Q_OBJECT;
 
-private:
-  class XmlHandler;
-
-  //! study to Python subinterpreter map
-  typedef QMap<int, SALOME_PYQT_PyInterp*> InterpMap;
-
-  static InterpMap           myInterpMap;  //!< study to Python subinterpreter map
-  SALOME_PYQT_PyInterp*      myInterp;     //!< current Python subinterpreter
-  PyObjWrapper               myModule;     //!< Python GUI module
-  static SALOME_PYQT_Module* myInitModule; //!< Python GUI being initialized (not zero only during the initialization)
-
-  XmlHandler*                myXmlHandler; //!< XML resource file parser
-  QMap<int, int>             myWindowsMap; //!< windows map
-  QStringList                myViewMgrList;//!< compatible view managers list
-
-  bool                       myLastActivateStatus; //!< latest module activation status
-
 public:
   SALOME_PYQT_Module();
   ~SALOME_PYQT_Module();
 
-public:
-  static SALOME_PYQT_Module* getInitModule();
-
-  void                       initialize( CAM_Application* );
-  void                       windows( QMap<int, int>& ) const;
-  void                       viewManagers( QStringList& ) const;
-  void                       contextMenuPopup( const QString&, QMenu*, QString& );
-  void                       createPreferences();
-  QString                    engineIOR() const;
-  void                       studyActivated();
-  void                       preferencesChanged( const QString&, const QString& );
-
-  static int                 defaultMenuGroup();
-
-  int                        createTool( const QString& );
-  int                        createTool( const int, const int, const int = -1 );
-  int                        createTool( const int, const QString&, const int = -1 );
-  int                        createTool( QAction*, const int, 
-                                        const int = -1, const int = -1 );
-  int                        createTool( QAction*, const QString&, 
-                                        const int = -1, const int = -1 );
-
-  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 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 );
-  int                        createMenu( QAction*, const QString&, 
-                                        const int = -1, const int = -1, const int = -1 );
-
-  QAction*                   separator();
-
-  QAction*                   action( const int ) const;
-  int                        actionId( const QAction* ) const;
-  QAction*                   createAction( const int, const QString&, const QString&, 
-                                          const QString&, const QString&, const int, 
-                                          const bool = false, QObject* = 0 );
-  QtxActionGroup*            createActionGroup( const int, const bool );
-
-
-  QIcon                      loadIcon( const QString& fileName );
-
-  int                        addGlobalPreference( const QString& );
-  int                        addPreference( const QString& );
-  int                        addPreference( const QString&, const int, const int = LightApp_Preferences::Auto,
-                                           const QString& = QString(),
-                                           const QString& = QString() );
-  QVariant                   preferenceProperty( const int, const QString& ) const;
-  void                       setPreferenceProperty( const int, const QString&, 
-                                                   const QVariant& );
+  /* get module engine IOR */
+  virtual QString            engineIOR() const;
 
 public slots:
   virtual bool               activateModule( SUIT_Study* );
-  virtual bool               deactivateModule( SUIT_Study* );
   void                       preferenceChanged( const QString&, 
-                                               const QString&, 
-                                               const QString& );
+                                                const QString&, 
+                                                const QString& );
   void                       onGUIEvent();
-
   void                       onActiveViewChanged( SUIT_ViewWindow* );
   void                       onViewClosed( SUIT_ViewWindow* );
+  void                       onViewTryClose( SUIT_ViewWindow* );
   void                       onViewCloned( SUIT_ViewWindow* );
 
 protected:
-  Engines::Component_var     getEngine() const;
+  /* create data model */
+  virtual CAM_DataModel*     createDataModel();
 
-private:
-  void                       init( CAM_Application* );
-  void                       activate( SUIT_Study* );
-  void                       deactivate( SUIT_Study* );
-  bool                       lastActivationStatus() const;
-  void                       customize( SUIT_Study* );
-  void                       studyChanged( SUIT_Study* );
-  void                       contextMenu( const QString&, QMenu* );
-  void                       guiEvent( const int );
-  void                       initPreferences();
-  void                       prefChanged( const QString&, const QString& );
+  Engines::EngineComponent_var getEngine() const;
 
-  void                       initInterp  ( int );
-  void                       importModule();
-  void                       setWorkSpace();
-  
-  void                       activeViewChanged( const SUIT_ViewWindow* );
-  void                       viewClosed( const SUIT_ViewWindow* );
-  void                       viewCloned( const SUIT_ViewWindow* );
-  void                       connectView( const SUIT_ViewWindow* );
+private:
+  void                       getEngineIOR();
 
-  friend class XmlHandler;
+private:
+  QString                    myIOR;
 };
 
 #endif // SALOME_PYQT_MODULE_H
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx
deleted file mode 100644 (file)
index 15d1528..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File   : SALOME_PYQT_PyInterp.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!
-#include <utilities.h>
-#include <Container_init_python.hxx>
-
-/*!
- * constructor : the main SALOME Python interpreter is used for PyQt GUI.
- * calls initialize method defined in base class, which calls virtual methods
- * initstate & initcontext redefined here
- */
-SALOME_PYQT_PyInterp::SALOME_PYQT_PyInterp(): PyInterp_Interp()
-{
-}
-
-SALOME_PYQT_PyInterp::~SALOME_PYQT_PyInterp()
-{
-}
-
-bool SALOME_PYQT_PyInterp::initState()
-{
- /*
-  * The GIL is assumed to not be held on the call
-  * The GIL is acquired in initState and will be held on initState exit
-  * It is the caller responsability to release the lock on exit if needed
-  */
-  SCRUTE(KERNEL_PYTHON::_gtstate);
-  _tstate = KERNEL_PYTHON::_gtstate;
-  PyEval_AcquireThread(_tstate);
-  SCRUTE(_tstate);
-  PyEval_ReleaseThread(_tstate);
-  return true;
-}
-
-bool SALOME_PYQT_PyInterp::initContext()
-{
-  /*
-   * The GIL is assumed to be held
-   * It is the caller responsability to acquire the GIL before calling initContext
-   * It will still be held on initContext exit
-   */
-  _g = PyDict_New();          // create interpreter dictionnary context
-  PyObject *bimod = PyImport_ImportModule("__builtin__");
-  PyDict_SetItemString(_g, "__builtins__", bimod);
-  Py_DECREF(bimod);
-  return true;
-}
-
-int SALOME_PYQT_PyInterp::run(const char *command)
-{
-  MESSAGE("compile");
-  PyObject *code = Py_CompileString((char *)command,"PyGUI",Py_file_input);
-  if(!code){
-    // Une erreur s est produite en general SyntaxError
-    PyErr_Print();
-    return -1;
-  }
-  //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
-  //  PyObject *r = PyEval_EvalCode(code,_g,_g);
-  //#else
-  PyObject *r = PyEval_EvalCode((PyCodeObject *)code,_g,_g);
-  //#endif
-  Py_DECREF(code);
-  if(!r){
-    // Une erreur s est produite a l execution
-    PyErr_Print();
-    return -1 ;
-  }
-  Py_DECREF(r);
-  return 0;
-}
diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h
deleted file mode 100644 (file)
index 3daf666..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File   : SALOME_PYQT_PyInterp.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#ifndef SALOME_PYQT_PYINTERP_H
-#define SALOME_PYQT_PYINTERP_H
-
-#include "SALOME_PYQT_GUI.h"
-
-#include <PyInterp_Interp.h> // this include must be first (see PyInterp_base.h)!
-
-class SALOME_PYQT_EXPORT SALOME_PYQT_PyInterp : public PyInterp_Interp
-{
-public:
-  SALOME_PYQT_PyInterp();
-  ~SALOME_PYQT_PyInterp();
-
-  int run( const char* );
-  
-protected:
-  virtual bool initState();
-  virtual bool initContext();  
-};
-
-#endif // SALOME_PYQT_PYINTERP_H
index 5ca53871ecf446961730993ff0de2f336617b8dd..e08d354570c25f35d51d3a3615dd158b2e4bc742 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Nicolas REJNERI
 #  Module : SALOME
@@ -47,27 +48,26 @@ CLEANFILES = $(SIP_SRC)
 MOC_FILES = SalomePyQt_moc.cxx
 
 # compilation flags
-COMMON_CPP_FLAGS = $(QT_INCLUDES) $(QWT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES)   \
-       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS)               \
-       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix              \
-       -I$(srcdir) -I$(top_builddir)/idl                                               \
-       -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD              \
-       -I$(srcdir)/../../Qtx -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../Event       \
-       -I$(srcdir)/../../SalomeSession -I$(srcdir)/../../LogWindow                     \
-       -I$(srcdir)/../../VTKViewer -I$(srcdir)/../../TOOLSGUI                          \
-       -I$(srcdir)/../../OCCViewer -I$(srcdir)/../../Plot2d                            \
-       -I$(srcdir)/../SALOME_PYQT_GUI -I$(srcdir)/../../PyInterp                       \
-       -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser                         \
-       -I$(srcdir)/../../OBJECT                                                        \
-       -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+COMMON_CPP_FLAGS = $(QT_INCLUDES) $(QWT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES)    \
+       $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS)                \
+       -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix               \
+       -I$(srcdir) -I$(top_builddir)/idl                                                \
+       -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD               \
+       -I$(srcdir)/../../Qtx -I$(srcdir)/../../Event                                    \
+       -I$(srcdir)/../../LogWindow                                                      \
+       -I$(srcdir)/../../VTKViewer                                                      \
+       -I$(srcdir)/../../OCCViewer -I$(srcdir)/../../Plot2d                             \
+       -I$(srcdir)/../SALOME_PYQT_GUILight -I$(srcdir)/../../PyInterp                   \
+       -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser                          \
+       -I$(srcdir)/../../OBJECT                                                        
 
 # linkage flags
-COMMON_LIBS = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(QWT_LIBS)          \
-       $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la       \
-       ../../Qtx/libqtx.la ../../SalomeApp/libSalomeApp.la ../../Event/libEvent.la     \
-       ../../Session/libSalomeSession.la ../../LogWindow/libLogWindow.la               \
-       ../../VTKViewer/libVTKViewer.la ../../TOOLSGUI/libToolsGUI.la                   \
-       ../SALOME_PYQT_GUI/libSalomePyQtGUI.la ../../OCCViewer/libOCCViewer.la          \
+COMMON_LIBS = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(QWT_LIBS)           \
+       $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la        \
+       ../../Qtx/libqtx.la ../../Event/libEvent.la                                      \
+       ../../LogWindow/libLogWindow.la                                                  \
+       ../../VTKViewer/libVTKViewer.la                                                  \
+       ../SALOME_PYQT_GUILight/libSalomePyQtGUILight.la ../../OCCViewer/libOCCViewer.la \
        ../../Plot2d/libPlot2d.la
 
 # libraries targets
index e50f65e24e2c1f1b984a60495d43eae00f0a4e47..899508ad39be2df1abc0c73bdaf6381e57af2a63 100644 (file)
@@ -1,28 +1,38 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SalomePyQt.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-#include <SALOME_PYQT_Module.h> // this include must be first!!!
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
+#include <SALOME_PYQT_ModuleLight.h> // this include must be first!!!
+#include <SALOME_PYQT_DataModelLight.h>
 #include "SalomePyQt.h"
 
 #include <QApplication>
 #include <QtxActionMenuMgr.h>
 #include <QtxActionGroup.h>
 #include <QtxWorkstack.h>
+#include <QtxTreeView.h>
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Tools.h>
 #include <SUIT_ViewManager.h>
 #include <SUIT_ViewWindow.h>
+#include <SUIT_DataBrowser.h>
 #include <STD_TabDesktop.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_Study.h>
 #include <LightApp_SelectionMgr.h>
 #include <LogWindow.h>
 #include <OCCViewer_ViewWindow.h>
   \internal
   \return active application object or 0 if there is no any
 */
-static SalomeApp_Application* getApplication()
+static LightApp_Application* getApplication()
 {
   if ( SUIT_Session::session() )
-    return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+    return dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
   return 0;
 }
 
@@ -69,10 +81,10 @@ static SalomeApp_Application* getApplication()
   \internal
   \return active study or 0 if there is no study opened
 */
-static SalomeApp_Study* getActiveStudy()
+static LightApp_Study* getActiveStudy()
 {
   if ( getApplication() )
-    return dynamic_cast<SalomeApp_Study*>( getApplication()->activeStudy() );
+    return dynamic_cast<LightApp_Study*>( getApplication()->activeStudy() );
   return 0;
 }
 
@@ -82,13 +94,13 @@ static SalomeApp_Study* getActiveStudy()
   This function returns correct result only if Python-based
   module is currently active. Otherwize, 0 is returned.
 */
-static SALOME_PYQT_Module* getActiveModule()
+static SALOME_PYQT_ModuleLight* getActiveModule()
 {
-  SALOME_PYQT_Module* module = 0;
-  if ( SalomeApp_Application* anApp = getApplication() ) {
-    module = SALOME_PYQT_Module::getInitModule();
+  SALOME_PYQT_ModuleLight* module = 0;
+  if ( LightApp_Application* anApp = getApplication() ) {
+    module = SALOME_PYQT_ModuleLight::getInitModule();
     if ( !module )
-      module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+      module = dynamic_cast<SALOME_PYQT_ModuleLight*>( anApp->activeModule() );
   }
   return module;
 }
@@ -102,7 +114,7 @@ static SALOME_PYQT_Module* getActiveModule()
   \brief Map of created selection objects.
   \internal
 */
-static QMap<SalomeApp_Application*, SALOME_Selection*> SelMap;
+static QMap<LightApp_Application*, SALOME_Selection*> SelMap;
 
 /*!
   \brief Get the selection object for the specified application.
@@ -112,7 +124,7 @@ static QMap<SalomeApp_Application*, SALOME_Selection*> SelMap;
   \param app application object
   \return selection object or 0 if \a app is invalid
 */
-SALOME_Selection* SALOME_Selection::GetSelection( SalomeApp_Application* app )
+SALOME_Selection* SALOME_Selection::GetSelection( LightApp_Application* app )
 {
   SALOME_Selection* sel = 0;
   if ( app && SelMap.find( app ) != SelMap.end() )
@@ -126,23 +138,27 @@ SALOME_Selection* SALOME_Selection::GetSelection( SalomeApp_Application* app )
   \brief Constructor.
   \param p parent object
 */
-SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( p ), mySelMgr( 0 )
+SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( 0 ), mySelMgr( 0 )
 {
-  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( p );
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>( p );
   if ( app ) {
     mySelMgr = app->selectionMgr();
     connect( mySelMgr, SIGNAL( selectionChanged() ), this, SIGNAL( currentSelectionChanged() ) );
     connect( mySelMgr, SIGNAL( destroyed() ),        this, SLOT  ( onSelMgrDestroyed() ) );
   }
 }
+
 /*!
   \brief Destructor.
 */
 SALOME_Selection::~SALOME_Selection()
 {
-  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( parent() );
-  if ( app && SelMap.find( app ) != SelMap.end() )
-    SelMap.remove( app );
+  LightApp_Application* app = 0;
+  QMap<LightApp_Application*, SALOME_Selection*>::Iterator it;
+  for ( it = SelMap.begin(); it != SelMap.end() && !app; ++it ) {
+    if ( it.value() == this ) app = it.key();
+  }
+  if ( app ) SelMap.remove( app );
 }
 
 /*!
@@ -282,7 +298,7 @@ public:
   TGetMainMenuBarEvent() : myResult( 0 ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       myResult = anApp->desktop()->menuBar();
     }
   }
@@ -293,7 +309,7 @@ QMenuBar* SalomePyQt::getMainMenuBar()
 }
 
 /*!
-  QMenu* SalomePyQt::getPopupMenu( const MenuName menu );
+  \fn QMenu* SalomePyQt::getPopupMenu( const MenuName menu );
   \brief Get main menu's child popup submenu by its identifier.
   
   This function is obsolete. 
@@ -304,7 +320,7 @@ QMenuBar* SalomePyQt::getMainMenuBar()
 */
 
 /*!
-  QMenu* SalomePyQt::getPopupMenu( const QString& menu );
+  \fn QMenu* SalomePyQt::getPopupMenu( const QString& menu );
   \brief Get main menu's child popup submenu by its name.
   
   The function creates menu if it does not exist.
@@ -322,7 +338,7 @@ public:
   TGetPopupMenuEvent( const QString& menu ) : myResult( 0 ), myMenuName( menu ) {}
   virtual void Execute()
   {
-    SalomeApp_Application* anApp = getApplication();
+    LightApp_Application* anApp = getApplication();
     if ( anApp && !myMenuName.isEmpty() ) {
       QtxActionMenuMgr* mgr = anApp->desktop()->menuMgr();
       myResult = mgr->findMenu( myMenuName, -1, false ); // search only top menu
@@ -330,6 +346,12 @@ public:
   }
 };
 
+/*!
+  \brief Get menu item title
+  \internal
+  \param menuId menu identifier
+  \return menu title (localized)
+*/
 static QString getMenuName( const QString& menuId )
 {
   QStringList contexts;
@@ -367,6 +389,31 @@ QMenu* SalomePyQt::getPopupMenu( const QString& menu )
   return ProcessEvent( new TGetPopupMenuEvent( menu ) );
 }
 
+/*!
+  \fn QTreeView* SalomePyQt::getObjectBrowser();
+  \brief Get object browser
+  \return object browser for the active study or 0 in case of error
+*/
+
+class TGetObjectBrowserEvent: public SALOME_Event
+{
+public:
+  typedef QTreeView* TResult;
+  TResult myResult;
+  TGetObjectBrowserEvent() : myResult( 0 ) {}
+  virtual void Execute()
+  {
+    LightApp_Application* anApp = getApplication();
+    if ( anApp ) {
+      myResult = anApp->objectBrowser()->treeView();
+    }
+  }
+};
+QTreeView* SalomePyQt::getObjectBrowser()
+{
+  return ProcessEvent( new TGetObjectBrowserEvent() );
+}
+
 /*!
   \fn int SalomePyQt::getStudyId();
   \brief Get active study's identifier.
@@ -381,8 +428,8 @@ public:
   TGetStudyIdEvent() : myResult( 0 ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
-      myResult = aStudy->studyDS()->StudyId();
+    if ( LightApp_Study* aStudy = getActiveStudy() ) {
+      myResult = aStudy->id();
     }
   }
 };
@@ -437,7 +484,7 @@ public:
   TPutInfoEvent( const QString& msg, const int sec = 0 ) : myMsg( msg ), mySecs( sec ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       anApp->putInfo( myMsg, mySecs * 1000 );
     }
   }
@@ -461,7 +508,7 @@ public:
   TGetActiveComponentEvent() {}
   virtual void Execute() 
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       if ( CAM_Module* mod = anApp->activeModule() ) {
         myResult = mod->name();
       }
@@ -473,6 +520,56 @@ const QString SalomePyQt::getActiveComponent()
   return ProcessEvent( new TGetActiveComponentEvent() );
 }
 
+/*!
+  \fn PyObject* SalomePyQt::getActivePythonModule()
+  \brief Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container.
+  \return Python module object currently loaded into SALOME_PYQT_ModuleLight container
+*/
+
+class TGetActivePyModuleEvent: public SALOME_Event
+{
+public:
+  typedef PyObject* TResult;
+  TResult myResult;
+  TGetActivePyModuleEvent() : myResult( 0 ) {}
+  virtual void Execute() 
+  {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (PyObject*)module->getPythonModule();
+  }
+};
+PyObject* SalomePyQt::getActivePythonModule()
+{
+  return ProcessEvent( new TGetActivePyModuleEvent() );
+}
+
+/*!
+  \fn bool SalomePyQt::activateModule( const QString& modName )
+  \brief Activates SALOME module with the given name
+  \return True if the module has been activated and False otherwise.
+*/
+
+class TActivateModuleEvent: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  QString myModuleName;
+  TActivateModuleEvent( const QString& modName ) 
+  : myResult( false ), myModuleName( modName ) {}
+  virtual void Execute() 
+  {
+    if ( LightApp_Application* anApp = getApplication() ) {
+      myResult = anApp->activateModule( myModuleName );
+    }
+  }
+};
+bool SalomePyQt::activateModule( const QString& modName )
+{
+  return ProcessEvent( new TActivateModuleEvent( modName ) );
+}
+
 /*!
   \brief Update an Object Browser of the specified (by identifier) study.
 
@@ -499,15 +596,15 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection )
       if ( SUIT_Session::session() ) {
         if ( getActiveStudy() && myStudyId <= 0 )
           myStudyId = getActiveStudy()->id();
-       if ( myStudyId > 0 ) {
+        if ( myStudyId > 0 ) {
           QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
           QList<SUIT_Application*>::Iterator it;
-         for( it = apps.begin(); it != apps.end(); ++it ) {
-            SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( *it );
+          for( it = apps.begin(); it != apps.end(); ++it ) {
+            LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( *it );
             if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) {
-             anApp->updateObjectBrowser();
-             return;
-           }
+              anApp->updateObjectBrowser();
+              return;
+            }
           }
         }
       }
@@ -516,6 +613,76 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection )
   ProcessVoidEvent( new TEvent( studyId, updateSelection ) );
 }
 
+
+/*!
+  SalomePyQt::isModified()
+  \return The modification status of the data model
+  for the currently active Python module
+  \sa setModified()
+*/
+class TIsModifiedEvent: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  TIsModifiedEvent() : myResult( false ) {}
+  virtual void Execute() 
+  {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( !module )
+      return;
+    
+    SALOME_PYQT_DataModelLight* aModel =
+      dynamic_cast<SALOME_PYQT_DataModelLight*>( module->dataModel() );
+    if ( aModel )
+      myResult = aModel->isModified();
+  }
+};
+bool SalomePyQt::isModified()
+{
+  return ProcessEvent(new TIsModifiedEvent());
+}
+
+/*!
+  SalomePyQt::setModified()
+
+  Sets the modification status of the data model for 
+  the currently active Python module. This method should be used
+  by the Python code in order to enable/disable "Save" operation
+  depending on the module's data state.
+
+  \param New modification status of the data model
+
+  \sa isModified()
+*/
+void SalomePyQt::setModified( bool flag )
+{  
+  class TEvent: public SALOME_Event
+  {
+    bool myFlag;
+  public:
+    TEvent( bool flag ) 
+      : myFlag( flag ) {}
+    virtual void Execute()
+    {
+      SALOME_PYQT_ModuleLight* module = getActiveModule();
+      if ( !module )
+       return;
+
+      SALOME_PYQT_DataModelLight* aModel =
+       dynamic_cast<SALOME_PYQT_DataModelLight*>( module->dataModel() );
+      LightApp_Application* aLApp = 
+       dynamic_cast<LightApp_Application*>( module->application() );
+      if ( !aModel || !aLApp )
+       return;
+
+      aModel->setModified( myFlag );
+      aLApp->updateActions();
+    }
+  };
+  ProcessVoidEvent( new TEvent( flag ) );
+}
+
 /*!
   \brief Default resource file section name.
   \internal
@@ -549,10 +716,10 @@ void SalomePyQt::addStringSetting( const QString& name, const QString& value, bo
     virtual void Execute() {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
-       if ( !_sec.isEmpty() && !_nam.isEmpty() )
+        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
     }
@@ -588,10 +755,10 @@ void SalomePyQt::addIntSetting( const QString& name, const int value, bool autoV
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
-       if ( !_sec.isEmpty() && !_nam.isEmpty() )
+        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
     }
@@ -627,10 +794,10 @@ void SalomePyQt::addDoubleSetting( const QString& name, const double value, bool
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
-       if ( !_sec.isEmpty() && !_nam.isEmpty() )
+        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
     }
@@ -666,10 +833,10 @@ void SalomePyQt::addBoolSetting( const QString& name, const bool value, bool aut
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
-       if ( !_sec.isEmpty() && !_nam.isEmpty() )
+        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->setValue( _sec, _nam, myValue );
       }
     }
@@ -694,10 +861,10 @@ void SalomePyQt::removeSettings( const QString& name )
     virtual void Execute() {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       QStringList sl = myName.split( ":", QString::SkipEmptyParts );
-       QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
-       QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
-       if ( !_sec.isEmpty() && !_nam.isEmpty() )
+        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+        if ( !_sec.isEmpty() && !_nam.isEmpty() )
           resMgr->remove( _sec, _nam );
       }
     }
@@ -760,7 +927,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->setValue( mySection, myName, myValue );
       }
     }
@@ -788,7 +955,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->setValue( mySection, myName, myValue );
       }
     }
@@ -818,7 +985,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->setValue( mySection, myName, myValue );
       }
     }
@@ -846,7 +1013,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->setValue( mySection, myName, myValue );
       }
     }
@@ -874,7 +1041,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->setValue( mySection, myName, myValue );
       }
     }
@@ -885,7 +1052,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const
 /*!
   \fn int SalomePyQt::integerSetting( const QString& section, 
                                       const QString& name, 
-                                     const int def );
+                                      const int def );
   \brief Get integer setting from the application preferences.
   \param section resources file section name 
   \param name setting name
@@ -919,7 +1086,7 @@ int SalomePyQt::integerSetting( const QString& section, const QString& name, con
 /*!
   \fn double SalomePyQt::doubleSetting( const QString& section, 
                                         const QString& name, 
-                                       const double def );
+                                        const double def );
   \brief Get double setting from the application preferences.
   \param section resources file section name 
   \param name setting name
@@ -953,7 +1120,7 @@ double SalomePyQt::doubleSetting( const QString& section, const QString& name, c
 /*!
   \fn bool SalomePyQt::boolSetting( const QString& section, 
                                     const QString& name, 
-                                   const bool def );
+                                    const bool def );
   \brief Get boolean setting from the application preferences.
   \param section resources file section name 
   \param name setting name
@@ -987,7 +1154,7 @@ bool SalomePyQt::boolSetting( const QString& section, const QString& name, const
 /*!
   \fn QString SalomePyQt::stringSetting( const QString& section, 
                                          const QString& name, 
-                                        const QString& def );
+                                         const QString& def );
   \brief Get string setting from the application preferences.
   \param section resources file section name 
   \param name setting name
@@ -1021,7 +1188,7 @@ QString SalomePyQt::stringSetting( const QString& section, const QString& name,
 /*!
   \fn QColor SalomePyQt::colorSetting( const QString& section, 
                                        const QString& name, 
-                                      const QColor def );
+                                       const QColor def );
   \brief Get color setting from the application preferences.
   \param section resources file section name 
   \param name setting name
@@ -1069,7 +1236,7 @@ void SalomePyQt::removeSetting( const QString& section, const QString& name )
     {
       if ( SUIT_Session::session() ) {
         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-       if ( !mySection.isEmpty() && !myName.isEmpty() )
+        if ( !mySection.isEmpty() && !myName.isEmpty() )
           resMgr->remove( mySection, myName );
       }
     }
@@ -1109,10 +1276,10 @@ bool SalomePyQt::hasSetting( const QString& section, const QString& name )
 
 /*!
   \fn QString SalomePyQt::getFileName( QWidget*           parent, 
-                                      const QString&     initial, 
-                                      const QStringList& filters, 
-                                      const QString&     caption,
-                                      bool               open );
+                                       const QString&     initial, 
+                                       const QStringList& filters, 
+                                       const QString&     caption,
+                                       bool               open );
   \brief Show 'Open/Save file' dialog box for file selection 
          and return a user's choice (selected file name).
   \param parent parent widget
@@ -1135,10 +1302,10 @@ public:
   QString     myCaption;
   bool        myOpen;
   TGetFileNameEvent( QWidget*           parent, 
-                    const QString&     initial, 
-                    const QStringList& filters, 
-                    const QString&     caption,
-                    bool               open ) 
+                     const QString&     initial, 
+                     const QStringList& filters, 
+                     const QString&     caption,
+                     bool               open ) 
     : myParent ( parent ), 
       myInitial( initial ), 
       myFilters( filters ), 
@@ -1146,26 +1313,26 @@ public:
       myOpen ( open ) {}
   virtual void Execute() 
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"), 
-                                    myCaption, myParent );
+                                     myCaption, myParent );
     }
   }
 };
 QString SalomePyQt::getFileName( QWidget*           parent, 
-                                const QString&     initial, 
-                                const QStringList& filters, 
-                                const QString&     caption,
-                                bool               open )
+                                 const QString&     initial, 
+                                 const QStringList& filters, 
+                                 const QString&     caption,
+                                 bool               open )
 {
   return ProcessEvent( new TGetFileNameEvent( parent, initial, filters, caption, open ) );
 }
 
 /*!
   \fn QStringList SalomePyQt::getOpenFileNames( QWidget*           parent, 
-                                               const QString&     initial, 
-                                               const QStringList& filters, 
-                                               const QString&     caption );
+                                                const QString&     initial, 
+                                                const QStringList& filters, 
+                                                const QString&     caption );
   \brief Show 'Open files' dialog box for multiple files selection
          and return a user's choice (selected file names list).
   \param parent parent widget
@@ -1185,32 +1352,32 @@ public:
   QStringList myFilters;
   QString     myCaption;
   TGetOpenFileNamesEvent( QWidget*           parent, 
-                         const QString&     initial, 
-                         const QStringList& filters, 
-                         const QString&     caption ) 
+                          const QString&     initial, 
+                          const QStringList& filters, 
+                          const QString&     caption ) 
     : myParent ( parent ), 
       myInitial( initial ), 
       myFilters( filters ), 
       myCaption( caption ) {}
   virtual void Execute() 
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       myResult = anApp->getOpenFileNames( myInitial, myFilters.join(";;"), myCaption, myParent );
     }
   }
 };
 QStringList SalomePyQt::getOpenFileNames( QWidget*           parent, 
-                                         const QString&     initial, 
-                                         const QStringList& filters, 
-                                         const QString&     caption )
+                                          const QString&     initial, 
+                                          const QStringList& filters, 
+                                          const QString&     caption )
 {
   return ProcessEvent( new TGetOpenFileNamesEvent( parent, initial, filters, caption ) );
 }
 
 /*!
   \fn QString SalomePyQt::getExistingDirectory( QWidget*       parent,
-                                               const QString& initial,
-                                               const QString& caption );
+                                                const QString& initial,
+                                                const QString& caption );
   \brief Show 'Get Directory' dialog box for the directory selection
          and return a user's choice (selected directory name).
   \param parent parent widget
@@ -1228,25 +1395,59 @@ public:
   QString     myInitial;
   QString     myCaption;
   TGetExistingDirectoryEvent( QWidget*           parent, 
-                             const QString&     initial, 
-                             const QString&     caption ) 
+                              const QString&     initial, 
+                              const QString&     caption ) 
     : myParent ( parent ), 
       myInitial( initial ), 
       myCaption( caption ) {}
   virtual void Execute() 
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       myResult = anApp->getDirectory( myInitial, myCaption, myParent );
     }
   }
 };
 QString SalomePyQt::getExistingDirectory( QWidget*       parent,
-                                         const QString& initial,
-                                         const QString& caption )
+                                          const QString& initial,
+                                          const QString& caption )
 {
   return ProcessEvent( new TGetExistingDirectoryEvent( parent, initial, caption ) );
 }
 
+/*!
+  \fn QString SalomePyQt::loadIcon( const QString& filename );
+  \brief Load an icon from the module resources by the specified file name.
+  \param filename icon file name
+  \return icon object
+*/
+class TLoadIconEvent: public SALOME_Event 
+{
+public:
+  typedef QIcon TResult;
+  TResult     myResult;
+  QString     myModule;
+  QString     myFileName;
+  TLoadIconEvent( const QString& module, const QString& filename ) 
+    : myModule( module ), 
+      myFileName ( filename ) {}
+  virtual void Execute() 
+  {
+    if ( LightApp_Application* anApp = getApplication() ) {
+      if ( !myFileName.isEmpty() ) {
+        QPixmap pixmap = anApp->resourceMgr()->loadPixmap( myModule, 
+                         QApplication::translate( myModule.toLatin1().data(), 
+                                                  myFileName.toLatin1().data() ) );
+        if ( !pixmap.isNull() )
+          myResult = QIcon( pixmap );
+      }
+    }
+  }
+};
+QIcon SalomePyQt::loadIcon( const QString& module, const QString& filename )
+{
+  return ProcessEvent( new TLoadIconEvent( module, filename ) );
+}
+
 /*!
   \brief Open external browser to display context help information.
   \todo
@@ -1267,7 +1468,7 @@ void SalomePyQt::helpContext( const QString& source, const QString& context )
       : mySource( source ), myContext( context ) {}
     virtual void Execute() 
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
+      if ( LightApp_Application* anApp = getApplication() ) {
         anApp->onHelpContextModule( "", mySource, myContext );
       }
     }
@@ -1298,19 +1499,19 @@ public:
     : myResult ( false ), myFileName( filename ) {}
   virtual void Execute() 
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       SUIT_ViewManager* vm = anApp->activeViewManager();
       if ( vm ) { 
         SUIT_ViewWindow* vw = vm->getActiveView();
-       if ( vw ) {
+        if ( vw ) {
           QImage im = vw->dumpView();
-         if ( !im.isNull() && !myFileName.isEmpty() ) {
+          if ( !im.isNull() && !myFileName.isEmpty() ) {
             QString fmt = SUIT_Tools::extension( myFileName ).toUpper();
-           if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
-           if ( fmt == "JPG" )  fmt = "JPEG";
-           myResult = im.save( myFileName, fmt.toLatin1() );
+            if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
+            if ( fmt == "JPG" )  fmt = "JPEG";
+            myResult = im.save( myFileName, fmt.toLatin1() );
           }
-       }
+        }
       }
     }
   }
@@ -1335,7 +1536,7 @@ public:
   TDefMenuGroupEvent() : myResult( -1 ) {}
   virtual void Execute() 
   {
-    myResult = SALOME_PYQT_Module::defaultMenuGroup();
+    myResult = SALOME_PYQT_ModuleLight::defaultMenuGroup();
   }
 };
 int SalomePyQt::defaultMenuGroup()
@@ -1357,7 +1558,7 @@ public:
   CrTool( QAction* action, const QString& tBar, const int id, const int idx )
     : myCase( 4 ), myAction( action ), myTbName( tBar ), myId( id ), myIndex( idx ) {}
 
-  int execute( SALOME_PYQT_Module* module ) const
+  int execute( SALOME_PYQT_ModuleLight* module ) const
   {
     if ( module ) {
       switch ( myCase ) {
@@ -1394,7 +1595,7 @@ public:
     : myResult( -1 ), myCrTool( crTool ) {}
   virtual void Execute() 
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = myCrTool.execute( module );
   }
@@ -1476,7 +1677,7 @@ public:
   CrMenu( QAction* action, const QString& menu, const int id, const int group, const int idx ) 
     : myCase( 5 ), myAction( action ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
 
-  int execute( SALOME_PYQT_Module* module ) const
+  int execute( LightApp_Module* module ) const
   {
     if ( module ) {
       switch ( myCase ) {
@@ -1517,9 +1718,12 @@ public:
     : myResult( -1 ), myCrMenu( crMenu ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
-    if ( module )
-      myResult = myCrMenu.execute( module );
+    if ( LightApp_Application* anApp = getApplication() ) 
+      {
+        LightApp_Module* module = dynamic_cast<LightApp_Module*>( anApp->activeModule() );
+        if ( module )
+          myResult = myCrMenu.execute( module );
+      }
   }
 };
 
@@ -1618,7 +1822,7 @@ public:
     : myResult( 0 ) {}
   virtual void Execute() 
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = (QAction*)module->separator();
   }
@@ -1631,11 +1835,11 @@ QAction* SalomePyQt::createSeparator()
 /*!
   \fn QAction* SalomePyQt::createAction( const int      id,
                                            const QString& menuText, 
-                                          const QString& tipText, 
-                                          const QString& statusText, 
-                                          const QString& icon,
-                                          const int      key, 
-                                          const bool     toggle )
+                                           const QString& tipText, 
+                                           const QString& statusText, 
+                                           const QString& icon,
+                                           const int      key, 
+                                           const bool     toggle )
   \brief Create an action which can be then used in the menu or toolbar.
   \param id the unique id action to be registered to
   \param menuText action text which should appear in menu
@@ -1659,19 +1863,19 @@ public:
   int     myKey;
   bool    myToggle;
   TCreateActionEvent( const int id, const QString& menuText, const QString& tipText, 
-                     const QString& statusText, const QString& icon, const int key, const bool toggle ) 
+                      const QString& statusText, const QString& icon, const int key, const bool toggle ) 
     : myResult( 0 ), myId( id ), myMenuText( menuText ), myTipText( tipText ),
       myStatusText( statusText ), myIcon( icon ), myKey( key ), myToggle( toggle ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = (QAction*)module->createAction( myId, myTipText, myIcon, myMenuText, myStatusText, myKey, myToggle );
   }
 };
 QAction* SalomePyQt::createAction( const int id,           const QString& menuText, 
-                                    const QString& tipText, const QString& statusText, 
-                                    const QString& icon,    const int key, const bool toggle )
+                                     const QString& tipText, const QString& statusText, 
+                                     const QString& icon,    const int key, const bool toggle )
 {
   return ProcessEvent( new TCreateActionEvent( id, menuText, tipText, statusText, icon, key, toggle ) );
 }
@@ -1692,7 +1896,7 @@ struct TcreateActionGroupEvent: public SALOME_Event {
     : myId( id ), myExclusive( exclusive ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->createActionGroup( myId, myExclusive );
   }
@@ -1718,7 +1922,7 @@ public:
     : myResult( 0 ), myId( id ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = (QAction*)module->action( myId );
   }
@@ -1744,7 +1948,7 @@ public:
     : myResult( -1 ), myAction( action ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->actionId( myAction );
   }
@@ -1771,7 +1975,7 @@ public:
     : myResult( -1 ), myLabel( label ) {}
   virtual void Execute() 
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->addGlobalPreference( myLabel );
   }
@@ -1798,7 +2002,7 @@ public:
     : myResult( -1 ), myLabel( label ) {}
   virtual void Execute() 
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->addPreference( myLabel );
   }
@@ -1810,7 +2014,7 @@ int SalomePyQt::addPreference( const QString& label )
 
 /*!
   \fn int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
-                                    const QString& section, const QString& param );
+                                     const QString& section, const QString& param );
   \brief Add module-related preferences.
   \param label preferences group name
   \param pId parent preferences group id
@@ -1831,21 +2035,21 @@ public:
   QString mySection;
   QString myParam;
   TAddPrefParamEvent( const QString& label, 
-                     const int pId, const int type,
-                     const QString& section, 
-                     const QString& param )
+                      const int pId, const int type,
+                      const QString& section, 
+                      const QString& param )
     : myResult( -1 ),
       myLabel( label ), myPId( pId ), myType( type ), 
       mySection( section ), myParam ( param ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam );
   }
 };
 int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
-                              const QString& section, const QString& param )
+                               const QString& section, const QString& param )
 {
   return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) );
 }
@@ -1869,7 +2073,7 @@ public:
     : myId( id ), myProp( prop ) {}
   virtual void Execute()
   {
-    SALOME_PYQT_Module* module = getActiveModule();
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
     if ( module )
       myResult = module->preferenceProperty( myId, myProp );
   }
@@ -1886,8 +2090,8 @@ QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop )
   \param var preferences property value
 */
 void SalomePyQt::setPreferenceProperty( const int id, 
-                                       const QString& prop,
-                                       const QVariant& var )
+                                        const QString& prop,
+                                        const QVariant& var )
 {
   class TEvent: public SALOME_Event
   {
@@ -1899,9 +2103,9 @@ void SalomePyQt::setPreferenceProperty( const int id,
       : myId( id ), myProp( prop ), myVar( var ) {}
     virtual void Execute() 
     {
-      SALOME_PYQT_Module* module = getActiveModule();
+      SALOME_PYQT_ModuleLight* module = getActiveModule();
       if ( module )
-       module->setPreferenceProperty( myId, myProp, myVar );
+        module->setPreferenceProperty( myId, myProp, myVar );
     }
   };
   ProcessVoidEvent( new TEvent( id, prop, var) );
@@ -1919,9 +2123,9 @@ void SalomePyQt::setPreferenceProperty( const int id,
   \param var preferences property value for the index \a idx
 */
 void SalomePyQt::addPreferenceProperty( const int id, 
-                                       const QString& prop,
-                                       const int idx, 
-                                       const QVariant& var )
+                                        const QString& prop,
+                                        const int idx, 
+                                        const QVariant& var )
 {
   class TEvent: public SALOME_Event
   {
@@ -1934,32 +2138,32 @@ void SalomePyQt::addPreferenceProperty( const int id,
       : myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {}
     virtual void Execute()
     {
-      SALOME_PYQT_Module* module = getActiveModule();
+      SALOME_PYQT_ModuleLight* module = getActiveModule();
       if ( module ) {
-       QVariant var =  module->preferenceProperty( myId, myProp );
-       if ( var.isValid() ) {
-         if ( var.type() == QVariant::StringList ) {
-           QStringList sl = var.toStringList();
-           if ( myIdx >= 0 && myIdx < sl.count() ) 
-             sl[myIdx] = myVar.toString();
-           else
-             sl.append( myVar.toString() );
-           module->setPreferenceProperty( myId, myProp, sl );
-         }
-         else if ( var.type() == QVariant::List ) {
-           QList<QVariant> vl = var.toList();
-           if ( myIdx >= 0 && myIdx < vl.count() ) 
-             vl[myIdx] = myVar;
-           else
-             vl.append( myVar );
-           module->setPreferenceProperty( myId, myProp, vl );
-         }
-       }
-       else {
-         QList<QVariant> vl;
-         vl.append( myVar );
-         module->setPreferenceProperty( myId, myProp, vl );
-       }
+        QVariant var =  module->preferenceProperty( myId, myProp );
+        if ( var.isValid() ) {
+          if ( var.type() == QVariant::StringList ) {
+            QStringList sl = var.toStringList();
+            if ( myIdx >= 0 && myIdx < sl.count() ) 
+              sl[myIdx] = myVar.toString();
+            else
+              sl.append( myVar.toString() );
+            module->setPreferenceProperty( myId, myProp, sl );
+          }
+          else if ( var.type() == QVariant::List ) {
+            QList<QVariant> vl = var.toList();
+            if ( myIdx >= 0 && myIdx < vl.count() ) 
+              vl[myIdx] = myVar;
+            else
+              vl.append( myVar );
+            module->setPreferenceProperty( myId, myProp, vl );
+          }
+        }
+        else {
+          QList<QVariant> vl;
+          vl.append( myVar );
+          module->setPreferenceProperty( myId, myProp, vl );
+        }
       }
     }
   };
@@ -1983,10 +2187,10 @@ void SalomePyQt::message( const QString& msg, bool addSeparator )
       : myMsg( msg ), myAddSep( addSeparator ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       LogWindow* lw = anApp->logWindow();
-       if ( lw )
-         lw->putMessage( myMsg, myAddSep );
+      if ( LightApp_Application* anApp = getApplication() ) {
+        LogWindow* lw = anApp->logWindow();
+        if ( lw )
+          lw->putMessage( myMsg, myAddSep );
       }
     }
   };
@@ -2004,10 +2208,10 @@ void SalomePyQt::clearMessages()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       LogWindow* lw = anApp->logWindow();
-       if ( lw )
-         lw->clear();
+      if ( LightApp_Application* anApp = getApplication() ) {
+        LogWindow* lw = anApp->logWindow();
+        if ( lw )
+          lw->clear();
       }
     }
   };
@@ -2024,19 +2228,18 @@ static SUIT_ViewWindow* getWnd( const int id )
 {
   SUIT_ViewWindow* resWnd = 0;
 
-  SalomeApp_Application* app  = getApplication();
+  LightApp_Application* app = getApplication();
   if ( app )
   {
-    STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
-    if ( tabDesk )
+    ViewManagerList vmlist = app->viewManagers();
+    foreach( SUIT_ViewManager* vm, vmlist )
     {
-      QList<SUIT_ViewWindow*> wndlist = tabDesk->windows();
-      SUIT_ViewWindow* wnd;
-      foreach ( wnd, wndlist )
+      QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+      foreach ( SUIT_ViewWindow* vw, vwlist )
       {
-        if ( id == wnd->getId() )
+        if ( id == vw->getId() )
         {
-          resWnd = wnd;
+          resWnd = vw;
           break;
         }
       }
@@ -2061,7 +2264,7 @@ public:
   virtual void Execute() 
   {
     myResult.clear();
-    SalomeApp_Application* app  = getApplication();
+    LightApp_Application* app  = getApplication();
     if ( app )
     {
       STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
@@ -2095,7 +2298,7 @@ public:
     : myResult( -1 ) {}
   virtual void Execute() 
   {
-    SalomeApp_Application* app = getApplication();
+    LightApp_Application* app = getApplication();
     if ( app )
     {
       SUIT_ViewManager* viewMgr = app->activeViewManager();
@@ -2225,7 +2428,7 @@ public:
   virtual void Execute() 
   {
     myResult.clear();
-    SalomeApp_Application* app  = getApplication();
+    LightApp_Application* app  = getApplication();
     if ( app )
     {
       ViewManagerList vmList;
@@ -2298,7 +2501,7 @@ public:
       myType( theType ) {}
   virtual void Execute() 
   {
-    SalomeApp_Application* app  = getApplication();
+    LightApp_Application* app  = getApplication();
     if ( app )
     {
       SUIT_ViewManager* viewMgr = app->createViewManager( myType );
@@ -2316,6 +2519,45 @@ int SalomePyQt::createView( const QString& type )
   return ProcessEvent( new TCreateView( type ) );
 }
 
+/*!
+  \fn int SalomePyQt::createView( const QString& type, QWidget* w )
+  \brief Create new view with custom widget embedded and activate it
+  \param type viewer type
+  \param w custom widget
+  \return integer identifier of created view (or -1 if view could not be created)
+*/
+
+class TCreateViewWg: public SALOME_Event
+{
+public:
+  typedef int TResult;
+  TResult myResult;
+  QString myType;
+  QWidget* myWidget;
+  TCreateViewWg( const QString& theType, QWidget* w )
+    : myResult( -1 ),
+      myType( theType ),
+      myWidget( w ) {}
+  virtual void Execute() 
+  {
+    LightApp_Application* app  = getApplication();
+    if ( app )
+    {
+      SUIT_ViewManager* viewMgr = app->createViewManager( myType, myWidget );
+      if ( viewMgr )
+      {
+        SUIT_ViewWindow* wnd = viewMgr->getActiveView();
+        if ( wnd )
+          myResult = wnd->getId();
+      }
+    }
+  }
+};
+int SalomePyQt::createView( const QString& type, QWidget* w )
+{
+  return ProcessEvent( new TCreateViewWg( type, w ) );
+}
+
 /*!
   \fn bool SalomePyQt::closeView( const int id )
   \brief Close view
@@ -2434,6 +2676,61 @@ bool SalomePyQt::isViewVisible( const int id )
   return ProcessEvent( new TIsViewVisible( id ) );
 }
   
+/*!
+  \fn bool SalomePyQt::setViewClosable( const int id, const bool on )
+  \brief Set / clear view's "closable" option. By default any view is closable
+        (i.e. can be closed by the user).
+  \param id window identifier
+  \param on new "closable" option's value
+*/
+
+void SalomePyQt::setViewClosable( const int id, const bool on )
+{
+  class TEvent: public SALOME_Event
+  {
+    int myWndId;
+    bool myOn;
+  public:
+    TEvent( const int id, const bool on )
+      : myWndId( id ), myOn( on ) {}
+    virtual void Execute()
+    {
+      SUIT_ViewWindow* wnd = getWnd( myWndId );
+      if ( wnd ) wnd->setClosable( myOn );
+    }
+  };
+  ProcessVoidEvent( new TEvent( id, on ) );
+}
+
+/*!
+  \fn bool SalomePyQt::isViewClosable( const int id )
+  \brief Check whether view is closable (i.e. can be closed by the user)
+  \param id window identifier
+  \return \c true if view is closable or \c false otherwise 
+*/
+
+class TIsViewClosable: public SALOME_Event
+{
+public:
+  typedef bool TResult;
+  TResult myResult;
+  int myWndId;
+  TIsViewClosable( const int id )
+    : myResult( true ),
+      myWndId( id ) {}
+  virtual void Execute() 
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd )
+      myResult = wnd->closable();
+  }
+};
+
+bool SalomePyQt::isViewClosable( const int id )
+{
+  return ProcessEvent( new TIsViewClosable( id ) );
+}
+
 /*!
   \fn bool SalomePyQt::groupAllViews()
   \brief Group all views to the single tab area
@@ -2449,7 +2746,7 @@ public:
     : myResult( false ) {}
   virtual void Execute() 
   {
-    SalomeApp_Application* app  = getApplication();
+    LightApp_Application* app  = getApplication();
     if ( app )
     {
       STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
@@ -2620,3 +2917,335 @@ QList<int> SalomePyQt::neighbourViews( const int id )
 {
   return ProcessEvent( new TNeighbourViews( id ) );
 }
+
+
+/*!
+  SalomePyQt::createObject(parent)
+  Create empty data object
+*/
+class TCreateEmptyObjectEvent: public SALOME_Event {
+public:
+  typedef QString TResult;
+  TResult  myResult;
+  QString  myParent;
+  TCreateEmptyObjectEvent(const QString& parent) : myParent( parent ) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (QString)module->createObject(myParent);
+  }
+};
+QString SalomePyQt::createObject(const QString& parent)
+{
+  return ProcessEvent( new TCreateEmptyObjectEvent(parent) );
+}
+
+/*!
+  SalomePyQt::createObject( name, icon, tooltip, parent )
+  Create data object with name, icon and tooltip
+*/
+class TCreateObjectEvent: public SALOME_Event {
+public:
+  typedef QString TResult;
+  TResult myResult;
+  QString myParent;
+  QString myName;
+  QString myIconName;
+  QString myToolTip;
+  TCreateObjectEvent(const QString& name,
+                     const QString& iconname,
+                     const QString& tooltip,
+                     const QString& parent) : myName(name),
+                                              myIconName(iconname),
+                                              myToolTip(tooltip),
+                                              myParent( parent ){}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (QString)module->createObject(myName, myIconName,
+                                               myToolTip, myParent);
+  }
+};
+QString SalomePyQt::createObject(const QString& name,
+                                 const QString& iconname,
+                                 const QString& tooltip,
+                                 const QString& parent)
+{
+  return ProcessEvent( new TCreateObjectEvent(name, iconname, tooltip, parent) );
+}
+
+
+/*!
+  SalomePyQt::setName(obj,name)
+  Set object name
+*/
+class TSetNameEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  QString myName;
+  TSetNameEvent( const QString& obj,
+                 const QString& name) : myObj(obj),
+                                         myName(name) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->setName(myObj,myName);
+  }
+};
+void SalomePyQt::setName(const QString& obj,const QString& name)
+{
+  ProcessVoidEvent(new TSetNameEvent(obj,name));
+}
+
+
+/*!
+  SalomePyQt::setIcon(obj,icon)
+  Set object icon
+*/
+class TSetIconEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  QString myIconName;
+  TSetIconEvent( const QString& obj,
+                 const QString& iconname) : myObj(obj),
+                                            myIconName(iconname) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->setIcon(myObj,myIconName);
+  }
+};
+
+void SalomePyQt::setIcon(const QString& obj,const QString& iconname)
+{
+  ProcessVoidEvent(new TSetIconEvent(obj,iconname));
+}
+
+/*!
+  SalomePyQt::setToolTip(obj,tooltip)
+  Set object tool tip
+*/
+class TSetToolTipEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  QString myToolTip;
+  TSetToolTipEvent( const QString& obj,
+                    const QString& tooltip) : myObj(obj),
+                                              myToolTip(tooltip) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->setToolTip(myObj,myToolTip);
+  }
+};
+void SalomePyQt::setToolTip(const QString& obj,const QString& tooltip)
+{
+  ProcessVoidEvent(new TSetToolTipEvent(obj,tooltip));
+}
+
+/*!
+  SalomePyQt::setReference(obj,refEntry)
+  Set entry to referenced object
+*/
+class TSetRefEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  QString myRefEntry;
+  TSetRefEvent( const QString& obj,
+               const QString& refEntry) : myObj(obj),
+                                          myRefEntry(refEntry) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->setReference(myObj,myRefEntry);
+  }
+};
+void SalomePyQt::setReference(const QString& obj,const QString& refEntry)
+{
+  ProcessVoidEvent(new TSetRefEvent(obj,refEntry));
+}
+
+/*!
+  SalomePyQt::setColor(obj,color)
+  Set object color
+*/
+class TSetColorEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  QColor  myColor;
+  TSetColorEvent( const QString& obj,
+                 const QColor& color) : myObj(obj),
+                                        myColor(color) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->setColor(myObj,myColor);
+  }
+};
+void SalomePyQt::setColor(const QString& obj,const QColor& color)
+{
+  ProcessVoidEvent(new TSetColorEvent(obj,color));
+}
+
+/*!
+  SalomePyQt::getName(obj)
+  Return name of object
+*/
+class TGetNameEvent: public SALOME_Event
+{
+public:
+  typedef QString TResult;
+  TResult myResult;
+  QString myObj;
+  TGetNameEvent( const QString& obj ) : myObj(obj) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (QString) module->getName(myObj);
+  }
+};
+
+QString SalomePyQt::getName(const QString& obj)
+{
+  return ProcessEvent(new TGetNameEvent(obj));
+}
+
+/*!
+  SalomePyQt::getToolTip(obj)
+  Return tool tip of object
+*/
+class TGetToolTipEvent: public SALOME_Event
+{
+public:
+  typedef QString TResult;
+  TResult myResult;
+  QString myObj;
+  TGetToolTipEvent( const QString& obj ) : myObj(obj) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (QString)module->getToolTip(myObj);
+  }
+};
+QString SalomePyQt::getToolTip(const QString& obj)
+{
+  return ProcessEvent(new TGetToolTipEvent(obj));
+}
+
+/*!
+  SalomePyQt::getReference(obj)
+  Return entry of the referenced object (if any)
+*/
+class TGetRefEvent: public SALOME_Event
+{
+public:
+  typedef QString TResult;
+  TResult myResult;
+  QString myObj;
+  TGetRefEvent( const QString& obj ) : myObj(obj) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = module->getReference(myObj);
+  }
+};
+QString SalomePyQt::getReference(const QString& obj)
+{
+  return ProcessEvent(new TGetRefEvent(obj));
+}
+
+/*!
+  SalomePyQt::getColor(obj)
+  Return the color of the object
+*/
+class TGetColorEvent: public SALOME_Event
+{
+public:
+  typedef QColor TResult;
+  TResult myResult;
+  QString myObj;
+  TGetColorEvent( const QString& obj ) : myObj(obj) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = module->getColor(myObj);
+  }
+};
+QColor SalomePyQt::getColor(const QString& obj)
+{
+  return ProcessEvent(new TGetColorEvent(obj));
+}
+
+/*!
+  SalomePyQt::removeChild(obj)
+  Remove childrens from object
+*/
+class TRemoveChildEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  TRemoveChildEvent(const QString& obj) : myObj(obj) {}
+  
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->removeChild(myObj);
+  }
+};
+void SalomePyQt::removeChild(const QString& obj)
+{
+  ProcessVoidEvent(new TRemoveChildEvent(obj));
+}
+
+
+/*!
+  SalomePyQt::removeObject(obj)
+  Remove object
+*/
+class TRemoveObjectEvent: public SALOME_Event
+{
+public:
+  QString myObj;
+  
+  TRemoveObjectEvent( const QString& obj) : myObj(obj) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      module->removeObject(myObj);
+  }
+};
+void SalomePyQt::removeObject(const QString& obj)
+{
+  ProcessVoidEvent(new TRemoveObjectEvent(obj));
+}
+
+/*!
+  SalomePyQt::getChildren(obj)
+  Return the list of the child objects
+  if rec == true then function get all sub children.
+*/
+
+class TGetChildrenEvent: public SALOME_Event
+{
+public:
+  typedef QStringList TResult;
+  TResult myResult;
+  QString myObj;
+  bool myRec; 
+  TGetChildrenEvent(const QString& obj, const bool rec) : myObj(obj),
+                                                          myRec(rec) {}
+  virtual void Execute() {
+    SALOME_PYQT_ModuleLight* module = getActiveModule();
+    if ( module )
+      myResult = (QStringList)module->getChildren(myObj,myRec);
+  }
+};
+QStringList SalomePyQt::getChildren(const QString& obj, const bool rec)
+{
+  return ProcessEvent( new TGetChildrenEvent(obj,rec) ); 
+}
index 2643b2112578b040bc52c8992b3b4c9742bad814..4f0decebc240b968a72b3b0dc11079af0744f2ab 100644 (file)
@@ -1,30 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SalomePyQt.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
 #ifndef SALOME_PYQT_H
 #define SALOME_PYQT_H
 
+#include <Python.h>
+
 #include <QObject>
 #include <QString>
 #include <QColor>
 #include <LightApp_Preferences.h>
 
 class LightApp_SelectionMgr;
-class SalomeApp_Application;
+class LightApp_Application;
 class QMenuBar;
 class QMenu;
 class QWidget;
 class QAction;
+class QTreeView;
 class QtxActionGroup;
 
 class SALOME_Selection : public QObject
@@ -46,7 +50,7 @@ class SALOME_Selection : public QObject
 
 public:
   ~SALOME_Selection();
-  static SALOME_Selection* GetSelection( SalomeApp_Application* );
+  static SALOME_Selection* GetSelection( LightApp_Application* );
 
   void Clear();
   void ClearIObjects();
@@ -120,16 +124,46 @@ public:
   static QMenuBar*         getMainMenuBar();
   static QMenu*            getPopupMenu( const MenuName );
   static QMenu*            getPopupMenu( const QString& );
+  static QTreeView*        getObjectBrowser();
   static SALOME_Selection* getSelection();
   static int               getStudyId();
   static void              putInfo( const QString&, const int = 0 );
   static const QString     getActiveComponent();
+  static PyObject*         getActivePythonModule();
+  static bool              activateModule( const QString& );
   static void              updateObjBrowser( const int = 0, bool = true );
 
+  static bool              isModified();
+  static void              setModified( bool );
+
   static QString           getFileName         ( QWidget*, const QString&, const QStringList&, const QString&, bool );
   static QStringList       getOpenFileNames    ( QWidget*, const QString&, const QStringList&, const QString& );
   static QString           getExistingDirectory( QWidget*, const QString&, const QString& );
 
+  static QString           createObject(const QString& parent = QString(""));
+  static QString           createObject(const QString& name,
+                                        const QString& iconname,
+                                        const QString& tooltip,
+                                        const QString& parent = QString(""));
+
+  static void              removeObject( const QString& obj);
+  static void              removeChild( const QString& obj = QString(""));
+  static QStringList       getChildren(const QString& obj = QString(""), const bool rec = false);
+  static void              setName(const QString& obj,const QString& name);
+  static void              setIcon(const QString& obj,const QString& iconname);
+  static void              setToolTip(const QString& obj,const QString& tooltip);
+  static QString           getName(const QString& obj);
+  static QString           getToolTip(const QString& obj);
+
+  static void              setColor(const QString& obj,const QColor& color);
+  static QColor            getColor(const QString& obj);
+
+  static void              setReference( const QString& obj, 
+                                        const QString& refEntry ); 
+  static QString           getReference( const QString& obj );
+
+  static QIcon             loadIcon( const QString&, const QString& );
+
   static void              helpContext( const QString&, const QString& );
 
   static bool              dumpView( const QString& );
@@ -143,23 +177,23 @@ public:
   static int               createTool( QAction*, const QString&, const int = -1, const int = -1 );
 
   static int               createMenu( const QString&, const int = -1,
-                                      const int = -1, const int = -1, const int = -1 );
+                                       const int = -1, const int = -1, const int = -1 );
   static int               createMenu( const QString&, const QString& = QString(), 
-                                      const int = -1, const int = -1, const int = -1 );
+                                       const int = -1, const int = -1, const int = -1 );
   static int               createMenu( const int,      const int = -1,
-                                      const int = -1, const int = -1 );
+                                       const int = -1, const int = -1 );
   static int               createMenu( const int,      const QString& = QString(), 
-                                      const int = -1, const int = -1 );
+                                       const int = -1, const int = -1 );
   static int               createMenu( QAction*,     const int,      const int = -1, 
-                                      const int = -1, const int = -1 );
+                                       const int = -1, const int = -1 );
   static int               createMenu( QAction*,     const QString&, const int = -1, 
-                                      const int = -1, const int = -1 );
+                                       const int = -1, const int = -1 );
 
   static QAction*          createSeparator();
 
   static QAction*          createAction( const int, const QString&,
-                                        const QString& = QString(), const QString& = QString(), 
-                                        const QString& = QString(), const int = 0, const bool = false );
+                                         const QString& = QString(), const QString& = QString(), 
+                                         const QString& = QString(), const int = 0, const bool = false );
   
   static QtxActionGroup*   createActionGroup( const int, const bool = true );
 
@@ -191,15 +225,15 @@ public:
   static int               addPreference( const QString&,
                                           const int, const int = PT_Auto,
                                           const QString& = QString(),
-                                         const QString& = QString() );
+                                          const QString& = QString() );
   static QVariant          preferenceProperty( const int, const QString& );
   static void              setPreferenceProperty( const int, 
                                                   const QString&,
                                                   const QVariant& );
   static void              addPreferenceProperty( const int,
-                                                 const QString&,
-                                                 const int,
-                                                 const QVariant& );
+                                                  const QString&,
+                                                  const int,
+                                                  const QVariant& );
 
   static void              message( const QString&, bool = true );
   static void              clearMessages();
@@ -212,10 +246,13 @@ public:
   static QList<int>        findViews( const QString& );
   static bool              activateView( const int );
   static int               createView( const QString& );
+  static int               createView( const QString&, QWidget* );
   static bool              closeView( const int );
   static int               cloneView( const int );
-  static bool              isViewVisible( const int id );
-  
+  static bool              isViewVisible( const int );
+  static void              setViewClosable( const int, const bool );
+  static bool              isViewClosable( const int );
+
   static bool              groupAllViews();
   static bool              splitView( const int, const Orientation, const Action );
   static bool              moveView( const int, const int, const bool );
index b4ff564440a1ab63f584d1aa189c472425d5b87b..2eb35bd845a17ebd12e83a101e022457766284ea 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : SalomePyQt.sip
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@ -208,16 +208,45 @@ public:
   static QMenuBar*         getMainMenuBar() /ReleaseGIL/ ;
   static QMenu*            getPopupMenu( const MenuName ) /ReleaseGIL/ ;
   static QMenu*            getPopupMenu( const QString& ) /ReleaseGIL/ ;
+  static QTreeView*        getObjectBrowser() /ReleaseGIL/ ;
   static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
   static int               getStudyId() /ReleaseGIL/ ;
   static void              putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
   static const QString     getActiveComponent() /ReleaseGIL/ ;
-  static void              updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
+  static SIP_PYOBJECT      getActivePythonModule() /ReleaseGIL/ ;
+  static bool              activateModule( const QString& ) /ReleaseGIL/ ;
+  static void              updateObjBrowser( const int = 0, bool =  true ) /ReleaseGIL/ ;
+  
+  static bool              isModified() /ReleaseGIL/ ;
+  static void              setModified( bool ) /ReleaseGIL/ ;
 
   static QString           getFileName         ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
   static QStringList       getOpenFileNames    ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
   static QString           getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
-
+                        
+  static QString           createObject( const QString& = QString("") )  /ReleaseGIL/ ;
+  static QString           createObject( const QString&,
+                                        const QString&,
+                                        const QString&,
+                                        const QString& = QString("") )  /ReleaseGIL/ ;
+
+  static void              setName(const QString& ,const QString& ) /ReleaseGIL/ ;
+  static void              setIcon(const QString& ,const QString& ) /ReleaseGIL/ ;
+  static void              setToolTip(const QString& ,const QString& ) /ReleaseGIL/ ;
+  static QString           getName(const QString& ) /ReleaseGIL/ ;
+  static QString           getToolTip(const QString& ) /ReleaseGIL/ ;
+
+  static void              setColor( const QString&, const QColor& ) /ReleaseGIL/ ;
+  static QColor            getColor( const QString& ) /ReleaseGIL/ ;
+
+  static void              setReference( const QString& ,const QString& ) /ReleaseGIL/ ; 
+  static QString           getReference( const QString& ) /ReleaseGIL/ ;
+
+  static void              removeObject(const QString&  )    /ReleaseGIL/ ;
+  static void              removeChild(const QString& = QString("")  ) /ReleaseGIL/ ;
+  static QStringList       getChildren(const QString&=QString("") , const bool = false) /ReleaseGIL/ ;
+
+  static QIcon             loadIcon( const QString&, const QString& ) /ReleaseGIL/ ;
   static void              helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
 
   static bool              dumpView( const QString& ) /ReleaseGIL/ ;
@@ -300,9 +329,12 @@ public:
   static QList<int>        findViews( const QString& ) /ReleaseGIL/ ;
   static bool              activateView( const int ) /ReleaseGIL/ ;
   static int               createView( const QString& ) /ReleaseGIL/ ;
+  static int               createView( const QString&, QWidget* ) /ReleaseGIL/ ;
   static bool              closeView( const int ) /ReleaseGIL/ ;
   static int               cloneView( const int ) /ReleaseGIL/ ;
   static bool              isViewVisible( const int id ) /ReleaseGIL/ ;
+  static void              setViewClosable( const int id, const bool ) /ReleaseGIL/ ;
+  static bool              isViewClosable( const int id ) /ReleaseGIL/ ;
   
   static bool              groupAllViews() /ReleaseGIL/ ;
   static bool              splitView( const int, Orientation, Action ) /ReleaseGIL/ ;
diff --git a/src/SALOME_SWIG/Help.py b/src/SALOME_SWIG/Help.py
deleted file mode 100755 (executable)
index 1de235e..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : Help.py
-#  Author : Paul RASCLE, EDF
-#  Module : SALOME
-#  $Header$
-#
-class SalomeDoc:
-    def __init__(self, aDoc):
-        self.doc = aDoc
-    def __repr__(self):
-        print self.doc
-        return "---"
-    def salome(self):
-        doc_salome = '''
-MODULE : salome
----------------
-module salome gives access to Salome ressources:
-variables:
-
-  salome:orb             : CORBA
-  salome.naming_service  : instance of naming Service class
-      methods:
-          Resolve(name)  : find a CORBA object (ior) by its pathname
-          Register(name) : register a CORBA object under a pathname
-  salome.lcc             : instance of lifeCycleCORBA class
-      methods:
-          FindOrLoadComponent(server,name) :
-                           obtain an Engine (CORBA object)
-                           or launch the Engine if not found,
-                           with a Server name and an Engine name
-  salome.sg
-      methods:
-         updateObjBrowser(bool):
-         getActiveStudyId():
-         getActiveStudyName():
-         
-         SelectedCount():      returns number of selected objects
-         getSelected(i):       returns entry of selected object number i
-         getAllSelected():     returns list of entry of selected objects
-         AddIObject(Entry):    select an existing Interactive object
-         RemoveIObject(Entry): remove object from selection
-         ClearIObjects():      clear selection
-         
-         Display(*Entry):
-         DisplayOnly(Entry):
-         Erase(Entry):
-         DisplayAll():
-         EraseAll():
-
-         IDToObject(Entry):    returns CORBA reference from entry
-
-  salome.myStudyName     : active Study Name
-  salome.myStudyId       : active Study Id
-  salome.myStudy         : the active Study itself (CORBA ior)
-                           methods : defined in SALOMEDS.idl
-                                                         
-methods:
-  salome.DumpStudy(study) : Dump a study, given the ior
----
-'''
-        print doc_salome
-        
-    def geompy(self):
-        doc_geompy = '''
-MODULE : geompy
----------------
-module geompy provides an encapsulation of GEOM Engine methods
-variables:
-  geompy.geom               : a Geometry Engine, found or loaded
-                              at first import of module geompy.
-                              methods : defined in GEOM_Gen.idl
-  geompy.myBuilder          : a study builder
-  geompy.father             : GEOM root in current study (salome.myStudy)
-
-methods:
-  addToStudy(aShape, aName) : add the shape into the current study
-  --- all methods of GEOM_Gen.idl that returns a shape are encapsulated,
-      with the same interface : shapes are named with their ior
-'''
-        print doc_geompy
-        
-    def supervision(self):
-        doc_supervision = '''
-MODULES : SALOME_SuperVisionEditor and SALOME_SuperVisionExecutor
------------------------------------------------------------------
-this modules provide access to Editor and Executor Engine methods
-
-See SUPERV.idl
-
-In order to run the example (supervisionexample.py)
-
-    Type : from supervisionexample import *
-           supervisionexample.py contains comments
-
-A new python example avoids references to LifeCycleCORBA
-                     avoids references to NamingService
-                     avoids references to ModuleCatalog
-                     avoids SuperVisionComponent creation
-                     allows G.Input(...) instead of AddInput(G,...)
-                     replaces Editor/Executor with Graph
-                     allows Nodes, Ports and Links CORBA objects
-                     shortens methods names
-                     ...
-
-    See /SuperVisionTest/resources/GraphExample.py
-                                   and GraphExample.xml
----
-'''
-        print doc_supervision
-        
-    
-
-help = SalomeDoc('''
-Availables modules:
-  salome      : gives access to Salome ressources
-  geompy      : encapsulation of GEOM Engine methods
-  supervision : gives access to SuperVision Engine
-To obtain specific help on a module "truc", type: help.truc()
-To run an example, type: import example3
-''')
-  
index 7719d37a1fc6e52206dee041adbc9d3507a33605..54e492d6eba76bcb55dfe2150919c4fbdc65b59d 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
@@ -53,8 +54,9 @@ SWIG_SOURCES  = libSALOME_Swig.i
 
 libSALOME_Swig.py: swig_wrap.cpp
 
-# library
-lib_LTLIBRARIES = _libSALOME_Swig.la
+salomepython_PYTHON = libSALOME_Swig.py
+salomepyexec_LTLIBRARIES = _libSALOME_Swig.la
+
 _libSALOME_Swig_la_SOURCES = $(SWIG_SOURCES) SALOMEGUI_Swig.cxx
 nodist__libSALOME_Swig_la_SOURCES = swig_wrap.cpp
 salomeinclude_HEADERS = $(SWIG_SOURCES) SALOMEGUI_Swig.hxx SALOMEGUI_Swig.i
@@ -62,18 +64,17 @@ salomeinclude_HEADERS = $(SWIG_SOURCES) SALOMEGUI_Swig.hxx SALOMEGUI_Swig.i
 _libSALOME_Swig_la_CPPFLAGS = \
        $(QT_INCLUDES) $(QWT_INCLUDES) $(PYTHON_INCLUDES) $(CAS_CPPFLAGS) $(VTK_INCLUDES)       \
        $(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@                     \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl -I$(srcdir)                     \
-       -I$(srcdir)/../SalomeApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT                         \
+       -I$(top_builddir)/idl -I$(srcdir)                                                       \
+       -I$(srcdir)/../LightApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT                          \
        -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LightApp -I$(srcdir)/../SOCC                   \
        -I$(srcdir)/../SVTK -I$(srcdir)/../Event -I$(srcdir)/../OBJECT                          \
        -I$(srcdir)/../CAM -I$(srcdir)/../STD -I$(srcdir)/../OCCViewer                          \
        -I$(srcdir)/../Prs -I$(srcdir)/../VTKViewer -I$(srcdir)/../SPlot2d                      \
-       -I$(srcdir)/../Plot2d                                                                   \
-       @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+       -I$(srcdir)/../Plot2d
 
 _libSALOME_Swig_la_LDFLAGS  = -module
 _libSALOME_Swig_la_LIBADD   =          \
-       ../SalomeApp/libSalomeApp.la    \
+       ../LightApp/libLightApp.la      \
        @PYTHON_LIBS@
 
 swig_wrap.cpp : $(SWIG_SOURCES)
diff --git a/src/SALOME_SWIG/PyInterp.py b/src/SALOME_SWIG/PyInterp.py
deleted file mode 100755 (executable)
index 311c4b3..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : PyInterp.py
-#  Author : Paul RASCLE, EDF
-#  Module : SALOME
-#  $Header$
-#
-import sys
-from omniORB import CORBA
-from LifeCycleCORBA import *
-from libSALOME_Swig import *
-import SALOMEDS
-from SALOME_NamingServicePy import *
-
-    #--------------------------------------------------------------------------
-
-def DumpComponent(Study, SO, offset):
-    it = Study.NewChildIterator(SO)
-    Builder = Study.NewBuilder()
-    while it.More():
-        CSO = it.Value()
-        it.Next()
-        anAttr = Builder.FindOrCreateAttribute(CSO, "AttributeName")
-        AtName = anAttr._narrow(SALOMEDS.AttributeName)
-        t_name = AtName.Value()
-        if t_name[0] == 1:
-            ofs = 1
-            a = ""
-            while ofs <= offset:
-                a = a + "--"
-                ofs = ofs +1
-            print a + ">" + CSO.GetID() + " " + t_name[1]
-        t_RefSO = CSO.ReferencedObject()
-        if t_RefSO[0] == 1:
-            RefSO = t_RefSO[1]
-            ofs = 1
-            a = ""
-            while ofs <= offset:
-                a = a + "  "
-                ofs = ofs +1
-            print a + ">" + RefSO.GetID()
-        DumpComponent(Study, CSO, offset+2)
-
-    #--------------------------------------------------------------------------
-
-def DumpStudy(Study):
-    itcomp = Study.NewComponentIterator()
-    while itcomp.More():
-        SC = itcomp.Value()
-        itcomp.Next()
-        name = SC.ComponentDataType()
-        print "-> ComponentDataType is " + name
-        DumpComponent(Study, SC, 1)
-        
-
-    #--------------------------------------------------------------------------
-
-# initialise the ORB
-orb = CORBA.ORB_init([''], CORBA.ORB_ID)
-
-# create an LifeCycleCORBA instance
-lcc = LifeCycleCORBA(orb)
-
-# create an SALOMEGUI_Swig instance
-sg = SALOMEGUI_Swig()
-
-#create an naming service instance
-naming_service = SALOME_NamingServicePy_i(orb)
-
-# get active study name and id
-myStudyName = sg.getActiveStudyName()
-print myStudyName
-
-myStudyId = sg.getActiveStudyId()
-print myStudyId
-
-# get Study Manager reference
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-
-# get active study
-myStudy = myStudyManager.GetStudyByName(myStudyName)
-
index 51e670e468a96498952894e1a9e0bce87f501442..f8103bf03f1a2cd2a8c7d1758c8574c913d199a2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 // File   : SALOMEGUI_Swig.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #include <SUIT_ViewManager.h>
 #include <SUIT_DataObjectIterator.h>
 #include <CAM_DataModel.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <SalomeApp_Module.h>
-#include <SalomeApp_DataObject.h>
+#include <LightApp_Application.h>
+#include <LightApp_Displayer.h>
+#include <LightApp_Study.h>
+#include <LightApp_Module.h>
+#include <LightApp_DataObject.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_DataOwner.h>
 #include <SALOME_Prs.h>
   \internal
   \return active application or 0 if there is no any
 */
-static SalomeApp_Application* getApplication()
+static LightApp_Application* getApplication()
 {
   if ( SUIT_Session::session() )
-    return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+    return dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
   return 0;
 }
 
@@ -113,10 +115,10 @@ static SalomeApp_Application* getApplication()
   \internal
   \return active study or 0 if there is no study opened
 */
-static SalomeApp_Study* getActiveStudy()
+static LightApp_Study* getActiveStudy()
 {
   if ( getApplication() )
-    return dynamic_cast<SalomeApp_Study*>( getApplication()->activeStudy() );
+    return dynamic_cast<LightApp_Study*>( getApplication()->activeStudy() );
   return 0;
 }
 
@@ -168,9 +170,9 @@ void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ )
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       anApp->updateObjectBrowser();
-       anApp->updateActions(); //SRN: added in order to update the toolbar
+      if ( LightApp_Application* anApp = getApplication() ) {
+        anApp->updateObjectBrowser();
+        anApp->updateActions(); //SRN: added in order to update the toolbar
       }
     }
   };
@@ -191,8 +193,8 @@ public:
   TGetActiveStudyIdEvent() : myResult( 0 ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
-      myResult = aStudy->studyDS()->StudyId();
+    if ( LightApp_Study* aStudy = getActiveStudy() ) {
+      myResult = aStudy->id();
     }
   }
 };
@@ -215,8 +217,8 @@ public:
   TGetActiveStudyNameEvent() {}
   virtual void Execute()
   {
-    if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
-      myResult = aStudy->studyDS()->Name();
+    if ( LightApp_Study* aStudy = getActiveStudy() ) {
+      myResult = aStudy->id();
     }
   }
 };
@@ -251,7 +253,7 @@ public:
     : myName( name ), myIsUserName( isUserName ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Application* app = getApplication() ) {
+    if ( LightApp_Application* app = getApplication() ) {
       myResult = myIsUserName ? app->moduleTitle( myName ) : app->moduleName( myName );
     }
   }
@@ -288,23 +290,23 @@ public:
   TGetSelectedEvent() {}
   virtual void Execute()
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
-      SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
+    if ( LightApp_Application* anApp = getApplication() ) {
+      LightApp_Study* aStudy  = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
       LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
       if ( aStudy && aSelMgr ) {
-       SUIT_DataOwnerPtrList aList;
-       aSelMgr->selected( aList );
-
-       for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); 
-             itr != aList.end(); ++itr ) {
-         const LightApp_DataOwner* owner = 
-           dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
-         if( !owner )
-           continue;
-         QString entry = owner->entry();
-         if( !myResult.contains( entry ) )
-           myResult.append( entry );
-       }
+        SUIT_DataOwnerPtrList aList;
+        aSelMgr->selected( aList );
+
+        for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); 
+              itr != aList.end(); ++itr ) {
+          const LightApp_DataOwner* owner = 
+            dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+          if( !owner )
+            continue;
+          QString entry = owner->entry();
+          if( !myResult.contains( entry ) )
+            myResult.append( entry );
+        }
       }
     }
   }
@@ -334,14 +336,14 @@ void SALOMEGUI_Swig::AddIObject( const char* theEntry )
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study*       aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
-       LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
-       if ( aStudy && aSelMgr ) {
-         SALOME_ListIO anIOList;
-         anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
-         aSelMgr->setSelectedObjects( anIOList, true );
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        LightApp_Study*       aStudy  = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
+        if ( aStudy && aSelMgr ) {
+          SALOME_ListIO anIOList;
+          anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
+          aSelMgr->setSelectedObjects( anIOList, true );
+        }
       }
     }
   };
@@ -361,26 +363,26 @@ void SALOMEGUI_Swig::RemoveIObject( const char* theEntry )
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
-       LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
-       if ( aStudy && aSelMgr ) {
-         SALOME_ListIO anIOList;
-         // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears
-         // Lately this should be replaced by the following:
-         // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) );
-         // aSelMgr->unsetSelectedObjects( anIOList );
-         ///////////////////////////////////////////////
-         aSelMgr->selectedObjects( anIOList );
-         SALOME_ListIteratorOfListIO anIter( anIOList );
-         for( ; anIter.More(); anIter.Next() ) {
-           if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { 
-             anIOList.Remove( anIter );
-             aSelMgr->setSelectedObjects( anIOList, true );
-             return;
-           }
-         }
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        LightApp_Study* aStudy  = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
+        if ( aStudy && aSelMgr ) {
+          SALOME_ListIO anIOList;
+          // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears
+          // Lately this should be replaced by the following:
+          // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) );
+          // aSelMgr->unsetSelectedObjects( anIOList );
+          ///////////////////////////////////////////////
+          aSelMgr->selectedObjects( anIOList );
+          SALOME_ListIteratorOfListIO anIter( anIOList );
+          for( ; anIter.More(); anIter.Next() ) {
+            if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { 
+              anIOList.Remove( anIter );
+              aSelMgr->setSelectedObjects( anIOList, true );
+              return;
+            }
+          }
+        }
       }
     }
   };
@@ -398,11 +400,11 @@ void SALOMEGUI_Swig::ClearIObjects()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study* aStudy  = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
-       LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
-       if ( aStudy && aSelMgr )
-         aSelMgr->clearSelected();
+      if ( LightApp_Application* anApp = getApplication() ) {
+        LightApp_Study* aStudy  = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+        LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); 
+        if ( aStudy && aSelMgr )
+          aSelMgr->clearSelected();
       }
     }
   };
@@ -415,10 +417,8 @@ void SALOMEGUI_Swig::ClearIObjects()
   The presentable object should be previously created and
   displayed in this viewer.
 
-  For the current moment implemented for OCC and VTK viewers only.
-
   \param theEntry object entry
-*/             
+*/              
 void SALOMEGUI_Swig::Display( const char* theEntry )
 {
   class TEvent: public SALOME_Event
@@ -427,12 +427,19 @@ void SALOMEGUI_Swig::Display( const char* theEntry )
   public:
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
     virtual void Execute() {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view )
-           view->Display( view->CreatePrs( myEntry.toLatin1() ) );
+      LightApp_Application* anApp  = getApplication();
+      LightApp_Study*       aStudy = getActiveStudy();
+      if ( anApp && aStudy ) {
+       QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+       LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+       if ( d ) {
+         QStringList entries;
+         if( aStudy->isComponent( myEntry ) )
+           aStudy->children( myEntry, entries );
+         else
+           entries.append( myEntry );
+         foreach( QString entry, entries )
+           d->Display( aStudy->referencedToEntry( entry ), false, 0 );
        }
       }
     }
@@ -447,8 +454,6 @@ void SALOMEGUI_Swig::Display( const char* theEntry )
   The presentable object should be previously created and 
   displayed in this viewer.
 
-  For the current moment implemented for OCC and VTK viewers only.
-  
   \param theEntry object entry
 */
 void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
@@ -460,14 +465,26 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view ) {
-           view->EraseAll( false );
-           view->Display( view->CreatePrs( myEntry.toLatin1() ) );
-         }
+      LightApp_Application* anApp  = getApplication();
+      LightApp_Study*       aStudy = getActiveStudy();
+      if ( anApp && aStudy ) {
+       QStringList comps;
+       aStudy->components( comps );
+       foreach( QString comp, comps ) {
+         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+         if ( d ) d->EraseAll( false, false, 0 );
+       }
+
+       QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+       LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+       if ( d ) {
+         QStringList entries;
+         if( aStudy->isComponent( myEntry ) )
+           aStudy->children( myEntry, entries );
+         else
+           entries.append( myEntry );
+         foreach( QString entry, entries )
+           d->Display( aStudy->referencedToEntry( entry ), false, 0 );
        }
       }
     }
@@ -481,10 +498,8 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
   The presentable object should be previously created and 
   displayed in this viewer.
 
-  For the current moment implemented for OCC and VTK viewers only.
-
   \param theEntry object entry
-*/             
+*/              
 void SALOMEGUI_Swig::Erase( const char* theEntry )
 {
   class TEvent: public SALOME_Event
@@ -494,12 +509,19 @@ void SALOMEGUI_Swig::Erase( const char* theEntry )
     TEvent( const char* theEntry ) : myEntry( theEntry ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view )
-           view->Erase( view->CreatePrs( myEntry.toLatin1() ) );
+      LightApp_Application* anApp  = getApplication();
+      LightApp_Study*       aStudy = getActiveStudy();
+      if ( anApp && aStudy ) {
+       QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+       LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+       if ( d ) {
+         QStringList entries;
+         if( aStudy->isComponent( myEntry ) )
+           aStudy->children( myEntry, entries );
+         else
+           entries.append( myEntry );
+         foreach( QString entry, entries )
+           d->Erase( aStudy->referencedToEntry( entry ), false, false, 0 );
        }
       }
     }
@@ -513,8 +535,6 @@ void SALOMEGUI_Swig::Erase( const char* theEntry )
   
   The presentable objects should be previously created and
   displayed in this viewer.
-
-  For the current moment implemented for OCC and VTK viewers only.
 */
 void SALOMEGUI_Swig::DisplayAll()
 {
@@ -524,18 +544,18 @@ void SALOMEGUI_Swig::DisplayAll()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SalomeApp_Study*  study        = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
-       SUIT_ViewWindow*  window       = anApp->desktop()->activeWindow();
-       SalomeApp_Module* activeModule = dynamic_cast<SalomeApp_Module*>( anApp->activeModule() );
-       if ( study && window && activeModule ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view ) {
-           for ( SUIT_DataObjectIterator it( activeModule->dataModel()->root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
-             SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( it.current() );
-             if ( obj && !obj->entry().isEmpty() )
-               view->Display( view->CreatePrs( obj->entry().toLatin1() ) );
-           }
+      LightApp_Application* anApp  = getApplication();
+      LightApp_Study*       aStudy = getActiveStudy();
+      if ( anApp && aStudy ) {
+       QStringList comps;
+       aStudy->components( comps );
+       foreach( QString comp, comps ) {
+         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+         if ( d ) {
+           QStringList entries;
+           aStudy->children( aStudy->centry( comp ), entries );
+           foreach( QString entry, entries )
+             d->Display( aStudy->referencedToEntry( entry ), false, 0 );
          }
        }
       }
@@ -546,8 +566,6 @@ void SALOMEGUI_Swig::DisplayAll()
 
 /*!
   \brief Erase all objects from the current view window.
-  
-  For the current moment implemented for OCC and VTK viewers only.
 */
 void SALOMEGUI_Swig::EraseAll()
 {
@@ -557,12 +575,14 @@ void SALOMEGUI_Swig::EraseAll()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view )
-           view->EraseAll( false );
+      LightApp_Application* anApp  = getApplication();
+      LightApp_Study*       aStudy = getActiveStudy();
+      if ( anApp && aStudy ) {
+       QStringList comps;
+       aStudy->components( comps );
+       foreach( QString comp, comps ) {
+         LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+         if ( d ) d->EraseAll( false, false, 0 );
        }
       }
     }
@@ -590,14 +610,14 @@ public:
   TIsInViewerEvent( const char* theEntry ) : myEntry( theEntry ), myResult( false ) {}
   virtual void Execute()
   {
-    if ( SalomeApp_Application* anApp = getApplication() ) {
+    if ( LightApp_Application* anApp = getApplication() ) {
       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
       if ( window ) {
-       SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-       if ( view ) {
-         SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
-         myResult = !aPrs->IsNull();
-       }
+        SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+        if ( view ) {
+          SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
+          myResult = !aPrs->IsNull();
+        }
       }
     }
   }
@@ -618,13 +638,13 @@ void SALOMEGUI_Swig::UpdateView()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
-         if ( view )
-           view->Repaint();
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+        if ( window ) {
+          SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+          if ( view )
+            view->Repaint();
+        }
       }
     }
   };
@@ -642,16 +662,16 @@ void SALOMEGUI_Swig::FitAll()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
-           ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
-         else if ( dynamic_cast<SOCC_ViewWindow*>( window ) )
-           ( dynamic_cast<SOCC_ViewWindow*>( window ) )->onFitAll();
-         else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
-           ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+        if ( window ) {
+          if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
+            ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
+          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+            ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )->onFitAll();
+          else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+            ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
+        }
       }
     }
   };
@@ -669,18 +689,18 @@ void SALOMEGUI_Swig::ResetView()
     TEvent() {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
-           (dynamic_cast<SVTK_ViewWindow*>( window ))->onResetView();
-         else if ( dynamic_cast<SOCC_ViewWindow*>( window ) )
-           (dynamic_cast<SOCC_ViewWindow*>( window ))->onResetView();
-         else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
-           (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
-         // VSR: there is no 'ResetView' functionality for Plot2d viewer,
-         // so we use 'FitAll' instead.
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+        if ( window ) {
+          if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
+            (dynamic_cast<SVTK_ViewWindow*>( window ))->onResetView();
+          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+            (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onResetView();
+          else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+            (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
+          // VSR: there is no 'ResetView' functionality for Plot2d viewer,
+          // so we use 'FitAll' instead.
+        }
       }
     }
   };
@@ -715,46 +735,46 @@ static void setView( int view )
     TEvent( int view ) : myView( view ) {}
     virtual void Execute()
     {
-      if ( SalomeApp_Application* anApp = getApplication() ) {
-       SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
-       if ( window ) {
-         if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
-           switch( myView ) {
-           case __ViewTop:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onTopView(); break;
-           case __ViewBottom:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onBottomView(); break;
-           case __ViewLeft:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onLeftView(); break;
-           case __ViewRight:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onRightView(); break;
-           case __ViewFront:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onFrontView(); break;
-           case __ViewBack:
-             (dynamic_cast<SVTK_ViewWindow*>( window ))->onBackView(); break;
-           default:
-             break;
-           }
-         }
-         else if ( dynamic_cast<SOCC_ViewWindow*>( window ) ) {
-           switch( myView ) {
-           case __ViewTop:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onTopView(); break;
-           case __ViewBottom:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onBottomView(); break;
-           case __ViewLeft:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onLeftView(); break;
-           case __ViewRight:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onRightView(); break;
-           case __ViewFront:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onFrontView(); break;
-           case __ViewBack:
-             (dynamic_cast<SOCC_ViewWindow*>( window ))->onBackView(); break;
-           default:
-             break;
-           }
-         }
-       }
+      if ( LightApp_Application* anApp = getApplication() ) {
+        SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+        if ( window ) {
+          if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
+            switch( myView ) {
+            case __ViewTop:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onTopView(); break;
+            case __ViewBottom:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onBottomView(); break;
+            case __ViewLeft:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onLeftView(); break;
+            case __ViewRight:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onRightView(); break;
+            case __ViewFront:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onFrontView(); break;
+            case __ViewBack:
+              (dynamic_cast<SVTK_ViewWindow*>( window ))->onBackView(); break;
+            default:
+              break;
+            }
+          }
+          else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) ) {
+            switch( myView ) {
+            case __ViewTop:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onTopView(); break;
+            case __ViewBottom:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBottomView(); break;
+            case __ViewLeft:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onLeftView(); break;
+            case __ViewRight:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onRightView(); break;
+            case __ViewFront:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onFrontView(); break;
+            case __ViewBack:
+              (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBackView(); break;
+            default:
+              break;
+            }
+          }
+        }
       }
     }
   };
index 02eced3736086e4a62a7b5ad3f9a3bfe3c44a32a..0ffa89cc6d01480d023a142a71cf195d7d90b2f2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 // File   : SALOMEGUI_Swig.hxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
index b53eca5137143c9d6cd0af37b0ff3bf4e01973a3..253403c03f567187d8c03bc93d6cb65a7f790d15 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOMEGUI_Swig.i
 //  Author : Paul RASCLE, EDF
index 02b161770d9024facbbd333c7c1741bdc318c512..eec52697af2f1f0beb78851d2165bc9dd8a9657b 100755 (executable)
@@ -1,29 +1,34 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 """
 
 """
 
-import SALOME_Session_idl
+try:
+   import SALOME_Session_idl
+except:
+   pass
 
 from import_hook import register_name
 register_name("SalomePyQt")
index 1fededccb5aa5969867957c3a1f1942fc5a593ec..05f3d20ccad95a3b528d3bf552ab51d044930287 100755 (executable)
@@ -1,33 +1,43 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : examplevtk1.py
 #  Module : SALOME
 #
+
+import os
 import libSalomePy
-ren=libSalomePy.renderer
-#iren=libSalomePy.interactor
+from vtk import *
+
+try:
+    from libvtkRenderingPython import *
+except:
+    from vtkRenderingPython import *
 
-from libVTKCommonPython import *
-from libVTKGraphicsPython import *
+# get the "vtkRenderer": an OpenGL rendering context
+ren = libSalomePy.getRenderer()
+
+# create an actor and give it cone geometry
 cone = vtkConeSource()
 cone.SetResolution(8)
 coneMapper = vtkPolyDataMapper()
@@ -35,6 +45,9 @@ coneMapper.SetInput(cone.GetOutput())
 coneActor = vtkActor()
 coneActor.SetMapper(coneMapper)
 
+# assign our actor to the renderer
 ren.AddActor(coneActor)
-iren = vtkRenderWindowInteractor()
 
+libSalomePy.fitAll()
+
+iren = libSalomePy.getRenderWindowInteractor()
index 14e318090d21d17095b5a3b29f568fc0623059f9..73d2bc0c468004524bb08df174f0a9410a56e979 100755 (executable)
@@ -1,31 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : libSALOME_Swig.i
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-//
+
 %module libSALOME_Swig
 
-//%include "SALOME_NamingService.i"
 %include "SALOMEGUI_Swig.i"
 
diff --git a/src/SALOME_SWIG/salome.py b/src/SALOME_SWIG/salome.py
deleted file mode 100755 (executable)
index 06a4c5b..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File   : salome.py
-#  Author : Paul RASCLE, EDF
-#  Module : SALOME
-#  $Header$
-#
-from omniORB import CORBA
-from LifeCycleCORBA import *
-from libSALOME_Swig import *
-import SALOMEDS
-from SALOME_NamingServicePy import *
-
-from SALOME_utilities import *
-
-#--------------------------------------------------------------------------
-
-def DumpComponent(Study, SO, offset):
-    it = Study.NewChildIterator(SO)
-    Builder = Study.NewBuilder()
-    while it.More():
-        CSO = it.Value()
-        it.Next()
-        anAttr = Builder.FindOrCreateAttribute(CSO, "AttributeName")
-        AtName = anAttr._narrow(SALOMEDS.AttributeName)
-        t_name = AtName.Value()
-        if t_name[0] == 1:
-            ofs = 1
-            a = ""
-            while ofs <= offset:
-                a = a + "--"
-                ofs = ofs +1
-            MESSAGE( a + ">" + str(CSO.GetID()) + " " + str(t_name[1]) )
-        t_RefSO = CSO.ReferencedObject()
-        if t_RefSO[0] == 1:
-            RefSO = t_RefSO[1]
-            ofs = 1
-            a = ""
-            while ofs <= offset:
-                a = a + "  "
-                ofs = ofs +1
-            MESSAGE( a + ">" + str(RefSO.GetID()) )
-        DumpComponent(Study, CSO, offset+2)
-
-    #--------------------------------------------------------------------------
-
-def DumpStudy(Study):
-    itcomp = Study.NewComponentIterator()
-    while itcomp.More():
-        SC = itcomp.Value()
-        itcomp.Next()
-        name = SC.ComponentDataType()
-        MESSAGE( "-> ComponentDataType is " + name )
-        DumpComponent(Study, SC, 1)
-        
-
-    #--------------------------------------------------------------------------
-
-def ImportComponentGUI(ComponentName):
-    libName = "lib" + ComponentName + "_Swig"
-    command = "from " + libName + " import *"
-    exec ( command )
-    constructor = ComponentName + "_Swig()"
-    command = "gui = " + constructor
-    exec ( command )
-    return gui
-
-    #--------------------------------------------------------------------------
-
-def SalomeGUIgetAllSelected(self):
-    selNumber = self.SelectedCount()
-    listSelected = []
-    for i in range(selNumber):
-        listSelected.append(self.getSelected(i))
-    return listSelected
-
-class SalomeGUI(SALOMEGUI_Swig):
-    getAllSelected = SalomeGUIgetAllSelected
-    
-    #--------------------------------------------------------------------------
-
-def IDToObject(id):
-    myObj = None
-    mySO = myStudy.FindObjectID(id);
-    if mySO is not None:
-        ok, anAttr = mySO.FindAttribute("AttributeIOR")
-        if ok:
-            AtIOR = anAttr._narrow(SALOMEDS.AttributeIOR)
-            if AtIOR.Value() != "":
-                myObj = orb.string_to_object(AtIOR.Value())
-    return myObj
-
-def ObjectToSObject(obj):
-    mySO = None
-    if obj is not None:
-        ior =  orb.object_to_string(obj)
-        if ior != "":
-            mySO = myStudy.FindObjectIOR(ior)
-    return mySO
-
-def ObjectToID(obj):
-    mySO = ObjectToSObject(obj)
-    if mySO:
-        return mySO.GetID()
-    return ""
-
-def IDToSObject(id):
-    mySO = myStudy.FindObjectID(id);
-    return mySO
-
-    #--------------------------------------------------------------------------
-
-# initialise the ORB
-orb = CORBA.ORB_init([''], CORBA.ORB_ID)
-
-# create an LifeCycleCORBA instance
-lcc = LifeCycleCORBA(orb)
-
-# create an SALOMEGUI_Swig instance
-sg = SalomeGUI()
-
-#create an naming service instance
-naming_service = SALOME_NamingServicePy_i(orb)
-
-# get active study name and id
-myStudyName = sg.getActiveStudyName()
-MESSAGE( myStudyName )
-
-myStudyId = sg.getActiveStudyId()
-MESSAGE( str(myStudyId) )
-
-# get Study Manager reference
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-
-# get active study
-myStudy = myStudyManager.GetStudyByName(myStudyName)
-
index 36a97cc412d2227f365d8dc20ee11b2f5241947f..9d42477bd8e24f070e5b15af78e31376f1d606de 100755 (executable)
@@ -1,31 +1,32 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #==============================================================================
 #  File      : supervisionexample.py
 #  Created   : 23 nov 2001
 #  Author    : Jean Rahuel
 #  Project   : SALOME
 #==============================================================================
-
+#
 from SuperV import *
 
 
index 09a2bf40dc43774119f34ddaf42ccf1fbe665158..d4281512e5130326650f2a87d00c4b219bf02cea 100755 (executable)
@@ -1,27 +1,27 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 # Generated python file of Graph GraphGeom2Essai
-
+#
 from SuperV import *
 
 import salome
index 4ac3761fd0fcc4b20231feece907099f3398c171..84b90a91f2670eb5e0b18b826ae7e6be384f9ef1 100755 (executable)
@@ -1,24 +1,26 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # File   : test_big_table.py
 # Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
index 2f4f5b5212a155665b1993e5695b8039fd8a4955..cce87473bc1800bfeacf1df2ac0231d56b7fe833 100755 (executable)
@@ -1,24 +1,26 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # File   : visu_many_objects.py
 # Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
index 1a5720f10e06cf44d6a570c6cc7cd9c3444ae8f6..5a27eaaf04c5d57dc9c7052e36754a8322123d50 100755 (executable)
@@ -1,24 +1,26 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : test_remove_ref.py
 #  Module : SALOMEDS     
 #
index e3cd71d65270bbecd5284e926ad9118c228d6c0b..f725e42129bdf42fb5900534938066e31cdec618 100755 (executable)
@@ -1,24 +1,26 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # File   : test_table.py
 # Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 #
index 077604f77c15e220886b37af6951e362d2cd947d..6de12512ad475e89be95f0b619a4401d20288ab8 100755 (executable)
@@ -1,28 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Alexander Solovyov(OCN)
 #  Module : SOCC
-# $Header: /dn06/SALOME_CVS/GUI_SRC/src/SOCC/Makefile.in,v 1.1
+# $Header$
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -49,5 +50,6 @@ libSOCC_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS)                        \
                      -I$(srcdir)/../OCCViewer -I$(srcdir)/../Qtx
 
 libSOCC_la_LDFLAGS  = $(QT_MT_LIBS)
+
 libSOCC_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
                      ../Prs/libSalomePrs.la ../OCCViewer/libOCCViewer.la
index 9e7794c80b76ae080c280506d4f3848ef6eb9e75..69351b10b259c6509f8dc76392adc82dd1566cb6 100755 (executable)
@@ -1,26 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifdef WIN32
-#ifdef SOCC_EXPORTS
+#if defined SOCC_EXPORTS
 #define SOCC_EXPORT __declspec(dllexport)
 #else
 #define SOCC_EXPORT __declspec(dllimport)
diff --git a/src/SOCC/SOCC.pro b/src/SOCC/SOCC.pro
deleted file mode 100644 (file)
index 1caf6c2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SOCC
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../OCCViewer
-LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lOCCViewer
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += SOCC_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = SOCC.h
-HEADERS += SOCC_ViewModel.h
-HEADERS += SOCC_Prs.h
-HEADERS += SOCC_ViewWindow.h
-
-SOURCES  = SOCC_ViewModel.cxx
-SOURCES += SOCC_Prs.cxx
-SOURCES += SOCC_ViewWindow.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 1f4c379d5d006aa3069e402c89de4f2bc7ea427e..70e4b0657d65a8388f938720373a54cd4adecf95 100644 (file)
@@ -1,36 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OCCViewer : build OCC Viewer into Salome desktop
 //  File   : SOCC_Prs.cxx
 //  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SOCC_Prs.h"
 
 #include <AIS_InteractiveObject.hxx>
 
-using namespace std;
-
 /*!
   Default constructor
 */
@@ -71,6 +68,22 @@ void SOCC_Prs::AddObject( const Handle(AIS_InteractiveObject)& obj )
   myObjects.Append( obj ); 
 }
 
+/*!
+  Prepend interactive object
+*/
+void SOCC_Prs::PrependObject( const Handle(AIS_InteractiveObject)& obj ) 
+{ 
+  myObjects.Prepend( obj ); 
+}
+
+/*!
+  Remove first interactive object
+*/
+void SOCC_Prs::RemoveFirst()
+{
+  myObjects.RemoveFirst();
+}
+
 /*!
   Remove all interactive objects
 */
index 007a68f90ac7806063e62fc26b76f057f9a9ad0c..eedcf619f535c43afead461bf0af303cb0e04bf1 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OCCViewer : build OCC Viewer into Salome desktop
 //  File   : SOCC_Prs.h
 //  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SOCC_Prs_H
 #define SOCC_Prs_H
 
@@ -50,7 +49,11 @@ public:
   // Get interactive objects list
   void AddObject( const Handle(AIS_InteractiveObject)& obj );
   // Add interactive object
+  void PrependObject( const Handle(AIS_InteractiveObject)& obj );
+  // Prepend interactive object
 
+  void RemoveFirst();
+  // Remove first interactive object
   void Clear();
   // Remove all interactive objects
 
index 49d9e53d2ea2d60baedfc597add1f5e9d6efc133..2d586ee0276ba80920dfe3f8f5c4e1ebc5b10c52 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SOCC_ViewModel.h"
 
 #include "SOCC_Prs.h"
@@ -44,6 +45,7 @@
 #include <SALOME_AISShape.hxx>
 #include <SALOME_AISObject.hxx>
 #include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
 
 // Temporarily commented to avoid awful dependecy on SALOMEDS
 // TODO: better mechanism of storing display/erse status in a study
 
 //#include "SALOMEDSClient.hxx"
 //#include "SALOMEDS_StudyManager.hxx"
+#include <Basics_OCCTVersion.hxx>
 
 #include <AIS_TypeOfIso.hxx>
+#include <Precision.hxx>
 
 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
@@ -123,7 +127,7 @@ bool SOCC_Viewer::highlight( const Handle(SALOME_InteractiveObject)& obj,
     {
       if ( !isInLocal )
           OCCViewer_Viewer::highlight( ite.Value(), hilight, false );
-      // highlight subshapes only when local selection is active
+      // highlight sub-shapes only when local selection is active
       else
       {
         /*if ( ite.Value()->IsKind( STANDARD_TYPE( SALOME_AISShape ) ) )
@@ -179,17 +183,19 @@ bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj,
 */
 bool SOCC_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& obj )
 {
-  AIS_ListOfInteractive List;
-  getAISContext()->DisplayedObjects( List );
-
-  AIS_ListIteratorOfListOfInteractive ite( List );
-  for ( ; ite.More(); ite.Next() )
-  {
-    Handle(SALOME_InteractiveObject) anObj =
-      Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
 
-    if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
-      return getAISContext()->IsDisplayed( ite.Value() );
+  std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> >::iterator it=entry2aisobjects.find(obj->getEntry());
+  if(it != entry2aisobjects.end())
+    {
+      // get context
+      Handle (AIS_InteractiveContext) ic = getAISContext();
+      std::vector<Handle(AIS_InteractiveObject)>& List = it->second;
+      for( unsigned int ind = 0; ind < List.size(); ind++ )
+        {
+          Handle(AIS_InteractiveObject) anAIS=List[ind];
+          if(ic->IsDisplayed(anAIS))
+            return true;
+        }
   }
   
   return false;
@@ -204,21 +210,21 @@ bool SOCC_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& obj )
 void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj,
                             const QColor& color, bool update )
 {
-  AIS_ListOfInteractive List;
-  getAISContext()->DisplayedObjects(List);
-  
-  AIS_ListIteratorOfListOfInteractive ite(List);
-  for ( ; ite.More(); ite.Next() )
-  {
-    Handle(SALOME_InteractiveObject) anObj =
-        Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+  if(obj.IsNull() || !obj->hasEntry() )
+    return;
 
-    if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+  if(entry2aisobjects.count(obj->getEntry())>0)
     {
-      OCCViewer_Viewer::setColor( ite.Value(), color, update );
-      return;
+      // get context
+      Handle (AIS_InteractiveContext) ic = getAISContext();
+      std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+      for( unsigned int ind = 0; ind < List.size(); ind++ )
+        {
+          Handle(AIS_InteractiveObject) anAIS=List[ind];
+          if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+            OCCViewer_Viewer::setColor( anAIS, color, update );
+        }
     }
-  }
 }
 
 /*!
@@ -230,21 +236,21 @@ void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj,
 void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)& obj,
                                         int mode, bool update )
 {
-  AIS_ListOfInteractive List;
-  getAISContext()->DisplayedObjects(List);
-  
-  AIS_ListIteratorOfListOfInteractive ite(List);
-  for ( ; ite.More(); ite.Next() )
-  {
-    Handle(SALOME_InteractiveObject) anObj =
-        Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+  if(obj.IsNull() || !obj->hasEntry() )
+    return;
 
-    if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+  if(entry2aisobjects.count(obj->getEntry())>0)
     {
-      OCCViewer_Viewer::switchRepresentation( ite.Value(), mode, update );
-      return;
+      // get context
+      Handle (AIS_InteractiveContext) ic = getAISContext();
+      std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+      for( unsigned int ind = 0; ind < List.size(); ind++ )
+        {
+          Handle(AIS_InteractiveObject) anAIS=List[ind];
+          if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+            OCCViewer_Viewer::switchRepresentation( anAIS, mode, update );
+        }
     }
-  }
 }
 
 /*!
@@ -256,21 +262,21 @@ void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)&
 void SOCC_Viewer::setTransparency( const Handle(SALOME_InteractiveObject)& obj,
                                    float trans, bool update )
 {
-  AIS_ListOfInteractive List;
-  getAISContext()->DisplayedObjects( List );
-  
-  AIS_ListIteratorOfListOfInteractive ite( List );
-  for ( ; ite.More(); ite.Next() )
-  {
-    Handle(SALOME_InteractiveObject) anObj =
-        Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+  if(obj.IsNull() || !obj->hasEntry() )
+    return;
 
-    if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+  if(entry2aisobjects.count(obj->getEntry())>0)
     {
-      OCCViewer_Viewer::setTransparency( ite.Value(), trans, update );
-      return;
+      // get context
+      Handle (AIS_InteractiveContext) ic = getAISContext();
+      std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+      for( unsigned int ind = 0; ind < List.size(); ind++ )
+        {
+          Handle(AIS_InteractiveObject) anAIS=List[ind];
+          if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+            OCCViewer_Viewer::setTransparency( anAIS, trans, update );
+        }
     }
-  }
 }
 
 /*!
@@ -332,13 +338,6 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
   // get context
   Handle (AIS_InteractiveContext) ic = getAISContext();
 
-  // get all displayed objects
-  AIS_ListOfInteractive List;
-  ic->DisplayedObjects( List );
-  // get objects in the collector
-  AIS_ListOfInteractive ListCollector;
-  ic->ObjectsInCollector( ListCollector );
-
   // get objects to be displayed
   AIS_ListOfInteractive anAISObjects;
   anOCCPrs->GetObjects( anAISObjects );
@@ -350,68 +349,78 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
     if ( !anAIS.IsNull() )
     {
       // try to find presentation in the viewer
-      bool bDisplayed = false;
-      AIS_ListIteratorOfListOfInteractive ite( List );
-      for ( ; ite.More(); ite.Next() )
-      {
-        // compare presentations by handles
-        // if the object is already displayed - nothing to do more
-        if ( ite.Value() == anAIS )
+
+      // if the object is already displayed - nothing to do more
+      if(ic->IsDisplayed(anAIS))
         {
           // Deactivate object if necessary
           if ( !anOCCPrs->ToActivate() )
             ic->Deactivate( anAIS );
-          bDisplayed = true;
-          break;
+          continue;
         }
-      }
-
-      if ( bDisplayed )
-        continue;
 
       // then try to find presentation in the collector
-      bDisplayed = false;
-      ite.Initialize( ListCollector );
-      for ( ; ite.More(); ite.Next() )
-      {
-        // compare presentations by handles
-        // if the object is in collector - display it
-        if ( ite.Value() == anAIS )
+      if(ic->IsInCollector(anAIS))
         {
           ic->DisplayFromCollector( anAIS, false );
-
           // Deactivate object if necessary
           if ( !anOCCPrs->ToActivate() )
             ic->Deactivate( anAIS );
-          bDisplayed = true;
 
           // Set visibility flag
-         // Temporarily commented to avoid awful dependecy on SALOMEDS
-         // TODO: better mechanism of storing display/erse status in a study
-         // should be provided...
-         //Handle(SALOME_InteractiveObject) anObj =
+          // Temporarily commented to avoid awful dependecy on SALOMEDS
+          // TODO: better mechanism of storing display/erse status in a study
+          // should be provided...
+          //Handle(SALOME_InteractiveObject) anObj =
           //  Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
           //if ( !anObj.IsNull() && anObj->hasEntry() )
           //{
-         //  if ( study )
-         //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-         //}
-          break;
+          //  if ( study )
+          //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+          //}
+          continue;
         }
-      }
-      if ( bDisplayed )
-        continue;
 
       // if object is not displayed and not found in the collector - display it
       if ( anAIS->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
       {
         Handle(AIS_Trihedron) aTrh = Handle(AIS_Trihedron)::DownCast( anAIS );
         double aNewSize = 100, aSize = 100;
-        getTrihedronSize( aNewSize, aSize );
+        computeTrihedronSize( aNewSize, aSize );
         aTrh->SetSize( aTrh == getTrihedron() ? aNewSize : 0.5 * aNewSize );
       }
 
       ic->Display( anAIS, false );
+      
+#if OCC_VERSION_LARGE > 0x06050200 
+      Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast(anAIS);
+      if ( !aSh.IsNull() ) {
+          bool top = (aSh->isTopLevel() && aSh->switchTopLevel());
+             ic->SetZLayer( aSh, top ? getTopLayerId() : 0 );
+                 if(!aSh->toActivate()) {
+                       ic->Deactivate( aSh );
+                 }
+      }
+#endif
+      //Register anAIS (if it has an entry) in entry2aisobjects map
+      Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
+      if ( !anObj.IsNull() && anObj->hasEntry())
+        {
+          std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[anObj->getEntry()];
+          int found=0;
+          for ( unsigned int ind = 0; ind < List.size(); ind++ )
+          {
+            if(List[ind] == anAIS)
+              {
+                found=1;
+                break;
+              }
+          }
+          if(!found)
+            {
+              List.push_back(anAIS);
+            }
+        }
 
       // Set visibility flag
       // Temporarily commented to avoid awful dependecy on SALOMEDS
@@ -430,6 +439,7 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
         ic->Deactivate( anAIS );
     }
   }
+  updateTrihedron();
 }
 
 
@@ -481,6 +491,7 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
       //}
     }
   }
+  updateTrihedron();
 }
 
 
@@ -507,8 +518,8 @@ void SOCC_Viewer::EraseAll( const bool forced )
   ic->DisplayedObjects( aList );
   AIS_ListIteratorOfListOfInteractive anIter( aList );
   for ( ; anIter.More(); anIter.Next() ) {
-    if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) ||
-        anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron ))
+    if ( (isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron )) ||
+         anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron ))
       continue;
 
     // erase an object
@@ -521,16 +532,17 @@ void SOCC_Viewer::EraseAll( const bool forced )
     // should be provided...
     //if ( !forced ) {
     //  Handle(SALOME_InteractiveObject) anObj =
-    // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
+    //  Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
 
     //  if ( !anObj.IsNull() && anObj->hasEntry() ) {
-    // if ( study )
-    //   ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+    //  if ( study )
+    //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
     //  }
     //}
   }
-  
+
   Repaint();
+  updateTrihedron();
 }
 
 /*!
@@ -542,32 +554,28 @@ SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry )
   SOCC_Prs* prs = new SOCC_Prs();
   if ( entry )
   {
-    // get context
-    Handle(AIS_InteractiveContext) ic = getAISContext();
-
-    // get displayed objects
-    AIS_ListOfInteractive List;
-    ic->DisplayedObjects( List );
-    // get objects in the collector
-    AIS_ListOfInteractive ListCollector;
-    ic->ObjectsInCollector( ListCollector );
-    List.Append( ListCollector );
-
-    AIS_ListIteratorOfListOfInteractive ite( List );
-    for ( ; ite.More(); ite.Next() )
-    {
-      Handle(SALOME_InteractiveObject) anObj =
-        Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
-
-      if ( !anObj.IsNull() && anObj->hasEntry() && strcmp( anObj->getEntry(), entry ) == 0 )
-        prs->AddObject( ite.Value() );
-    }
+    if(entry2aisobjects.count(entry)>0)
+      {
+        //ais object exists
+        std::vector<Handle(AIS_InteractiveObject)> List = entry2aisobjects[entry];
+        // get context
+        Handle(AIS_InteractiveContext) ic = getAISContext();
+        //add all ais
+        for ( unsigned int ind = 0; ind < List.size(); ind++ )
+          {
+            Handle(AIS_InteractiveObject) anAIS=List[ind];
+            if(ic->IsDisplayed(anAIS)||ic->IsInCollector(anAIS))
+              {
+                prs->AddObject( anAIS );
+              }
+          }
+      }
   }
   return prs;
 }
 
 /*!
-  Activates selection of sub shapes
+  Activates selection of sub-shapes
 */
 void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode )
 {
@@ -612,7 +620,7 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode
 }
 
 /*!
-  Deactivates selection of sub shapes
+  Deactivates selection of sub-shapes
 */
 void SOCC_Viewer::GlobalSelection( const bool update ) const
 {
@@ -625,65 +633,27 @@ void SOCC_Viewer::GlobalSelection( const bool update ) const
   }
 }
 
-/*!
-  Auxiliary method called before displaying of objects
-*/
-void  SOCC_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
-  d->BeforeDisplay( this, SALOME_OCCViewType() );
-}
-
-/*!
-  Auxiliary method called after displaying of objects
-*/
-void SOCC_Viewer::AfterDisplay( SALOME_Displayer* d )
-{
-  d->AfterDisplay( this, SALOME_OCCViewType() );
-}
 
 /*!
-  Get new and current trihedron size corresponding to the current model size
+  \Collect objects visible in viewer
+  \param theList - visible objects collection
 */
-bool SOCC_Viewer::getTrihedronSize( double& theNewSize, double& theSize )
+void SOCC_Viewer::GetVisible( SALOME_ListIO& theList )
 {
-  theNewSize = 100;
-  theSize = 100;
-
-  //SRN: BUG IPAL8996, a usage of method ActiveView without an initialization
-  Handle(V3d_Viewer) viewer = getViewer3d();
-  viewer->InitActiveViews();
-  if(!viewer->MoreActiveViews()) return false;
-
-  Handle(V3d_View) view3d = viewer->ActiveView();
-  //SRN: END of fix
-
-  if ( view3d.IsNull() )
-    return false;
-
-  double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
-  double aMaxSide;
-
-  view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
-
-  if ( Xmin == RealFirst() || Ymin == RealFirst() || Zmin == RealFirst() ||
-       Xmax == RealLast()  || Ymax == RealLast()  || Zmax == RealLast() )
-    return false;
-
-  aMaxSide = Xmax - Xmin;
-  if ( aMaxSide < Ymax -Ymin ) aMaxSide = Ymax -Ymin;
-  if ( aMaxSide < Zmax -Zmin ) aMaxSide = Zmax -Zmin;
-
-  float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("Viewer","TrihedronSize", 105.);
-
-  static float EPS = 5.0E-3;
-  theSize = getTrihedron()->Size();
-  theNewSize = aMaxSide*aSizeInPercents / 100.0;
+  AIS_ListOfInteractive List;
+  getAISContext()->DisplayedObjects(List);
+  
+  AIS_ListIteratorOfListOfInteractive ite(List);
+  for ( ; ite.More(); ite.Next() )
+  {
+    Handle(SALOME_InteractiveObject) anObj =
+        Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
 
-  return fabs( theNewSize - theSize ) > theSize * EPS ||
-         fabs( theNewSize - theSize) > theNewSize * EPS;
+    if ( !anObj.IsNull() && anObj->hasEntry() )
+      theList.Append( anObj );
+  }
 }
 
-
 /*!
   Updates current viewer
 */
@@ -697,9 +667,18 @@ void SOCC_Viewer::Repaint()
 /*!
   create SOCC_ViewWindow
 */
-SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
+/*SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
 {
   SOCC_ViewWindow* view = new SOCC_ViewWindow(theDesktop, this);
-  initView( view );
+  //initView( view );
+  initView( view->getView(OCCViewer_ViewFrame::MAIN_VIEW) );
   return view;
+  }*/
+
+/* 
+ * Returns a new OCCViewer_ViewWindow instance which will be placed as a sub window in ViewFrame
+ */
+OCCViewer_ViewWindow* SOCC_Viewer::createSubWindow()
+{
+  return new SOCC_ViewWindow( 0,  this);
 }
index 9eb1a0398b977bc21e9c65851038fa5b4b11f29b..2e25c255a53fae70ea6598a4713f190787417421 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SOCC_VIEWMODEL_H
 #define SOCC_VIEWMODEL_H
 
@@ -30,6 +31,7 @@
 #include "SALOME_Prs.h"
 #include "OCCViewer_ViewModel.h"
 
+class SALOME_ListIO;
 class Handle(SALOME_InteractiveObject);
 
 class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
@@ -41,7 +43,7 @@ public:
   virtual ~SOCC_Viewer();
 
   /* Selection management */
-  bool     highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
+  bool      highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
   bool      isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
 
   void      setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true );
@@ -50,23 +52,23 @@ public:
 
   void      rename( const Handle(SALOME_InteractiveObject)&, const QString& );
 
-  virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+  //virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+  virtual OCCViewer_ViewWindow* createSubWindow();
 
   /* Reimplemented from SALOME_View */
   virtual void                Display( const SALOME_OCCPrs* );
   virtual void                Erase( const SALOME_OCCPrs*, const bool = false );
   virtual void                EraseAll( const bool = false );
   virtual SALOME_Prs*         CreatePrs( const char* entry = 0 );
-  virtual void                BeforeDisplay( SALOME_Displayer* d );
-  virtual void                AfterDisplay ( SALOME_Displayer* d );
+
   virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
   virtual void                GlobalSelection( const bool = false ) const;
   virtual bool                isVisible( const Handle(SALOME_InteractiveObject)& );
+  virtual void                GetVisible( SALOME_ListIO& );
   virtual void                Repaint();
 
-  // a utility function, used by SALOME_View_s methods
-  bool                        getTrihedronSize( double& theNewSize, double& theSize );
-
+  //a map to store AIS objects associated to a SALOME entry
+  std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> > entry2aisobjects;
 };
 
 #ifdef WIN32
index 4fdb39108531ae9aa26313d2d29dca17041c7353..d1ef02dbc77b4968b34a0f9b98a1931bf9ecd762 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SOCC_ViewWindow.h"
 
 #include "OCCViewer_ViewPort3d.h"
@@ -30,7 +31,7 @@
 */
 SOCC_ViewWindow
 ::SOCC_ViewWindow( SUIT_Desktop* theDesktop, 
-                  OCCViewer_Viewer* theModel)
+                   OCCViewer_Viewer* theModel)
   : OCCViewer_ViewWindow( theDesktop, theModel )
 {
 }
index 656f2d3a5f6719eccfd588295634a5d8a0e25b2c..e13b76e267a49729c54a9f3887553d97c4d84520 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SOCC_VIEWWINDOW_H
 #define SOCC_VIEWWINDOW_H
 
@@ -27,7 +28,7 @@
 #endif
 
 #include "SOCC.h"
-#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewFrame.h"
 
 class SOCC_EXPORT SOCC_ViewWindow : public OCCViewer_ViewWindow
 {
index 1f4b4033a9660d2913a98c3a82360c4196fe796c..3fb07f871786c56193b38ef0fff7afaff6c6e1b2 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSPlot2d.la
@@ -26,12 +27,14 @@ lib_LTLIBRARIES = libSPlot2d.la
 salomeinclude_HEADERS =                \
        SPlot2d.h               \
        SPlot2d_Curve.h         \
+       SPlot2d_Histogram.h     \
        SPlot2d_Prs.h           \
        SPlot2d_ViewModel.h     \
        SPlot2d_ViewWindow.h
 
 dist_libSPlot2d_la_SOURCES =   \
        SPlot2d_Curve.cxx       \
+       SPlot2d_Histogram.cxx   \
        SPlot2d_Prs.cxx         \
        SPlot2d_ViewModel.cxx   \
        SPlot2d_ViewWindow.cxx
@@ -44,7 +47,10 @@ nodist_libSPlot2d_la_SOURCES = $(MOC_FILES)
 libSPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)      \
                         -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Plot2d           \
                         -I$(srcdir)/../Prs -I$(srcdir)/../OBJECT
-libSPlot2d_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+libSPlot2d_la_LDFLAGS  = ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+
+### VSR: 24/11/2009: remove these libs to avoid double linking to the native libraries
+###$(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) 
 
 
 
index 320c0e5716701811da499e90f8aaa3e4a9e916e5..2590e0553aae9182a871da919c49cf39ff46876b 100644 (file)
@@ -1,26 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifdef WIN32
-#ifdef SPLOT2D_EXPORTS
+#if defined SPLOT2D_EXPORTS || defined SPlot2d_EXPORTS
 #define SPLOT2D_EXPORT __declspec(dllexport)
 #else
 #define SPLOT2D_EXPORT __declspec(dllimport)
diff --git a/src/SPlot2d/SPlot2d.pro b/src/SPlot2d/SPlot2d.pro
deleted file mode 100644 (file)
index faf945c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SPlot2d
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-QWTHOME=$$(QWTHOME)
-QWTINC=$${QWTHOME}/include
-QWTLIB=$${QWTHOME}/lib
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../../include $${QWTINC} $${BOOST_CPPFLAGS}
-INCLUDEPATH += ../Qtx ../SUIT ../Plot2d ../Prs ../OBJECT
-unix:LIBS  += -L$${QWTLIB} -lqwt
-win32:LIBS += /LIBPATH:$$(QWTLIB)
-LIBS += -L../../lib -lsuit -lPlot2d -lSalomePrs
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SPLOT2D_EXPORTS
-
-HEADERS  = SPlot2d.h
-HEADERS  = SPlot2d_Curve.h
-HEADERS  = SPlot2d_Prs.h
-HEADERS  = SPlot2d_ViewModel.h
-HEADERS  = SPlot2d_ViewWindow.h
-
-SOURCES   = SPlot2d_Curve.cxx
-SOURCES  += SPlot2d_Curve.cxx
-SOURCES  += SPlot2d_Prs.cxx
-SOURCES  += SPlot2d_ViewModel.cxx
-SOURCES  += SPlot2d_ViewWindow.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
index 95c17a520e0c282df790f3468f8788900a336ec9..a769bce7e155dc25c2bd018516dc5ed9a9f8addd 100644 (file)
@@ -1,33 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Curve.cxx
-//  Author : Sergey RUIN
-//  Module : SUIT
-//
-#include "SPlot2d_Curve.h"
-#include <QString>
-#include <QColor>
+//  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
 
-using namespace std;
+#include "SPlot2d_Curve.h"
 
 /*!
   Constructor
@@ -48,19 +43,10 @@ SPlot2d_Curve::~SPlot2d_Curve()
   Copy constructor. Makes deep copy of data.
 */
 SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
+: Plot2d_Curve( curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
-  myColor      = curve.getColor();
-  myMarker     = curve.getMarker();
-  myLine       = curve.getLine();
-  myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
-  myIO         = curve.getIO();
-  myTableIO    = curve.getTableIO();
+  myIO      = curve.getIO();
+  myTableIO = curve.getTableIO();
 }
 
 /*!
@@ -68,16 +54,7 @@ SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
 */
 SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
 {
-  myAutoAssign = curve.isAutoAssign();
-  myHorTitle   = curve.getHorTitle();
-  myVerTitle   = curve.getVerTitle();
-  myHorUnits   = curve.getHorUnits();
-  myVerUnits   = curve.getVerUnits();
-  myColor      = curve.getColor();
-  myMarker     = curve.getMarker();
-  myLine       = curve.getLine();
-  myLineWidth  = curve.getLineWidth();
-  myPoints     = curve.getPointList();
+  Plot2d_Curve::operator=(curve);
   myIO         = curve.getIO();
   myTableIO    = curve.getTableIO();
   return *this;
@@ -143,3 +120,37 @@ QString SPlot2d_Curve::getTableTitle() const
     title = getTableIO()->getName();
   return title;
 }
+
+/*!
+  Add owner of the curve.
+  \param owner  - owner of the curve
+*/
+void SPlot2d_Curve::addOwner(const QString& owner) {
+  myOwners.insert(owner);
+}
+
+/*!
+  Remove owner of the curve.
+  \param owner  - owner of the curve
+*/
+void SPlot2d_Curve::removeOwner(const QString& owner) {
+  myOwners.insert(owner);
+}
+
+/*!
+  Get all owners of the curve.
+  \return owners of the curve.
+*/
+OwnerSet SPlot2d_Curve::getOwners() const {
+  return myOwners;
+}
+
+
+/*!
+  Add owners of the curve.
+  \param owners  - owners of the curve
+*/
+void SPlot2d_Curve::addOwners(OwnerSet& owners) {
+  myOwners = myOwners|=owners;
+}
+
index 444fddda71b2dbfb3685e3e79538ab07a02da1cb..d691b937cf0417e96621508533d4b0622c3685e4 100644 (file)
@@ -1,42 +1,42 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Curve.h
-//  Author : Sergey RUIN
-//  Module : SUIT
-//
+//  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
 #ifndef SPlot2d_Curve_h
 #define SPlot2d_Curve_h
 
 #include "SPlot2d.h"  
-
 #include "Plot2d_Curve.h"
 
+
+#include <QSet>
+
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
 #include <Handle_SALOME_InteractiveObject.hxx>
 #endif
 #include "SALOME_InteractiveObject.hxx"
 
-class QString;
-class QColor;
+typedef QSet<QString> OwnerSet;
 
 class SPLOT2D_EXPORT SPlot2d_Curve : public Plot2d_Curve
 {
@@ -57,11 +57,15 @@ public:
   virtual Handle(SALOME_InteractiveObject) getTableIO() const;
   virtual void                             setTableIO( const Handle(SALOME_InteractiveObject)& );
   
+  virtual void                             addOwner(const QString& owner);
+  virtual void                             removeOwner(const QString& owner);
+  virtual OwnerSet                         getOwners() const;
+  virtual void                             addOwners (OwnerSet& owners);
+  
 private:
   Handle(SALOME_InteractiveObject) myIO;
   Handle(SALOME_InteractiveObject) myTableIO;
+  OwnerSet                         myOwners;
 };
 
 #endif // SPlot2d_Curve_h
-
-
index e96b2cc2829968f85ae44524944dcfb366513376..8669e2c326e27a382ff2d777efb93b84adf14b2b 100644 (file)
@@ -1,32 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Prs.cxx
-//  Author : Sergey RUIN
-//  Module : SUIT
-//
+//  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
 #include "SPlot2d_Prs.h"
-#ifndef WIN32
-using namespace std;
-#endif
 
 /*!
  Default constructor
@@ -39,7 +35,7 @@ SPlot2d_Prs::SPlot2d_Prs()
 /*!
  Standard constructor
 */
-SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Curve* obj )
+SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Object* obj )
 :Plot2d_Prs(obj)
 { 
 }
@@ -50,7 +46,8 @@ SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Curve* obj )
 SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Prs* prs )
 {
   mySecondY = prs->isSecondY();
-  myCurves = prs->getCurves();
+  myObjects = prs->getObjects();
+  myIsAutoDel = false;          // VSR: error? should auto-delete flag be removed
 }
 
 /*!
@@ -61,3 +58,18 @@ SPlot2d_Prs::~SPlot2d_Prs()
 }
 
 
+/*!
+  Check if the presentation is empty
+*/
+bool SPlot2d_Prs::IsNull() const
+{
+  return Plot2d_Prs::IsNull();
+}
+
+/*!
+  Get contained objects
+*/
+objectList SPlot2d_Prs::GetObjects() const
+{
+  return getObjects();
+}
index 67b79b0980d4071744d1b173271e9715980c903f..de71d29922cb3798efafc73c8bedaa4538346b01 100644 (file)
@@ -1,28 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SPlot2d_Prs.h
-//  Author : Sergey RUIN
-//  Module : SUIT
-//
+//  Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
 #ifndef SPLOT2D_PRS_H
 #define SPLOT2D_PRS_H
 
@@ -35,24 +34,22 @@ class Plot2d_Curve;
 class SPLOT2D_EXPORT SPlot2d_Prs : public SALOME_Prs2d, public Plot2d_Prs
 {
 public:
-
   // Default constructor 
   SPlot2d_Prs();
 
   // Standard constructor    
-  SPlot2d_Prs( const Plot2d_Curve* obj );
+  SPlot2d_Prs( const Plot2d_Object* obj );
 
   SPlot2d_Prs( const Plot2d_Prs* prs );
 
   // Destructor
   ~SPlot2d_Prs();
 
-  virtual bool IsNull() const { return Plot2d_Prs::IsNull(); }
+  virtual bool IsNull() const;
 
   // Get curves list
-  // Note: Depricated method, use method getCurves     
-  curveList GetObjects() const { return getCurves(); }
-
+  // Note: Deprecated method, use method getCurves     
+  objectList GetObjects() const;
 };
 
 #endif
index 10afaed7ce3984292f4aa1cb956daa46e522d64b..0f8fe39fd1e425b271c8f35ff324907908e21ccd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SPlot2d_Viewer.cxx
 //  Author : Sergey RUIN
 //  Module : SUIT
 #include "SPlot2d_ViewWindow.h"
 
 #include "SPlot2d_Prs.h"
+#include "SPlot2d_Histogram.h"
 #include "SUIT_Session.h"
 #include "SUIT_Application.h"
 #include "SUIT_ViewManager.h"
 
 #include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
 
 #include <QApplication>
 #include <QToolBar>
@@ -45,8 +48,6 @@
 #include <qwt_plot_curve.h>
 #include <stdlib.h>
 
-using namespace std;
-
 //ASL: Temporary commented in order to avoir dependency on SALOMEDS
 
 //#include "SALOMEDSClient.hxx"
@@ -76,7 +77,8 @@ using namespace std;
   Constructor
 */
 SPlot2d_Viewer::SPlot2d_Viewer(  bool theAutoDel )
-: Plot2d_Viewer( theAutoDel )    
+: Plot2d_Viewer( theAutoDel ),
+  myDeselectAnalytical(true)
 {
 }
 
@@ -91,7 +93,7 @@ SPlot2d_Viewer::~SPlot2d_Viewer()
   Renames curve if it is found
 */
 void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject,
-                            const QString& newName, Plot2d_ViewFrame* fr ) 
+                             const QString& newName, Plot2d_ViewFrame* fr ) 
 {
   Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
   if( !aViewFrame )
@@ -150,8 +152,8 @@ bool SPlot2d_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& IObject
       CurveDict::Iterator it = aCurves.begin();
       for( ; it != aCurves.end(); ++it ) {
         SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
-       if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
-         return 1;
+        if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
+          return 1;
       }
     }
   }
@@ -216,10 +218,10 @@ void SPlot2d_Viewer::Erase( const Handle(SALOME_InteractiveObject)& IObject, boo
       _PTR(SObject) aChildSO = aIter->Value();
       _PTR(SObject) refSO;
       if ( aChildSO->ReferencedObject( refSO ) && refSO )
-       aChildSO = refSO;
+        aChildSO = refSO;
       curve = getCurveByIO( new SALOME_InteractiveObject( aChildSO->GetID().c_str(), "") );
       if ( curve )
-       aViewFrame->eraseCurve( curve, update );
+        aViewFrame->eraseCurve( curve, update );
     }
   }
 */
@@ -270,30 +272,26 @@ void SPlot2d_Viewer::Erase( const SALOME_Prs2d* prs, const bool )
 SALOME_Prs* SPlot2d_Viewer::CreatePrs( const char* entry )
 {
   Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+  SPlot2d_Prs *prs = new SPlot2d_Prs();
   if(aViewFrame)
   {
-    Plot2d_Prs* prs = aViewFrame->CreatePrs(entry);
-    if( prs )
-      return new SPlot2d_Prs( prs );
+    CurveDict aCurves = aViewFrame->getCurves();
+    CurveDict::Iterator it = aCurves.begin();
+    for( ; it != aCurves.end(); ++it ) {
+      SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.value());
+      OwnerSet owners = aCurve->getOwners();
+      if(aCurve) {
+       if ( 
+           (aCurve->hasIO() && !strcmp( aCurve->getIO()->getEntry(), entry )) ||
+           (aCurve->hasTableIO() && !strcmp( aCurve->getTableIO()->getEntry(), entry )) ||
+           owners.contains(entry)
+           ) {
+         prs->AddObject(aCurve);
+       }
+      }      
+    }
   }
-
-  return NULL;
-}
-
-/*!
-  Axiluary method called before displaying of objects
-*/
-void  SPlot2d_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
-  d->BeforeDisplay( this, SALOME_Plot2dViewType() );
-}
-
-/*!
-  Axiluary method called after displaying of objects
-*/
-void  SPlot2d_Viewer::AfterDisplay( SALOME_Displayer* d )
-{
-  d->AfterDisplay( this, SALOME_Plot2dViewType() );
+  return prs;
 }
 
 /*!
@@ -308,6 +306,23 @@ bool SPlot2d_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& IObject
   return aViewFrame->isVisible( curve );
 }
 
+/*!
+  \Collect objects visible in viewer
+  \param theList - visible objects collection
+*/
+void SPlot2d_Viewer::GetVisible( SALOME_ListIO& theList )
+{
+  Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+  if(aViewFrame == NULL) return;
+  CurveDict aCurves = aViewFrame->getCurves();
+  CurveDict::Iterator it = aCurves.begin();
+  for( ; it != aCurves.end(); ++it ) {
+    SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.value()); 
+    if ( aCurve && aCurve->hasIO() && aViewFrame->isVisible( aCurve ) )
+      theList.Append( aCurve->getIO() );
+  }
+}
+
 /*!
   Return interactive obeject if is presented in the viewer
 */
@@ -350,7 +365,7 @@ Plot2d_ViewFrame* SPlot2d_Viewer::getActiveViewFrame()
   \param fr - viewframe
 */
 SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject,
-                                            Plot2d_ViewFrame* fr )
+                                             Plot2d_ViewFrame* fr )
 {
   if ( !theIObject.IsNull() ) {
     Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
@@ -359,10 +374,10 @@ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObje
       CurveDict::Iterator it = aCurves.begin();
       for( ; it != aCurves.end(); ++it ) {
         SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
-       if(aCurve) {
-         if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
-           return aCurve;
-       }
+        if(aCurve) {
+          if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
+            return aCurve;
+        }
       }
     }
   }
@@ -375,6 +390,7 @@ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObje
 SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop )
 {
   SPlot2d_ViewWindow* aPlot2dView = new SPlot2d_ViewWindow(theDesktop, this);
+  aPlot2dView->initLayout();
   if (getPrs())
     aPlot2dView->getViewFrame()->Display(getPrs());
   return aPlot2dView;
@@ -389,19 +405,95 @@ void SPlot2d_Viewer::onLegendClicked( QwtPlotItem* plotItem )
   Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
   if(aViewFrame == NULL) return;
 
-  CurveDict aCurves = aViewFrame->getCurves();
-  SPlot2d_Curve* aSCurve;
-  CurveDict::Iterator it = aCurves.begin();
-  for( ; it != aCurves.end(); ++it )
-  {
-    if ( it.key() == plotItem ) {
-      aSCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
-      break;
-    }
+  bool isAnalytical = false;
+  AnalyticalCurveList curves = aViewFrame->getAnalyticalCurves();
+   foreach ( Plot2d_AnalyticalCurve* curve, curves ) {
+          if(plotItem == curve->plotItem()) {
+                 isAnalytical = true;
+                 curve->setSelected(true);
+          } else {
+                 curve->setSelected(false);
+          }
+   }
+  if(isAnalytical) {
+       myDeselectAnalytical = false;
+       emit clearSelected();
+       aViewFrame->updateAnalyticalCurves();
+       myDeselectAnalytical = true;
+       return;
   }
-  // Highlight curve in Object Browser
-  if(aSCurve && aSCurve->hasIO()) {
-    QString anEntry = aSCurve->getIO()->getEntry();
-    emit legendSelected( anEntry );
+
+  Plot2d_Object* anObject = aViewFrame->getPlotObject(plotItem);
+  
+  if(anObject) {
+    
+    // Highlight object in Object Browser
+    QString anEntry;
+    if(SPlot2d_Curve* aSCurve = dynamic_cast<SPlot2d_Curve*>(anObject)) {
+      if(aSCurve->hasIO())
+       anEntry = aSCurve->getIO()->getEntry();
+    } else if( SPlot2d_Histogram* aSHisto = dynamic_cast<SPlot2d_Histogram*>(anObject)) {
+      if(aSHisto->hasIO())
+       anEntry = aSHisto->getIO()->getEntry();
+    }
+    
+    if(!anEntry.isEmpty())
+      emit legendSelected( anEntry );
+  }    
+}
+
+/*!
+  
+*/
+void SPlot2d_Viewer::setObjectsSelected( SALOME_ListIO& theList ) {
+  Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+  if(aViewFrame) {
+
+    objectList allObjects;
+    aViewFrame->getObjects( allObjects );
+    
+    bool isSelected = false;
+    SPlot2d_Histogram* h = 0;
+    SPlot2d_Curve* c =0;
+    
+    foreach ( Plot2d_Object* o, allObjects ) {
+      isSelected = false;
+      
+      Handle(SALOME_InteractiveObject) io;
+      if( (h = dynamic_cast<SPlot2d_Histogram*>(o)) && h->hasIO() ) {
+       io = h->getIO();
+      } else if((c = dynamic_cast<SPlot2d_Curve*>(o)) && c->hasIO()) {
+       io = c->getIO();
+      } else {
+       continue;
+      }
+
+      SALOME_ListIteratorOfListIO anIter( theList ); 
+      
+      for( ; anIter.More(); anIter.Next() ) {
+       if ( anIter.Value()->hasEntry() ) {
+         if( io->isSame(anIter.Value()) ) {
+           isSelected = o->isSelected();
+           if( !isSelected ) {
+             o->setSelected(true);
+             aViewFrame->updateObject(o);
+             theList.Remove(anIter);
+             isSelected = true;
+             break;
+           } else 
+             break;
+         }
+       }
+      }
+      if( !isSelected && o->isSelected() != false ) {  
+       o->setSelected(false);
+       aViewFrame->updateObject(o);
+      }
+    }
+       if( myDeselectAnalytical ) {
+               aViewFrame->deselectAnalyticalCurves();
+               aViewFrame->updateAnalyticalCurves(); 
+       }
+    aViewFrame->Repaint();
   }
 }
index 2fc3491e029209c700ab003d8eada2b5b97ffcab..da3bb13a96c2ed6c87ea1e5f827adef0e22195ad 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SPlot2d_ViewModel.h
 //  Author : Sergey RUIN
 //  Module : SUIT
 #ifndef SPlot2d_ViewModel_H
 #define SPlot2d_ViewModel_H
 
-#include "SPlot2d.h"  
-
-#include "SALOME_Prs.h"
+#include "SPlot2d.h"
+#include "SPlot2d_Curve.h"
 #include "Plot2d_ViewModel.h"
-#include "SALOME_InteractiveObject.hxx"
 #include "Plot2d_ViewFrame.h"
 #include "Plot2d_ViewWindow.h"
-#include "SPlot2d_Curve.h"
+
+#include <SALOME_Prs.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
 
 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
 { 
@@ -58,7 +60,7 @@ public:
 
   virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
   
-  /* display */                
+  /* display */         
   void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
   void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
   void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
@@ -69,9 +71,11 @@ public:
   virtual void         EraseAll(const bool = false);
   virtual void         Repaint();
   virtual SALOME_Prs*  CreatePrs( const char* entry = 0 );
-  virtual void         BeforeDisplay( SALOME_Displayer* d );
-  virtual void         AfterDisplay ( SALOME_Displayer* d );
+
   virtual bool         isVisible( const Handle(SALOME_InteractiveObject)& IObject );
+  virtual void         GetVisible( SALOME_ListIO& theList );
+
+  virtual void         setObjectsSelected(  SALOME_ListIO& theList );
 
 
   /* operations */
@@ -84,6 +88,9 @@ protected slots:
 
 signals:
   void legendSelected( const QString& );
+  void clearSelected();
+private:
+  bool myDeselectAnalytical;
 };
 
 
index ce235bfd92b0b372bdaed96c06a3d550c31305d7..ebe1bdfad6048f69784730a7119e658138142aa2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SPlot2d_ViewWindow.h"
 
 #include "Plot2d_ViewFrame.h"
@@ -30,7 +31,7 @@
 */
 SPlot2d_ViewWindow
 ::SPlot2d_ViewWindow( SUIT_Desktop* theDesktop, 
-                     Plot2d_Viewer* theModel)
+                      Plot2d_Viewer* theModel)
   : Plot2d_ViewWindow( theDesktop, theModel )
 {
 }
index 1f9ba0b8014ade3e25c06e8a620bfad0a5cab3d5..0fdd092e0759e0d778d3c1caaf3b1b1122241518 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SPLOT2D_VIEWWINDOW_H
 #define SPLOT2D_VIEWWINDOW_H
 
diff --git a/src/SPlot2d/resources/SPlot2d_msg_en.po b/src/SPlot2d/resources/SPlot2d_msg_en.po
deleted file mode 100644 (file)
index ccf1816..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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. translating
-# from French to English, "Foo::Bar" would be translated to "Pub",
-# not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2005-06-16 12:01:13 PM MSD\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
index fa5aa382a6dc6cbad81fccb790b6f57cddb97307..b376e7536fd6349261b6e7e3e7cde62276b6ecfd 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : STD
@@ -70,7 +71,8 @@ dist_salomeres_DATA =                 \
 
 nodist_salomeres_DATA =        \
        STD_images.qm   \
-       STD_msg_en.qm
+       STD_msg_en.qm   \
+       STD_msg_fr.qm
 
 libstd_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
 libstd_la_LDFLAGS  = $(QT_MT_LIBS)
index 6569cff7fb96dc1b0ccacfcc4316ee87d4d614c1..4256ef96f12e5025dba84ab5ce2de21c896e5ad5 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef STD_H
 #define STD_H
 
 #if defined WIN32
-#  if defined STD_EXPORTS
+#  if defined STD_EXPORTS || defined std_EXPORTS
 #    define STD_EXPORT  __declspec( dllexport )
 #  else
 #    define STD_EXPORT  __declspec( dllimport )
 
 #if defined ( _DEBUG ) || defined ( DEBUG )
 #include <assert.h>
-#define STD_VERIFY(x)                          (assert(x))
-#define STD_ASSERT(x)              (assert(x))
+#define STD_VERIFY(x)                           (assert(x))
+#define STD_ASSERT(x)               (assert(x))
 #else
-#define STD_VERIFY(x)                          (x)
+#define STD_VERIFY(x)                           (x)
 #define STD_ASSERT(x)
 #endif
 
diff --git a/src/STD/STD.pro b/src/STD/STD.pro
deleted file mode 100644 (file)
index 0917122..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = std
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += STD_EXPORTS
-
-HEADERS  = STD.h
-HEADERS += STD_Application.h
-HEADERS += STD_MDIDesktop.h
-HEADERS += STD_SDIDesktop.h
-HEADERS += STD_TabDesktop.h
-
-SOURCES  = STD_Application.cxx
-SOURCES += STD_MDIDesktop.cxx
-SOURCES += STD_SDIDesktop.cxx
-SOURCES += STD_TabDesktop.cxx
-
-TRANSLATIONS = resources/STD_images.ts \
-               resources/STD_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
index eefdd5165818556bfb57c471d6e26f25c13fdb2c..e4eb217cda4f776cc84a3f77b8e22ba5231fca50 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "STD_Application.h"
 
 #include "STD_MDIDesktop.h"
@@ -161,6 +162,10 @@ void STD_Application::createActions()
                 tr( "MEN_DESK_FILE_OPEN" ), tr( "PRP_DESK_FILE_OPEN" ),
                 Qt::CTRL+Qt::Key_O, desk, false, this, SLOT( onOpenDoc() ) );
 
+  createAction( FileReopenId, tr( "TOT_DESK_FILE_REOPEN" ), QIcon(),
+                tr( "MEN_DESK_FILE_REOPEN" ), tr( "PRP_DESK_FILE_REOPEN" ),
+                0, desk, false, this, SLOT( onReopenDoc() ) );
+
   createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ),
                 tr( "MEN_DESK_FILE_CLOSE" ), tr( "PRP_DESK_FILE_CLOSE" ),
@@ -177,7 +182,7 @@ void STD_Application::createActions()
 
   createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIcon(),
                 tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
-                Qt::CTRL+Qt::Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
+                Qt::CTRL+Qt::SHIFT+Qt::Key_S, desk, false, this, SLOT( onSaveAsDoc() ) );
 
   createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
                 resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
@@ -191,7 +196,7 @@ void STD_Application::createActions()
 
   QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
                              QIcon(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
-                             tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::SHIFT+Qt::Key_S, desk, true );
+                             tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::ALT+Qt::SHIFT+Qt::Key_S, desk, true );
   a->setChecked( desk->statusBar()->isVisibleTo( desk ) );
   connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
 
@@ -200,7 +205,7 @@ void STD_Application::createActions()
 
   createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIcon(),
                 tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
-                Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) );
+                Qt::ALT+Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) );
 
 
   QtxDockAction* dwa = new QtxDockAction( tr( "TOT_DOCKWINDOWS" ), tr( "MEN_DESK_VIEW_DOCKWINDOWS" ), desk );
@@ -222,6 +227,7 @@ void STD_Application::createActions()
 
   createMenu( FileNewId,    fileMenu, 0 );
   createMenu( FileOpenId,   fileMenu, 0 );
+  createMenu( FileReopenId, fileMenu, 0 ); 
   createMenu( FileCloseId,  fileMenu, 5 );
   createMenu( separator(),  fileMenu, -1, 5 );
   createMenu( FileSaveId,   fileMenu, 5 );
@@ -326,6 +332,51 @@ bool STD_Application::onOpenDoc( const QString& aName )
   return res;
 }
 
+/*! Reload document from the file.*/
+bool STD_Application::onReopenDoc()
+{
+  bool res = false;
+
+  SUIT_Study* study = activeStudy();
+  if ( study && study->isSaved() ) {
+    // ask user for the confirmation
+    if ( SUIT_MessageBox::question( desktop(), tr( "REOPEN_STUDY" ), tr( "REOPEN_QUESTION" ),
+                                    SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No
+                                    ) == SUIT_MessageBox::No )
+      return false;
+
+    // remember study name
+    QString studyName = study->studyName();
+
+    // close study
+    beforeCloseDoc( study );
+    study->closeDocument( true );
+
+    // update views / windows / status bar / title
+    clearViewManagers();
+    setActiveStudy( 0 );
+    updateDesktopTitle();
+    updateCommandsStatus();
+
+    // delete study
+    delete study;
+    study = 0;
+    
+    // post closing actions
+    afterCloseDoc();
+
+    // reload study from the file
+    res = useFile( studyName ) && activeStudy();
+
+    // if reloading is failed, close the desktop
+    if ( !res ) {
+      setDesktop( 0 );
+      closeApplication();
+    }
+  }
+  return res;
+}
+
 /*!Virtual function. Not implemented here.*/
 void STD_Application::beforeCloseDoc( SUIT_Study* )
 {
@@ -456,13 +507,13 @@ bool STD_Application::openAction( const int choice, const QString& aName )
       QList<SUIT_Application*> aAppList = aSession->applications();
       for ( QList<SUIT_Application*>::iterator it = aAppList.begin(); it != aAppList.end() && !aApp; ++it )
       {
-       if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
-         aApp = *it;
+        if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+          aApp = *it;
       }
       if ( aApp )
-       aApp->desktop()->activateWindow();
+        aApp->desktop()->activateWindow();
       else
-       res = false;
+        res = false;
     }
     break;
   case OpenNew:
@@ -472,9 +523,9 @@ bool STD_Application::openAction( const int choice, const QString& aName )
     {
       SUIT_Application* aApp = startApplication( 0, 0 );
       if ( aApp )
-       res = aApp->useFile( aName );
+        res = aApp->useFile( aName );
       if ( !res )
-       aApp->closeApplication();
+        aApp->closeApplication();
     }
     break;
   case OpenCancel:
@@ -507,7 +558,7 @@ void STD_Application::onSaveDoc()
       putInfo( "" );
       // displaying a message box as SUIT_Validator in case file can't be written (the most frequent case)
       SUIT_MessageBox::critical( desktop(), tr( "ERR_ERROR" ),
-                                 tr( "ERR_PERMISSION_DENIED" ).arg( activeStudy()->studyName() ) );
+                                 tr( "INF_DOC_SAVING_FAILS" ).arg( activeStudy()->studyName() ) );
     }
     else
       putInfo( tr( "INF_DOC_SAVED" ).arg( "" ) );
@@ -621,12 +672,14 @@ void STD_Application::updateCommandsStatus()
 {
   SUIT_Application::updateCommandsStatus();
 
-  bool aHasStudy = activeStudy() != 0;
-  bool aIsNeedToSave = false;
-  if ( aHasStudy )
-    aIsNeedToSave = !activeStudy()->isSaved() || activeStudy()->isModified();
+  bool aHasStudy     = activeStudy() != 0;
+  bool aSaved        = aHasStudy && activeStudy()->isSaved();
+  bool aModified     = aHasStudy && activeStudy()->isModified();
+  bool aIsNeedToSave = aHasStudy && ( !aSaved || aModified );
 
-  if ( action( FileSaveId ) )
+ if ( action( FileReopenId ) )
+    action( FileReopenId )->setEnabled( aSaved );
+ if ( action( FileSaveId ) )
     action( FileSaveId )->setEnabled( aIsNeedToSave );
   if ( action( FileSaveAsId ) )
     action( FileSaveAsId )->setEnabled( aHasStudy );
@@ -802,7 +855,7 @@ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextM
 
 /*!\retval QString - return file name from dialog.*/
 QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
-                                     const QString& caption, QWidget* parent )
+                                      const QString& caption, QWidget* parent )
 {
   if ( !parent )
     parent = desktop();
@@ -824,9 +877,9 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q
         isOk = true;
       else
       {
-       int aEnd = aUsedFilter.lastIndexOf( ')' );
-       int aStart = aUsedFilter.lastIndexOf( '(', aEnd );
-       QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
+        int aEnd = aUsedFilter.lastIndexOf( ')' );
+        int aStart = aUsedFilter.lastIndexOf( '(', aEnd );
+        QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
 
         int idx = 0;
         QStringList extList;
@@ -840,23 +893,23 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q
         if ( !extList.isEmpty() && !extList.contains( SUIT_Tools::extension( aName ) ) )
           aName += QString( ".%1" ).arg( extList.first() );
 
-       if ( QFileInfo( aName ).exists() )
+        if ( QFileInfo( aName ).exists() )
         {
-         int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ),
-                                                  tr( "MSG_FILE_EXISTS" ).arg( aName ),
-                                                  SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
-         if ( aAnswer == SUIT_MessageBox::Cancel )
+          int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ),
+                                                   tr( "MSG_FILE_EXISTS" ).arg( aName ),
+                                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
+          if ( aAnswer == SUIT_MessageBox::Cancel )
           {     // cancelled
             aName = QString();
-           isOk = true;
+            isOk = true;
           }
-         else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
-           anOldPath = aName;             // not to return to the same initial dir at each "while" step
-         else                     // overwrite the existing file
-           isOk = true;
+          else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
+            anOldPath = aName;             // not to return to the same initial dir at each "while" step
+          else                     // overwrite the existing file
+            isOk = true;
         }
-       else
-         isOk = true;
+        else
+          isOk = true;
       }
     }
     return aName;
@@ -878,13 +931,12 @@ QString STD_Application::getDirectory( const QString& initial, const QString& ca
 */
 void STD_Application::setDesktop( SUIT_Desktop* desk )
 {
-  SUIT_Desktop* prev = desktop();
-
   SUIT_Application::setDesktop( desk );
 
-  if ( prev != desk && desk )
+  if ( desk ) {
     connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
-             this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
+             this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ), Qt::UniqueConnection );
+  }
 }
 
 /*!
@@ -930,3 +982,12 @@ void STD_Application::studySaved( SUIT_Study* )
   updateDesktopTitle();
   updateCommandsStatus();
 }
+
+/*!
+  Return index of the view ma
+*/
+int STD_Application::viewManagerId( const SUIT_ViewManager* theManager) const
+{
+  return myViewMgrs.indexOf(const_cast<SUIT_ViewManager*>(theManager));
+}
+
index 41ba71a88e36fae21e035f31af268eca79c67268..58a5003618bcb8d084ed3e46d25c6ea5b13b2a12 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef STD_APPLICATION_H
 #define STD_APPLICATION_H
 
@@ -52,7 +53,7 @@ class STD_EXPORT STD_Application : public SUIT_Application
   Q_OBJECT
 
 public:
-  enum { MenuFileId, FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
+  enum { MenuFileId, FileNewId, FileOpenId, FileReopenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
          MenuViewId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId,
          MenuEditId, EditCutId, EditCopyId, EditPasteId,
          MenuHelpId, HelpAboutId,
@@ -85,10 +86,11 @@ public:
   ViewManagerList       viewManagers() const;
   void                  viewManagers( ViewManagerList& ) const;
   void                  viewManagers( const QString&, ViewManagerList& ) const;
+  virtual int           viewManagerId (const SUIT_ViewManager* ) const;
 
   virtual QString       getFileFilter() const { return QString(); }
   virtual QString       getFileName( bool open, const QString& initial, const QString& filters,
-                                                            const QString& caption, QWidget* parent );
+                                                             const QString& caption, QWidget* parent );
   QString               getDirectory( const QString& initial, const QString& caption, QWidget* parent );
 
   virtual void          start();
@@ -121,6 +123,8 @@ public slots:
   virtual void          onOpenDoc();
   virtual bool          onOpenDoc( const QString& );
 
+  virtual bool          onReopenDoc();
+
   virtual void          onExit();
 
   virtual void          onCopy();
index de0dcf8802f9728a9a94518d4c836398b0450bcf..93b7b30685022c987b08c0e8ef8958a58bdc932b 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "STD_MDIDesktop.h"
 
 #include <SUIT_Session.h>
@@ -175,8 +176,8 @@ void STD_MDIDesktop::createActions()
   myWorkspaceAction = new QtxWorkspaceAction( workspace(), this );
 
   myWorkspaceAction->setMenuActions( QtxWorkspaceAction::Cascade | QtxWorkspaceAction::Tile  |
-                                    QtxWorkspaceAction::HTile   | QtxWorkspaceAction::VTile |
-                                    QtxWorkspaceAction::Windows );
+                                     QtxWorkspaceAction::HTile   | QtxWorkspaceAction::VTile |
+                                     QtxWorkspaceAction::Windows );
 
   // Cascade
   myWorkspaceAction->setIcon( QtxWorkspaceAction::Cascade,
index a229ab713d0c0f7fc7f3ef373e2491eb0c9643a9..9f2fee2de9882b79b00771bbe654754e834a77a9 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef STD_MDIDESKTOP_H
 #define STD_MDIDESKTOP_H
 
index 87a65307a90cf7ea9cb93cc7c2a9f90ff06fdee0..fb4f467ed83747303b7c5b64be0df8e8d2914290 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "STD_SDIDesktop.h"
 
 #include <SUIT_ViewWindow.h>
index d5e17e891968b506cbd213adc8aef326586162d5..bf703780386cd5b5558ba30c68535c5c7e493139 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef STD_SDIDESKTOP_H
 #define STD_SDIDESKTOP_H
 
index f63f36e7ee85f5373c5edbf84393c6ed6ca90531..18da37188d8f6e576abce1ac7d70c15a1ad72c53 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "STD_TabDesktop.h"
 
 #include <SUIT_Session.h>
@@ -51,22 +52,22 @@ myWorkstackAction( 0 )
   myWorkstack = new QtxWorkstack( base );
   main->addWidget( myWorkstack );
   // setting Expanding size policy for central workstack.  If there are several widgets
-  // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).  
+  // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).
   // But the workstack must occupy as much space as possible -- set Expanding for it.
   myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
 
-  myWorkstack->setAccel( QtxWorkstack::SplitVertical,   Qt::SHIFT + Qt::Key_V );
-  myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
-  myWorkstack->setAccel( QtxWorkstack::Close,           Qt::SHIFT + Qt::Key_C );
+  myWorkstack->setAccel( QtxWorkstack::SplitVertical,   Qt::ALT + Qt::SHIFT + Qt::Key_V );
+  myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::ALT + Qt::SHIFT + Qt::Key_H );
+  //myWorkstack->setAccel( QtxWorkstack::Close,           Qt::CTRL + Qt::Key_F4 );
 
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   if ( resMgr ) {
-    myWorkstack->setIcon( QtxWorkstack::SplitVertical,   
-                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+    myWorkstack->setIcon( QtxWorkstack::SplitVertical,
+                          resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
     myWorkstack->setIcon( QtxWorkstack::SplitHorizontal,
-                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+                          resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
     myWorkstack->setIcon( QtxWorkstack::Close,
-                         resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
+                          resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
   }
 
   connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
@@ -138,18 +139,18 @@ void STD_TabDesktop::windowOperation( const int type )
 void STD_TabDesktop::setWindowOperations( const int first, ... )
 {
   va_list ints;
-       va_start( ints, first );
+        va_start( ints, first );
 
-       QList<int> typeList;
+        QList<int> typeList;
 
-       int cur = first;
-       while ( cur )
-       {
-         typeList.append( cur );
-               cur = va_arg( ints, int );
+        int cur = first;
+        while ( cur )
+        {
+          typeList.append( cur );
+                cur = va_arg( ints, int );
   }
 
-       setWindowOperations( typeList );
+        setWindowOperations( typeList );
 }
 
 /*!
@@ -203,14 +204,14 @@ void STD_TabDesktop::createActions()
                               resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
   myWorkstackAction->setText( QtxWorkstackAction::SplitHorizontal, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
   myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitHorizontal, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
-  myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::ALT + Qt::SHIFT + Qt::Key_H );
 
   // Split Vertical
   myWorkstackAction->setIcon( QtxWorkstackAction::SplitVertical,
                               resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
   myWorkstackAction->setText( QtxWorkstackAction::SplitVertical, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
   myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
-  myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical,   Qt::SHIFT + Qt::Key_V );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical,   Qt::ALT + Qt::SHIFT + Qt::Key_V );
 
   QtxActionMenuMgr* mMgr = menuMgr();
   if ( !mMgr )
index 57d5195ad8fa5a2cf61db0363156b0570864f60d..3b8660b2186d3175429d04d2479264882f460ac2 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef STD_TABDESKTOP_H
 #define STD_TABDESKTOP_H
 
diff --git a/src/STD/resources/STD_images.po b/src/STD/resources/STD_images.po
deleted file mode 100755 (executable)
index 066c686..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_DESK_DEFAULTICON"
-msgstr "default.png" 
-
-msgid "ICON_APP_DEFAULTICON"
-msgstr "default.png"
-
-msgid "ICON_FILE_NEW"
-msgstr "new.png"
-
-msgid "ICON_FILE_OPEN"
-msgstr "open.png"
-
-msgid "ICON_FILE_SAVE"
-msgstr "save.png"
-
-msgid "ICON_FILE_CLOSE"
-msgstr "close.png"
-
-msgid "ICON_EDIT_CUT"
-msgstr "cut.png"
-
-msgid "ICON_EDIT_COPY"
-msgstr "copy.png"
-
-msgid "ICON_EDIT_PASTE"
-msgstr "paste.png"
-
-msgid "ICON_HELP"
-msgstr "help.png"
-
-msgid "ICON_PRINT"
-msgstr "print.png"
-
-msgid "ICON_RESET"
-msgstr "reset.png"
-
-msgid "ICON_DESK_WINDOW_CASCADE"
-msgstr "cascade.png"
-
-msgid "ICON_DESK_WINDOW_TILE"
-msgstr "tile.png"
-
-msgid "ICON_DESK_WINDOW_VTILE"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_HTILE"
-msgstr "htile.png"
-
-msgid "ICON_DESK_WINDOW_VSPLIT"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_HSPLIT"
-msgstr "htile.png"
-
-msgid "ICON_APP_EDIT_UNDO"
-msgstr "undo.png"
-
-msgid "ICON_APP_EDIT_REDO"
-msgstr "redo.png"
-
-msgid "SUIT_ViewPort::ICON_CURSOR_ROTATE"
-msgstr "cursor_rotate.png"
-
-msgid "SUIT_ViewPort::ICON_CURSOR_ZOOM"
-msgstr "cursor_zoom.png"
index 216ea3f4a69c8a05703199521d5c3b732f072f93..e26af026407b30c42e06d0c2cda2148b0d4b8db6 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
diff --git a/src/STD/resources/STD_msg_en.po b/src/STD/resources/STD_msg_en.po
deleted file mode 100755 (executable)
index c96e51b..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "INF_READY"
-msgstr "Ready"
-
-msgid "BUT_OK"
-msgstr "&Ok"
-
-msgid "BUT_CANCEL"
-msgstr "&Cancel"
-
-msgid "BUT_CLOSE"
-msgstr "&Close"
-
-msgid "BUT_HELP"
-msgstr "&Help"
-
-msgid "BUT_YES"
-msgstr "&Yes"
-
-msgid "BUT_NO"
-msgstr "&No"
-
-msgid "BUT_APPLY"
-msgstr "&Apply"
-
-msgid "ERR_ERROR"
-msgstr "Error"
-
-msgid "WRN_WARNING"
-msgstr "Warning"
-
-msgid "INF_INFO" 
-msgstr "Information"
-
-msgid "FILTER_FILES"
-msgstr "%1 Files (%2)"
-
-msgid "ALL_FILES"
-msgstr "All Files (*.*)"
-
-msgid "INF_CANCELLED"
-msgstr "Cancelled"
-
-msgid "ERR_UNKNOWN"
-msgstr "Unknown error"
-
-## ----------------------------------------------------
-
-msgid "INF_DESK_DOC_CREATE"
-msgstr "Create a new document"
-
-msgid "ERR_APP_NOAPP"
-msgstr "No application"
-
-msgid "INF_DESK_EXIT"
-msgstr "Exit"
-
-msgid "INF_DESK_TOOLBAR_STANDARD"
-msgstr "Standard"
-
-msgid "MEN_DESK_FILE"
-msgstr "&File"
-
-msgid "MEN_DESK_FILE_CLOSE"
-msgstr "&Close"
-
-msgid "MEN_DESK_FILE_EXIT"
-msgstr "E&xit"
-
-msgid "MEN_DESK_FILE_NEW"
-msgstr "&New"
-
-msgid "MEN_DESK_FILE_OPEN"
-msgstr "&Open..."
-
-msgid "MEN_DESK_FILE_PRINT"
-msgstr "&Print"
-
-msgid "MEN_DESK_FILE_SAVE"
-msgstr "&Save"
-
-msgid "MEN_DESK_FILE_SAVEAS"
-msgstr "Save &As..."
-
-msgid "MEN_DESK_EDIT"
-msgstr "&Edit"
-
-msgid "MEN_DESK_EDIT_CUT"
-msgstr "Cu&t"
-
-msgid "MEN_DESK_EDIT_COPY"
-msgstr "&Copy"
-
-msgid "MEN_DESK_EDIT_PASTE"
-msgstr "&Paste"
-
-msgid "MEN_DESK_HELP"
-msgstr "&Help"
-
-msgid "MEN_DESK_HELP_ABOUT"
-msgstr "&About..."
-
-msgid "MEN_DESK_HELP_CONTENTS"
-msgstr "&Contents"
-
-msgid "MEN_DESK_HELP_SEARCH"
-msgstr "&Search..."
-
-msgid "MEN_DESK_VIEW"
-msgstr "&View"
-
-msgid "MEN_DESK_VIEW_TOOLBARS"
-msgstr "T&oolbars"
-
-msgid "MEN_DESK_VIEW_DOCKWINDOWS"
-msgstr "W&indows"
-
-msgid "MEN_DESK_VIEW_STATUSBAR"
-msgstr "&Status Bar"
-
-msgid "MEN_DESK_VIEW_STDTOOLBAR"
-msgstr "&Standard"
-
-msgid "PRP_DESK_FILE_CLOSE"
-msgstr "Closes the active document"
-
-msgid "PRP_DESK_FILE_EXIT"
-msgstr "Exits the application"
-
-msgid "PRP_DESK_FILE_NEW"
-msgstr "Creates a new document"
-
-msgid "PRP_DESK_FILE_OPEN"
-msgstr "Opens an existing document"
-
-msgid "PRP_DESK_FILE_PRINT"
-msgstr "Prints the active document"
-
-msgid "PRP_DESK_FILE_SAVE"
-msgstr "Saves the active document"
-
-msgid "PRP_DESK_FILE_SAVEAS"
-msgstr "Saves the active document with a new name"
-
-msgid "PRP_DESK_EDIT_CUT"
-msgstr "Cuts the selection and puts it to the Clipboard"
-
-msgid "PRP_DESK_EDIT_COPY"
-msgstr "Copy the selection to the Clipboard"
-
-msgid "PRP_DESK_EDIT_PASTE"
-msgstr "Inserts the Clipboard content at the insertion point"
-
-msgid "PRP_DESK_HELP_ABOUT"
-msgstr "Shows \'About\' dialog"
-
-msgid "PRP_DESK_HELP_CONTENTS"
-msgstr "Shows the whole help contents"
-
-msgid "PRP_DESK_HELP_SEARCH"
-msgstr "Searches help for a topic"
-
-msgid "PRP_DESK_VIEW_STATUSBAR"
-msgstr "Toggles status bar view on/off"
-
-msgid "PRP_DESK_VIEW_STDTOOLBAR"
-msgstr "Toggles standard toolbar on/off"
-
-msgid "QUE_DESK_EXIT"
-msgstr "Do you really want to quit ?"
-
-msgid "TOT_DESK_FILE_NEW"
-msgstr "New document"
-
-msgid "TOT_DESK_FILE_OPEN"
-msgstr "Open document"
-
-msgid "TOT_DESK_FILE_CLOSE"
-msgstr "Close document"
-
-msgid "TOT_DESK_FILE_PRINT"
-msgstr "Print document"
-
-msgid "TOT_DESK_FILE_SAVE"
-msgstr "Save document"
-
-msgid "TOT_DESK_FILE_SAVEAS"
-msgstr "Save document as..."
-
-msgid "TOT_DESK_FILE_EXIT"
-msgstr "Exit from application"
-
-msgid "TOT_DESK_EDIT_CUT"
-msgstr "Cut"
-
-msgid "TOT_DESK_EDIT_COPY"
-msgstr "Copy"
-
-msgid "TOT_DESK_EDIT_PASTE"
-msgstr "Paste"
-
-msgid "TOT_DESK_HELP_ABOUT"
-msgstr "About..."
-
-msgid "STD_Application::TOT_DOCK_WINDOWS"
-msgstr "Show / hide dockable windows and toolbars"
-
-msgid "STD_Application::MEN_DOCK_WINDOWS"
-msgstr "Windows and Toolbars"
-
-msgid "ERR_DOC_UNKNOWNTYPE_OPEN"
-msgstr "You are trying to open a document of an unknown type\n( %1 )"
-
-msgid "ERR_DOC_UNKNOWNTYPE_SAVE"
-msgstr "You are trying to save this document under an unknown type\n( %1 )"
-
-msgid "ERR_DOC_PERMISSIONDENIED_SAVE"
-msgstr "Can not save file %1. Permission denied"
-
-msgid "ERR_DOC_DIRWITHNAMEEXIST_SAVE"
-msgstr "Can not save file %1.\nDirectory with this name exist on disc. Try to use another name"
-
-msgid "QUE_DOC_FILEEXISTS"
-msgstr "The file %1 already exists.\nDo you want to overwrite it ?"
-
-msgid "ERR_DESK_NOAPP"
-msgstr "No applications registered"
-
-msgid "DESK_DEFAULTTITLE"
-msgstr "Qt Application Desktop"
-
-msgid "QUE_DOC_ALREADYOPEN"
-msgstr "The document %1 is already open.\nDo you want to reload it ?"
-
-msgid "MEN_DESK_WINDOW"
-msgstr "&Window"
-
-msgid "MEN_DESK_NEWWINDOW"
-msgstr "&New Window"
-
-msgid "TOT_DESK_NEWWINDOW"
-msgstr "Create new Window"
-
-msgid "PRP_DESK_NEWWINDOW"
-msgstr "Create new Window"
-
-msgid "MEN_DESK_WINDOW_CASCADE"
-msgstr "&Cascade"
-
-msgid "PRP_DESK_WINDOW_CASCADE"
-msgstr "Arranges the windows as overlapping tiles"
-
-msgid "MEN_DESK_WINDOW_TILE"
-msgstr "&Tile"
-
-msgid "PRP_DESK_WINDOW_TILE"
-msgstr "Arranges the windows as nonoverlapping tiles"
-
-msgid "MEN_DESK_WINDOW_HTILE"
-msgstr "Tile &Horizontally"
-
-msgid "PRP_DESK_WINDOW_HTILE"
-msgstr "Arranges the windows as nonoverlapping horizontal tiles"
-
-msgid "MEN_DESK_WINDOW_VTILE"
-msgstr "Tile &Vertically"
-
-msgid "PRP_DESK_WINDOW_VTILE"
-msgstr "Arranges the windows as nonoverlapping vertical tiles"
-
-msgid "PRP_DESK_WINDOW_ACTIVATE"
-msgstr "Activates this window"
-
-msgid "MEN_DESK_WINDOW_HSPLIT"
-msgstr "Split &Horizontally"
-
-msgid "PRP_DESK_WINDOW_HSPLIT"
-msgstr "Splits the active window on two horizontal parts"
-
-msgid "MEN_DESK_WINDOW_VSPLIT"
-msgstr "Split &Vertically"
-
-msgid "PRP_DESK_WINDOW_VSPLIT"
-msgstr "Splits the active window on two vertical parts"
-
-msgid "INF_DESK_DOCALREADYOPEN"
-msgstr "A document cannot be saved under a name of a document already opened.\nPlease, type another name for the document you want to save.\n( %1 )"
-
-msgid "MEN_DESK_FILE_MRU"
-msgstr "Recent &Files"
-
-msgid "PRP_DESK_FILE_MRU"
-msgstr "Opens a document"
-
-msgid "STD_Application::ABOUT_INFO"
-msgstr "SUIT Std application"
-
-msgid "MSG_FILE_EXISTS"
-msgstr "File \"%1\" already exists.\nDo you want to overwrite it?"
-
-msgid "MSG_CANT_SAVE"
-msgstr "Can't save file \"%1\"."
-
-msgid "TIT_FILE_SAVEAS"
-msgstr "Save As"
-
-msgid "STD_Application::INF_DOC_MODIFIED"
-msgstr "Document has been modified.\nDo you want to save changes?"
-
-msgid "STD_Application::INF_DOCUMENT_MODIFIED"
-msgstr "Document \"%1\" has been modified.\nDo you want to save changes?"
-
-msgid "STD_Application::INF_DOC_SAVED"
-msgstr "Study %1 saved"
-
-msgid "STD_Application::INF_DOC_SAVING"
-msgstr "Saving study "
-
-msgid "STD_Application::INF_DOC_SAVING_FAILS"
-msgstr "Can't save file \"%1\".\nPossible reason is permission denied or disc full.\nTry to use another file name."
-
-msgid "TOT_DESK_FILE_LOAD"
-msgstr "Load document"
-
-msgid "PRP_DESK_FILE_LOAD"
-msgstr "Load a document"
-
-msgid "MEN_DESK_FILE_LOAD"
-msgstr "Conn&ect..."    
-
-msgid "DLG_LOAD_STUDY_CAPTION"
-msgstr "Load Study"
-
-msgid "MEN_STUDIES_CHOICE"
-msgstr "Choose existent study."
-
-
-
index cfa9e93f4765bfaeedfa5946b075f3f485dd285f..84899db0f9e649e0e36bb50124f2d1d2b3c4026a 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
@@ -387,6 +366,10 @@ Do you want to overwrite it?</translation>
         <source>TOT_DESK_FILE_OPEN</source>
         <translation>Open document</translation>
     </message>
+    <message>
+        <source>TOT_DESK_FILE_REOPEN</source>
+        <translation>Reopen document</translation>
+    </message>
     <message>
         <source>PRP_DESK_FILE_EXIT</source>
         <translation>Exits the application</translation>
@@ -395,13 +378,17 @@ Do you want to overwrite it?</translation>
         <source>PRP_DESK_FILE_OPEN</source>
         <translation>Opens an existing document</translation>
     </message>
+    <message>
+        <source>PRP_DESK_FILE_REOPEN</source>
+        <translation>Reload the current document from the file</translation>
+    </message>
     <message>
         <source>PRP_DESK_FILE_SAVE</source>
         <translation>Saves the active document</translation>
     </message>
     <message>
         <source>PRP_DESK_FILE_LOAD</source>
-        <translation>Load a document</translation>
+        <translation>Loads a document</translation>
     </message>
     <message>
         <source>PRP_DESK_WINDOW_HTILE</source>
@@ -423,6 +410,10 @@ Do you want to overwrite it?</translation>
         <source>MEN_DESK_FILE_OPEN</source>
         <translation>&amp;Open...</translation>
     </message>
+    <message>
+        <source>MEN_DESK_FILE_REOPEN</source>
+        <translation>Reopen</translation>
+    </message>
     <message>
         <source>MEN_DESK_FILE_LOAD</source>
         <translation>Conn&amp;ect...</translation>
@@ -470,7 +461,10 @@ Do you want to save changes?</translation>
     <message>
         <source>INF_DOC_SAVING_FAILS</source>
         <translation>Can&apos;t save file &quot;%1&quot;.
-Possible reason is permission denied or disc full.
+Possible reasons:
+- permission denied;
+- unsufficient disk space;
+- application error.
 Try to use another file name.</translation>
     </message>
     <message>
@@ -486,5 +480,14 @@ Do you want to save changes?</translation>
         <source>CLOSE_QUESTION</source>
         <translation>Do you want to save study before closing?</translation>
     </message>
+    <message>
+        <source>REOPEN_STUDY</source>
+        <translation>Reopen study</translation>
+    </message>
+    <message>
+        <source>REOPEN_QUESTION</source>
+        <translation>Do you really want to re-open study?
+All the changes made since last saving will be lost.</translation>
+    </message>
 </context>
 </TS>
index 2c2646522b9fe37a331d5b3d90f6baed4b49a391..68f6184c0e8859e1d9a71ff61875bbe845674f23 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suit
@@ -60,7 +61,8 @@ salomeinclude_HEADERS =                       \
        SUIT_TreeModel.h                \
        SUIT_ViewManager.h              \
        SUIT_ViewModel.h                \
-       SUIT_ViewWindow.h
+       SUIT_ViewWindow.h               \
+       SUIT_ShortcutMgr.h
 
 dist_libsuit_la_SOURCES =              \
        SUIT_Accel.cxx                  \
@@ -91,7 +93,8 @@ dist_libsuit_la_SOURCES =             \
        SUIT_TreeModel.cxx              \
        SUIT_ViewManager.cxx            \
        SUIT_ViewModel.cxx              \
-       SUIT_ViewWindow.cxx
+       SUIT_ViewWindow.cxx             \
+       SUIT_ShortcutMgr.cxx
 
 MOC_FILES =                            \
        SUIT_Accel_moc.cxx              \
@@ -112,12 +115,20 @@ MOC_FILES =                               \
        SUIT_TreeModel_moc.cxx          \
        SUIT_ViewManager_moc.cxx        \
        SUIT_ViewModel_moc.cxx          \
-       SUIT_ViewWindow_moc.cxx
+       SUIT_ViewWindow_moc.cxx         \
+       SUIT_ShortcutMgr_moc.cxx
 
 nodist_libsuit_la_SOURCES = $(MOC_FILES)
 
 nodist_salomeres_DATA =                        \
-       SUIT_msg_en.qm
+       SUIT_msg_en.qm                  \
+       SUIT_msg_fr.qm                  \
+       SUIT_images.qm
+               
+dist_salomeres_DATA =                     \
+       resources/icon_visibility_on.png  \
+       resources/icon_visibility_off.png
+                               
 
 libsuit_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../ObjBrowser
 
index 2d52a79f6b3613819fc3ebd892f18976db3f9aeb..94e177881988d76ba1719589440c38b07acc682c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT.h
 // Author : 
 //
@@ -26,7 +27,7 @@
 #define SUIT_H
 
 #if defined WIN32
-#  if defined SUIT_EXPORTS
+#  if defined SUIT_EXPORTS || defined suit_EXPORTS
 #    define SUIT_EXPORT __declspec( dllexport )
 #  else
 #    define SUIT_EXPORT __declspec( dllimport )
diff --git a/src/SUIT/SUIT.pro b/src/SUIT/SUIT.pro
deleted file mode 100644 (file)
index 9161aed..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = suit
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx
-LIBS += -L../../lib -lqtx
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SUIT_EXPORTS
-
-HEADERS  = SUIT.h
-HEADERS += SUIT_Accel.h
-HEADERS += SUIT_ActionOperation.h
-HEADERS += SUIT_Application.h
-HEADERS += SUIT_DataObject.h
-HEADERS += SUIT_DataObjectIterator.h
-HEADERS += SUIT_DataObjectKey.h
-HEADERS += SUIT_DataOwner.h
-HEADERS += SUIT_Desktop.h
-HEADERS += SUIT_ExceptionHandler.h
-HEADERS += SUIT_FileDlg.h
-HEADERS += SUIT_FileValidator.h
-HEADERS += SUIT_LicenseDlg.h
-HEADERS += SUIT_MessageBox.h
-HEADERS += SUIT_Operation.h
-HEADERS += SUIT_OverrideCursor.h
-HEADERS += SUIT_PopupClient.h
-HEADERS += SUIT_ResourceMgr.h
-HEADERS += SUIT_SelectionFilter.h
-HEADERS += SUIT_SelectionMgr.h
-HEADERS += SUIT_Selector.h
-HEADERS += SUIT_Session.h
-HEADERS += SUIT_SmartPtr.h
-HEADERS += SUIT_Study.h
-HEADERS += SUIT_Tools.h
-HEADERS += SUIT_TreeSync.h
-HEADERS += SUIT_ViewManager.h
-HEADERS += SUIT_ViewModel.h
-HEADERS += SUIT_ViewWindow.h
-
-SOURCES  = SUIT_Accel.cxx
-SOURCES += SUIT_ActionOperation.cxx
-SOURCES += SUIT_Application.cxx
-SOURCES += SUIT_DataObject.cxx
-SOURCES += SUIT_DataObjectIterator.cxx
-SOURCES += SUIT_DataObjectKey.cxx
-SOURCES += SUIT_DataOwner.cxx
-SOURCES += SUIT_Desktop.cxx
-SOURCES += SUIT_ExceptionHandler.cxx
-SOURCES += SUIT_FileDlg.cxx
-SOURCES += SUIT_FileValidator.cxx
-SOURCES += SUIT_LicenseDlg.cxx
-SOURCES += SUIT_MessageBox.cxx
-SOURCES += SUIT_Operation.cxx
-SOURCES += SUIT_OverrideCursor.cxx
-SOURCES += SUIT_PopupClient.cxx
-SOURCES += SUIT_ResourceMgr.cxx
-SOURCES += SUIT_SelectionFilter.cxx
-SOURCES += SUIT_SelectionMgr.cxx
-SOURCES += SUIT_Selector.cxx
-SOURCES += SUIT_Session.cxx
-SOURCES += SUIT_Study.cxx
-SOURCES += SUIT_Tools.cxx
-SOURCES += SUIT_ViewManager.cxx
-SOURCES += SUIT_ViewModel.cxx
-SOURCES += SUIT_ViewWindow.cxx
-
-TRANSLATIONS = resources/SUIT_images.ts \
-               resources/SUIT_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index f7babbb3fbd0b7d0c11acec7b30edf8c49622ea7..414bc3171dc69eef4f6e303eb40a480db5fde5af 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // SUIT_Accel.cxx: implementation of the SUIT_Accel class.
 //
 #include "SUIT_Accel.h"
@@ -130,12 +131,15 @@ bool SUIT_Accel::eventFilter( QObject *obj, QEvent *event )
   if ( key ) {
     SUIT_ViewWindow* vw = ::getParentViewWindow( obj ); 
     if ( vw ) {
-      QString type = vw->getViewManager()->getViewModel()->getType();
-      if ( myMap.contains( type ) ) {
-       IdActionMap idActionMap = myMap[type];
-       if ( idActionMap.contains( key ) ) {
-         return vw->onAccelAction( idActionMap[key] );
-       }
+      if ( vw->getViewManager() && vw->getViewManager()->getViewModel() )
+      {
+        QString type = vw->getViewManager()->getViewModel()->getType();
+        if ( myMap.contains( type ) ) {
+          IdActionMap idActionMap = myMap[type];
+          if ( idActionMap.contains( key ) ) {
+            return vw->onAccelAction( idActionMap[key] );
+          }
+        }
       }
     }
   }
index b3b0886f1d7e615520e911a025b317af6d50ccda..c5fe5c4ac1c4a711701ac5bf0b1d05d40965b767 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // SUIT_Accel.h: interface for the SUIT_Accel class.
 //
 #ifndef SUIT_ACELL_H
index f3f40ee5913cc4e1b06b83994d08b9774ad73000..bbcc9f5795fd562afc59b3dcbf776d374b04cddc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_ActionOperation.h"
 
 #include "SUIT_Application.h"
@@ -53,7 +54,7 @@ QtxAction* SUIT_ActionOperation::action() const
  * Create new instance of QtxAction and set.
  */
 void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
-                                                             const QString& menuText, QKeySequence accel,
+                                                              const QString& menuText, QKeySequence accel,
                                       QObject* parent, bool toggle )
 {
   setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
@@ -63,7 +64,7 @@ void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
  * Create new instance of QtxAction and set.
  */
 void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
-                                                             QKeySequence accel, QObject* parent, bool toggle )
+                                                              QKeySequence accel, QObject* parent, bool toggle )
 {
   setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
 }
index f4f8e895188fea7e2bb4ea17eef6fa185390497c..78e7f2e4d066cf0f0c348d88018c064b0d2f7243 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_ACTIONOPERATION_H
 #define SUIT_ACTIONOPERATION_H
 
@@ -35,32 +36,32 @@ class QtxAction;
 /*!Provide support QtxAction*/
 class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation
 {
-       Q_OBJECT
+        Q_OBJECT
 
 public:
-       SUIT_ActionOperation( SUIT_Application* );
-       virtual ~SUIT_ActionOperation();
+        SUIT_ActionOperation( SUIT_Application* );
+        virtual ~SUIT_ActionOperation();
 
-       QtxAction*   action() const;
+        QtxAction*   action() const;
 
-       /** @name GUI management*/
-       //@{
-       virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
-                                                 QKeySequence accel, QObject* parent, bool toggle = false );
+        /** @name GUI management*/
+        //@{
+        virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
+                                                  QKeySequence accel, QObject* parent, bool toggle = false );
 
-       virtual void setAction( const QString& text, const QString& menuText,
+        virtual void setAction( const QString& text, const QString& menuText,
                           QKeySequence accel, QObject* parent, bool toggle = false );
-       virtual void setAction( QtxAction* theAction );
-       
-       bool         addTo( QWidget* theWidget );
+        virtual void setAction( QtxAction* theAction );
+        
+        bool         addTo( QWidget* theWidget );
 
-       void         setStatusTip( const QString& theTip );
-       //@}
+        void         setStatusTip( const QString& theTip );
+        //@}
 
 private:
-       QtxAction*   myAction;
+        QtxAction*   myAction;
 
-       friend class SUIT_Study;
+        friend class SUIT_Study;
 };
 
 #endif
index 042b6fc8c11492c3b2bd5bae5c13c2271535d035..3c4eac06fc5dd164ea5acea962855a63e4898d99 100755 (executable)
@@ -1,30 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Application.h"
 
 #include "SUIT_Study.h"
 #include "SUIT_Session.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
+#include "SUIT_ShortcutMgr.h"
 
 #include <QTimer>
 #include <QLabel>
@@ -36,6 +38,7 @@
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
+
 /*!
   \class StatusLabel
   \brief Status bar customization label. Used to workaroubd desktop resizing bug.
@@ -122,6 +125,9 @@ void SUIT_Application::start()
 {
   if ( desktop() )
     desktop()->show();
+
+  // Initialize shortcut manager
+  SUIT_ShortcutMgr::Init();
 }
 
 /*!
@@ -173,6 +179,15 @@ SUIT_ResourceMgr* SUIT_Application::resourceMgr() const
   return SUIT_Session::session()->resourceMgr();
 }
 
+/*!
+  \brief Get access to shortcut manager.
+  \return global shortcut manager
+*/
+SUIT_ShortcutMgr* SUIT_Application::shortcutMgr() const
+{
+  return SUIT_ShortcutMgr::getShortcutMgr();
+}
+
 #define DEFAULT_MESSAGE_DELAY 3000
 
 /*!
@@ -257,7 +272,9 @@ void SUIT_Application::setDesktop( SUIT_Desktop* desk )
   if ( myDesktop == desk )
     return;
 
-  delete myDesktop;
+  // >> VSR 09/06/2009: workaround about the Qt 4.5.0 bug: SIGSEGV on desktop delete
+  myDesktop->deleteLater(); // delete myDesktop;
+  // << VSR 09/06/2009
   myDesktop = desk;
   if ( myDesktop ) {
     connect( myDesktop, SIGNAL( activated() ), this, SLOT( onDesktopActivated() ) );
@@ -287,10 +304,10 @@ void SUIT_Application::setActiveStudy( SUIT_Study* study )
 
   if ( myStudy )
     disconnect( myStudy, SIGNAL( studyModified( SUIT_Study* ) ),
-               this, SLOT( updateCommandsStatus() ) );
+                this, SLOT( updateCommandsStatus() ) );
   if ( study )
     connect( study, SIGNAL( studyModified( SUIT_Study* ) ),
-            this, SLOT( updateCommandsStatus() ) );
+             this, SLOT( updateCommandsStatus() ) );
 
   myStudy = study;
 }
@@ -609,9 +626,10 @@ QList<int> SUIT_Application::actionIds() const
 */
 QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon,
                                          const QString& menu, const QString& tip, const int key,
-                                         QObject* parent, const bool toggle, QObject* reciever, const char* member )
+                                         QObject* parent, const bool toggle, QObject* reciever, 
+                                        const char* member, const QString& shortcutAction )
 {
-  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
+  QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
   a->setStatusTip( tip );
 
   if ( reciever && member )
@@ -675,6 +693,6 @@ void SUIT_Application::onDesktopActivated()
 */
 void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/,
                                             const QString& /*theFileName*/,
-                                           const QString& /*theContext*/ )
+                                            const QString& /*theContext*/ )
 {
 }
index 98141edc52277ff0a7ef1717af2c4bec688e6ce4..5fb7fe9672d8a618335aaa4580dad05ee7c8f5fc 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_APPLICATION_H
 #define SUIT_APPLICATION_H
 
@@ -34,8 +35,9 @@ class QAction;
 class QWidget;
 
 class SUIT_Desktop;
-class SUIT_ViewModel;
+class SUIT_ViewManager;
 class SUIT_ResourceMgr;
+class SUIT_ShortcutMgr;
 class SUIT_Study;
 
 #ifdef WIN32
@@ -96,15 +98,22 @@ public:
 
   SUIT_ResourceMgr*     resourceMgr() const;
 
+  SUIT_ShortcutMgr*     shortcutMgr() const;
+
   //! Puts the message to the status bar  
-  void putInfo ( const QString&, const int = 0 );
+  void                  putInfo ( const QString&, const int = 0 );
 
   //! Invokes application-specific "Open/Save File" dialog and returns the selected file name.
-  virtual QString getFileName( bool open, const QString& initial, const QString& filters, 
-                              const QString& caption, QWidget* parent ) = 0;
+  virtual QString       getFileName( bool open, const QString& initial, const QString& filters, 
+                                     const QString& caption, QWidget* parent ) = 0;
 
   //! Invokes application-specific "Select Directory" dialog and returns the selected directory name.
-  virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+  virtual QString       getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+
+
+  virtual int           viewManagerId ( const SUIT_ViewManager* ) const = 0;
+  virtual void          viewManagers( const QString&, QList<SUIT_ViewManager*>& ) const = 0;
+  QAction*              action( const int ) const;
 
 signals:
   void                  applicationClosed( SUIT_Application* );
@@ -154,7 +163,6 @@ protected:
   void                  setActionShown( const int, const bool );
 
   static QAction*       separator();
-  QAction*              action( const int ) const;
   int                   actionId( const QAction* ) const;
 
   QList<QAction*>       actions() const;
@@ -163,7 +171,8 @@ protected:
   int                   registerAction( const int, QAction* );
   QAction*              createAction( const int, const QString&, const QIcon&, const QString&,
                                       const QString&, const int, QObject* = 0,
-                                      const bool = false, QObject* = 0, const char* = 0 );
+                                      const bool = false, QObject* = 0, const char* = 0,
+                                     const QString& = QString() );
 
 protected slots:
   virtual void          onDesktopActivated();
@@ -172,6 +181,7 @@ private:
   SUIT_Study*           myStudy;
   SUIT_Desktop*         myDesktop;
   QMap<int, QAction*>   myActionMap;
+  SUIT_ShortcutMgr*     myShortcutMgr;
 
   QLabel*               myStatusLabel;
 };
index 715f3a6fd1df5e5e84ff6a12ca6e1c0c243106b5..99adcc0cdf1afb5168e9cdc4b436184d7c22e7de 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_DataBrowser.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -118,6 +116,27 @@ void SUIT_DataBrowser::setAutoUpdate( const bool on )
     m->setAutoUpdate( on );
 }
 
+/*!
+  \brief Get 'updateModified' flag value.
+  \return 'updateModified' flag value
+*/
+bool SUIT_DataBrowser::updateModified() const
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  return m ? m->updateModified() : false;
+}
+
+/*!
+  \brief Set 'updateModified' flag value.
+  \param on 'updateModified' flag value
+*/
+void SUIT_DataBrowser::setUpdateModified( const bool on )
+{
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  if ( m ) 
+    m->setUpdateModified( on );
+}
+
 /*!
   \brief Update object browser starting from the object \obj;
   open all branches automatically if \a autoOpen is \c true.
@@ -139,29 +158,27 @@ void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
 }
 
 /*!
-  \brief Get current key accelerator used for the 
-  object browser update operation.
+  \brief Get current key accelerator by id.
   \return current key accelerator
-  \sa setUpdateKey(), requestUpdate()
+  \sa setShortcutKey(), requestUpdate(), requestRename()
 */
-int SUIT_DataBrowser::updateKey() const
+int SUIT_DataBrowser::shortcutKey(const int id) const
 {
-  return myShortcut->key();
+  return myShortcutMap.value(id)->key();
 }
 
 /*!
-  \brief Assign the key accelerator to be used for the 
-  object browser update operation.
-
-  By default, \c [F5] key is assigned for the update operation.
-  To disable the accelerator, pass 0 to this method.
-
+  \brief Assign the key accelerator for the shortcut.
+  
+  \param id id of the shortcut
   \param key new key accelerator
-  \sa updateKey(), requestUpdate()
+  \sa shortcutKey(), requestUpdate(), requestRename()
 */
-void SUIT_DataBrowser::setUpdateKey( const int key )
-{
-  myShortcut->setKey( key );
+void SUIT_DataBrowser::setShortcutKey( const int id, const int key )
+{ 
+  ShortcutMap::iterator it = myShortcutMap.find( key );
+  if( it != myShortcutMap.end() )
+    (*it)->setKey(key);
 }
 
 /*!
@@ -193,7 +210,7 @@ void SUIT_DataBrowser::getSelected( DataObjectList& lst ) const
     foreach( idx, sel ) {
       SUIT_DataObject* obj = m->object( idx );
       if ( obj )
-       lst.append( obj );
+        lst.append( obj );
     }
   }
 }
@@ -215,6 +232,18 @@ void SUIT_DataBrowser::setSelected( const SUIT_DataObject* obj, const bool appen
   }
 }
 
+/*!
+  \brief function to sort QModelIndexList with qSort
+*/
+bool modelIndexLessThan(const QModelIndex& lhs, const QModelIndex& rhs)
+{
+  QModelIndex lhs_parent=lhs.parent();
+  QModelIndex rhs_parent=rhs.parent();
+  if(lhs_parent < rhs_parent)return true;
+  if(lhs_parent == rhs_parent) return lhs < rhs;
+  return false;
+}
+
 /*!
   \brief Set list of selected data objects.
   \param lst list of the data object to set selected
@@ -232,12 +261,47 @@ void SUIT_DataBrowser::setSelected( const DataObjectList& lst, const bool append
     foreach( obj, lst ) {
       QModelIndex index = m->index( obj );
       if ( index.isValid() )
-       indexes.append( index );
+        indexes.append( index );
     }
+    qSort(indexes.begin(), indexes.end(), modelIndexLessThan);
+
     select( indexes, true, append ); // if !indexes.isEmpty() ???
   }
 }
 
+/*!
+  \brief Make the view item for specified data object is visible.
+  \param obj data object
+*/
+void SUIT_DataBrowser::ensureVisible( SUIT_DataObject* obj )
+{
+  if ( !obj )
+    return;
+
+  DataObjectList lst;
+  lst.append( obj );
+  ensureVisible( lst );
+}
+
+/*!
+  \brief Make the view items for specified data objects is visible.
+  \param lst data object list
+*/
+void SUIT_DataBrowser::ensureVisible( const DataObjectList& lst )
+{
+  QtxTreeView* tv = treeView();
+  SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
+  if ( !tv || !treeModel )
+    return;
+
+  for ( DataObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    QModelIndex idx = treeModel->index( *it );
+    if ( idx.isValid() )
+      tv->scrollTo( idx );
+  }
+}
+
 /*!
   \brief Add custom actions to the popup menu.
   \param menu popup menu
@@ -309,14 +373,18 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root )
   setModel( m );
   setItemDelegate( qobject_cast<SUIT_ProxyModel*>( model() )->delegate() );
   connect( treeView(), SIGNAL( sortingEnabled( bool ) ), 
-          model(),    SLOT( setSortingEnabled( bool ) ) );
+           model(),    SLOT( setSortingEnabled( bool ) ) );
   connect( treeView(), SIGNAL( clicked( const QModelIndex& ) ), 
-          this,       SLOT( onClicked( const QModelIndex& ) ) );
+           this,       SLOT( onClicked( const QModelIndex& ) ) );
   connect( treeView(), SIGNAL( doubleClicked( const QModelIndex& ) ), 
-          this,       SLOT( onDblClicked( const QModelIndex& ) ) );
+           this,       SLOT( onDblClicked( const QModelIndex& ) ) );
   connect( treeView(), SIGNAL( expanded( const QModelIndex& ) ), 
-          this,       SLOT( onExpanded( const QModelIndex& ) ) );
-  myShortcut = new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) );
+           this,       SLOT( onExpanded( const QModelIndex& ) ) );
+  connect( this      , SIGNAL( requestRename() ),
+          this      , SLOT ( onStartEditing() ));
+
+  myShortcutMap.insert(UpdateShortcut , new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) ) );
+  myShortcutMap.insert(RenameShortcut , new QShortcut( Qt::Key_F2, this, SIGNAL( requestRename() ), SIGNAL( requestRename() ) ) );
 
   myAutoSizeFirstColumn = true;
   myAutoSizeColumns = false;
@@ -329,9 +397,9 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root )
   assigned for the update operation is pressed by the user.
 
   By default, \c [F5] key is assigned for the update operation.
-  The key accelerator can be changed with the setUpdateKey() method.
+  The key accelerator can be changed with the setShortcutKey() method.
 
-  \sa updateKey(), setUpdateKey()
+  \sa shortcutKey(), setShortcutKey()
 */
 
 /*!
@@ -374,7 +442,10 @@ void SUIT_DataBrowser::onClicked( const QModelIndex& index )
 
   if ( m ) {
     SUIT_DataObject* obj = m->object( index );
-    if ( obj ) emit( clicked( obj ) );
+    if ( obj ) { 
+      emit( clicked( obj ) );
+      m->emitClicked(obj, index);
+    }
   }
 }
 
@@ -406,3 +477,15 @@ void SUIT_DataBrowser::onExpanded( const QModelIndex& index )
   }
 }
 
+/*!
+  \brief Make editable selected item in place.
+  \internal
+*/
+void SUIT_DataBrowser::onStartEditing() {
+  DataObjectList sel = getSelected();
+  SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+  if(treeView() && m && sel.count() == 1){
+    treeView()->edit(m->index( sel.first(), SUIT_DataObject::NameId ));
+  }
+}
+
index f619e4ff3b8445a6c4a606ad47adb21fa128fb13..a1905ed251af7f132f5d0f9985908e49aacd8c36 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_DataBrowser.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -40,6 +38,8 @@ public:
   SUIT_DataBrowser( QWidget* = 0 );
   SUIT_DataBrowser( SUIT_DataObject*, QWidget* = 0 );
   ~SUIT_DataBrowser();
+  
+  enum {UpdateShortcut = 0, RenameShortcut};
 
   virtual QString  popupClientType() const;
 
@@ -49,10 +49,13 @@ public:
   bool             autoUpdate() const;
   void             setAutoUpdate( const bool );
 
+  bool             updateModified() const;
+  void             setUpdateModified( const bool );
+
   void             updateTree( SUIT_DataObject* = 0, const bool = true );
 
-  int              updateKey() const;
-  void             setUpdateKey( const int );
+  int              shortcutKey(const int) const;
+  void             setShortcutKey( const int, const int );
 
   DataObjectList   getSelected() const;
   void             getSelected( DataObjectList& ) const;
@@ -66,6 +69,9 @@ public:
   void             setAutoSizeColumns( const bool on );
   void             setResizeOnExpandItem( const bool on );
 
+  void             ensureVisible( SUIT_DataObject* );
+  void             ensureVisible( const DataObjectList& );
+
 protected:
   virtual void     contextMenuEvent( QContextMenuEvent* );
 
@@ -74,6 +80,7 @@ private:
 
 signals:
   void             requestUpdate();
+  void             requestRename();
   void             clicked( SUIT_DataObject* );
   void             doubleClicked( SUIT_DataObject* );
 
@@ -82,9 +89,11 @@ private slots:
   void             onClicked( const QModelIndex& );
   void             onDblClicked( const QModelIndex& );
   void             onExpanded( const QModelIndex& );
+  void             onStartEditing();
 
 private:
-  QShortcut*       myShortcut;
+  typedef          QMap<int, QShortcut*> ShortcutMap;
+  ShortcutMap      myShortcutMap;
 
   bool             myAutoSizeFirstColumn;
   bool             myAutoSizeColumns;
index 7f4f1db88d9a37548efc39583db083c5e10f7ad2..a169442011610280f8963965834ca147c1a4befc 100755 (executable)
@@ -1,29 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_DataObject.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
+#include <QVariant>
+
 #include "SUIT_DataObject.h"
 #include "SUIT_DataObjectKey.h"
+#include <cstdio>
 
 SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
 
@@ -47,7 +51,8 @@ SUIT_DataObject::SUIT_DataObject( SUIT_DataObject* p )
 : myParent( 0 ),
   myOpen( false ),
   myCheck( false ),
-  myAutoDel( true )
+  myAutoDel( true ),
+  _modified( false )
 {
   setParent( p );
   signal()->emitCreated( this );
@@ -280,6 +285,19 @@ void SUIT_DataObject::insertChild( SUIT_DataObject* obj, int position )
   signal()->emitInserted( obj, this );
 }
 
+/*!
+  \brief Insert new child object into the list of the children (faster version of insertChild without signal).
+  \param obj child object being added
+  \param position child position
+*/
+void SUIT_DataObject::insertChildAtPos( SUIT_DataObject* obj, int position )
+{
+  if ( !obj )return;
+  int pos = position < 0 ? myChildren.count() : position;
+  myChildren.insert( qMin( pos, (int)myChildren.count() ), obj );
+  obj->assignParent( this );
+}
+
 /*!
   \brief Remove the specified child object reference.
   \param obj child object being removed
@@ -373,6 +391,14 @@ void SUIT_DataObject::setParent( SUIT_DataObject* p )
     parent()->appendChild( this );
 }
 
+void SUIT_DataObject::assignParent( SUIT_DataObject* p )
+{
+  if ( p == myParent )
+    return;
+
+  myParent = p;
+}
+
 /*!
   \brief Get data object name.
 
@@ -520,6 +546,24 @@ int SUIT_DataObject::alignment( const int /*id*/ ) const
   return Qt::AlignLeft;
 }
 
+bool SUIT_DataObject::expandable() const
+{
+  return true;
+}
+
+/*!
+  \brief Check if the object is visible.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c true (all objects are visible by default).
+
+  \return \c true if this object is displayable or \c false otherwise
+*/
+bool SUIT_DataObject::isVisible() const
+{
+  return true;
+}
+
 /*!
   \brief Check if the object is draggable.
 
@@ -528,23 +572,20 @@ int SUIT_DataObject::alignment( const int /*id*/ ) const
 
   \return \c true if it is possible to drag this object
 */
-bool SUIT_DataObject::isDragable() const
+bool SUIT_DataObject::isDraggable() const
 {
   return false;
 }
 
 /*!
-  \brief Check if the drop operation fo this object is possible.
+  \brief Check if the drop operation for this object is possible.
 
   This method can be re-implemented in the subclasses.
   Default implementation returns \c false (drop operation is not allowed).
 
-  \param obj object being dropped
-  \return \c true if it is possible to drop an object \c obj
-          to this object
+  \return \c true if it is possible to drop one or more objects (currently selected) to this object
 */
-
-bool SUIT_DataObject::isDropAccepted( SUIT_DataObject* /*obj*/ )
+bool SUIT_DataObject::isDropAccepted() const
 {
   return false;
 }
@@ -590,6 +631,32 @@ bool SUIT_DataObject::isCheckable( const int /*id*/ ) const
   return false;
 }
 
+/*!
+  \brief Check if this object is can't be renamed in place
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false (all objects can not be renamed).
+
+  \param id column id
+  \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
+*/
+bool SUIT_DataObject::renameAllowed( const int /*id*/ ) const
+{
+  return false;
+}
+
+/*!
+  \brief Set name of the this object.
+
+  This method can be re-implemented in the subclasses.
+  Default implementation returns \c false.
+
+  \return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool SUIT_DataObject::setName(const QString& /*name*/) {
+  return false;
+}
+
 /*!
   \brief Get the checked state of the object (if it is checkable)
   for the specified column.
@@ -676,7 +743,7 @@ bool SUIT_DataObject::customSorting( const int /*id*/ ) const
   \sa customSorting()
 */
 bool SUIT_DataObject::compare( const QVariant& /*left*/, const QVariant& /*right*/,
-                              const int /*id*/ ) const
+                               const int /*id*/ ) const
 {
   return false;
 }
@@ -806,7 +873,7 @@ SUIT_DataObject::Signal::Signal()
 SUIT_DataObject::Signal::~Signal()
 {
   for ( DataObjectList::Iterator it = myDelLaterObjects.begin();
-       it != myDelLaterObjects.end(); ++it ) {
+        it != myDelLaterObjects.end(); ++it ) {
     delete *it;
   }
   myDelLaterObjects.clear();
@@ -894,7 +961,12 @@ int SUIT_DataObject::groupId() const
 {
   return 0;
 }
-
+/*!
+  \brief return custom data for data object.
+ */
+QVariant SUIT_DataObject::customData(Qtx::CustomDataType /*type*/) {
+  return QVariant();
+}
 /*!
   \fn void SUIT_DataObject::Signal::created( SUIT_DataObject* object );
   \brief Emitted when data object is created.
index 8e06fad064460a5b95932f3567e427e9f0cda3cb..3358c01311765b2e54db67ca23a29f4cf39d80ab 100755 (executable)
@@ -1,32 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_DataObject.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef SUIT_DATAOBJECT_H
 #define SUIT_DATAOBJECT_H
 
 #include "SUIT.h"
 
+#include <Qtx.h>
+
 #include <QList>
 #include <QObject>
 #include <QString>
@@ -42,13 +45,13 @@ typedef QList<SUIT_DataObject*> DataObjectList;
 #pragma warning( disable:4251 )
 #endif
 
-class SUIT_EXPORT SUIT_DataObject  
+class SUIT_EXPORT SUIT_DataObject
 {
 public:
   class Signal;
 
   //! Color role
-  typedef enum { 
+  typedef enum {
     Text,              //!< editor foreground (text) color
     Base,              //!< editor background color
     Foreground,        //!< foreground (text) color
@@ -59,8 +62,9 @@ public:
 
   //! Column id
   enum
-  { 
-    NameId            //!< name column
+  {
+    NameId,          //!< name column
+    VisibilityId     //!< visibility state column
   };
 
   SUIT_DataObject( SUIT_DataObject* = 0 );
@@ -84,7 +88,7 @@ public:
 
   virtual void                children( DataObjectList&, const bool = false ) const;
   virtual DataObjectList      children( const bool = false );
-  
+
   void                        appendChild( SUIT_DataObject* );
   virtual void                insertChild( SUIT_DataObject*, int );
   virtual void                removeChild( SUIT_DataObject*, const bool = false );
@@ -94,6 +98,10 @@ public:
 
   virtual SUIT_DataObject*    parent() const;
   virtual void                setParent( SUIT_DataObject* );
+  virtual void                assignParent( SUIT_DataObject* );
+  void                        insertChildAtPos( SUIT_DataObject* obj, int position );
+  bool                        modified(){return _modified;};
+  void                        setModified(bool modified){_modified = modified;};
 
   virtual QString             name() const;
   virtual QString             text( const int = NameId ) const;
@@ -105,12 +113,16 @@ public:
   virtual QFont               font( const int = NameId ) const;
   virtual int                 alignment( const int = NameId ) const;
 
-  virtual bool                isDragable() const;
-  virtual bool                isDropAccepted( SUIT_DataObject* obj );
+  virtual bool                expandable() const;
+  virtual bool                isVisible() const;
+  virtual bool                isDraggable() const;
+  virtual bool                isDropAccepted() const;
 
   virtual bool                isEnabled() const;
   virtual bool                isSelectable() const;
   virtual bool                isCheckable( const int = NameId ) const;
+  virtual bool                renameAllowed( const int = NameId ) const;
+  virtual bool                setName(const QString& name);
 
   virtual bool                isOn( const int = NameId ) const;
   virtual void                setOn( const bool, const int = NameId );
@@ -123,7 +135,8 @@ public:
   virtual bool                compare( const QVariant&, const QVariant&, const int = NameId ) const;
 
   virtual SUIT_DataObjectKey* key() const;
-  virtual int groupId() const;
+  virtual int                 groupId() const;
+  virtual QVariant            customData(Qtx::CustomDataType /*type*/);
 
   static Signal*              signal();
   static bool                 connect( const char*, QObject*, const char* );
@@ -139,6 +152,7 @@ private:
   bool                        myCheck;
   bool                        myAutoDel;
   DataObjectList              myChildren;
+  bool                        _modified;
 
   static Signal*              mySignal;
 
index 145c0bd71ab0a9bed9c373fb8f06fd56b258af9c..a91ff24583484d9a216d4d15157b4f482f2f27f7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_DataObjectIterator.h"
 
 /*!
@@ -26,8 +27,7 @@
 */
 SUIT_DataObjectIterator::SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot )
 : myRoot( root ),
-myDetourType( det ),
-myCurrentLevel( 0 )
+myDetourType( det )
 {
   if ( myRoot && fromTrueRoot )
     myRoot = myRoot->root();
@@ -64,7 +64,7 @@ void SUIT_DataObjectIterator::operator++()
       if ( myCurrent->myChildren.count() > 0 )
       {
         myCurrent = extreme( myCurrent->myChildren, myDetourType == DepthLeft );
-        myCurrentLevel++;
+        myChildrenIndexes.append(myDetourType == DepthLeft ? 0 : myCurrent->myChildren.size() - 1);
       }
       else do
       {
@@ -77,18 +77,22 @@ void SUIT_DataObjectIterator::operator++()
         }
         else
         {
-          int idx = aParent->myChildren.indexOf( myCurrent );
-          if ( myDetourType == DepthLeft )
-            myCurrent = idx < aParent->myChildren.count() - 1 ? aParent->myChildren[idx + 1] : 0;
-          else
-            myCurrent = idx > 0 ? aParent->myChildren[idx - 1] : 0;
-          if ( !myCurrent )
+          int idx = myChildrenIndexes.last();
+          if (myDetourType == DepthLeft && idx < aParent->myChildren.count() - 1) 
           {
-            myCurrent = aParent;
-            myCurrentLevel--;
+            myChildrenIndexes.last()++;
+            myCurrent = aParent->myChildren[idx + 1];
+            exit = true;
           }
-          else
+          else if (myDetourType == DepthRight && idx > 0) 
+          {
+            myChildrenIndexes.last()--;
+            myCurrent = aParent->myChildren[idx - 1];
             exit = true;
+          } else {
+            myCurrent = aParent;
+            myChildrenIndexes.removeLast();
+          }
         }
       }
       while ( !exit );
@@ -106,7 +110,7 @@ void SUIT_DataObjectIterator::operator++()
           {
             myExtremeChild = extreme( cur->myChildren, myDetourType == BreadthLeft );
             myCurrent = myExtremeChild;
-            myCurrentLevel++;
+            myChildrenIndexes.append(myDetourType == BreadthLeft ? 0 : myCurrent->myChildren.size() - 1);
           }
         }
       }
@@ -129,7 +133,7 @@ SUIT_DataObject* SUIT_DataObjectIterator::current() const
 */
 int SUIT_DataObjectIterator::depth() const
 {
-  return myCurrentLevel;
+  return myChildrenIndexes.size();
 }
 
 /*!
index b17ba2e1b25b0f9be8696649f0f44bda4adab2da..360a816c158b21106b731b2c03ee6f6036822e7c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_DATAOBJECT_ITERATOR_H
 #define SUIT_DATAOBJECT_ITERATOR_H
 
@@ -54,7 +55,9 @@ protected:
 
 private:
   SUIT_DataObject*  myExtremeChild;
-  int               myDetourType, myCurrentLevel;
+  int               myDetourType;
+  ///! Indexes of the iterated children at each level (optimization for avoid indexOf call)
+  QList<int>        myChildrenIndexes;
 };
 
 /*!
index ac17c9152caf61c791bf6a0636ca924c9fbaea86..073cf453ce800929d4cd7b5bcc6c6ca588beba24 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_DataObjectKey.h"
 
 #include <string.h>
index 00ac5ffd2ee787b9918893c6778dba9288d4c239..e3d0030049f8449bd362861a8dc2a8bb0634108d 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_DATAOBJECTKEY_H
 #define SUIT_DATAOBJECTKEY_H
 
index 300a88e7c0295975a0e8b21a08c5fa57d3e25953..4ac93607e055e213f01529fb07a2a3badcfbe584 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_DataOwner.h"
 
 #ifndef WIN32
index 9136041f1d5ba791d34d32d023cb2522ced6f864..3cec827bfa79fa90eff672606872e775fad82503 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_DATAOWNER_H
 #define SUIT_DATAOWNER_H
 
index e7019f4677e70ae6d6d7e7e57333a6ab0fd27427..8b06efc65f31df59c681db1f46a5429627f0888b 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Desktop.h"
 
 #include "SUIT_ViewWindow.h"
@@ -87,7 +88,7 @@ bool SUIT_Desktop::event( QEvent* e )
     break;
   }
 
-  return QMainWindow::event( e );
+  return QtxMainWindow::event( e );
 }
 
 /*!
index ad49bd55e5462240f27173eb38f98ba86e813877..228574800b9b1a0419828026d7e224979b00666d 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_DESKTOP_H
 #define SUIT_DESKTOP_H
 
index 8793c96311c38adb359ac98f5d11c8b1eceee091..9a616557fae7db416aaa076d7a9fe61f84b35d22 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_ExceptionHandler.h"
 
 #include "SUIT_MessageBox.h"
index ccc53e91d275087b2ec687f35570d146f2f02d8a..53922d2c03b4afb9f52cd1c8e1e16d25b32c35ae 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_EXCEPTIONHANDLER_H
 #define SUIT_EXCEPTIONHANDLER_H
 
index a3cb690f339196b6b9bf9aa4a7591ffdd56bfa49..c6cf44fc6665c746348e2a34b2ebfa48f2d9da9b 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_FileDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -39,9 +40,9 @@
   filters << "Image files (*.bmp *.gif *.jpg )" << "All files (*)";
   QString fileName = SUIT_FileDlg::getFileName( desktop(), 
                                                 QString(), 
-                                               filters, 
-                                               "Dump view",
-                                               false );
+                                                filters, 
+                                                "Dump view",
+                                                false );
   if ( !fileName.isEmpty() ) {
     ... writing image to the file 
   }
@@ -51,8 +52,8 @@
   filters << "*.cpp | *.cxx | *.c++" << "*.h | *.hpp | *.hxx";
   QStringList fileNames = SUIT_FileDlg::getOpenFileName( desktop(),
                                                          QString(), 
-                                                        filters, 
-                                                        QString() );
+                                                         filters, 
+                                                         QString() );
   if ( !fileNames.isEmpty() ) {
     ... open files
   }
@@ -79,6 +80,7 @@
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_FileValidator.h"
+#include "Qtx.h"
 
 #include <QDir>
 #include <QEvent>
@@ -90,6 +92,9 @@
 #include <QApplication>
 #include <QListView>
 #include <QLineEdit>
+// GDD
+#include <QUrl>
+#include <QDesktopServices>
 
 /*!
   \brief Defines extension behavior.
@@ -118,11 +123,18 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool
   myQuickButton( 0 ),
   myCheckPermissions( true )
 {
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  
   setModal( modal );
   setSizeGripEnabled( true );
   if ( parent )
     setWindowIcon( parent->windowIcon() );
 
+  // GDD
+  myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation)));
+  myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
+  setSidebarUrls(myUrls);
+
   // add quick directories widgets
   if ( showQuickDir ) {
     myQuickLab    = new QLabel( tr( "LAB_QUICK_PATH" ), this );
@@ -136,15 +148,21 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool
       // retrieve directories list from the resources
       QStringList dirList;
   
-      SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
       if ( resMgr )
-       dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
+        dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts );
 
       if ( dirList.isEmpty() ) 
-       dirList << QDir::homePath();
+        dirList << QDir::homePath();
+
+      // GDD
+      for ( int i = 0; i < dirList.count(); i++ ) {
+        myQuickCombo->addItem( dirList[i] );
+        myUrls.append(QUrl::fromLocalFile(dirList[i]));
+      }
 
-      for ( int i = 0; i < dirList.count(); i++ )
-       myQuickCombo->addItem( dirList[i] );
+      // GDD
+      setSidebarUrls(myUrls);
+      
     }
     else {
       delete myQuickLab;    myQuickLab = 0;
@@ -156,11 +174,16 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool
   setAcceptMode( open ? AcceptOpen: AcceptSave );
   setWindowTitle( open ? tr( "INF_DESK_DOC_OPEN" ) : tr( "INF_DESK_DOC_SAVE" ) );
 
+  bool showCurrentDirInitial = resMgr ? resMgr->booleanValue( "FileDlg", "ShowCurDirInitial", false ) : false;
+
   // If last visited path doesn't exist -> switch to the first preferred path
   if ( !myLastVisitedPath.isEmpty() ) {
     if ( !processPath( myLastVisitedPath ) && showQuickDir )
       processPath( myQuickCombo->itemText( 0 ) );
   }
+  else if ( showCurrentDirInitial ) {
+    processPath( QDir::currentPath() );
+  }
   else if ( showQuickDir ) {
     processPath( myQuickCombo->itemText( 0 ) );
   }
@@ -286,7 +309,7 @@ QStringList SUIT_FileDlg::selectedFiles() const
       QString f = it.next();
       QFileInfo finfo( f );
       if ( !finfo.isDir() )
-       it.setValue( addExtension( f ) );
+        it.setValue( addExtension( f ) );
     }
   }
   return files;
@@ -344,7 +367,7 @@ QLineEdit* SUIT_FileDlg::lineEdit() const
     for ( int i = 0; i < editBoxes.count(); i++ ) {
       int widx = grid->indexOf( editBoxes[ i ] );
       if ( widx >= 0 )
-       idx = qMin( idx, widx );
+        idx = qMin( idx, widx );
     }
     if ( grid->itemAt( idx )  )
       ebox = qobject_cast<QLineEdit*>( grid->itemAt( idx )->widget() );
@@ -378,26 +401,26 @@ bool SUIT_FileDlg::acceptData()
     if ( txt == ".." ) {
       QDir dir = directory();
       if ( dir.cdUp() ) {
-       setDirectory( dir );
-       bool block = lineEdit()->blockSignals( true );
-       lineEdit()->setText( ".." );
-       lineEdit()->selectAll();
-       lineEdit()->setFocus( Qt::OtherFocusReason );
-       lineEdit()->blockSignals( block );
-       return false;
+        setDirectory( dir );
+        bool block = lineEdit()->blockSignals( true );
+        lineEdit()->setText( ".." );
+        lineEdit()->selectAll();
+        lineEdit()->setFocus( Qt::OtherFocusReason );
+        lineEdit()->blockSignals( block );
+        return false;
       }
     }
     else if ( fileMode() != DirectoryOnly ) {
       QStringList fs = txt.split( " ", QString::SkipEmptyParts );
       for ( int i = 0; i < fs.count(); i++ ) {
-       QString wc = fs.at( i );
-       if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) )
-         wc = wc.mid( 1, wc.length()-2 );
-       if ( hasWildCards( wc ) ) {
-         addFilter( wc );
-         lineEdit()->clear();
-         return false;
-       }
+        QString wc = fs.at( i );
+        if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) )
+          wc = wc.mid( 1, wc.length()-2 );
+        if ( hasWildCards( wc ) ) {
+          addFilter( wc );
+          lineEdit()->clear();
+          return false;
+        }
       }
     }
   }
@@ -414,8 +437,8 @@ bool SUIT_FileDlg::acceptData()
     {
       QString fn = files.first();
       if ( validator() ) {
-       bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) : 
-                           validator()->canWriteDir( fn, checkPermissions() );
+        bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) : 
+                            validator()->canWriteDir( fn, checkPermissions() );
       }
       break;
     }
@@ -424,17 +447,17 @@ bool SUIT_FileDlg::acceptData()
       QString fn = files.first();
       QFileInfo info( fn );
       if ( info.isDir() ) {
-       setDirectory( info.absoluteFilePath() );
-       if ( lineEdit() ) {
-         lineEdit()->selectAll();
-         lineEdit()->setFocus( Qt::OtherFocusReason );
-       }
-       return false;
+        setDirectory( info.absoluteFilePath() );
+        if ( lineEdit() ) {
+          lineEdit()->selectAll();
+          lineEdit()->setFocus( Qt::OtherFocusReason );
+        }
+        return false;
       }
       // validation is not required
       if ( validator() ) {
-       bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) : 
-                           validator()->canSave( fn, checkPermissions() );
+        bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) : 
+                            validator()->canSave( fn, checkPermissions() );
       }
       break;
     }
@@ -442,21 +465,21 @@ bool SUIT_FileDlg::acceptData()
   case ExistingFiles: 
     {
       for ( int i = 0; i < files.count(); ++i ) {
-       QFileInfo info( files.at( i ) );
-       if ( info.isDir() ) {
-         setDirectory( info.absoluteFilePath() );
-         if ( lineEdit() ) {
-           lineEdit()->selectAll();
-           lineEdit()->setFocus( Qt::OtherFocusReason );
-         }
-         return false;
-       }
-       if ( validator() ) {
-         bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) : 
-                             validator()->canSave( files.at( i ), checkPermissions() );
-       if ( !bOk )
-         return false;
-       }
+        QFileInfo info( files.at( i ) );
+        if ( info.isDir() ) {
+          setDirectory( info.absoluteFilePath() );
+          if ( lineEdit() ) {
+            lineEdit()->selectAll();
+            lineEdit()->setFocus( Qt::OtherFocusReason );
+          }
+          return false;
+        }
+        if ( validator() ) {
+          bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) : 
+                              validator()->canSave( files.at( i ), checkPermissions() );
+        if ( !bOk )
+          return false;
+        }
       }
       break;
     }
@@ -497,6 +520,9 @@ QString SUIT_FileDlg::addExtension( const QString& fileName ) const
   QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
   int index = r.indexIn( selectedFilter().trimmed() );
 
+  if ( QFileInfo( fileName ).exists() )
+    return fileName; // if file exists return as is
+
   if ( index >= 0 ) {            
     // Create wildcard regular expression basing on selected filter 
     // in order to validate a file extension.
@@ -553,16 +579,16 @@ bool SUIT_FileDlg::processPath( const QString& path )
     QFileInfo fi( path );
     if ( fi.exists() ) {
       if ( fi.isFile() )
-       selectFile( path );
+        selectFile( path );
       else if ( fi.isDir() )
-       setDirectory( path );
-      return true;
-    }
-    else if ( QFileInfo( SUIT_Tools::dir( path ) ).exists() ) {
-      setDirectory( SUIT_Tools::dir( path ) );
-      selectFile( path );
+        setDirectory( path );
       return true;
     }
+    QString dirPath = SUIT_Tools::dir( path, false );
+    if ( !dirPath.isEmpty() && QFileInfo( dirPath ).exists() )
+      setDirectory( dirPath );
+    selectFile( SUIT_Tools::file( path ) );
+    return true;
   }
   return false;
 }
@@ -636,18 +662,18 @@ void SUIT_FileDlg::addQuickDir()
 
     SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
     if ( resMgr )
-      dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
+      dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts );
 
     bool found = false;
     bool emptyAndHome = false;
     if ( dirList.count() > 0 ) {
       for ( int i = 0; i < dirList.count() && !found; i++ )  {
-       QDir aDir( dirList[i] );
-       if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() ||
-            !aDir.canonicalPath().isNull() && aDir.exists() && 
-            aDir.canonicalPath() == dir.canonicalPath() ) {
-         found = true;
-       }
+        QDir aDir( dirList[i] );
+        if ( ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() ) ||
+             ( !aDir.canonicalPath().isNull() && aDir.exists() &&  
+             aDir.canonicalPath() == dir.canonicalPath() ) ) {
+          found = true;
+        }
       }
     }
     else {
@@ -656,9 +682,13 @@ void SUIT_FileDlg::addQuickDir()
 
     if ( !found ) {
       dirList.append( dp );
-      resMgr->setValue( "FileDlg", QString( "QuickDirList" ), dirList.join( ";" ) );
-      if ( !emptyAndHome )
-       myQuickCombo->addItem( dp );
+      resMgr->setValue( "FileDlg", "QuickDirList", dirList.join( ";" ) );
+      // GDD
+      if ( !emptyAndHome ) {
+        myQuickCombo->addItem( dp );
+        myUrls.append(QUrl::fromLocalFile( dp ));
+        setSidebarUrls(myUrls);
+      }
     }
   }
 }
@@ -673,11 +703,11 @@ void SUIT_FileDlg::polish()
   int maxBtnWidth = 0;
 
   for ( QList<QPushButton*>::const_iterator it = buttons.begin(); 
-       it != buttons.end(); ++it )
+        it != buttons.end(); ++it )
     maxBtnWidth = qMax( maxBtnWidth, (*it)->sizeHint().width() );
 
   for ( QList<QPushButton*>::const_iterator it = buttons.begin(); 
-       it != buttons.end(); ++it ) {
+        it != buttons.end(); ++it ) {
     (*it)->setDefault( false );
     (*it)->setAutoDefault( false );
     (*it)->setFixedWidth( maxBtnWidth );
@@ -685,7 +715,7 @@ void SUIT_FileDlg::polish()
 
   QList<QListView*> views = findChildren<QListView*>();
   for ( QList<QListView*>::const_iterator it = views.begin(); 
-       it != views.end(); ++it ) {
+        it != views.end(); ++it ) {
     (*it)->setViewMode( QListView::ListMode );
   }
 }
@@ -725,8 +755,8 @@ void SUIT_FileDlg::polish()
   \sa getOpenFileNames(), getExistingDirectory()
 */
 QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, 
-                                  const QStringList& filters, const QString& caption, 
-                                  const bool open, const bool showQuickDir,
+                                   const QStringList& filters, const QString& caption, 
+                                   const bool open, const bool showQuickDir,
                                    SUIT_FileValidator* validator )
 {            
   SUIT_FileDlg fd( parent, open, showQuickDir, true );    
@@ -798,12 +828,12 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial,
   \sa getOpenFileNames(), getExistingDirectory()
 */
 QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, 
-                                  const QString& filters, const QString& caption, 
-                                  const bool open, const bool showQuickDir,
+                                   const QString& filters, const QString& caption, 
+                                   const bool open, const bool showQuickDir,
                                    SUIT_FileValidator* validator )
 {
   return getFileName( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), 
-                     caption, open, showQuickDir, validator );
+                      caption, open, showQuickDir, validator );
 }
 
 /*!
@@ -836,9 +866,9 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial,
   \sa getFileName(), getExistingDirectory()
 */
 QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
-                                           const QStringList& filters, const QString& caption,
-                                           const bool showQuickDir, 
-                                           SUIT_FileValidator* validator )
+                                            const QStringList& filters, const QString& caption,
+                                            const bool showQuickDir, 
+                                            SUIT_FileValidator* validator )
 {            
   SUIT_FileDlg fd( parent, true, showQuickDir, true );
 
@@ -900,12 +930,12 @@ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& init
   \sa getFileName(), getExistingDirectory()
 */
 QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
-                                           const QString& filters, const QString& caption,
-                                           const bool showQuickDir,
-                                           SUIT_FileValidator* validator )
+                                            const QString& filters, const QString& caption,
+                                            const bool showQuickDir,
+                                            SUIT_FileValidator* validator )
 {
   return getOpenFileNames( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), 
-                          caption, showQuickDir, validator );
+                           caption, showQuickDir, validator );
 }
 
 /*!
@@ -935,7 +965,7 @@ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& init
 */
 QString SUIT_FileDlg::getExistingDirectory( QWidget* parent, const QString& initial,
                                             const QString& caption, const bool showQuickDir,
-                                           SUIT_FileValidator* validator )
+                                            SUIT_FileValidator* validator )
 {
   SUIT_FileDlg fd( parent, true, showQuickDir, true );
 
@@ -981,5 +1011,6 @@ QString SUIT_FileDlg::getLastVisitedPath()
 void SUIT_FileDlg::selectFile( const QString& f )
 {
   QFileDialog::selectFile( QFileInfo( f ).baseName() );
-  setDirectory( QFileInfo( f ).absoluteDir() );
+  if ( !Qtx::dir( f, false ).isEmpty() )
+    setDirectory( QFileInfo( f ).absolutePath() );
 }
index 2e0d02d99f851edfe1a5e8673522282d0e85e84a..df902f67a8d9b71d3f635b93794f1acd745611eb 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_FileDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -33,6 +34,7 @@ class QLabel;
 class QLineEdit;
 class QComboBox;
 class QPushButton;
+class QUrl;
 class SUIT_FileValidator;
 
 class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
@@ -61,38 +63,38 @@ public:
   static QString      getLastVisitedDirectory();
 
   static QString      getFileName( QWidget*, 
-                                  const QString&, 
-                                  const QStringList&, 
-                                  const QString& = QString(), 
-                                  const bool = true, 
-                                  const bool = true,
+                                   const QString&, 
+                                   const QStringList&, 
+                                   const QString& = QString(), 
+                                   const bool = true, 
+                                   const bool = true,
                                    SUIT_FileValidator* = 0 );
   static QString      getFileName( QWidget*, 
-                                  const QString&, 
-                                  const QString&,
-                                  const QString& = QString(), 
-                                  const bool = true,
-                                  const bool = true,
+                                   const QString&, 
+                                   const QString&,
+                                   const QString& = QString(), 
+                                   const bool = true,
+                                   const bool = true,
                                    SUIT_FileValidator* = 0 );
 
   static QStringList  getOpenFileNames( QWidget*, 
-                                       const QString&,
-                                       const QStringList&, 
-                                       const QString& = QString(),
-                                       const bool = true, 
-                                       SUIT_FileValidator* = 0 );
+                                        const QString&,
+                                        const QStringList&, 
+                                        const QString& = QString(),
+                                        const bool = true, 
+                                        SUIT_FileValidator* = 0 );
   static QStringList  getOpenFileNames( QWidget*, 
-                                       const QString&,
-                                       const QString&, 
-                                       const QString& = QString(),
-                                       const bool = true, 
-                                       SUIT_FileValidator* = 0 );
+                                        const QString&,
+                                        const QString&, 
+                                        const QString& = QString(),
+                                        const bool = true, 
+                                        SUIT_FileValidator* = 0 );
 
   static QString      getExistingDirectory( QWidget*, 
-                                           const QString&,
+                                            const QString&,
                                             const QString& = QString(), 
-                                           const bool = true,
-                                           SUIT_FileValidator* = 0 );
+                                            const bool = true,
+                                            SUIT_FileValidator* = 0 );
 
   static QString      getLastVisitedPath();
 
@@ -117,6 +119,7 @@ private:
   SUIT_FileValidator* myValidator;        //!< file validator
   QLabel*             myQuickLab;         //!< quick dir combo box
   QComboBox*          myQuickCombo;       //!< quick dir combo box
+  QList<QUrl>         myUrls;             //!< quick dir Sidebar Urls
   QPushButton*        myQuickButton;      //!< quick dir add button
   bool                myCheckPermissions; //!< check permissions option
   static QString      myLastVisitedPath;  //!< last visited path
index d2afda00ed9c4f00d25d96294bfa3d0698eb7726..cbe7250cd527a233bdb1d93ed89f77a3dbc5493c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_FileValidator.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -60,13 +61,13 @@ bool SUIT_FileValidator::canOpen( const QString& fileName, bool checkPermission
   if ( !QFile::exists( fileName ) ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) );
+                                 QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) );
     return false;
   }
   if ( checkPermission && !QFileInfo( fileName ).isReadable() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+                                 QObject::tr( "ERR_OPEN_PERMISSION_DENIED" ).arg( fileName ) );
     return false; 
   }
   return true;
@@ -91,24 +92,29 @@ bool SUIT_FileValidator::canSave( const QString& fileName, bool checkPermission
   if ( QFile::exists( fileName ) ) {
     if ( parent() )
       if ( SUIT_MessageBox::question( parent(), QObject::tr( "WRN_WARNING" ),
-                                     QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ),
-                                     SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                     SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
-       return false;
+                                      QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ),
+                                      SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                      SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+        return false;
     
     if ( checkPermission && !QFileInfo( fileName ).isWritable() ) {
       if ( parent() ) 
-       SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ),
-                                  QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+        SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ),
+                                   QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
       return false; 
     }
   }
   else {
     QString dirName = SUIT_Tools::dir( fileName );
+    if ( !QFile::exists( dirName ) ) {
+      SUIT_MessageBox::critical( parent(), QObject::tr( "WRN_WARNING" ),
+                                 QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+      return false;
+    }
     if ( checkPermission && !QFileInfo( dirName ).isWritable() ) {
       if ( parent() )
-       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                  QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+        SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+                                   QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
       return false;
     }
   }
@@ -132,19 +138,19 @@ bool SUIT_FileValidator::canReadDir( const QString& dirName, bool checkPermissio
   if ( !info.exists() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+                                 QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
     return false;
   }
   if ( !info.isDir() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+                                 QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
     return false;
   }
   if ( checkPermission && !info.isReadable() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+                                 QObject::tr( "ERR_DIR_READ_PERMISSION_DENIED" ).arg( dirName ) );
     return false; 
   }
   return true;
@@ -167,19 +173,19 @@ bool SUIT_FileValidator::canWriteDir( const QString& dirName, bool checkPermissi
   if ( !info.exists() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+                                 QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
     return false;
   }
   if ( !info.isDir() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+                                 QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
     return false;
   }
   if ( checkPermission && !info.isWritable() ) {
     if ( parent() )
       SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
-                                QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+                                 QObject::tr( "ERR_DIR_WRITE_PERMISSION_DENIED" ).arg( dirName ) );
     return false; 
   }
   return true;
index 2f1c06ae842fda8bcc0c224062b520becc00dd21..4f94827f287d0194063d35ab4621f1a632fda9a7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_FileValidator.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index 08358f5ea04cf77d38a8ded8ca675478e0d07de3..e95319c1ee134045998f6e085acce5420f7a15a9 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_LicenseDlg.h"
 
 #include <QApplication>
@@ -50,10 +48,10 @@ SUIT_LicenseDlg::SUIT_LicenseDlg( bool firstShow, QWidget* parent, const char* n
   setObjectName( name );
   setModal( modal );
   QString env;
-  if ( ::getenv( "TRIPOLI_ROOT_DIR" ) )
-    env = ::getenv( "TRIPOLI_ROOT_DIR" );
+  if ( ::getenv( "SALOME_LICENSE_FILE" ) )
+    env = ::getenv( "SALOME_LICENSE_FILE" );
  
-  QFile file( env + "/share/salome/resources/License.txt" ); // Read the text from a file
+  QFile file( env ); // Read the text from a file
   
   if ( !file.exists() || !file.open( QIODevice::ReadOnly ) )
     return;
@@ -108,8 +106,8 @@ SUIT_LicenseDlg::SUIT_LicenseDlg( bool firstShow, QWidget* parent, const char* n
 }
 
 /*!
-       Name: ~SUIT_LicenseDlg [public]
-       Desc: Destructor
+        Name: ~SUIT_LicenseDlg [public]
+        Desc: Destructor
 */
 
 SUIT_LicenseDlg::~SUIT_LicenseDlg()
@@ -175,20 +173,20 @@ void SUIT_LicenseDlg::onPrint()
 
     // convert text to rich text format
     QString aFormattedText = Qt::convertFromPlainText( myTextEdit->toPlainText() );
-       
+        
     QTextDocument aRichText( aFormattedText );
     aRichText.setDefaultFont( aBodyFont );
 
 
     /*QSimpleRichText aRichText( aFormattedText,
-                              aBodyFont,
-                              myTextEdit->context(),
-                              myTextEdit->styleSheet(),
-                              myTextEdit->mimeSourceFactory(),
-                              aBody.height() );
+                               aBodyFont,
+                               myTextEdit->context(),
+                               myTextEdit->styleSheet(),
+                               myTextEdit->mimeSourceFactory(),
+                               aBody.height() );
     */
     aRichText.setPageSize( QSize( aBody.width(), aRichText.pageSize().height() ) );
-       //aRichText.setWidth( &aPainter, aBody.width() );
+        //aRichText.setWidth( &aPainter, aBody.width() );
     
     QRect aView( aBody );
     
@@ -197,7 +195,7 @@ void SUIT_LicenseDlg::onPrint()
     do {
       // print page text
       aRichText.drawContents( &aPainter, aView );
-         //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() );
+          //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() );
       aView.translate( 0, aBody.height() );
       aPainter.translate( 0 , -aBody.height() );
       
@@ -206,10 +204,10 @@ void SUIT_LicenseDlg::onPrint()
       aPainter.setFont(aFooterFont);
       QString aFooter = QString("Page ") + QString::number(aPageIndex);
       aPainter.drawText( aView.right() - aPainter.fontMetrics().width( aFooter ),
-                        aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter );
+                         aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter );
       
       if ( aView.top() >= aRichText.size().height() )
-       break;
+        break;
       aPrinter.newPage();
       aPageIndex++;
     } while (true);
index cc9e79fbb7c0de43eab7ea8a3a383e8675d7b910..eba78b9b141f53ff6734216fde280c1f47b1b855 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_LICENSEDLG_H
 #define SUIT_LICENSEDLG_H
 
index 46dfe4f730160a5f9ab58f263a187e416a0424c5..3bdf5f21cb0680f7468083957a0a888da63361fb 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_MessageBox.h"
 
 #include "SUIT_OverrideCursor.h"
@@ -63,8 +64,8 @@
   // show question message box with two standard buttons
   int result = SUIT_MessageBox::question(desktop(), "Error",
                                          "File already exists? Overwrite?",
-                                        SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                        SUIT_MessageBox::No );
+                                         SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                         SUIT_MessageBox::No );
   if ( result == SUIT_MessageBox::Yes )
     overwriteFileFunction();
 
@@ -72,7 +73,7 @@
   // default is second button and escape is third button
   int result = SUIT_MessageBox::critical(desktop(), "Hazard!",
                                          "The situation is critical! What to do?",
-                                        "Hide", "Run Away", "Stand still", 1, 2);
+                                         "Hide", "Run Away", "Stand still", 1, 2);
   switch ( result )
   {
   case 0:
@@ -89,8 +90,8 @@
   // both default and escape buttons are set to first button ("Zero")
   int result = SUIT_MessageBox::information(desktop(), "Question",
                                             "Select your favourite number",
-                                           0, 0,
-                                           "Zero", "One", "Two", "Three", "Four", "Five");
+                                            0, 0,
+                                            "Zero", "One", "Two", "Three", "Four", "Five");
   useMyFavouriteNumberSomewhere( result );
   \endcode
 */
@@ -230,7 +231,7 @@ SUIT_MessageBox::StandardButton SUIT_MessageBox::question( QWidget* parent, cons
   \return button id clicked by the user (QMessageBox::StandardButton)
 */
 int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button )
+                               const QString& button )
 {
   ButtonInfos lst;
   lst.append( ButtonInfo( 0, button ) );
@@ -251,7 +252,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   \return button id clicked by the user (QMessageBox::StandardButton)
 */
 int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
-                             const QString& button )
+                              const QString& button )
 {
   ButtonInfos lst;
   lst.append( ButtonInfo( 0, button ) );
@@ -272,7 +273,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   \return button id clicked by the user (QMessageBox::StandardButton)
 */
 int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button )
+                                  const QString& button )
 {
   ButtonInfos lst;
   lst.append( ButtonInfo( 0, button ) );
@@ -298,7 +299,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   \return button id clicked by the user (QMessageBox::StandardButton)
 */
 int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button )
+                               const QString& button )
 {
   ButtonInfos lst;
   lst.append( ButtonInfo( 0, button ) );
@@ -329,15 +330,15 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
   lst.append( ButtonInfo( id++, button1 ) );
   lst.append( ButtonInfo( id++, button2 ) );
   return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -364,15 +365,15 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
-                             const QString& button1, const QString& button2,
-                             const int defaultButton, const int escapeButton )
+                              const QString& button1, const QString& button2,
+                              const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
   lst.append( ButtonInfo( id++, button1 ) );
   lst.append( ButtonInfo( id++, button2 ) );
   return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -399,15 +400,15 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   \return button used button id
 */
 int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2,
-                                 const int defaultButton, const int escapeButton )
+                                  const QString& button1, const QString& button2,
+                                  const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
   lst.append( ButtonInfo( id++, button1 ) );
   lst.append( ButtonInfo( id++, button2 ) );
   return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -434,15 +435,15 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   \return button used button id
 */
 int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
   lst.append( ButtonInfo( id++, button1 ) );
   lst.append( ButtonInfo( id++, button2 ) );
   return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -470,9 +471,9 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2, 
-                              const QString& button3,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2, 
+                               const QString& button3,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -480,7 +481,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   lst.append( ButtonInfo( id++, button2 ) );
   lst.append( ButtonInfo( id++, button3 ) );
   return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -508,9 +509,9 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
-                             const QString& button1, const QString& button2,
-                             const QString& button3,
-                             const int defaultButton, const int escapeButton )
+                              const QString& button1, const QString& button2,
+                              const QString& button3,
+                              const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -518,7 +519,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   lst.append( ButtonInfo( id++, button2 ) );
   lst.append( ButtonInfo( id++, button3 ) );
   return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -546,9 +547,9 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   \return button used button id
 */
 int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2,
-                                 const QString& button3,
-                                 const int defaultButton, const int escapeButton )
+                                  const QString& button1, const QString& button2,
+                                  const QString& button3,
+                                  const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -556,7 +557,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   lst.append( ButtonInfo( id++, button2 ) );
   lst.append( ButtonInfo( id++, button3 ) );
   return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -584,9 +585,9 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   \return button used button id
 */
 int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2,
-                              const QString& button3,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2,
+                               const QString& button3,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -594,7 +595,7 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   lst.append( ButtonInfo( id++, button2 ) );
   lst.append( ButtonInfo( id++, button3 ) );
   return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -624,9 +625,9 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2, 
-                              const QString& button3, const QString& button4,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2, 
+                               const QString& button3, const QString& button4,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -635,7 +636,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   lst.append( ButtonInfo( id++, button3 ) );
   lst.append( ButtonInfo( id++, button4 ) );
   return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -665,9 +666,9 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
-                             const QString& button1, const QString& button2, 
-                             const QString& button3, const QString& button4,
-                             const int defaultButton, const int escapeButton )
+                              const QString& button1, const QString& button2, 
+                              const QString& button3, const QString& button4,
+                              const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -676,7 +677,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   lst.append( ButtonInfo( id++, button3 ) );
   lst.append( ButtonInfo( id++, button4 ) );
   return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -706,9 +707,9 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   \return button used button id
 */
 int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2, 
-                                 const QString& button3, const QString& button4,
-                                 const int defaultButton, const int escapeButton )
+                                  const QString& button1, const QString& button2, 
+                                  const QString& button3, const QString& button4,
+                                  const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -717,7 +718,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   lst.append( ButtonInfo( id++, button3 ) );
   lst.append( ButtonInfo( id++, button4 ) );
   return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -747,9 +748,9 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   \return button used button id
 */
 int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
-                              const QString& button1, const QString& button2, 
-                              const QString& button3, const QString& button4,
-                              const int defaultButton, const int escapeButton )
+                               const QString& button1, const QString& button2, 
+                               const QString& button3, const QString& button4,
+                               const int defaultButton, const int escapeButton )
 {
   ButtonInfos lst;
   int id = 0;
@@ -758,7 +759,7 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   lst.append( ButtonInfo( id++, button3 ) );
   lst.append( ButtonInfo( id++, button4 ) );
   return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, 
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -789,14 +790,14 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, 
-                              const int defaultButton, const int escapeButton, 
-                              char* btn, ... )
+                               const int defaultButton, const int escapeButton, 
+                               char* btn, ... )
 {
   va_list args;
   va_start( args, btn );
   return messageBox( SUIT_MessageBox::Critical, parent, title, text,
                      messageList( btn, args ),
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -827,14 +828,14 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr
   \return button used button id
 */
 int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, 
-                             const int defaultButton, const int escapeButton, 
-                             char* btn, ... )
+                              const int defaultButton, const int escapeButton, 
+                              char* btn, ... )
 {
   va_list args;
   va_start( args, btn );
   return messageBox( SUIT_MessageBox::Warning, parent, title, text,
                      messageList( btn, args ),
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -865,14 +866,14 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri
   \return button used button id
 */
 int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, 
-                                 const int defaultButton, const int escapeButton, 
-                                 char* btn, ... )
+                                  const int defaultButton, const int escapeButton, 
+                                  char* btn, ... )
 {
   va_list args;
   va_start( args, btn );
   return messageBox( SUIT_MessageBox::Information, parent, title, text,
                      messageList( btn, args ),
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -903,14 +904,14 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q
   \return button used button id
 */
 int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, 
-                              const int defaultButton, const int escapeButton, 
-                              char* btn, ... )
+                               const int defaultButton, const int escapeButton, 
+                               char* btn, ... )
 {
   va_list args;
   va_start( args, btn );
   return messageBox( SUIT_MessageBox::Question, parent, title, text,
                      messageList( btn, args ),
-                    defaultButton, escapeButton );
+                     defaultButton, escapeButton );
 }
 
 /*!
@@ -950,10 +951,10 @@ SUIT_MessageBox::ButtonInfos SUIT_MessageBox::messageList( char* txt, va_list& a
   \return button used button id
 */
 int SUIT_MessageBox::messageBox( Icon icon, QWidget* parent, 
-                                const QString& title, const QString& text, 
-                                const ButtonInfos& lst, 
-                                const int defaultButton, 
-                                const int escapeButton )
+                                 const QString& title, const QString& text, 
+                                 const ButtonInfos& lst, 
+                                 const int defaultButton, 
+                                 const int escapeButton )
 {
   SUIT_MessageBox msgBox( icon, title, text, NoButton, parent );
 
@@ -967,9 +968,9 @@ int SUIT_MessageBox::messageBox( Icon icon, QWidget* parent,
     QPushButton* pb = msgBox.addButton( txt, role );
     bm.insert( pb, btn );
 
-    if ( defaultButton == -1 && i == 0 || btn == defaultButton )
+    if ( ( defaultButton == -1 && i == 0 ) || btn == defaultButton )
       msgBox.setDefaultButton( pb );
-    if ( escapeButton == -1 && i == lst.count() - 1 || btn == escapeButton )
+    if ( ( escapeButton == -1 && i == lst.count() - 1 ) || btn == escapeButton )
       msgBox.setEscapeButton( pb );
   }
     
index 6fb2e5164811aee3ecd22e46291bfcc8f9d09642..06c1a72c2e4cd1ea36ffc970ddec8ac17d32811e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_MESSAGEBOX_H
 #define SUIT_MESSAGEBOX_H
 
@@ -53,81 +54,81 @@ public:
   
   // message boxes with one custom button
   static int            critical( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button );
+                                  const QString& button );
   static int            warning( QWidget* parent, const QString& title, const QString& text,
-                                const QString& button );
+                                 const QString& button );
   static int            information( QWidget* parent, const QString& title, const QString& text,
-                                    const QString& button );
+                                     const QString& button );
   static int            question( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button );
+                                  const QString& button );
 
   // message boxes with two custom buttons
   static int            critical( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2, 
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2, 
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   static int            warning( QWidget* parent, const QString& title, const QString& text,
-                                const QString& button1, const QString& button2, 
-                                const int defaultButton = -1, const int escapeButton = -1 );
+                                 const QString& button1, const QString& button2, 
+                                 const int defaultButton = -1, const int escapeButton = -1 );
   static int            information( QWidget* parent, const QString& title, const QString& text,
-                                    const QString& button1, const QString& button2, 
-                                    const int defaultButton = -1, const int escapeButton = -1 );
+                                     const QString& button1, const QString& button2, 
+                                     const int defaultButton = -1, const int escapeButton = -1 );
   static int            question( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2, 
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2, 
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   
   // message boxes with three custom buttons
   static int            critical( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2, const QString& button3,
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2, const QString& button3,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   static int            warning( QWidget* parent, const QString& title, const QString& text,
-                                const QString& button1, const QString& button2, const QString& button3,
-                                const int defaultButton = -1, const int escapeButton = -1 );
+                                 const QString& button1, const QString& button2, const QString& button3,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
   static int            information( QWidget* parent, const QString& title, const QString& text,
-                                    const QString& button1, const QString& button2, const QString& button3,
-                                    const int defaultButton = -1, const int escapeButton = -1 );
+                                     const QString& button1, const QString& button2, const QString& button3,
+                                     const int defaultButton = -1, const int escapeButton = -1 );
   static int            question( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2, const QString& button3,
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2, const QString& button3,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   
   // message boxes with four custom buttons
   static int            critical( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2,
-                                 const QString& button3, const QString& button4,
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2,
+                                  const QString& button3, const QString& button4,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   static int            warning( QWidget* parent, const QString& title, const QString& text,
-                                const QString& button1, const QString& button2,
-                                const QString& button3, const QString& button4,
-                                const int defaultButton = -1, const int escapeButton = -1 );
+                                 const QString& button1, const QString& button2,
+                                 const QString& button3, const QString& button4,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
   static int            information( QWidget* parent, const QString& title, const QString& text,
-                                    const QString& button1, const QString& button2,
-                                    const QString& button3, const QString& button4,
-                                    const int defaultButton = -1, const int escapeButton = -1 );
+                                     const QString& button1, const QString& button2,
+                                     const QString& button3, const QString& button4,
+                                     const int defaultButton = -1, const int escapeButton = -1 );
   static int            question( QWidget* parent, const QString& title, const QString& text,
-                                 const QString& button1, const QString& button2,
-                                 const QString& button3, const QString& button4,
-                                 const int defaultButton = -1, const int escapeButton = -1 );
+                                  const QString& button1, const QString& button2,
+                                  const QString& button3, const QString& button4,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
   
   // message boxes with arbitrary number of buttons
   static int            critical( QWidget* parent, const QString& title, const QString& text, 
-                                 const int defaultButton, const int escapeButton, 
-                                 char*, ... );
+                                  const int defaultButton, const int escapeButton, 
+                                  char*, ... );
   static int            warning( QWidget* parent, const QString& title, const QString& text,
-                                const int defaultButton, const int escapeButton, 
-                                char*, ... );
+                                 const int defaultButton, const int escapeButton, 
+                                 char*, ... );
   static int            information( QWidget* parent, const QString& title, const QString& text,
-                                    const int defaultButton, const int escapeButton, 
-                                    char*, ... );
+                                     const int defaultButton, const int escapeButton, 
+                                     char*, ... );
   static int            question( QWidget* parent, const QString& title, const QString& text,
-                                 const int defaultButton, const int escapeButton, 
-                                 char*, ... );
+                                  const int defaultButton, const int escapeButton, 
+                                  char*, ... );
 
 private:
   class ButtonInfo
   {
   public:
     ButtonInfo( const int id, 
-               const QString& text, 
-               const ButtonRole role = ActionRole )
+                const QString& text, 
+                const ButtonRole role = ActionRole )
       : myId( id ), myText( text ), myRole( role ) {}
     int        id()   const { return myId;   }
     QString    text() const { return myText; }
@@ -142,10 +143,10 @@ private:
 
 private:
   static int          messageBox( SUIT_MessageBox::Icon icon, QWidget* parent, 
-                                 const QString& title, const QString& text, 
-                                 const ButtonInfos& lst, 
-                                 const int defaultButton = -1, 
-                                 const int escapeButton  = -1 );
+                                  const QString& title, const QString& text, 
+                                  const ButtonInfos& lst, 
+                                  const int defaultButton = -1, 
+                                  const int escapeButton  = -1 );
   static ButtonInfos  messageList( char*, va_list& );
 };
 
index 3088a5c4f2cab1aa6c92073f37e618153e0d379f..c215d9a4f80c9ff9c0ae84b5278cd404ee55854c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Operation.h"
 
 #include "SUIT_Study.h"
index 1137949c46bbc731c3598238509fcd13ddd9c796..5076b2ffcec18e88325947a2474d97e5f53f7999 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_OPERATION_H
 #define SUIT_OPERATION_H
 
index d5718b729a5a050fc86484e84e630c3d3c25e8aa..307f8d68963b8866ca64e7ffd121ab6e367dbd76 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_OverrideCursor.h"
 
 #include <QApplication>
index 95e56c1afc98ebe136217865c7e97027ae0c1c96..498e190273ccd80ab933b83d3090066c9cbcdb30 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_OVERRIDECURSOR_H
 #define SUIT_OVERRIDECURSOR_H
 
index 5f79a5352c5096dbcd358beee877bb1cfccf13ca..033370e1dd4977dae83823c9381e735fa09642e9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_PopupClient.h"
 
 /*! constructor. initialize mySignal.*/
index eab6c722326650df16b3bc383f5c132f10cb91fb..4d1291d1b4469a3a5422c546be7630eae541df19 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_POPUPCLIENT_H
 #define SUIT_POPUPCLIENT_H
 
index 512fdafa0b6a09a589ca3ba0b6f5a457e57a24d7..d6286ac8bf4ad2bc416f969433c7d5101c585736 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      SUIT_PreferenceMgr.cxx
 // Author:    Sergey TELKOV
 //
@@ -132,6 +130,9 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId,
   case Integer:
     item = new QtxPagePrefEditItem( QtxPagePrefEditItem::Integer, title, parent, sect, param );
     break;
+  case Slider:
+    item = new QtxPagePrefSliderItem( title, parent, sect, param );
+    break;
   case GroupBox:
     item = new QtxPagePrefGroupItem( title, parent, sect, param );
     break;
@@ -150,6 +151,21 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId,
   case DirList:
     item = new QtxPagePrefPathListItem( Qtx::PT_Directory, title, parent, sect, param );
     break;
+  case Shortcut:
+    item = new QtxPagePrefShortcutBtnsItem( title, parent, sect, param );
+    break;
+  case ShortcutTree:
+    item = new QtxPagePrefShortcutTreeItem( title, parent, sect, param );
+    break;
+  case BiColor:
+    item = new QtxPagePrefBiColorItem( title, parent, sect, param );
+    break;
+  case Background:
+    item = new QtxPagePrefBackgroundItem( title, parent, sect, param );
+    break;
+  case UserDefined:
+    item = new QtxUserDefinedItem(parent);
+    break;
   }
 
   return item ? item->id() : -1;
index f6987252f134e3e5ba3546e712761589b022cf5b..a699c47c465af10b8413f890e629a06722328af6 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      SUIT_PreferenceMgr.h
 // Author:    Sergey TELKOV
 //
@@ -39,7 +37,9 @@ class SUIT_EXPORT SUIT_PreferenceMgr : public QtxPagePrefMgr
 public:
   typedef enum { Auto, Space, Bool, Color, String, Selector,
                  DblSpin, IntSpin, Double, Integer,
-                 GroupBox, Tab, Frame, Font, DirList, File } PrefItemType;
+                 GroupBox, Tab, Frame, Font, DirList, File,
+                Slider, Shortcut, ShortcutTree, BiColor, Background,            
+                 UserDefined = 1000 } PrefItemType;
 
 public:
   SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );
index f134e733279e4edfa421c3faa0cadf05885088b1..b2fa90dcf41cb6f1db3fd78c729bcdfb33bfafca 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_ResourceMgr.h"
 
 #include <QDir>
@@ -115,33 +116,59 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
 */
 QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const
 {
-  QDir d( QFileInfo( fname ).dir() );
-  d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
-  QStringList l = d.entryList();
   QString appr_file;
-  int id0 = userFileId( fname ), id, appr=-1;
-  if( id0<0 )
+
+  // calculate default file id from user file name
+  long id0 = userFileId( fname );
+  if ( id0 < 0 ) // can't calculate file id from user file name, no further processing
     return appr_file;
 
-  for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
-  {
-    id = userFileId( *anIt );
-    if( id<0 )
-      continue;
+  long id, appr = -1;
+
+  // get all files from the same dir where use file is (should be) situated
+  QDir d( QFileInfo( fname ).dir() );
+  if ( d.exists() ) {
+    d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
+    QStringList l = d.entryList();
+    for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
+    {
+      id = userFileId( *anIt );
+      if ( id < 0 )
+       continue;
+      if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
+      {
+       appr = id;
+       appr_file = d.absoluteFilePath( *anIt );
+      }
+    }
+  }
+
+  // backward compatibility: check also user's home directory (if it differs from above one)
+  QDir home = QDir::home();
+  if ( home.exists() && d.canonicalPath() != home.canonicalPath() ) {
+    home.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
+    QStringList l = home.entryList();
 
-    if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) )
+    for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
     {
-      appr = id;
-      appr_file = d.absoluteFilePath( *anIt );
+      id = userFileId( *anIt );
+      if ( id < 0 )
+       continue;
+      if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
+      {
+       appr = id;
+       appr_file = home.absoluteFilePath( *anIt );
+      }
     }
   }
+  
   return appr_file;
 }
 
 /*!
     Calculates integer extended version number by user file name for comparing
 */
-int SUIT_ResourceMgr::userFileId( const QString& ) const
+long SUIT_ResourceMgr::userFileId( const QString& ) const
 {
   return -1;
 }
index e0ff7ce17bcfe57b5298870539b70f346bb550e0..690bee8f87b07b53861f79d9b2b8128fa1a0241e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_RESOURCEMGR_H
 #define SUIT_RESOURCEMGR_H
 
@@ -40,7 +41,7 @@ public:
 protected:
   virtual QString userFileName( const QString&, const bool = true ) const;
   virtual QString findAppropriateUserFile( const QString& ) const;
-  virtual int     userFileId( const QString& ) const;
+  virtual long    userFileId( const QString& ) const;
 
 private:
   QString         myVersion;
index 85f8d7d99a05a994107b2fe19b226e47ae7764bd..ce9cadf92d80a13df3e4a1eb6d75a6e11ac41a80 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_SelectionFilter.h"
 
 /*! constructor. do nothing*/
index 862a0d114e269ce7581cf356ce1c6f5b7790d30d..43af9c55c3b1c3608601a4fa9c34ad362df3e6bb 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_SELECTIONFILTER_H
 #define SUIT_SELECTIONFILTER_H
 
index 5b8595b8c24e52c1638ab2dbe92fe179e76d94f1..56c1759ca666030c61df5296bf9b13dffc7993a1 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_SelectionMgr.h"
 
 #include "SUIT_Selector.h"
@@ -95,6 +96,8 @@ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& typ
 
   for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
   {
+    if ( !(*it)->isEnabled() )
+      continue;
     if ( !type.isEmpty() && (*it)->type() != type )
       continue;
 
@@ -153,7 +156,7 @@ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel )
     {
       // Temporary action(to avoid selection of the objects which don't pass the filters):
       //if ( *it != sel )
-       (*it)->setSelected( newOwners );
+        (*it)->setSelected( newOwners );
     }
   }
   myIsSelChangeEnabled = true;
index 19b6bb60bcc5696c6982ef3ff9b653b38fdcc13a..9393dc300c4053a2e9026055d94e8eaf6a839191 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_SELECTIONMGR_H
 #define SUIT_SELECTIONMGR_H
 
index 553d6ab62fdb449a3e0e706dea89a99897ffa371..29881c37e87751723a64823f7fd82aeed7a70ecb 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Selector.h"
 
 #include "SUIT_SelectionMgr.h"
index 5be859d77349a1fdefe753d4d75ad5d104124d41..775d01fb1abdb04dac7bc3c6e6dc8f6dff4c9674 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_SELECTOR_H
 #define SUIT_SELECTOR_H
 
index 8848a2c868d24a35207f8ea42bc3413163d38442..586399f0dc545a5d7b97f059cf51de2bae3e1640 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Session.h"
 
 #include "SUIT_Study.h"
@@ -173,7 +174,7 @@ void SUIT_Session::insertApplication( SUIT_Application* app )
   connect( app, SIGNAL( applicationClosed( SUIT_Application* ) ),
            this, SLOT( onApplicationClosed( SUIT_Application* ) ) );
   connect( app, SIGNAL( activated( SUIT_Application* ) ), 
-                this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
+                 this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
 }
 
 /*!
@@ -254,7 +255,7 @@ void SUIT_Session::closeSession( int mode, int flags )
     {
       SUIT_Study* study = app->activeStudy();
       if ( study->isModified() && study->isSaved() )
-             study->saveDocument();
+              study->saveDocument();
     }
     else if ( mode == DONT_SAVE )
     {
index 479e5bd0e68abb11f777798cbb5d2ad4c7eac991..2a11526e911cce98564e8f3e460cd5d37d7a77d1 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_SESSION_H
 #define SUIT_SESSION_H
 
index dc3fb52b09bff2913cd1a5ecf5621699c509d6ac..6dccd55090315e46e43c3643131e55df756d0620 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #if !defined(__SUIT_SMARTPTR_H)
 #define __SUIT_SMARTPTR_H
 
index 845b2faba3e379ef2c3306b3108671f5bae15b72..d365cceffdd0a94c32577d28b35fc325a20dec06 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Study.h"
 
 #include "SUIT_Desktop.h"
@@ -288,7 +289,7 @@ bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck )
     {
       int anAnsw = SUIT_MessageBox::question( application()->desktop(),
                                               tr( "OPERATION_LAUNCH" ), tr( "PREVIOUS_NOT_FINISHED" ),
-                                             tr( "CONTINUE" ), tr( "CANCEL" ) );
+                                              tr( "CONTINUE" ), tr( "CANCEL" ) );
 
       if ( anAnsw == 1 )
         return false;
index c442ec1bfb8c38f6c9cdb4bea51f4ecb2837631e..02d9d6e11a2148020fd2d5bfb35cf24e32bd674f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_STUDY_H
 #define SUIT_STUDY_H
 
@@ -47,7 +48,7 @@ public:
   virtual int       id() const;
 
   SUIT_DataObject*  root() const;
-  QString           studyName() const;
+  virtual QString   studyName() const;
   SUIT_Application* application() const;
 
   virtual bool      isSaved()  const;
index 6a72ad284b3769a6ebbb86f8f87f318588154b7e..32e9e12172b14ebcd9c6baf5f2563e08c65a0ee5 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_Tools.h"
 
 #include <QDir>
@@ -39,10 +40,10 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... )
 
   tmpPath += QString( "Salome_trace" );
 
-  FILE*        pStream;
+  FILE* pStream;
   pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" );
   if ( pStream ) 
-  {    
+  {     
     va_list argptr;
     va_start( argptr, lpszFormat );
     fprintf( pStream, "- Trace %s [%d] : %s", __FILE__, __LINE__, lpszFormat );
@@ -55,7 +56,7 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... )
 /*! 
     Creates a rect with TopLeft = ( min(x1,x2), min(y1,y2) )
     and BottomRight = ( TopLeft + (x2-x1)(y2-y1) )    
-*/     
+*/      
 QRect SUIT_Tools::makeRect( const int x1, const int y1, const int x2, const int y2 )
 {  
   return QRect( qMin( x1, x2 ), qMin( y1, y2 ), qAbs( x2 - x1 ), qAbs( y2 - y1 ) );
index ec252782682906afeefadb4957e3d42fb90144fd..fbef3e06f8baee33152708ebe40d46812446164f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_TOOLS_H
 #define SUIT_TOOLS_H
 
index 718d42514683d4bee88e974fc1fc5299b367a5b1..9e45581385b0201a3e381128fa200c99d7fc96c2 100755 (executable)
@@ -1,35 +1,36 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:   SUIT_TreeModel.cxx
 // Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
+#include "SUIT_Session.h"
 #include "SUIT_TreeModel.h"
 #include "SUIT_TreeSync.h"
 #include "SUIT_DataObject.h"
+#include "SUIT_ResourceMgr.h"
 
 #include <QApplication>
 #include <QHash>
+#include <QMimeData>
 
-SUIT_AbstractModel::SUIT_AbstractModel()
+SUIT_AbstractModel::SUIT_AbstractModel() : mySearcher( 0 )
 {
 }
 
@@ -48,9 +49,15 @@ SUIT_AbstractModel::operator const QObject*() const
   return dynamic_cast<const QObject*>( this );
 }
 
+SUIT_DataSearcher* SUIT_AbstractModel::searcher() const
+{
+  return mySearcher;
+}
 
-
-
+void SUIT_AbstractModel::setSearcher( SUIT_DataSearcher* s )
+{
+  mySearcher = s;
+}
 
 
 /*!
@@ -70,6 +77,7 @@ public:
   SUIT_DataObject*      dataObject() const;
   TreeItem*             parent() const;
   int                   position() const;
+  void                  setPosition(int position) {_position=position;};
   int                   childCount() const;
   TreeItem*             child( const int i );
   QList<TreeItem*>      children() const;
@@ -80,6 +88,7 @@ private:
   TreeItem*             myParent;
   QList<TreeItem*>      myChildren;
   SUIT_DataObject*      myObj;
+  int _position;
 };
 
 /*!
@@ -90,10 +99,11 @@ private:
   \param after tree item after each this one should be inserted
 */
 SUIT_TreeModel::TreeItem::TreeItem( SUIT_DataObject*          obj, 
-                                   SUIT_TreeModel::TreeItem* parent,
-                                   SUIT_TreeModel::TreeItem* after )
+                                    SUIT_TreeModel::TreeItem* parent,
+                                    SUIT_TreeModel::TreeItem* after )
 : myParent( parent ),
-  myObj( obj )
+  myObj( obj ),
+  _position(-1)
 {
   // Add <this> to the parent's children list
   if ( myParent )
@@ -123,12 +133,12 @@ SUIT_TreeModel::TreeItem::~TreeItem()
   \param after tree item after each \a child should be inserted
 */
 void SUIT_TreeModel::TreeItem::insertChild( SUIT_TreeModel::TreeItem* child, 
-                                           SUIT_TreeModel::TreeItem* after )
+                                            SUIT_TreeModel::TreeItem* after )
 {
   if ( !child )
     return;
 
-  int index = after ? myChildren.indexOf( after ) + 1 : 0;
+  int index = after ? after->position() + 1 : 0;
   myChildren.insert( index, child );
 }
 
@@ -171,7 +181,7 @@ SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::parent() const
 */
 int SUIT_TreeModel::TreeItem::position() const
 {
-  return myParent ? myParent->myChildren.indexOf( (TreeItem*)this ) : -1;
+  return _position;
 }
 
 /*!
@@ -303,8 +313,8 @@ SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::nullTrg() const
   \return created item
 */
 SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::createItem( const ObjPtr&  obj,
-                                                             const ItemPtr& parent, 
-                                                             const ItemPtr& after ) const
+                                                              const ItemPtr& parent, 
+                                                              const ItemPtr& after ) const
 {
   ItemPtr item = myModel ? myModel->createItem( obj, parent, after ) : 0;
 
@@ -325,7 +335,7 @@ void SUIT_TreeModel::TreeSync::updateItem( const ObjPtr& obj, const ItemPtr& ite
   if( obj )
     obj->update();
   if ( item && needUpdate( item ) ) 
-    myModel->updateItem( item );
+    myModel->updateItem( item, false );
 }
 
 /*!
@@ -401,21 +411,21 @@ bool SUIT_TreeModel::TreeSync::needUpdate( const ItemPtr& item ) const
 /*      update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item );
 
       if ( !update ) { 
-       // 2. check pixmap (compare serialNumber()-s)
-       QPixmap objPix = obj->icon();
-       const QPixmap* itemPix = item->pixmap( 0 );
-       update = (  objPix.isNull() && (  itemPix && !itemPix->isNull() ) ) || 
-                ( !objPix.isNull() && ( !itemPix ||  itemPix->isNull() ) ); 
-       if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
-         int aIconW = objPix.width();
-         if( aIconW > 20 ) {
-           QWMatrix aM;
-           double aScale = 20.0 / aIconW;
-           aM.scale( aScale, aScale );
-           objPix = objPix.xForm( aM );
-         }
-         update = ( objPix.serialNumber() != itemPix->serialNumber() );
-       }
+        // 2. check pixmap (compare serialNumber()-s)
+        QPixmap objPix = obj->icon();
+        const QPixmap* itemPix = item->pixmap( 0 );
+        update = (  objPix.isNull() && (  itemPix && !itemPix->isNull() ) ) || 
+                 ( !objPix.isNull() && ( !itemPix ||  itemPix->isNull() ) ); 
+        if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
+          int aIconW = objPix.width();
+          if( aIconW > 20 ) {
+            QWMatrix aM;
+            double aScale = 20.0 / aIconW;
+            aM.scale( aScale, aScale );
+            objPix = objPix.xForm( aM );
+          }
+          update = ( objPix.serialNumber() != itemPix->serialNumber() );
+        }
       }*/
     }
   }
@@ -441,7 +451,8 @@ SUIT_TreeModel::SUIT_TreeModel( QObject* parent )
   myRoot( 0 ),
   myRootItem( 0 ),
   myAutoDeleteTree( false ),
-  myAutoUpdate( true )
+  myAutoUpdate( true ),
+  myUpdateModified( false )
 {
   initialize();
 }
@@ -456,7 +467,8 @@ SUIT_TreeModel::SUIT_TreeModel( SUIT_DataObject* root, QObject* parent )
   myRoot( root ),
   myRootItem( 0 ),
   myAutoDeleteTree( false ),
-  myAutoUpdate( true )
+  myAutoUpdate( true ),
+  myUpdateModified( false )
 {
   initialize();
 }
@@ -468,9 +480,9 @@ SUIT_TreeModel::~SUIT_TreeModel()
 {
   if ( autoDeleteTree() ) {
     SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                                this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                                 this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
     SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                                this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                                 this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
     delete myRoot;
   }
 
@@ -486,22 +498,22 @@ SUIT_TreeModel::~SUIT_TreeModel()
 void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, const int custom_id )
 {
   bool found = false;
-  for( int i=0, n=myColumns.size(); i<n && !found; i++ )
-    if( name==myColumns[i].myName )
-       {
-         myColumns[i].myIds.insert( group_id, custom_id );
-         found = true;
-       }
-  if( !found )
-  {
-       ColumnInfo inf;
-       inf.myName = name;
-       inf.myIds.insert( group_id, custom_id );
-       inf.myAppropriate = Qtx::Shown;
-       int n = myColumns.size();
-       myColumns.resize( n+1 );
-       myColumns[n] = inf;
-       reset();
+  for ( int i=0, n=myColumns.size(); i<n && !found; i++ ) {
+    if ( name == myColumns[i].myName ) {
+      myColumns[i].myIds.insert( group_id, custom_id );
+      found = true;
+    }
+  }
+  if ( !found ) {
+    ColumnInfo inf;
+    inf.myName = name;
+    inf.myIds.insert( group_id, custom_id );
+    inf.myAppropriate = Qtx::Shown;
+    inf.myHeaderFlags = Qtx::ShowAll;
+    int n = myColumns.size();
+    myColumns.resize( n+1 );
+    myColumns[n] = inf;
+    reset();
   }
 }
 
@@ -518,17 +530,16 @@ void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, co
  */
 void SUIT_TreeModel::unregisterColumn( const int group_id, const QString& name )
 {
-  for( int i=0, n=myColumns.size(); i<n; i++ )
-    if( myColumns[i].myName==name )
-       {
-         myColumns[i].myIds.remove( group_id );
-         if( myColumns[i].myIds.isEmpty() )
-         {
-           myColumns.remove( i );
-               reset();
-         }
-         break;
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name ) {
+      myColumns[i].myIds.remove( group_id );
+      if ( myColumns[i].myIds.isEmpty() ) {
+       myColumns.remove( i );
+       reset();
+      }
+      break;
     }
+  }
 }
 
 /*!
@@ -539,12 +550,12 @@ void SUIT_TreeModel::unregisterColumn( const int group_id, const QString& name )
 */
 void SUIT_TreeModel::setColumnIcon( const QString& name, const QPixmap& icon )
 {
-  for( int i=0, n=myColumns.size(); i<n; i++ )
-    if( myColumns[i].myName==name )
-       {
-         myColumns[i].myIcon = icon;
-         break;
-       }
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name ) {
+      myColumns[i].myIcon = icon;
+      break;
+    }
+  }
 }
 
 /*!
@@ -556,12 +567,12 @@ void SUIT_TreeModel::setColumnIcon( const QString& name, const QPixmap& icon )
 QPixmap SUIT_TreeModel::columnIcon( const QString& name ) const
 {
   QPixmap res;
-  for( int i=0, n=myColumns.size(); i<n; i++ )
-    if( myColumns[i].myName==name )
-       {
-         res = myColumns[i].myIcon;
-         break;
-       }
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name ) {
+      res = myColumns[i].myIcon;
+      break;
+    }
+  }
   return res;
 }
 
@@ -579,13 +590,13 @@ QPixmap SUIT_TreeModel::columnIcon( const QString& name ) const
 */
 void SUIT_TreeModel::setAppropriate( const QString& name, const Qtx::Appropriate appr )
 {
-  for( int i=0, n=myColumns.size(); i<n; i++ )
-    if( myColumns[i].myName==name )
-       {
-         myColumns[i].myAppropriate = appr;
-         emit headerDataChanged( Qt::Horizontal, i, i );
-         break;
-       }
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name && myColumns[i].myAppropriate != appr ) {
+      myColumns[i].myAppropriate = appr;
+      emit headerDataChanged( Qt::Horizontal, i, i );
+      break;
+    }
+  }
 }
 
 /*!
@@ -601,16 +612,144 @@ void SUIT_TreeModel::setAppropriate( const QString& name, const Qtx::Appropriate
 Qtx::Appropriate SUIT_TreeModel::appropriate( const QString& name ) const
 {
   Qtx::Appropriate appr = Qtx::Shown;
-  for( int i=0, n=myColumns.size(); i<n; i++ )
-    if( myColumns[i].myName==name )
-       {
-         appr = myColumns[i].myAppropriate;
-         break;
-       }
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name ) {
+      appr = myColumns[i].myAppropriate;
+      break;
+    }
+  }
   return appr;
 }
 
 
+/*!
+  \brief Set header flags.
+  
+  These flags allow show in the header of the column text (name of the column),
+  icon or both text and icon.
+  
+  \param name - column name
+  \param flags - header flags
+
+*/
+void SUIT_TreeModel::setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags )
+{
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name && myColumns[i].myHeaderFlags != flags ) {
+      myColumns[i].myHeaderFlags = flags;
+      emit headerDataChanged( Qt::Horizontal, i, i );
+      break;
+    }
+  }
+}
+
+/*!
+  \brief Get the  header flags.
+  
+  These flags allow show in the header of the column text (name of the column),
+  icon or both text and icon.
+  
+  \param name - column name
+  \return header flags
+*/
+Qtx::HeaderViewFlags SUIT_TreeModel::headerFlags( const QString& name ) const
+{
+  Qtx::HeaderViewFlags flags;
+  for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+    if ( myColumns[i].myName == name ) {
+      flags = myColumns[i].myHeaderFlags;
+      break;
+    }
+  }
+  return flags;
+}
+
+/*!
+  \brief Set visibility state of the object.
+  
+  \param id - column name
+  \param state - visible state
+*/
+void SUIT_TreeModel::setVisibilityState( const QString& id, Qtx::VisibilityState state )
+{
+  VisibilityMap::const_iterator it = myVisibilityMap.find( id );
+  if ( it != myVisibilityMap.end() && it.value() == state )
+    return;
+  
+  bool needSignal = false;
+  if ( state != Qtx::UnpresentableState ) {
+    myVisibilityMap.insert( id, state );
+    needSignal = true;
+  }
+  else {
+    needSignal = myVisibilityMap.remove( id ) > 0;
+  }
+  if ( needSignal ) {
+    QModelIndexList lst;
+    if ( searcher() ) {
+      SUIT_DataObject* o = searcher()->findObject( id );
+      if ( o ) lst << index( o );
+    }
+    else {
+      lst = match( index( 0, root()->customData( Qtx::IdType ).toInt() ), DisplayRole, id, 1, Qt::MatchExactly | Qt::MatchRecursive );
+    }
+    if ( !lst.isEmpty() ) {
+      QModelIndex idx = index( lst.first().row(), SUIT_DataObject::VisibilityId, lst.first().parent() );
+      emit dataChanged( idx, idx );
+    }
+  }
+}
+
+/*!
+  \brief Set visibility state for all objects.
+  
+  \param id - column name
+  \param state - visible state
+*/
+void SUIT_TreeModel::setVisibilityStateForAll( Qtx::VisibilityState state )
+{
+  if ( state != Qtx::UnpresentableState ) {
+    VisibilityMap::ConstIterator it = myVisibilityMap.begin();
+    while ( it != myVisibilityMap.end() ) {
+      if ( it.value() != state )
+       setVisibilityState( it.key(), state );
+      it++;
+    }
+  }
+  else {
+    QList<QString> anIds = myVisibilityMap.keys();
+    myVisibilityMap.clear();
+    QList<QString>::ConstIterator it = anIds.begin();
+    while ( it != anIds.end() ) {
+      QModelIndexList lst;
+      if ( searcher() ) {
+       SUIT_DataObject* o = searcher()->findObject( *it );
+       if ( o ) lst << index( o );
+      }
+      else {
+       lst = match( index( 0, root()->customData( Qtx::IdType ).toInt() ), DisplayRole, (*it), 1, Qt::MatchExactly | Qt::MatchRecursive );
+      }
+      if ( !lst.isEmpty() ) {
+       QModelIndex idx = index( lst.first().row(), SUIT_DataObject::VisibilityId ,lst.first().parent() );
+       emit dataChanged( idx, idx );
+      }
+      it++;
+    }
+  }
+}
+
+/*!
+  \brief Get visibility state of the object.
+  
+  \param id - column name
+  \return visible state
+*/
+Qtx::VisibilityState SUIT_TreeModel::visibilityState( const QString& id ) const
+{
+  VisibilityMap::const_iterator it = myVisibilityMap.find( id );
+  return it != myVisibilityMap.end() ? it.value() : Qtx::UnpresentableState;
+}
+
 /*!
   \brief Get data tree root object.
   \return data tree root
@@ -633,9 +772,9 @@ void SUIT_TreeModel::setRoot( SUIT_DataObject* r )
 
   if ( autoDeleteTree() ) {
     SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                                this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                                 this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
     SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                                this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                                 this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
     delete myRoot;
   }
 
@@ -659,6 +798,8 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
     return QVariant();
 
   SUIT_DataObject* obj = object( index );
+  if ( !obj )
+    return QVariant();
 
   QColor c;
   QVariant val;
@@ -678,15 +819,38 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
   if ( obj )
   {
     switch ( role )
-       {
+        {
     case DisplayRole:
       // data object text for the specified column
-      val = obj->text( id ); 
+      val = obj->text( id );
       break;
-    case DecorationRole:
-      // data object icon for the specified column
-      val = obj->icon( id ); 
+    case EditRole:
+      // data object text for the specified column (for editor)
+      val = obj->text( id );
       break;
+    case DecorationRole: {
+      // icon
+      if ( id == SUIT_DataObject::VisibilityId ) {
+       // for visibility column, icon is defined specifically (using data object id)
+       QString objId = objectId( index );
+       if ( myVisibilityMap.contains( objId ) ) {
+         // visibility status is defined -> return proper icon
+         SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();      
+         val  = ( myVisibilityMap.value( objId ) == Qtx::ShownState ) ? 
+           resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) : 
+           resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) );
+       } 
+       else {
+         // visibility status is undefined -> no icon
+         val = QIcon();
+       }
+      }
+      else {
+       // for other columns get icon from the object
+       val = obj->icon( id );
+      }
+      break;
+    }
     case ToolTipRole:
       // data object tooltip for the specified column
       val = obj->toolTip( id ); 
@@ -711,7 +875,7 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
       // data background color for the specified column
       c = obj->color( SUIT_DataObject::Background, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::Base );
+            c = QApplication::palette().color( QPalette::Base );
       c.setAlpha( 0 );
       val = c; 
       break;
@@ -719,42 +883,42 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
       // data foreground (text) color for the specified column
       c = obj->color( SUIT_DataObject::Foreground, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::Foreground );
+            c = QApplication::palette().color( QPalette::Foreground );
       val = c; 
       break;
     case BaseColorRole:
       // editor background color for the specified column
       c = obj->color( SUIT_DataObject::Base, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::Base );
+            c = QApplication::palette().color( QPalette::Base );
       val = c; 
       break;
     case TextColorRole:
       // editor foreground (text) color for the specified column
       c = obj->color( SUIT_DataObject::Text, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::Text );
+            c = QApplication::palette().color( QPalette::Text );
       val = c; 
       break;
     case HighlightRole:
       // adta object highlighted background color for the specified column
       c = obj->color( SUIT_DataObject::Highlight, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::Highlight );
+            c = QApplication::palette().color( QPalette::Highlight );
       val = c; 
       break;
     case HighlightedTextRole:
       // data object highlighted foreground (text) color for the specified column
       c = obj->color( SUIT_DataObject::HighlightedText, id );
       if( !c.isValid() ) // default value
-           c = QApplication::palette().color( QPalette::HighlightedText );
+            c = QApplication::palette().color( QPalette::HighlightedText );
       val = c; 
       break;
     case CheckStateRole:
       // data object checked state for the specified column
       // NOTE! three-state check is not supported currently
       if( obj->isCheckable( id ) )
-           val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked; 
+            val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked; 
       break;
     case SizeHintRole:
       // data size hint
@@ -776,7 +940,7 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const
   \sa data()
 */
 bool SUIT_TreeModel::setData( const QModelIndex& index, 
-                             const QVariant& value, int role )
+                              const QVariant& value, int role )
 {
   if ( index.isValid() && value.isValid() ) {
     SUIT_DataObject* obj = object( index );
@@ -784,15 +948,24 @@ bool SUIT_TreeModel::setData( const QModelIndex& index,
       // NOTE! only 'check state' data is supported by default
       switch ( role ) {
       case CheckStateRole:
-       // checked state
-       if ( obj->isCheckable( index.column() ) ) {
-         obj->setOn( value.toBool(), index.column() );
-         emit( dataChanged( index, index ) );
+        // checked state
+        if ( obj->isCheckable( index.column() ) ) {
+          obj->setOn( value.toBool(), index.column() );
+          emit( dataChanged( index, index ) );
+          return true;
+        }
+        break;
+      case EditRole: {
+       QString val = value.toString();
+        if ( !val.isEmpty() && obj->setName(val) ) {
+          emit( dataChanged( index, index ) );
          return true;
        }
-       break;
+       return false;
+        break;
+      }
       default:
-       break;
+        break;
       }
     }
   }
@@ -806,28 +979,48 @@ bool SUIT_TreeModel::setData( const QModelIndex& index,
 */
 Qt::ItemFlags SUIT_TreeModel::flags( const QModelIndex& index ) const
 {
-  if ( !index.isValid() )
-    return 0;
-
-  SUIT_DataObject* obj = object( index );
   Qt::ItemFlags f = 0;
 
-  if ( obj ) {
+  if (!index.isValid())
+    //return Qt::ItemIsDropEnabled; // items can be dropped into the top level of the model
+    return f;
+
+  SUIT_DataObject* obj = object(index);
+
+  if (obj) {
     // data object is enabled
-    if ( obj->isEnabled() )
+    if (obj->isEnabled())
       f = f | Qt::ItemIsEnabled;
 
     // data object is selectable
-    if ( obj->isSelectable() )
+    if (obj->isSelectable())
       f = f | Qt::ItemIsSelectable;
 
     // data object is checkable
-    if ( obj->isCheckable( index.column() ) )
+    if (obj->isCheckable(index.column()))
       f = f | Qt::ItemIsUserCheckable;
+    
+    // data object can be renamed
+    if (obj->renameAllowed(index.column()))
+      f = f | Qt::ItemIsEditable;
+    
+    // data object can be dragged
+    if (obj->isDraggable())
+      f = f | Qt::ItemIsDragEnabled;
+    
+    // another data object(s) can be dropped on this one
+    if (obj->isDropAccepted())
+      f = f | Qt::ItemIsDropEnabled;
   }
+
   return f;
 }
 
+Qt::DropActions SUIT_TreeModel::supportedDropActions() const
+{
+  return Qt::CopyAction | Qt::MoveAction;
+}
+
 /*!
   \brief Get header data (can be used in any data view).
   \param column column number
@@ -842,14 +1035,22 @@ QVariant SUIT_TreeModel::headerData( int column, Qt::Orientation orientation, in
   if ( root() && orientation == Qt::Horizontal )
   {
     switch ( role )
-       {
+        {
     case DisplayRole:
       // column title
-      d = myColumns[column].myName;
+      if((myColumns[column].myHeaderFlags & Qtx::ShowText) || 
+        (myColumns[column].myHeaderFlags == Qtx::ShowAll)) 
+       d = myColumns[column].myName;
+      else
+       d = QString();
       break;
     case DecorationRole:
       // column icon
-      d = myColumns[column].myIcon;
+      if((myColumns[column].myHeaderFlags & Qtx::ShowIcon) || 
+        (myColumns[column].myHeaderFlags == Qtx::ShowAll)) 
+       d = myColumns[column].myIcon;
+      else
+       d = QIcon();      
       break;
     case AppropriateRole:
       // appropriate flag (can column be hidden via context popup menu)
@@ -870,7 +1071,7 @@ QVariant SUIT_TreeModel::headerData( int column, Qt::Orientation orientation, in
   \return model index
 */
 QModelIndex SUIT_TreeModel::index( int row, int column, 
-                                  const QModelIndex& parent ) const
+                                   const QModelIndex& parent ) const
 {
   if( hasIndex( row, column, parent ) )
   {
@@ -879,7 +1080,7 @@ QModelIndex SUIT_TreeModel::index( int row, int column,
     {
       TreeItem* childItem = parentItem->child( row );
       if( childItem )
-       return createIndex( row, column, childItem );
+        return createIndex( row, column, childItem );
     }
   }
   return QModelIndex();
@@ -923,8 +1124,10 @@ int SUIT_TreeModel::columnCount( const QModelIndex& /*parent*/ ) const
 */
 int SUIT_TreeModel::rowCount( const QModelIndex& parent ) const
 {
-  if ( parent.column() > 0 )
-    return 0;
+  // Commented by rnv in the frame of the 
+  // "20830: EDF 1357 GUI : Hide/Show Icon" imp
+  // if ( parent.column() > 0 )
+  // return 0;
 
   TreeItem* parentItem = treeItem( parent );
 
@@ -1006,21 +1209,37 @@ void SUIT_TreeModel::setAutoUpdate( const bool on )
     return;
 
   SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                               this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
   SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                               this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
   myAutoUpdate = on;
 
   if ( myAutoUpdate ) {
     SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                             this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
     SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                             this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
 
     updateTree();
   }
 }
 
+/*!
+  \brief Get 'updateModified' flag value.
+  \return 'updateModified' flag value
+*/
+bool SUIT_TreeModel::updateModified() const
+{
+  return myUpdateModified;
+}
+/*!
+  \brief Set 'updateModified' flag value.
+  \param on 'updateModified' flag value
+*/
+void SUIT_TreeModel::setUpdateModified(const bool on)
+{
+  myUpdateModified=on;
+}
 
 /*!
   \brief Check if the specified column supports custom sorting.
@@ -1033,6 +1252,11 @@ bool SUIT_TreeModel::customSorting( const int column ) const
   return root() ? root()->customSorting( column ) : false;
 }
 
+void SUIT_TreeModel::forgetObject( const SUIT_DataObject* obj )
+{
+  removeItem( treeItem( obj ) );
+}
+
 /*!
   \brief Compares two model indexes for the sorting purposes.
 
@@ -1060,6 +1284,19 @@ QAbstractItemDelegate* SUIT_TreeModel::delegate() const
   return new SUIT_ItemDelegate( const_cast<SUIT_TreeModel*>( this ) );
 }
 
+
+void SUIT_TreeModel::emitClicked( SUIT_DataObject* obj, const QModelIndex& index) {
+  int obj_group_id = obj->groupId();
+  const ColumnInfo& inf = myColumns[index.column()];
+
+  int id = -1;
+  if( inf.myIds.contains( 0 ) )
+    id = inf.myIds[0];
+  if( inf.myIds.contains( obj_group_id ) )
+    id = inf.myIds[obj_group_id];
+  emit clicked(obj, id);
+}
+
 /*!
   \brief Update tree model.
 
@@ -1075,6 +1312,68 @@ void SUIT_TreeModel::updateTree( const QModelIndex& index )
   updateTree( object( index ) );
 }
 
+
+void SUIT_TreeModel::updateTreeModel(SUIT_DataObject* obj,TreeItem* item)
+{
+  int kobj=0;
+  int kitem=0;
+  int nobjchild=obj->childCount();
+  SUIT_DataObject* sobj=obj->childObject(kobj);
+  TreeItem* sitem = item->child(kitem);
+
+  while(kobj < nobjchild)
+    {
+      if(sitem==0)
+        {
+          //end of item list
+          if(kitem==0)
+            sitem=createItemAtPos(sobj,item,0);
+          else
+            sitem=createItemAtPos(sobj,item,kitem);
+          updateTreeModel(sobj,sitem);
+          kobj++;
+          kitem++;
+          sobj=obj->childObject(kobj);
+          sitem = item->child(kitem);
+        }
+      else if(sitem->dataObject() != sobj)
+        {
+          if(treeItem(sobj))
+            {
+              // item : to remove
+              removeItem(sitem);
+              sitem = item->child(kitem);
+            }
+          else
+            {
+              // obj : new object
+              createItemAtPos(sobj,item,kitem);
+              kobj++;
+              kitem++;
+              sobj=obj->childObject(kobj);
+              sitem = item->child(kitem);
+            }
+        }
+      else
+        {
+          //obj and item are synchronised : go to next ones
+          updateTreeModel(sobj,sitem);
+          if(sobj->modified()) updateItem(sitem, true);
+          if( sobj ) sobj->update();
+          kobj++;
+          kitem++;
+          sobj=obj->childObject(kobj);
+          sitem = item->child(kitem);
+        }
+    }
+  //remove remaining items
+  for(int i = item->childCount(); i > kitem;i--)
+    {
+      sitem = item->child(i-1);
+      removeItem(sitem);
+    }
+}
+
 /*!
   \brief Update tree model.
 
@@ -1093,9 +1392,16 @@ void SUIT_TreeModel::updateTree( SUIT_DataObject* obj )
   else if ( obj->root() != root() )
     return;
 
-  synchronize<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( obj, 
-                                                       treeItem( obj ), 
-                                                       SUIT_TreeModel::TreeSync( this ) );
+  if(updateModified())
+    {
+      updateTreeModel(obj,treeItem( obj ));
+    }
+  else
+    {
+      synchronize<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( obj,
+                                                            treeItem( obj ),
+                                                            SUIT_TreeModel::TreeSync( this ) );
+    }
   emit modelUpdated();
 }
 
@@ -1105,14 +1411,14 @@ void SUIT_TreeModel::updateTree( SUIT_DataObject* obj )
 void SUIT_TreeModel::initialize()
 {
   SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                               this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
   SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                               this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
   if ( autoUpdate() ) {
     SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
-                             this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                              this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
     SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
-                             this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+                              this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
   }
 
   myItems.clear(); // ????? is it really necessary
@@ -1121,6 +1427,14 @@ void SUIT_TreeModel::initialize()
     myRootItem = new TreeItem( 0 );
 
   registerColumn( 0, QObject::tr( "NAME_COLUMN" ), SUIT_DataObject::NameId );
+
+  QString visCol = QObject::tr( "VISIBILITY_COLUMN" );
+  registerColumn( 0, visCol, SUIT_DataObject::VisibilityId );
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  setColumnIcon( visCol, resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ));
+  setHeaderFlags( visCol, Qtx::ShowIcon);
+
   updateTree();
 }
 
@@ -1174,6 +1488,28 @@ SUIT_DataObject* SUIT_TreeModel::object( const SUIT_TreeModel::TreeItem* item )
   return myItems.contains( obj ) ? obj : 0;
 }
 
+/*!
+  \brief Get unique object identifier
+  
+  Object identifier is customized via the Qtx::IdType custom data
+
+  \param index model index
+  \return object identifier or null string if it isn't specified
+  \sa SUIT_DataObject::customData()
+*/
+QString SUIT_TreeModel::objectId( const QModelIndex& index ) const
+{
+  QString objId;
+  if ( index.isValid() ) {
+    SUIT_DataObject* obj = object( index );
+    if ( obj ) {
+      int anId = obj->customData( Qtx::IdType ).toInt(); 
+      objId = data( createIndex( index.row(), anId, index.internalPointer() ) ).toString();
+    }
+  }
+  return objId;
+}
+
 /*!
   \brief Create an item corresponding to the data object.
   \param obj source data object
@@ -1182,8 +1518,8 @@ SUIT_DataObject* SUIT_TreeModel::object( const SUIT_TreeModel::TreeItem* item )
   \return created tree item or 0 if item could not be created
 */
 SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj,
-                                                     SUIT_TreeModel::TreeItem* parent, 
-                                                     SUIT_TreeModel::TreeItem* after )
+                                                      SUIT_TreeModel::TreeItem* parent, 
+                                                      SUIT_TreeModel::TreeItem* after )
 {
   if ( !obj )
     return 0;
@@ -1198,16 +1534,57 @@ SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj,
 
   myItems[ obj ] = new TreeItem( obj, parent, after );
 
+  for(int pos=row;pos < parent->childCount();pos++)
+    parent->child(pos)->setPosition(pos);
+
   endInsertRows();
 
+  obj->setModified(false);
+
   return myItems[ obj ];
 }
 
+/*!
+  \brief Create an item corresponding to the data object.
+  \param obj source data object
+  \param parent parent tree item
+  \param pos tree item position into which new item should be inserted
+  \return created tree item or 0 if item could not be created
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItemAtPos( SUIT_DataObject* obj,
+                                                           SUIT_TreeModel::TreeItem* parent,
+                                                           int pos )
+{
+  if ( !obj )
+    return 0;
+
+  SUIT_DataObject* parentObj = object( parent );
+  QModelIndex parentIdx = index( parentObj );
+
+  int row = pos ;
+  SUIT_TreeModel::TreeItem* after = pos>0 ? parent->child(pos-1) : 0 ;
+
+  beginInsertRows( parentIdx, row, row );
+
+  SUIT_TreeModel::TreeItem* item = new TreeItem( obj, parent, after );
+  myItems[ obj ] = item;
+
+  for(int pos=row;pos < parent->childCount();pos++)
+    parent->child(pos)->setPosition(pos);
+
+  endInsertRows();
+
+  obj->setModified(false);
+
+  return item;
+}
+
 /*!
   \brief Update tree item.
   \param item tree item to be updated
+  \param emitLayoutChanged if signal about changed layout should be emitted
 */
-void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
+void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item, bool emitLayoutChanged )
 {
   if ( !item )
     return;
@@ -1217,9 +1594,13 @@ void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
     return;
   
   // update all columns corresponding to the given data object
+  //emit layoutAboutToBeChanged(); // VSR 25/04/2011: fix crash on delete objects
   QModelIndex firstIdx = index( obj, 0 );
   QModelIndex lastIdx  = index( obj, columnCount() - 1 );
   emit dataChanged( firstIdx, lastIdx );
+  obj->setModified(false);
+  if( emitLayoutChanged )
+    emit layoutChanged();
 }
 
 /*!
@@ -1241,7 +1622,8 @@ void SUIT_TreeModel::removeItem( SUIT_TreeModel::TreeItem* item )
   
   // Warning! obj can be deleted at this point!
 
-  SUIT_DataObject* parentObj = object( item->parent() );
+  TreeItem* parent=item->parent();
+  SUIT_DataObject* parentObj = object( parent );
   QModelIndex parentIdx = index( parentObj, 0 );
   int row = item->position();
   
@@ -1250,8 +1632,12 @@ void SUIT_TreeModel::removeItem( SUIT_TreeModel::TreeItem* item )
 
   if ( obj == root() )
     setRoot( 0 );
-  else if ( item->parent() )
-    item->parent()->removeChild( item );
+  else if ( parent )
+    {
+      parent->removeChild( item );
+      for(int pos=row;pos < parent->childCount();pos++)
+        parent->child(pos)->setPosition(pos);
+    }
 
   delete item;
 
@@ -1280,9 +1666,85 @@ void SUIT_TreeModel::onRemoved( SUIT_DataObject* /*object*/, SUIT_DataObject* pa
     updateTree( parent );
 }
 
+/*!
+  \brief Drag and Drop support.
+*/
+QStringList SUIT_TreeModel::mimeTypes() const
+{
+  QStringList types;
+  types << "application/vnd.text.list";
+  return types;
+}
+
+/*!
+  \brief Called when the data objects are exported(dragged) from the tree.
+  \param indexes the list of exported objects
+*/
+QMimeData* SUIT_TreeModel::mimeData( const QModelIndexList& indexes ) const
+{
+  QMimeData* mimeData = new QMimeData();
+  QByteArray encodedData;
+
+  QDataStream stream( &encodedData, QIODevice::WriteOnly );
+
+  foreach ( QModelIndex index, indexes ) {
+    QString id = objectId( index );
+    // we have to check only 0 column in order to avoid repeating items in the drag object
+    // - QTreeView tries to drag indices for all visible columns
+    if ( index.isValid() && index.column() == 0 && !id.isEmpty() )
+      stream << id;
+  }
+
+  mimeData->setData( "application/vnd.text.list", encodedData );
+  return mimeData;
+}
+
+bool SUIT_TreeModel::dropMimeData( const QMimeData* data, Qt::DropAction action,
+                                   int row, int column, const QModelIndex& parent )
+{
+  if ( action == Qt::IgnoreAction )
+    // do nothing with data
+    return false;
+
+  if ( !data->hasFormat( "application/vnd.text.list" ) )
+    // not supported data dropped
+    return false;
+
+  if ( !parent.isValid() )
+    // dropping into the top level of the model is not allowed
+    return false;
+
+  // get parent object
+  SUIT_DataObject* pobj = object( parent );
+  if ( !pobj )
+    // invalid parent
+    return false;
+
+  // decode mime data and collect data objects being dropped
+  QByteArray encodedData = data->data( "application/vnd.text.list" );
+  QDataStream stream( &encodedData, QIODevice::ReadOnly );
+  
+  DataObjectList objects;
+
+  while ( !stream.atEnd() ) {
+    QString id;
+    stream >> id;
+    if ( !id.isEmpty() && searcher() ) {
+      SUIT_DataObject* obj = searcher()->findObject( id );
+      if ( obj ) objects << obj;
+    }
+  }
+
+  // emit signal
+  emit dropped( objects, pobj, row, action );
+
+  // return true if there's any to drop
+  return !objects.isEmpty();
+}
+
 /*!
   \class SUIT_ProxyModel
-  \brief Proxy model which can be used above the SUIT_TreeMovel class
+  \brief Proxy model which can be used above the SUIT_TreeModel class
   to enable custom sorting/filtering of the data.
 
   The SUIT_TreeModel class does not support custom sorting/filtering of the data.
@@ -1300,7 +1762,11 @@ SUIT_ProxyModel::SUIT_ProxyModel( QObject* parent )
 {
   SUIT_TreeModel* model = new SUIT_TreeModel( this );
   connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  connect( model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL(clicked( SUIT_DataObject*, int ) ) );
+  connect( model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+           this,  SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
   setSourceModel( model );
+  setDynamicSortFilter( true );
 }
 
 /*!
@@ -1314,7 +1780,11 @@ SUIT_ProxyModel::SUIT_ProxyModel( SUIT_DataObject* root, QObject* parent )
 {
   SUIT_TreeModel* model = new SUIT_TreeModel( root, this );
   connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  connect( model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL( clicked( SUIT_DataObject*, int ) ) );
+  connect( model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+           this,  SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
   setSourceModel( model );
+  setDynamicSortFilter( true );
 }
 
 /*!
@@ -1327,7 +1797,11 @@ SUIT_ProxyModel::SUIT_ProxyModel( SUIT_AbstractModel* model, QObject* parent )
   mySortingEnabled( true )
 {
   connect( *model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+  connect( *model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL( clicked( SUIT_DataObject*, int ) ) );
+  connect( *model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+           this,   SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
   setSourceModel( *model );
+  setDynamicSortFilter( true );
 }
 
 /*!
@@ -1414,6 +1888,28 @@ bool SUIT_ProxyModel::autoUpdate() const
   return treeModel() ? treeModel()->autoUpdate() : false;
 }
 
+/*!
+  \brief Get 'updateModified' flag value.
+  \return 'updateModified' flag value
+*/
+bool SUIT_ProxyModel::updateModified() const
+{
+  return treeModel() ? treeModel()->updateModified() : false;
+}
+/*!
+  \brief Set 'updateModified' flag value.
+
+  If this flag is set to \c true (default=false), the model is updated by updateTreeModel that 
+  uses the isModified flag to update only modified objects
+
+  \param on 'updateModified' flag value
+*/
+void SUIT_ProxyModel::setUpdateModified( const bool on )
+{
+  if ( treeModel() )
+    treeModel()->setUpdateModified( on );
+}
+
 /*!
   \brief Set 'auto-update tree' flag value.
 
@@ -1439,6 +1935,16 @@ bool SUIT_ProxyModel::isSortingEnabled() const
   return mySortingEnabled;
 }
 
+SUIT_DataSearcher* SUIT_ProxyModel::searcher() const
+{
+  return treeModel() ? treeModel()->searcher() : 0;
+}
+
+void SUIT_ProxyModel::setSearcher( SUIT_DataSearcher* s )
+{
+  if ( treeModel() ) treeModel()->setSearcher( s );
+}
+
 /*!
   \brief Get item delegate for the model.
   \return new item delegate
@@ -1480,6 +1986,12 @@ void SUIT_ProxyModel::updateTree( SUIT_DataObject* obj )
     treeModel()->updateTree( obj );
 }
 
+void SUIT_ProxyModel::forgetObject( const SUIT_DataObject* obj )
+{
+  if ( treeModel() )
+    treeModel()->forgetObject( obj );
+}
+
 /*!
   \brief Compares two model indexes for the sorting purposes.
   \param left first index to compare
@@ -1528,6 +2040,19 @@ SUIT_AbstractModel* SUIT_ProxyModel::treeModel() const
   return dynamic_cast<SUIT_AbstractModel*>( sourceModel() );
 }
 
+/*!
+  \brief Filter rows
+  \param sourceRow row index of the source data model
+  \param sourceParent parent model index of the source data model
+  \return \c true if the specified row should be filtered out (i.e. not displayed) or \c false otherwise
+*/
+bool SUIT_ProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
+{
+  SUIT_DataObject* o = treeModel()->object( sourceModel()->index( sourceRow, 0, sourceParent ) );
+  SUIT_DataObject* p = o ? o->parent() : 0;
+  return ( !p || p->expandable() ) && o && o->isVisible();
+}
+
 /*!
   \brief Register new column in the model
   \param group_id - unique data object identificator allowing the classification of objects 
@@ -1613,10 +2138,76 @@ Qtx::Appropriate SUIT_ProxyModel::appropriate( const QString& name ) const
   return treeModel() ? treeModel()->appropriate( name ) : Qtx::Shown;
 }
 
+/*!
+  \brief Set header flags.
+  
+  These flags allow show in the header of the column text (name of the column),
+  icon or both text and icon.
+  
+  \param name - column name
+  \param flags - header flags
+
+*/
+void SUIT_ProxyModel::setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags )
+{
+  if(treeModel())
+    treeModel()->setHeaderFlags(name, flags);
+}
+
+/*!
+  \brief Get the  header flags.
+  
+  These flags allow show in the header of the column text (name of the column),
+  icon or both text and icon.
+  
+  \param name - column name
+  \return header flags
+*/
+Qtx::HeaderViewFlags SUIT_ProxyModel::headerFlags( const QString& name ) const
+{
+  return treeModel() ? treeModel()->headerFlags( name ) : Qtx::ShowAll;
+}
 
+/*!
+  \brief Set visibility state of the object.
+  
+  \param id - column name
+  \param state - visible state
+*/
+void SUIT_ProxyModel::setVisibilityState(const QString& id, Qtx::VisibilityState state)
+{
+  if(treeModel())
+    treeModel()->setVisibilityState(id,state);
+}
 
+/*!
+  \brief Set visibility state for all objects.
+  
+  \param id - column name
+  \param state - visible state
+*/
+void SUIT_ProxyModel::setVisibilityStateForAll(Qtx::VisibilityState state)
+{
+  if(treeModel())
+    treeModel()->setVisibilityStateForAll(state);
+}
 
+/*!
+  \brief Get visibility state of the object.
+  
+  \param id - column name
+  \return visible state
+*/
+Qtx::VisibilityState SUIT_ProxyModel::visibilityState(const QString& id) const
+{
+  return treeModel() ? treeModel()->visibilityState(id) : Qtx::UnpresentableState;
+}
 
+void SUIT_ProxyModel::emitClicked( SUIT_DataObject* obj, const QModelIndex& index)
+{
+  if(treeModel())
+    treeModel()->emitClicked(obj,index);
+}
 
 /*!
   \class SUIT_ItemDelegate
@@ -1647,8 +2238,8 @@ SUIT_ItemDelegate::SUIT_ItemDelegate( QObject* parent )
   \param index model index being rendered
 */
 void SUIT_ItemDelegate::paint( QPainter* painter, 
-                              const QStyleOptionViewItem& option,
-                              const QModelIndex& index ) const
+                               const QStyleOptionViewItem& option,
+                               const QModelIndex& index ) const
 {
   QStyleOptionViewItem opt = option;
   if ( index.isValid() ) {
@@ -1668,7 +2259,16 @@ void SUIT_ItemDelegate::paint( QPainter* painter,
       opt.palette.setBrush( QPalette::Highlight, val.value<QColor>() );
     val = index.data( SUIT_TreeModel::HighlightedTextRole );
     if ( val.isValid() && val.value<QColor>().isValid() )
-      opt.palette.setBrush( QPalette::HighlightedText, val.value<QColor>() );
+      opt.palette.setBrush( QPalette::HighlightedText, val.value<QColor>() );      
   }
   QItemDelegate::paint( painter, opt, index );
 }
+
+QSize SUIT_ItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
+{
+    QSize size = QItemDelegate::sizeHint ( option, index );
+#if QT_VERSION >= 0x040500
+    size.setHeight( size.height() + 1 );
+#endif
+    return size;
+}
index e35570342eed3397db4127c4841497bde9e5922b..f06ffb32fe5a69c5db439aeb8dd384d65b148e99 100755 (executable)
@@ -1,27 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:   SUIT_TreeModel.h
 // Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef SUIT_TREEMODEL_H
 #define SUIT_TREEMODEL_H
 
@@ -34,6 +32,7 @@
 #include <QModelIndex>
 #include <QItemDelegate>
 #include <QVariant>
+#include <QMap>
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
 
 class SUIT_DataObject;
 class SUIT_TreeModel;
+class QMimeData;
+
+class SUIT_EXPORT SUIT_DataSearcher
+{
+public:
+  virtual SUIT_DataObject* findObject( const QString& ) const = 0;
+};
 
 class SUIT_EXPORT SUIT_AbstractModel
 {
+  SUIT_DataSearcher* mySearcher;
+
 public:
   SUIT_AbstractModel();
 
@@ -51,27 +59,39 @@ public:
   operator QAbstractItemModel*();
   operator const QObject*() const;
 
-  virtual SUIT_DataObject* root() const = 0;
-  virtual void             setRoot( SUIT_DataObject* ) = 0;
-  virtual SUIT_DataObject* object( const QModelIndex& = QModelIndex() ) const = 0;
-  virtual QModelIndex      index( const SUIT_DataObject*, int = 0 ) const = 0;
-  virtual bool             autoDeleteTree() const = 0;
-  virtual void             setAutoDeleteTree( const bool ) = 0;
-  virtual bool             autoUpdate() const = 0;
-  virtual void             setAutoUpdate( const bool ) = 0;
+  virtual SUIT_DataObject*      root() const = 0;
+  virtual void                  setRoot( SUIT_DataObject* ) = 0;
+  virtual SUIT_DataObject*      object( const QModelIndex& = QModelIndex() ) const = 0;
+  virtual QModelIndex           index( const SUIT_DataObject*, int = 0 ) const = 0;
+  virtual bool                  autoDeleteTree() const = 0;
+  virtual void                  setAutoDeleteTree( const bool ) = 0;
+  virtual bool                  autoUpdate() const = 0;
+  virtual void                  setAutoUpdate( const bool ) = 0;
+  virtual bool                  updateModified() const = 0;
+  virtual void                  setUpdateModified( const bool ) = 0;
   virtual QAbstractItemDelegate* delegate() const = 0;
-  virtual bool             customSorting( const int ) const = 0;
-  virtual bool             lessThan( const QModelIndex& left, const QModelIndex& right ) const = 0;
-
-  virtual void             updateTree( const QModelIndex& ) = 0;
-  virtual void             updateTree( SUIT_DataObject* = 0 ) = 0;
-
-  virtual void             registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
-  virtual void             unregisterColumn( const int group_id, const QString& name ) = 0;
-  virtual void             setColumnIcon( const QString& name, const QPixmap& icon ) = 0;
-  virtual QPixmap          columnIcon( const QString& name ) const = 0;
-  virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr ) = 0;
-  virtual Qtx::Appropriate appropriate( const QString& name ) const = 0;
+  virtual bool                  customSorting( const int ) const = 0;
+  virtual bool                  lessThan( const QModelIndex& left, const QModelIndex& right ) const = 0;
+  virtual void                  forgetObject( const SUIT_DataObject* ) = 0;
+
+  virtual void                  updateTree( const QModelIndex& ) = 0;
+  virtual void                  updateTree( SUIT_DataObject* = 0 ) = 0;
+
+  virtual void                  registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
+  virtual void                  unregisterColumn( const int group_id, const QString& name ) = 0;
+  virtual void                  setColumnIcon( const QString& name, const QPixmap& icon ) = 0;
+  virtual QPixmap               columnIcon( const QString& name ) const = 0;
+  virtual void                  setAppropriate( const QString& name, const Qtx::Appropriate appr ) = 0;
+  virtual Qtx::Appropriate      appropriate( const QString& name ) const = 0;
+  virtual void                  setVisibilityState(const QString& id, Qtx::VisibilityState state) = 0;
+  virtual void                  setVisibilityStateForAll(Qtx::VisibilityState state) = 0;
+  virtual Qtx::VisibilityState  visibilityState(const QString& id) const = 0;
+  virtual void                  setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags ) = 0;
+  virtual Qtx::HeaderViewFlags  headerFlags( const QString& name ) const = 0;
+  virtual void                  emitClicked( SUIT_DataObject* obj, const QModelIndex& index) = 0;
+
+  virtual SUIT_DataSearcher*    searcher() const;
+  virtual void                  setSearcher( SUIT_DataSearcher* );
 };
 
 
@@ -119,6 +139,8 @@ public:
   virtual Qt::ItemFlags  flags( const QModelIndex& ) const;
   virtual QVariant       headerData( int, Qt::Orientation, int = Qt::DisplayRole ) const;
 
+  virtual Qt::DropActions supportedDropActions() const;
+
   virtual QModelIndex    index( int, int, const QModelIndex& = QModelIndex() ) const;
   virtual QModelIndex    parent( const QModelIndex& ) const;
 
@@ -130,6 +152,13 @@ public:
   virtual QPixmap          columnIcon( const QString& name ) const;
   virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr );
   virtual Qtx::Appropriate appropriate( const QString& name ) const;
+  virtual void                  setVisibilityState(const QString& id, Qtx::VisibilityState state);
+  virtual void                  setVisibilityStateForAll(Qtx::VisibilityState state);
+  virtual Qtx::VisibilityState  visibilityState(const QString& id) const;
+  virtual void                  setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags );
+  virtual Qtx::HeaderViewFlags  headerFlags( const QString& name ) const;
+  virtual void           emitClicked( SUIT_DataObject* obj, const QModelIndex& index);
+
 
   SUIT_DataObject*       object( const QModelIndex& = QModelIndex() ) const;
   QModelIndex            index( const SUIT_DataObject*, int = 0 ) const;
@@ -140,17 +169,31 @@ public:
   bool                   autoUpdate() const;
   void                   setAutoUpdate( const bool );
 
+  bool                   updateModified() const;
+  void                   setUpdateModified( const bool );
+
   virtual bool           customSorting( const int ) const;
   virtual bool           lessThan( const QModelIndex& left, const QModelIndex& right ) const;
+  virtual void           forgetObject( const SUIT_DataObject* );
 
   QAbstractItemDelegate* delegate() const;
 
+
+  virtual void           updateTreeModel(SUIT_DataObject*,TreeItem*);
+
+  virtual QStringList    mimeTypes() const;
+  virtual QMimeData*     mimeData (const QModelIndexList& indexes) const;
+  virtual bool           dropMimeData (const QMimeData *data, Qt::DropAction action,
+                                       int row, int column, const QModelIndex &parent);
+
 public slots:
   virtual void           updateTree( const QModelIndex& );
   virtual void           updateTree( SUIT_DataObject* = 0 );
 
 signals:
   void modelUpdated();
+  void clicked( SUIT_DataObject*, int );
+  void dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
 
 private:
   void                   initialize();
@@ -159,9 +202,11 @@ private:
   TreeItem*              treeItem( const QModelIndex& ) const;
   TreeItem*              treeItem( const SUIT_DataObject* ) const;
   SUIT_DataObject*       object( const TreeItem* ) const;
+  QString                objectId( const QModelIndex& = QModelIndex() ) const;
 
   TreeItem*              createItem( SUIT_DataObject*, TreeItem* = 0, TreeItem* = 0 );
-  void                   updateItem( TreeItem* );
+  TreeItem*              createItemAtPos( SUIT_DataObject*, TreeItem* = 0, int pos=0 );
+  void                   updateItem( TreeItem*, bool emitLayoutChanged );
   void                   removeItem( TreeItem* );
 
 private slots:
@@ -173,17 +218,22 @@ private:
   typedef struct
   {
     QString myName;
-       QMap<int,int> myIds;
-       QPixmap myIcon;
-       Qtx::Appropriate myAppropriate;
+        QMap<int,int> myIds;
+        QPixmap myIcon;
+        Qtx::HeaderViewFlags myHeaderFlags;
+        Qtx::Appropriate myAppropriate;
 
   } ColumnInfo;
+
+  typedef QMap<QString,Qtx::VisibilityState> VisibilityMap;
   
   SUIT_DataObject*    myRoot;
   TreeItem*           myRootItem;
   ItemMap             myItems;
+  VisibilityMap       myVisibilityMap;
   bool                myAutoDeleteTree;
   bool                myAutoUpdate;
+  bool                myUpdateModified;
   QVector<ColumnInfo> myColumns;
 
   friend class SUIT_TreeModel::TreeSync;
@@ -210,10 +260,14 @@ public:
 
   bool                   autoUpdate() const;
   void                   setAutoUpdate( const bool );
+
+  bool                   updateModified() const;
+  void                   setUpdateModified( const bool );
+
   bool                   isSortingEnabled() const;
   bool                   customSorting( const int ) const;
 
+  virtual void             forgetObject( const SUIT_DataObject* );
   virtual bool             lessThan( const QModelIndex&, const QModelIndex& ) const;
   virtual void             registerColumn( const int group_id, const QString& name, const int custom_id );
   virtual void             unregisterColumn( const int group_id, const QString& name );
@@ -221,6 +275,15 @@ public:
   virtual QPixmap          columnIcon( const QString& name ) const;
   virtual void             setAppropriate( const QString& name, const Qtx::Appropriate appr );
   virtual Qtx::Appropriate appropriate( const QString& name ) const;
+  virtual void                  setVisibilityState(const QString& id, Qtx::VisibilityState state);
+  virtual void                  setVisibilityStateForAll(Qtx::VisibilityState state);
+  virtual Qtx::VisibilityState  visibilityState(const QString& id) const;
+  virtual void                  setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags );
+  virtual Qtx::HeaderViewFlags  headerFlags( const QString& name ) const;
+  virtual void             emitClicked( SUIT_DataObject* obj, const QModelIndex& index);
+
+  virtual SUIT_DataSearcher*    searcher() const;
+  virtual void                  setSearcher( SUIT_DataSearcher* );
 
   QAbstractItemDelegate* delegate() const;
 
@@ -231,9 +294,12 @@ public slots:
 
 signals:
   void modelUpdated();
+  void clicked( SUIT_DataObject*, int );
+  void dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
 
 protected:
   SUIT_AbstractModel*    treeModel() const;
+  virtual bool           filterAcceptsRow( int, const QModelIndex& ) const;
 
 private:
   bool                   mySortingEnabled;
@@ -247,7 +313,9 @@ public:
   SUIT_ItemDelegate( QObject* = 0 );
   
   virtual void paint( QPainter*, const QStyleOptionViewItem&,
-                     const QModelIndex& ) const;
+                      const QModelIndex& ) const;
+                      
+  virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
 };
 
 #ifdef WIN32
index 1369fde22b819cac0aa26a16e67592e207d97492..2b94e98ea7a37faebba02e6cf9e29e9978d104dc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SUIT_TreeSync.h
 // Author : Alexander SOLOVYOV
 //
@@ -54,17 +55,17 @@ TrgItem synchronize( const SrcItem&, const TrgItem&, const TreeData& );
 
 template <class SrcItem, class TrgItem, class TreeData>
 QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem&, 
-                                                const TrgItem&, 
-                                                const TreeData& );
+                                                 const TrgItem&, 
+                                                 const TreeData& );
 
 template <class SrcItem, class TrgItem, class TreeData>
 TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const TreeData& );
 
 template <class SrcItem, class TrgItem, class TreeData>
 const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
-                                                        const typename QList<TrgItem>::const_iterator& first,
-                                                        const typename QList<TrgItem>::const_iterator& last,
-                                                        const TreeData& td );
+                                                         const typename QList<TrgItem>::const_iterator& first,
+                                                         const typename QList<TrgItem>::const_iterator& last,
+                                                         const TreeData& td );
 
 
 //
@@ -129,24 +130,24 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td )
     for ( ; anIt != aLast; anIt++ ) {
       const DiffItem<SrcItem,TrgItem>& item = *anIt;
       if ( item.mySrc == td.nullSrc() ) {
-       if ( item.myTrg == td.nullTrg() )
-         qDebug( "error: both null" );
+        if ( item.myTrg == td.nullTrg() )
+          qDebug( "error: both null" );
         else
-         // delete item
-         td.deleteItemWithChildren( item.myTrg );
+          // delete item
+          td.deleteItemWithChildren( item.myTrg );
       }
       else {
-       if ( item.myTrg == td.nullTrg() ) {
-         // add item (recursively)
-         TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
-         if ( nitem != td.nullTrg() )
-           lastItem = nitem;
-       }
+        if ( item.myTrg == td.nullTrg() ) {
+          // add item (recursively)
+          TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
+          if ( nitem != td.nullTrg() )
+            lastItem = nitem;
+        }
         else {
-         // update item
-         synchronize( item.mySrc, item.myTrg, td );
-         lastItem = item.myTrg;
-       }
+          // update item
+          synchronize( item.mySrc, item.myTrg, td );
+          lastItem = item.myTrg;
+        }
       }
     }
     return r2;
@@ -177,9 +178,9 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td )
 */
 template <class SrcItem, class TrgItem, class TreeData>
 const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
-                                                        const typename QList<TrgItem>::const_iterator& first,
-                                                        const typename QList<TrgItem>::const_iterator& last,
-                                                        const TreeData& td )
+                                                         const typename QList<TrgItem>::const_iterator& first,
+                                                         const typename QList<TrgItem>::const_iterator& last,
+                                                         const TreeData& td )
 {
   typename QList<TrgItem>::const_iterator cur = first;
   for ( ; cur != last; cur++ ) {
@@ -199,7 +200,7 @@ const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
 */
 template <class SrcItem, class TrgItem, class TreeData>
 QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgItem& trg,
-                                                const TreeData& td )
+                                                 const TreeData& td )
 {
   //if( src==td.nullSrc() || trg==td.nullTrg() )
   //  return;
@@ -219,10 +220,10 @@ QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgIt
       // target is found
       // mark all items before found one as "to be deleted"
       for ( typename QList<TrgItem>::const_iterator it = cur; it != f; it++ ) {
-       DiffItem<SrcItem,TrgItem> ndiff;
-       ndiff.mySrc = td.nullSrc();
-       ndiff.myTrg = *it;        // delete item
-       d.append( ndiff );
+        DiffItem<SrcItem,TrgItem> ndiff;
+        ndiff.mySrc = td.nullSrc();
+        ndiff.myTrg = *it;        // delete item
+        d.append( ndiff );
       }
       cur = f;
       DiffItem<SrcItem,TrgItem> ndiff;
@@ -261,7 +262,7 @@ QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgIt
 */
 template <class SrcItem, class TrgItem, class TreeData>
 TrgItem createSubTree( const SrcItem& src, const TrgItem& parent,
-                      const TrgItem& after, const TreeData& td )
+                       const TrgItem& after, const TreeData& td )
 {
   if ( src == td.nullSrc() )
     return td.nullTrg();
index c3ff10c41508c1d40f3e3eea98d1c2362680dd71..70351487517b41afd9d408a8f231b034ef625497 100755 (executable)
@@ -1,30 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUIT_ViewManager.h"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_ViewModel.h"
 #include "SUIT_ViewWindow.h"
 #include "SUIT_Study.h"
+#include "SUIT_Session.h"
 
 #include <QMap>
 #include <QRegExp>
@@ -45,9 +47,9 @@ SUIT_ViewManager::SUIT_ViewManager( SUIT_Study* theStudy,
                                     SUIT_Desktop* theDesktop,
                                     SUIT_ViewModel* theViewModel )
 : QObject( 0 ),
-myDesktop( theDesktop ),
-myTitle( "Default: %M - viewer %V" ),
-myStudy( NULL )
+  myDesktop( theDesktop ),
+  myTitle( "Default: %M - viewer %V" ),
+  myStudy( NULL )
 {
   myViewModel = 0;
   myActiveView = 0;
@@ -83,6 +85,16 @@ int SUIT_ViewManager::useNewId( const QString& type )
   return id;
 }
 
+
+int SUIT_ViewManager::getGlobalId() const {
+  int id = -1;
+  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+  if(app) {
+    id = app->viewManagerId(this);
+  }
+  return id;
+}
+
 void SUIT_ViewManager::setTitle( const QString& theTitle )
 {
   if ( myTitle == theTitle )
@@ -208,6 +220,9 @@ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView)
   connect(theView, SIGNAL(closing(SUIT_ViewWindow*)),
           this,    SLOT(onClosingView(SUIT_ViewWindow*)));
 
+  connect(theView, SIGNAL(tryClosing(SUIT_ViewWindow*)),
+          this,    SIGNAL(tryCloseView(SUIT_ViewWindow*)));
+
   connect(theView, SIGNAL(mousePressed(SUIT_ViewWindow*, QMouseEvent*)),
           this,    SLOT(onMousePressed(SUIT_ViewWindow*, QMouseEvent*)));
 
@@ -260,6 +275,7 @@ void SUIT_ViewManager::closeView( SUIT_ViewWindow* theView )
 
   QPointer<SUIT_ViewWindow> view( theView );
 
+  view->setClosable( false );
   view->hide();
 
   if ( !view->testAttribute( Qt::WA_DeleteOnClose ) )
index 9126290a63fb5ecda6f2dff52e6294e5c3821233..8a351ae437113f6ff738e3407d965305f718c5fd 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_VIEWMANAGER_H
 #define SUIT_VIEWMANAGER_H
 
@@ -82,12 +83,15 @@ public:
 
   int              getId() const;
 
+  int              getGlobalId() const;
+
 public slots:
   void             createView();
   void             closeAllViews();
 
 signals:
   void             lastViewClosed(SUIT_ViewManager*);
+  void             tryCloseView(SUIT_ViewWindow*);
   void             deleteView(SUIT_ViewWindow*);
   void             viewCreated(SUIT_ViewWindow*);
   void             mousePress(SUIT_ViewWindow*, QMouseEvent*);
index 4061961857d147fc5efe7d862f7c73f01d7a8e96..226574278183de55450ff1b9342f274aa9476f58 100755 (executable)
@@ -1,31 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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"
 #include "SUIT_ViewWindow.h"
 
-SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap;
-SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap;
+SUIT_ViewModel::InteractionStyle2StatesMap SUIT_ViewModel::myStateMap;
+SUIT_ViewModel::InteractionStyle2ButtonsMap SUIT_ViewModel::myButtonMap;
 
 static bool isInitialized = false;
 
@@ -36,17 +37,31 @@ SUIT_ViewModel::SUIT_ViewModel()
   {
     isInitialized = true;
 
-    SUIT_ViewModel::myStateMap[ZOOM]  = Qt::ControlModifier;
-    SUIT_ViewModel::myButtonMap[ZOOM] = Qt::LeftButton;
+    // standard interaction style
+    SUIT_ViewModel::myStateMap[STANDARD][ZOOM]  = Qt::ControlModifier;
+    SUIT_ViewModel::myButtonMap[STANDARD][ZOOM] = Qt::LeftButton;
+
+    SUIT_ViewModel::myStateMap[STANDARD][PAN]   = Qt::ControlModifier;
+    SUIT_ViewModel::myButtonMap[STANDARD][PAN]  = Qt::MidButton;
+
+    SUIT_ViewModel::myStateMap[STANDARD][ROTATE]  = Qt::ControlModifier;
+    SUIT_ViewModel::myButtonMap[STANDARD][ROTATE] = Qt::RightButton;
+
+    SUIT_ViewModel::myStateMap[STANDARD][FIT_AREA]  = Qt::ControlModifier;
+    SUIT_ViewModel::myButtonMap[STANDARD][FIT_AREA] = Qt::RightButton;
+
+    // "key free" interaction style
+    SUIT_ViewModel::myStateMap[KEY_FREE][ZOOM]  = Qt::NoModifier;
+    SUIT_ViewModel::myButtonMap[KEY_FREE][ZOOM] = Qt::LeftButton | Qt::MidButton;
 
-    SUIT_ViewModel::myStateMap[PAN]   = Qt::ControlModifier;
-    SUIT_ViewModel::myButtonMap[PAN]  = Qt::MidButton;
+    SUIT_ViewModel::myStateMap[KEY_FREE][PAN]   = Qt::NoModifier;
+    SUIT_ViewModel::myButtonMap[KEY_FREE][PAN]  = Qt::MidButton;
 
-    SUIT_ViewModel::myStateMap[ROTATE]  = Qt::ControlModifier;
-    SUIT_ViewModel::myButtonMap[ROTATE] = Qt::RightButton;
+    SUIT_ViewModel::myStateMap[KEY_FREE][ROTATE]  = Qt::NoModifier;
+    SUIT_ViewModel::myButtonMap[KEY_FREE][ROTATE] = Qt::LeftButton;
 
-    SUIT_ViewModel::myStateMap[FIT_AREA]  = Qt::ControlModifier;
-    SUIT_ViewModel::myButtonMap[FIT_AREA] = Qt::RightButton;
+    SUIT_ViewModel::myStateMap[KEY_FREE][FIT_AREA]  = Qt::NoModifier; // unused
+    SUIT_ViewModel::myButtonMap[KEY_FREE][FIT_AREA] = Qt::NoButton;   // unused
   }
   myViewManager = 0;
 }
@@ -85,10 +100,11 @@ SUIT_ViewManager* SUIT_ViewModel::getViewManager() const
  *\param theState - adding state to state map operations.
  *\param theButton - adding state to button map operations.
  */
-void SUIT_ViewModel::setHotButton( HotOperation theOper, Qt::KeyboardModifier theState, Qt::MouseButton theButton )
+void SUIT_ViewModel::setHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+                                   Qt::KeyboardModifiers theState, Qt::MouseButtons theButton )
 {
-  myStateMap[theOper]  = theState;
-  myButtonMap[theOper] = theButton;
+  myStateMap[theInteractionStyle][theOper]  = theState;
+  myButtonMap[theInteractionStyle][theOper] = theButton;
 }
 
 /*! Gets hot button for operation \a theOper.
@@ -96,8 +112,9 @@ void SUIT_ViewModel::setHotButton( HotOperation theOper, Qt::KeyboardModifier th
  *\param theState - output state from state map operations.
  *\param theButton - output state from button map operations.
 */
-void SUIT_ViewModel::getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState, Qt::MouseButton& theButton )
+void SUIT_ViewModel::getHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+                                   Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton )
 {
-  theState  = myStateMap[theOper];
-  theButton = myButtonMap[theOper];
+  theState  = myStateMap[theInteractionStyle][theOper];
+  theButton = myButtonMap[theInteractionStyle][theOper];
 }
index baff2049ef9375f87d0539d085884e2a1a616caf..5249b135d7560a6434ec5370465ab412110f42c7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUIT_VIEWMODEL_H
 #define SUIT_VIEWMODEL_H
 
@@ -44,12 +45,16 @@ class SUIT_ViewManager;
  */
 class SUIT_EXPORT SUIT_ViewModel : public QObject
 {
-       Q_OBJECT
+        Q_OBJECT
 public:
   enum HotOperation { PAN, ZOOM, ROTATE, FIT_AREA };
+  enum InteractionStyle { STANDARD, KEY_FREE };
+
+  typedef QMap<HotOperation, Qt::KeyboardModifiers> StatesMap;
+  typedef QMap<HotOperation, Qt::MouseButtons>      ButtonsMap;
 
-  typedef QMap<HotOperation, Qt::KeyboardModifier> StatesMap;
-  typedef QMap<HotOperation, Qt::MouseButton>      ButtonsMap;
+  typedef QMap<InteractionStyle, StatesMap>         InteractionStyle2StatesMap;
+  typedef QMap<InteractionStyle, ButtonsMap>        InteractionStyle2ButtonsMap;
   
   SUIT_ViewModel();
   virtual ~SUIT_ViewModel();
@@ -63,17 +68,17 @@ public:
 
   virtual void      contextMenuPopup( QMenu* ) {}
 
-  static void       setHotButton( HotOperation theOper, Qt::KeyboardModifier theState,
-                                 Qt::MouseButton theButton );
-  static void       getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState,
-                                 Qt::MouseButton& theButton );
+  static void       setHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+                                  Qt::KeyboardModifiers theState, Qt::MouseButtons theButton );
+  static void       getHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+                                  Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton );
 
 protected:
   SUIT_ViewManager* myViewManager;
 
 public:
-  static StatesMap  myStateMap;
-  static ButtonsMap myButtonMap;
+  static InteractionStyle2StatesMap  myStateMap;
+  static InteractionStyle2ButtonsMap myButtonMap;
 };
 
 #ifdef WIN32
index cb7045eee7d7dca2be79e4dcf253ee278c103002..6bf0ebe3c3a8fb0bcbe60f56659d07fc08d70787 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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"
@@ -30,6 +31,7 @@
 #include "SUIT_Application.h"
 #include "SUIT_ViewManager.h"
 #include "QtxActionToolMgr.h"
+#include "QtxMultiAction.h"
 
 #include <QEvent>
 #include <QIcon>
@@ -45,15 +47,17 @@ const int DUMP_EVENT = QEvent::User + 123;
 
 /*! Constructor.*/
 SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop )
-: QMainWindow( theDesktop )
+  : QMainWindow( theDesktop ), myManager( 0 ), myIsDropDown( true )
 {
   myDesktop = theDesktop;
 
-  setWindowIcon( myDesktop->windowIcon() );
+  setWindowIcon( myDesktop ? myDesktop->windowIcon() : QApplication::windowIcon() );
 
   setAttribute( Qt::WA_DeleteOnClose );
 
   myToolMgr = new QtxActionToolMgr( this );
+
+  setProperty( "VectorsMode", false );
 }
 
 /*! Destructor.*/
@@ -116,6 +120,7 @@ bool SUIT_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
 */
 bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format )
 {
+  Qtx::Localizer loc;
   return dumpViewToFormat( dumpView(), fileName, format );
 }
 
@@ -132,7 +137,8 @@ void SUIT_ViewWindow::setDestructiveClose( const bool on )
 void SUIT_ViewWindow::closeEvent( QCloseEvent* e )
 {
   e->ignore();
-  emit closing( this );
+  emit tryClosing( this );
+  if ( closable() ) emit closing( this );
 }
 
 /*! Context menu requested for event \a e.
@@ -154,7 +160,8 @@ void SUIT_ViewWindow::contextMenuEvent( QContextMenuEvent* e )
 */
 void SUIT_ViewWindow::onDumpView()
 {
-  QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) );
+  // VSV (TRIPOLI dev): next line commented: causes error messages
+  //QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) );
   QApplication::postEvent( this, new QEvent( (QEvent::Type)DUMP_EVENT ) );
 }
 
@@ -175,18 +182,18 @@ 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(), filter(), tr( "TLT_DUMP_VIEW" ), 0 );
       if ( !fileName.isEmpty() )
       {
-             QString fmt = SUIT_Tools::extension( fileName ).toUpper();
-             bOk = dumpViewToFormat( im, fileName, fmt );
+        QImage im = dumpView();
+       QString fmt = SUIT_Tools::extension( fileName ).toUpper();
+       Qtx::Localizer loc;
+       bOk = dumpViewToFormat( im, fileName, fmt );
       }
       else
-             bOk = true; // cancelled
+       bOk = true; // cancelled
     }
     if ( !bOk )
       SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) );
@@ -210,10 +217,27 @@ bool SUIT_ViewWindow::action( const int  )
   return true;
 }
 
+/*! Returns \c true if view window can be closed by the user
+*/
+bool SUIT_ViewWindow::closable() const
+{
+  QVariant val = property( "closable" );
+  return !val.isValid() || val.toBool();
+}
+
+/*! Set / reset "closable" option of the view window
+*/
+bool SUIT_ViewWindow::setClosable( const bool on )
+{
+  bool prev = closable();
+  setProperty( "closable", on );
+  return prev;
+}
+
 /*!
   \return string containing visual parameters of window
 */
-QString   SUIT_ViewWindow::getVisualParameters()
+QString SUIT_ViewWindow::getVisualParameters()
 {
   return "empty";
 }
@@ -234,6 +258,67 @@ QtxActionToolMgr* SUIT_ViewWindow::toolMgr() const
   return myToolMgr;
 }
 
+/*!
+  \brief Set buttons mode to drop-down (\a on = \c true) or ligned (\a on = \c false) 
+  \param on new buttons mode
+  \sa dropDownButtons()
+*/
+void SUIT_ViewWindow::setDropDownButtons( bool on )
+{
+  if ( myIsDropDown != on ) {
+    myIsDropDown = on;
+    if ( myIsDropDown ) {
+      ActionsMap::const_iterator it;
+      for( it = myMultiActions.constBegin(); it != myMultiActions.constEnd(); ++it )
+      {
+       int tid = it.key();
+       const QList<QtxMultiAction*>& mlist = it.value();
+       QList<QtxMultiAction*>::const_iterator mit;
+       for ( mit = mlist.constBegin(); mit != mlist.constEnd(); ++mit )
+       {
+         QtxMultiAction* ma = *mit;
+         const QList<QAction*> alist = ma->actions();
+         if ( alist.isEmpty() ) continue;
+         int idx = toolMgr()->index( toolMgr()->actionId( alist[0] ), tid );
+         if ( idx == -1 ) continue;
+         foreach ( QAction* a, alist ) toolMgr()->remove( toolMgr()->actionId( a ), tid );
+         toolMgr()->insert( ma, tid, idx );
+       }
+      }
+      myMultiActions.clear();
+    }
+    else {
+      QIntList tblist = toolMgr()->toolBarsIds();
+      QIntList alist  = toolMgr()->idList();
+      foreach( int aid, alist )
+      {
+       QtxMultiAction* ma = qobject_cast<QtxMultiAction*>( toolMgr()->action( aid ) );
+       if ( !ma ) continue;
+       foreach( int tid, tblist )
+       {
+         int idx = toolMgr()->index( aid, tid );
+         if ( idx >= 0 )
+         {
+           myMultiActions[ tid ].append( ma );
+           toolMgr()->remove( aid, tid );
+           foreach( QAction* a, ma->actions() ) toolMgr()->insert( a, tid, idx++ );
+         }
+       }
+      }
+    }
+  }
+}
+
+/*!
+  \brief Get current buttons mode
+  \return current buttons mode
+  \sa setDropDownButtons()
+*/
+bool SUIT_ViewWindow::dropDownButtons() const
+{
+  return myIsDropDown;
+}
+
 /*!
   \return window unique identifier  
 */
index 8fcf5102dfb00df8f5229603a3848a7e01e18f31..e7dc87a1a8492625fc37c8face92e17287a06b5f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
 //
 #ifndef SUIT_VIEWWINDOW_H
 #include "SUIT.h"
 
 #include <QMainWindow>
+#include <QList>
+#include <QMap>
 
 class SUIT_Desktop;
 class SUIT_ViewManager;
 class QtxActionToolMgr;
+class QtxMultiAction;
 class QImage;
 
 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow 
 {
   Q_OBJECT
+
 public:
+
   SUIT_ViewWindow( SUIT_Desktop* );
   virtual ~SUIT_ViewWindow();
 
-  void              setViewManager( SUIT_ViewManager* );
+  virtual void      setViewManager( SUIT_ViewManager* );
   SUIT_ViewManager* getViewManager() const;
 
   bool              event(QEvent*);
@@ -50,6 +56,9 @@ public:
 
   bool              onAccelAction( int );
 
+  bool              closable() const;
+  bool              setClosable( const bool );
+
   virtual QString   getVisualParameters();
   virtual void      setVisualParameters( const QString& parameters );
 
@@ -59,10 +68,14 @@ public:
 
   QtxActionToolMgr* toolMgr() const;
 
+  virtual void      setDropDownButtons( bool );
+  bool              dropDownButtons() const;
+
 public slots:
   virtual void      onDumpView();
 
 signals:
+  void              tryClosing( SUIT_ViewWindow* );
   void              closing( SUIT_ViewWindow* );
   void              mousePressed( SUIT_ViewWindow*, QMouseEvent* );
   void              mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
@@ -84,7 +97,11 @@ protected:
   SUIT_ViewManager* myManager;
 
 private:
+  typedef QMap< int, QList<QtxMultiAction*> > ActionsMap;
+
   QtxActionToolMgr* myToolMgr;
+  bool              myIsDropDown;
+  ActionsMap        myMultiActions;
 };
 
-#endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
+#endif // SUIT_VIEWWINDOW_H
diff --git a/src/SUIT/resources/SUIT_images.po b/src/SUIT/resources/SUIT_images.po
deleted file mode 100755 (executable)
index 5be9df3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_DESK_WINDOW_CASCADE"
-msgstr "cascade.png"
-
-msgid "ICON_DESK_WINDOW_VTILE"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_TILE"
-msgstr "htile.png"
-
diff --git a/src/SUIT/resources/SUIT_msg_en.po b/src/SUIT/resources/SUIT_msg_en.po
deleted file mode 100755 (executable)
index 9eb98ee..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "MEN_DESK_WINDOW"
-msgstr "&Window"
-
-msgid "MEN_DESK_WINDOW_CASCADE"
-msgstr "&Cascade"
-
-msgid "PRP_DESK_WINDOW_CASCADE"
-msgstr "Arranges the windows as overlapping tiles"
-
-msgid "MEN_DESK_WINDOW_TILE"
-msgstr "&Tile"
-
-msgid "PRP_DESK_WINDOW_TILE"
-msgstr "Arranges the windows as nonoverlapping tiles"
-
-msgid "MEN_DESK_WINDOW_VTILE"
-msgstr "Tile &Vertically"
-
-msgid "PRP_DESK_WINDOW_VTILE"
-msgstr "Arranges the windows as nonoverlapping vertical tiles"
-
-msgid "PRP_DESK_WINDOW_ACTIVATE"
-msgstr "Activates this window"
-
-msgid "LAB_QUICK_PATH"
-msgstr "Quick path:"
-
-msgid "BUT_ADD_PATH"
-msgstr "Add path"
-
-msgid "INF_DESK_DOC_OPEN"
-msgstr "Open File"
-
-msgid "INF_DESK_DOC_SAVE"
-msgstr "Save File"
-
-msgid "ERR_ERROR"
-msgstr "Error"
-
-msgid "WRN_WARNING"
-msgstr "Warning"
-
-msgid "ERR_DIR_NOT_EXIST"
-msgstr "The directory \"%1\" does not exist!"
-
-msgid "ERR_FILE_NOT_EXIST"
-msgstr "The file \"%1\" does not exist!"
-
-msgid "ERR_PERMISSION_DENIED"
-msgstr "Can't save file \"%1\".\nPermission denied."
-
-msgid "INF_DIRECTORIES_FILTER"
-msgstr "Directories"
-
-msgid "QUE_FILE_EXISTS"
-msgstr "The file \"%1\" already exists.\nDo you want to overwrite it?"
-
-msgid "TLT_DUMP_VIEW"
-msgstr "Dump View to File"
-
-msgid "TLT_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)""
-
-msgid "ERR_CANT_DUMP_VIEW"
-msgstr "Can't dump view contents to the file."
-
-msgid "CONTINUE"
-msgstr "Continue"
-
-msgid "CANCEL"
-msgstr "Cancel"
-
-#======================================================================
-
-msgid "SUIT_Study::OPERATION_LAUNCH"
-msgstr "Operation launch"
-
-msgid "SUIT_Study::PREVIOUS_NOT_FINISHED"
-msgstr "Previous operation is not finished and will be aborted"
-
-#======================================================================
-
-
-
-
-
-
-
-                                            
\ No newline at end of file
index feb7e2a3030e686b04cd5b8f1e981897cc61d36f..c1435da5bad404f50a62202a39d585a34dc45712 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
@@ -76,6 +55,21 @@ Do you want to overwrite it ?</translation>
     <message>
         <source>ERR_PERMISSION_DENIED</source>
         <translation>Can&apos;t save file &quot;%1&quot;.
+Permission denied.</translation>
+    </message>
+    <message>
+        <source>ERR_OPEN_PERMISSION_DENIED</source>
+        <translation>Can&apos;t open file &quot;%1&quot;.
+Permission denied.</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_READ_PERMISSION_DENIED</source>
+        <translation>Can&apos;t read directory &quot;%1&quot;.
+Permission denied.</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_WRITE_PERMISSION_DENIED</source>
+        <translation>Can&apos;t write directory &quot;%1&quot;.
 Permission denied.</translation>
     </message>
     <message>
@@ -84,7 +78,7 @@ Permission denied.</translation>
     </message>
     <message>
         <source>QUE_FILE_EXISTS</source>
-        <translation>The file &quot;%1&quot; already exists.
+        <translation>The file %1 already exists.
 Do you want to overwrite it?</translation>
     </message>
     <message>
index fae3df008cdaec07d85a04b9b5a19412f0c65f4d..d4dda85518d47f051788d37b69bcb39b595dd4ad 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : suitApp
@@ -33,14 +34,19 @@ salomeinclude_HEADERS =             \
 
 dist_libSUITApp_la_SOURCES =   \
        SUITApp.cxx             \
-       SUITApp_Application.cxx 
+       SUITApp_Application.cxx
+
+if ENABLE_PYCONSOLE
+  salomeinclude_HEADERS += SUITApp_init_python.hxx
+  dist_libSUITApp_la_SOURCES += SUITApp_init_python.cxx 
+endif
 
 MOC_FILES =                            \
        SUITApp_Application_moc.cxx
 
 nodist_libSUITApp_la_SOURCES = $(MOC_FILES)
 
-nodist_salomeres_DATA = SUITApp_msg_en.qm
+nodist_salomeres_DATA = SUITApp_msg_en.qm SUITApp_msg_fr.qm
 
 libSUITApp_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
                          -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
@@ -59,7 +65,7 @@ endif
 libSUITApp_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
 
 if ENABLE_PYCONSOLE
-libSUITApp_la_LDFLAGS += -Xlinker -export-dynamic $(PYTHON_LIBS)
+  libSUITApp_la_LDFLAGS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 endif
 
 # Executable
@@ -74,7 +80,10 @@ if ENABLE_TESTRECORDER
   SUITApp_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
 endif
 
-SUITApp_LDADD    = libSUITApp.la  ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
+SUITApp_LDADD    = libSUITApp.la  ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la ${QT_LIBS}
+if ENABLE_PYCONSOLE
+  SUITApp_LDADD += $(PYTHON_LIBS)
+endif
 
 if ENABLE_TESTRECORDER
   SUITApp_LDADD+= $(TESTRECORDER_LIBS)
index 9fefe90f0813d8f3328eb86481459a7b9b49311f..7a6b0c3e6dff463be3b40d32bece96b71257d125 100644 (file)
@@ -1,52 +1,53 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-#if defined WIN32
 
-#ifdef SUIT_ENABLE_PYTHON
-#undef SUIT_ENABLE_PYTHON
-#endif
-
-#else //#if defined WIN32
-
-#ifndef SUIT_ENABLE_PYTHON
+//#if defined WIN32
+//#ifdef SUIT_ENABLE_PYTHON
+//#undef SUIT_ENABLE_PYTHON
+//#endif
+//#else //#if defined WIN32
+//#ifndef SUIT_ENABLE_PYTHON
 // NOTE: DO NOT DELETE THIS DEFINITION ON LINUX
 // or make sure Python is initialized in main() in any case
 // Otherwise, application based on light SALOME and using Python 
 // are unlikely to work properly.
-#define SUIT_ENABLE_PYTHON
-#include <Python.h>
+//#define SUIT_ENABLE_PYTHON
+//#include <Python.h>
+//#endif
+//
+#ifdef SUIT_ENABLE_PYTHON
+#include "SUITApp_init_python.hxx"
 #endif
 
-#endif //#if defined WIN32
+//#endif //#if defined WIN32
 
+#include "GUI_version.h"
 #include "SUITApp_Application.h"
-
-#include <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_ResourceMgr.h>
-#include <Style_Salome.h>
-#include <QtxSplash.h>
-
-#include <SUIT_LicenseDlg.h>
+#include "SUIT_Desktop.h"
+#include "SUIT_LicenseDlg.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "Style_Salome.h"
+#include "QtxSplash.h"
 
 #include <QDir>
 #include <QFile>
 
 static QString salomeVersion()
 {
-  QString path( ::getenv( "GUI_ROOT_DIR" ) );
-  if ( !path.isEmpty() )
-    path += QDir::separator();
-
-  path += QString( "bin/salome/VERSION" );
-
-  QFile vf( path );
-  if ( !vf.open( QFile::ReadOnly ) )
-    return QString();
-
-  QString line = vf.readLine( 1024 );
-  vf.close();
-
-  if ( line.isEmpty() )
-    return QString();
-
-  while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
-    line.remove( line.length() - 1, 1 );
-
-  QString ver;
-  int idx = line.lastIndexOf( ":" );
-  if ( idx != -1 )
-    ver = line.mid( idx + 1 ).trimmed();
-
-  return ver;
+  return GUI_VERSION_STR;
 }
 
-static void MessageOutput( QtMsgType type, const char* msg )
+static QString getAppName( const QString& libName )
 {
-  switch ( type )
-  {
-  case QtDebugMsg:
-#ifdef _DEBUG_
-    printf( "Debug: %s\n", msg );
-#endif
-    break;
-  case QtWarningMsg:
-#ifdef _DEBUG_
-    printf( "Warning: %s\n", msg );
-#endif
-    break;
-  case QtFatalMsg:
-#ifdef _DEBUG_
-    printf( "Fatal: %s\n", msg );
-#endif
-    break;
-  default:
-    break;
-  }
+  QString appName = QFileInfo( libName ).baseName();
+  if ( appName.startsWith( "lib" ) ) appName = appName.mid( 3 );
+  return appName;
 }
 
+// static void MessageOutput( QtMsgType type, const char* msg )
+// {
+//   switch ( type )
+//   {
+//   case QtDebugMsg:
+// #ifdef _DEBUG_
+//     printf( "Debug: %s\n", msg );
+// #endif
+//     break;
+//   case QtWarningMsg:
+// #ifdef _DEBUG_
+//     printf( "Warning: %s\n", msg );
+// #endif
+//     break;
+//   case QtFatalMsg:
+// #ifdef _DEBUG_
+//     printf( "Fatal: %s\n", msg );
+// #endif
+//     break;
+//   default:
+//     break;
+//   }
+// }
+
 /* XPM */
 static const char* pixmap_not_found_xpm[] = {
 "16 16 3 1",
@@ -172,15 +156,15 @@ private:
 
 int main( int argc, char* argv[] )
 {
-#ifdef SUIT_ENABLE_PYTHON
-  // First of all initialize Python, as in complex multi-component applications
-  // someone else might initialize it some way unsuitable for light SALOME!
-  Py_SetProgramName( argv[0] );
-  Py_Initialize(); // Initialize the interpreter
-  PySys_SetArgv( argc,  argv );
-  PyEval_InitThreads(); // Create (and acquire) the interpreter lock
-  PyEval_ReleaseLock(); // Let the others use Python API until we need it again
-#endif
+  //#ifdef SUIT_ENABLE_PYTHON
+  //  // First of all initialize Python, as in complex multi-component applications
+  //  // someone else might initialize it some way unsuitable for light SALOME!
+  //  Py_SetProgramName( argv[0] );
+  //  Py_Initialize(); // Initialize the interpreter
+  //  PySys_SetArgv( argc,  argv );
+  //  PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+  //  PyEval_ReleaseLock(); // Let the others use Python API until we need it again
+  //#endif
 
   //qInstallMsgHandler( MessageOutput );
 
@@ -189,7 +173,7 @@ int main( int argc, char* argv[] )
   bool iniFormat        = false;
   bool noSplash         = false;
   bool useLicense       = false;
-  for ( int i = 1; i < argc /*&& !noExceptHandling*/; i++ )
+  for ( int i = 1; i < argc; i++ )
   {
     if ( !strcmp( argv[i], "--noexcepthandling" ) )
       noExceptHandling = true;
@@ -197,13 +181,25 @@ int main( int argc, char* argv[] )
       iniFormat = true;
     else if ( !strcmp( argv[i], "--nosplash") )
       noSplash = true;
-       else if ( !strcmp( argv[i], "--uselicense" ) )
+    else if ( !strcmp( argv[i], "--uselicense" ) )
       useLicense = true;
-       else
+    else
       argList.append( QString( argv[i] ) );
   }
 
+  // add $QTDIR/plugins to the pluins search path for image plugins
+  QString qtdir( ::getenv( "QTDIR" ) );
+  if ( !qtdir.isEmpty() )
+    QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
+  
   SUITApp_Application app( argc, argv );
+  QString cfgAppName = getAppName( argList.isEmpty() ? QString() : argList.first() );
+  // hard-coding for LightApp :( no other way to this for the moment
+  if ( cfgAppName == "LightApp" ) {
+    app.setOrganizationName( "salome" );
+    app.setApplicationName( "salome" );
+    app.setApplicationVersion( salomeVersion() );
+  }
 
   int result = -1;
 
@@ -241,46 +237,63 @@ int main( int argc, char* argv[] )
     {
       if ( resMgr )
       {
-       resMgr->loadLanguage( false );
-
-       splash = QtxSplash::splash( QPixmap() );
-       splash->readSettings( resMgr );
-       if ( splash->pixmap().isNull() ) {
-         delete splash;
-         splash = 0;
-       }
-       else {
-         QString appName    = QObject::tr( "APP_NAME" ).trimmed();
-         QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
-         if ( appVersion == "APP_VERSION" )
-         {
-           if ( appName == "APP_NAME" || appName.toLower() == "salome" )
-             appVersion = salomeVersion();
-           else
-             appVersion = "";
-         }
-         splash->setOption( "%A", appName );
-         splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
-         splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
-         splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
-         splash->show();
-         QApplication::instance()->processEvents();
-       }
+        resMgr->loadLanguage();
+
+        splash = QtxSplash::splash( QPixmap() );
+        splash->readSettings( resMgr );
+        if ( splash->pixmap().isNull() ) {
+          delete splash;
+          splash = 0;
+        }
+        else {
+          QString appName    = QObject::tr( "APP_NAME" ).trimmed();
+          QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
+          if ( appVersion == "APP_VERSION" )
+          {
+            if ( appName == "APP_NAME" || appName.toLower() == "salome" )
+              appVersion = salomeVersion();
+            else
+              appVersion = "";
+          }
+          splash->setOption( "%A", appName );
+          splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
+          splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
+          splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
+          splash->show();
+          QApplication::instance()->processEvents();
+        }
       }
     }
 
+#ifdef SUIT_ENABLE_PYTHON
+    //...Initialize python 
+    int   _argc   = 1;
+    char* _argv[] = {(char*)""};
+    SUIT_PYTHON::init_python(_argc,_argv);
+    
+    PyEval_RestoreThread( SUIT_PYTHON::_gtstate );
+    
+    if ( !SUIT_PYTHON::salome_shared_modules_module ) // import only once
+      SUIT_PYTHON::salome_shared_modules_module = PyImport_ImportModule( (char*)"salome_shared_modules" );
+    if ( !SUIT_PYTHON::salome_shared_modules_module ) 
+      PyErr_Print();
+    
+    PyEval_ReleaseThread( SUIT_PYTHON::_gtstate );
+
+#endif
+
     SUIT_Application* theApp = aSession->startApplication( argList.first() );
     if ( theApp )
     {
       Style_Salome::initialize( theApp->resourceMgr() );
       if ( theApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
-       Style_Salome::apply();
+        Style_Salome::apply();
 
       if ( !noExceptHandling )
         app.setHandler( aSession->handler() );
 
       if ( splash )
-       splash->finish( theApp->desktop() );
+        splash->finish( theApp->desktop() );
 
       result = app.exec();
     }
diff --git a/src/SUITApp/SUITApp.pro b/src/SUITApp/SUITApp.pro
deleted file mode 100644 (file)
index cd5f85f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = app
-TARGET = SUITApp
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-
-HEADERS  = SUITApp_Application.h
-
-SOURCES  = SUITApp.cxx
-SOURCES += SUITApp_Application.cxx
index b0c4f91675599668a61d6f237b82230ef3c2cfba..1a578e86bce631d6e5842bf9d918b4ea11960c23 100644 (file)
@@ -1,29 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUITApp_Application.h"
 
 #include <SUIT_Tools.h>
 #include <SUIT_ExceptionHandler.h>
 
+#include <Qtx.h>
+
 #include <QDir>
 #include <QTranslator>
 
@@ -41,7 +44,13 @@ SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_Exception
 #ifdef ENABLE_TESTRECORDER
   : TestApplication( argc, argv ),
 #else
-  : QApplication( argc, argv ),
+#ifndef WIN32
+  // san: Opening an X display and choosing a visual most suitable for 3D visualization
+  // in order to make SALOME viewers work with non-native X servers
+  : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+#else
+  : QApplication( argc, argv ), 
+#endif
 #endif
 myExceptHandler( hand )
 {
@@ -93,7 +102,7 @@ bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
 */
 void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand )
 {
-       myExceptHandler = hand;
+        myExceptHandler = hand;
 }
 
 /*!
index 17b41cd5d7adf84454e38a5538b3482ed0588bcb..dc669df2c1cee0a17f99ca9b0bb42b1a13fac3a7 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUITAPP_APPLICATION_H
 #define SUITAPP_APPLICATION_H
 
@@ -31,7 +32,7 @@
 class SUIT_ExceptionHandler;
 
 #ifdef WNT
-#  ifdef SUITAPP_EXPORTS
+#  if defined SUITAPP_EXPORTS || defined SUITApp_EXPORTS
 #    define SUITAPP_EXPORT __declspec(dllexport)
 #  else
 #   define SUITAPP_EXPORT __declspec(dllimport)
@@ -54,8 +55,8 @@ public:
 
   virtual bool notify( QObject* receiver, QEvent* e );
 
-       SUIT_ExceptionHandler* handler() const;
-       void                   setHandler( SUIT_ExceptionHandler* );
+        SUIT_ExceptionHandler* handler() const;
+        void                   setHandler( SUIT_ExceptionHandler* );
 
 private:
   SUIT_ExceptionHandler* myExceptHandler;
diff --git a/src/SUITApp/resources/SUITApp_msg_en.po b/src/SUITApp/resources/SUITApp_msg_en.po
deleted file mode 100644 (file)
index 7801991..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-msgid "APP_ERROR"
-msgstr "Error"
-
-msgid "APP_OK"
-msgstr "Ok"
-
-msgid "APP_UNK_EXCEPTION"
-msgstr "Unknown exception"
index c355758a68dd2ff11a103e1acb27adbbbddb3110..b67d2ec370bcaad2bee5d422b3a74f7be22013f0 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index 621001bb865bbb1f50d51ee9ac02d2b0e68e636d..d0245a46bf2c1a99e94a325c597f48502034fc55 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSUPERVGraph.la
@@ -48,7 +49,8 @@ dist_salomeres_DATA =                 \
 
 nodist_salomeres_DATA =                \
        SUPERVGraph_images.qm   \
-       SUPERVGraph_msg_en.qm  
+       SUPERVGraph_msg_en.qm   \
+       SUPERVGraph_msg_fr.qm  
 
 libSUPERVGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
                             -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT
index 2a923e09e4db19bfc2ddcec450bad5f0908cf89c..2735c8d88ba9e5e223f9ab0a57c34681f556d832 100755 (executable)
@@ -1,38 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SUPERVGraph.h"
 #include "SUPERVGraph_ViewFrame.h"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_ViewWindow.h"
 
-using namespace std;
-
 /*!
   Creates view
 */
index dcc9eaf4d89297041d3abac7a784f40ffb52c6bc..1d996132d2173fcdac5671826f6ed39e49dd95a5 100755 (executable)
@@ -1,35 +1,34 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SUPERVGraph_HeaderFile
 #define SUPERVGraph_HeaderFile
 
 #ifdef WIN32
-#ifdef SUPERVGRAPH_EXPORTS
+#if defined SUPERVGRAPH_EXPORTS || defined SUPERVGraph_EXPORTS
 #define SUPERVGRAPH_EXPORT __declspec(dllexport)
 #else
 #define SUPERVGRAPH_EXPORT __declspec(dllimport)
diff --git a/src/SUPERVGraph/SUPERVGraph.pro b/src/SUPERVGraph/SUPERVGraph.pro
deleted file mode 100644 (file)
index e0e1884..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SUPERVGraph
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += SUPERVGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = SUPERVGraph_ViewFrame.h
-HEADERS += SUPERVGraph_ViewManager.h
-HEADERS += SUPERVGraph_ViewModel.h
-HEADERS += SUPERVGraph.h
-
-SOURCES  = SUPERVGraph.cxx
-SOURCES += SUPERVGraph_ViewFrame.cxx
-SOURCES += SUPERVGraph_ViewManager.cxx
-SOURCES += SUPERVGraph_ViewModel.cxx
-
-TRANSLATIONS = resources/SUPERVGraph_images.ts \
-               resources/SUPERVGraph_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 6cabb4e4efa0d7a9e06e78031ae25b267097d986..8cebe97db462c76c724ca82144ad301454fbba43 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph_ViewFrame.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SUPERVGraph_ViewFrame.h"
 
 #include <SUIT_ResourceMgr.h>
@@ -34,9 +33,6 @@
 #include <QVBoxLayout>
 #include <QToolBar>
 
-using namespace std;
-
-
 /*!
   Constructor
 */
@@ -93,6 +89,7 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop )
   setBackgroundColor(QColor(R,G,B));*/
 
   myToolBar = new QToolBar(this);
+  myToolBar->setFloatable(false);
   //myToolBar->setCloseMode(QDockWindow::Undocked);
   myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
   createActions();
@@ -110,14 +107,14 @@ void SUPERVGraph_ViewFrame::createActions()
 
   // Panning
   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
-                         tr( "MNU_PAN_VIEW" ), 0, this);
+                          tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
   myActionsMap[ PanId ] = aAction;
 
   // Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
-                         tr( "MNU_RESET_VIEW" ), 0, this);
+                          tr( "MNU_RESET_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
   myActionsMap[ ResetId ] = aAction;
@@ -307,7 +304,7 @@ void SUPERVGraph_ViewFrame::onAdjustTrihedron()
   \param name - new name
 */
 void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject, 
-                                   QString newName )
+                                    QString newName )
 {
 //  MESSAGE ( "SUPERVGraph_ViewFrame::rename" )
 }
@@ -328,7 +325,7 @@ void SUPERVGraph_ViewFrame::unHighlightAll()
   \param update - update current viewer
 */
 void SUPERVGraph_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject, 
-                                      bool highlight, bool immediatly ) 
+                                       bool highlight, bool immediatly ) 
 {
 //  MESSAGE ( "SUPERVGraph_ViewFrame::highlight" )
 }
index 8f5dc645cef71bd668a9d1bbd8912ee780ad479b..53fcb25e0d88c9b1e6e7659ffbb2dfae1f593eed 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SUPERVGraph : build Supervisor viewer into desktop
 //  File   : SUPERVGraph_ViewFrame.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SUPERVGraph_ViewFrame_H
 #define SUPERVGraph_ViewFrame_H
 
@@ -79,17 +78,17 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
   
   /*  interactive object management */
   void                           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
-                                           bool highlight, bool immediatly = true );
+                                            bool highlight, bool immediatly = true );
   void                           unHighlightAll();
   void                           rename( const Handle(SALOME_InteractiveObject)& IObject,
-                                        QString newName );
+                                         QString newName );
   bool                           isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
   bool                           isVisible( const Handle(SALOME_InteractiveObject)& IObject );
   
   /* selection */
   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; };
 
-  /* display */                
+  /* display */         
   void           Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
   void           DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
   void           Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
index cf50f7e26ee262e43e4206053e5d8cddc17cde16..1b6f6d554b403889628bddad3e4c6400f855123f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUPERVGraph_ViewManager.h"
 
 #include "SUIT_ViewWindow.h"
@@ -29,8 +30,8 @@ int SUPERVGraph_ViewManager::myMaxId = 0;
   Constructor
 */
 SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy, 
-                                                 SUIT_Desktop* theDesktop, 
-                                                 SUIT_ViewModel* theViewModel )
+                                                  SUIT_Desktop* theDesktop, 
+                                                  SUIT_ViewModel* theViewModel )
   : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
 {
   myId = ++myMaxId;
index 30998a8e7a624d23232a0073a0671436562c5f02..e92dcba1adb9de12bfc489f2293068f4f1f6e29f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SUPERVGRAPH_VIEWMANAGER_H
 #define SUPERVGRAPH_VIEWMANAGER_H
 
index 59120a3fa443ed3f207c7c9e2863290d2c58ae64..27923f809a81578ffce52570aa6ee8bd9daa00d5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SUPERVGraph_ViewModel.h"
 #include "SUPERVGraph_ViewFrame.h"
 #include "SUIT_Desktop.h"
index 7b62c8cea39cc33772a3c14525fd4c5a92d63bd0..9031a1be69efbc2453679b03b02c147fb78a79b9 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
deleted file mode 100644 (file)
index 9787ad6..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  File:      SUPERVGraph_images.po
-#  Created:   11/22/2005 10:52:37 PM
-#  Author:    Margarita Karpunina
-
-msgid "ICON_SUPERVGraph_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_SUPERVGraph_RESET"
-msgstr "view_reset.png"
-
index 5d7cf3bbc2f5cdb04d87a56a2b671007b509cb2c..74ebf2e827278ff92b6d8f2555175ab99d48f897 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
diff --git a/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po
deleted file mode 100644 (file)
index 83edc98..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.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
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
index 145326d7497d5a1ff62f828fb6203eaa31816fe2..6a21a259ebf8ac397d613a61b9e0d38d59d0479b 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
index 4fd59aa4a111e9c280e720a5999969c0f01c8e0e..144ad705e85508099ad1ee7f8f2bf8846296dba4 100755 (executable)
@@ -1,28 +1,29 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Alexander Solovyov(OCN)
 #  Module : SVTK
-# $Header
+# $Header$
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -35,7 +36,6 @@ salomeinclude_HEADERS= \
        SALOME_Actor.h \
        SVTK_RectPicker.h \
        SVTK_DeviceActor.h \
-       SVTK_DialogBase.h \
        SVTK_FontWidget.h \
        SVTK_CubeAxesActor2D.h \
        SVTK_Functor.h \
@@ -57,7 +57,6 @@ salomeinclude_HEADERS= \
        SVTK_SetRotationPointDlg.h \
        SVTK_ViewParameterDlg.h \
        SVTK_ComboAction.h \
-       SVTK_Extension.h \
        SVTK_Recorder.h \
        SVTK_RecorderDlg.h \
        SVTK_ImageWriter.h \
@@ -73,7 +72,6 @@ dist_libSVTK_la_SOURCES= \
        SVTK_NonIsometricDlg.cxx \
        SVTK_UpdateRateDlg.cxx \
        SVTK_CubeAxesDlg.cxx \
-       SVTK_DialogBase.cxx \
        SVTK_FontWidget.cxx \
        SVTK_Trihedron.cxx \
        SVTK_View.cxx \
@@ -90,11 +88,14 @@ dist_libSVTK_la_SOURCES= \
        SVTK_SetRotationPointDlg.cxx \
        SVTK_ViewParameterDlg.cxx \
        SVTK_ComboAction.cxx \
-       SVTK_Extension.cxx \
        SVTK_Recorder.cxx \
        SVTK_RecorderDlg.cxx \
        SVTK_ImageWriter.cxx \
-       SVTK_ImageWriterMgr.cxx
+       SVTK_ImageWriterMgr.cxx \
+       vtkPVAxesActor.h \
+       vtkPVAxesActor.cxx \
+       vtkPVAxesWidget.h \
+       vtkPVAxesWidget.cxx
 
 
 # internal headers
@@ -107,7 +108,6 @@ MOC_FILES= \
        SVTK_UpdateRateDlg_moc.cxx \
        SVTK_CubeAxesDlg_moc.cxx \
        SVTK_FontWidget_moc.cxx \
-       SVTK_DialogBase_moc.cxx \
        SVTK_ViewModelBase_moc.cxx \
        SVTK_ViewManager_moc.cxx \
        SVTK_ViewWindow_moc.cxx \
@@ -128,13 +128,17 @@ dist_salomeres_DATA=\
        resources/vtk_view_perspective.png \
        resources/vtk_view_parameters.png \
        resources/vtk_view_style_switch.png \
+       resources/vtk_view_zooming_style_switch.png \
        resources/vtk_view_recording_start.png \
        resources/vtk_view_recording_play.png \
        resources/vtk_view_recording_pause.png \
-       resources/vtk_view_recording_stop.png
+       resources/vtk_view_recording_stop.png \
+       resources/vtk_view_sync.png \
+       resources/vtk_view_highlight.png
 
 nodist_salomeres_DATA =        \
        SVTK_msg_en.qm  \
+       SVTK_msg_fr.qm  \
        SVTK_images.qm
 
 libSVTK_la_CPPFLAGS =          \
@@ -144,17 +148,23 @@ libSVTK_la_CPPFLAGS =             \
        $(BOOST_CPPFLAGS)       \
        -I$(srcdir)/../Qtx      \
        -I$(srcdir)/../SUIT     \
+       -I$(srcdir)/../ViewerTools \
        -I$(srcdir)/../OBJECT   \
        -I$(srcdir)/../Prs      \
-       -I$(srcdir)/../VTKViewer
+       -I$(srcdir)/../VTKViewer \
+       -I$(srcdir)/../OpenGLUtils
 
 libSVTK_la_LDFLAGS =                   \
+       $(VTK_LIBS) $(OGL_LIBS)         \
        $(QT_MT_LIBS)                   \
-       $(CAS_KERNEL) $(CAS_VIEWER)     \
-       $(VTK_LIBS) $(OGL_LIBS)
+       $(CAS_KERNEL) $(CAS_VIEWER)     \
+       $(KERNEL_LDFLAGS)
+
 
-libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
-                   ../Prs/libSalomePrs.la ../VTKViewer/libVTKViewer.la
+libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../ViewerTools/libViewerTools.la \
+                   ../OBJECT/libSalomeObject.la ../Prs/libSalomePrs.la \
+                   ../VTKViewer/libVTKViewer.la ../OpenGLUtils/libOpenGLUtils.la \
+                   -lSALOMELocalTrace -lOpUtil
 
 # Executable
 bin_PROGRAMS = SVTK
index 0fc168c054edfbe675d91b87d167fa426214c30b..ad20490b22ba51da80df7cf4dd6ac145f25d7a07 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 /*!
   \class SALOME_Actor SALOME_Actor.h
   \brief Abstract class of SALOME Objects in VTK.
 #include "SALOME_Actor.h"
 #include "SALOME_InteractiveObject.hxx"
 
+#include "VTKViewer_Algorithm.h"
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_TransformFilter.h"
 #include "VTKViewer_GeometryFilter.h"
+#include "VTKViewer_FramedTextActor.h"
 #include "SVTK_RectPicker.h"
 
 #include "SVTK_Actor.h"
 
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
 // VTK Includes
 #include <vtkCell.h>
 #include <vtkLine.h>
@@ -62,8 +66,6 @@
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
-using namespace std;
-
 #if defined __GNUC__
   #if __GNUC__ == 2
     #define __GNUC_2__
@@ -77,8 +79,8 @@ namespace
 {
   int
   GetEdgeId(SALOME_Actor* theActor,
-           vtkPicker* thePicker, 
-           int theObjId)
+            vtkPicker* thePicker, 
+            int theObjId)
   {
     int anEdgeId = 0;
     if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
@@ -86,15 +88,15 @@ namespace
       thePicker->GetPickPosition(aPickPosition);
       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;  
-         vtkFloatingPointType pcoords[3], closestPoint[3], weights[3];
-         aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
-         if (aDist < aMinDist) {
-           aMinDist = aDist;
-           anEdgeId = -1 - i;
-         }
-       }
+        if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
+          int subId;  
+          vtkFloatingPointType pcoords[3], closestPoint[3], weights[3];
+          aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
+          if (aDist < aMinDist) {
+            aMinDist = aDist;
+            anEdgeId = -1 - i;
+          }
+        }
       }
     }
     return anEdgeId;
@@ -103,8 +105,8 @@ namespace
   inline
   bool
   CheckDimensionId(Selection_Mode theMode, 
-                  SALOME_Actor *theActor, 
-                  vtkIdType theObjId)
+                   SALOME_Actor *theActor, 
+                   vtkIdType theObjId)
   {
     switch(theMode){
     case CellSelection:
@@ -118,7 +120,27 @@ namespace
     };
     return false;
   }
+}
 
+namespace SVTK
+{
+  /*!
+    Make picker work with this actor only
+  */
+  TPickLimiter::TPickLimiter(vtkAbstractPicker* picker, SALOME_Actor* actor):myPicker(picker)
+  {
+    myPicker->InitializePickList();
+    myPicker->AddPickList( actor );
+    myPicker->SetPickFromList( true );
+  }
+  /*!
+    Unlimit picking
+  */
+  TPickLimiter::~TPickLimiter()
+  {
+    myPicker->SetPickFromList( false );
+    myPicker->InitializePickList();
+  }
 }
 
 
@@ -135,17 +157,21 @@ SALOME_Actor
   myPreHighlightActor(SVTK_Actor::New()),
   myHighlightActor(SVTK_Actor::New()),
   myOutline(vtkOutlineSource::New()),
-  myOutlineActor(VTKViewer_Actor::New())
+  myOutlineActor(VTKViewer_Actor::New()),
+  myIsDisplayNameActor(false),
+  myNameActor(VTKViewer_FramedTextActor::New())
 {
   myPreHighlightActor->Delete();
   myPreHighlightActor->Initialize();
   myPreHighlightActor->PickableOff();
   myPreHighlightActor->SetVisibility( false );
+  myPreHighlightActor->SetCoincident3DAllowed(true);
 
   myHighlightActor->Delete();
   myHighlightActor->Initialize();
   myHighlightActor->PickableOff();
   myHighlightActor->SetVisibility( false );
+  myHighlightActor->SetCoincident3DAllowed(true);
 
   myOutline->Delete();
 
@@ -162,6 +188,24 @@ SALOME_Actor
   myOutlineActor->GetProperty()->SetAmbient(1.0);
   myOutlineActor->GetProperty()->SetDiffuse(0.0);
   myOutlineActor->SetVisibility( false );
+
+  // Name actor
+  myNameActor->Delete();
+  myNameActor->SetVisibility(false);
+  myNameActor->SetPickable(false);
+  myNameActor->SetModePosition(VTKViewer_FramedTextActor::TopRight);
+  myNameActor->SetLayoutType(VTKViewer_FramedTextActor::Vertical);
+
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+  QColor aForegroundColor = aResourceMgr->colorValue( "VTKViewer", "group_names_text_color", Qt::white );
+  myNameActor->SetForegroundColor(aForegroundColor.redF(),
+                                  aForegroundColor.greenF(),
+                                  aForegroundColor.blueF());
+
+  vtkFloatingPointType aGroupNamesTransparency = 0.5;
+  aGroupNamesTransparency = aResourceMgr->doubleValue( "VTKViewer", "group_names_transparency", aGroupNamesTransparency );
+  myNameActor->SetTransparency(aGroupNamesTransparency);
 }
 
 /*!
@@ -211,8 +255,9 @@ void
 SALOME_Actor
 ::setName(const char* theName)
 {
-  if(hasIO())  
+  if(hasIO())   
     myIO->setName(theName);
+  myNameActor->SetText(theName);
   Superclass::setName(theName);
 }
 
@@ -231,6 +276,7 @@ SALOME_Actor
   theRenderer->AddActor( myPreHighlightActor.GetPointer() );
   theRenderer->AddActor( myHighlightActor.GetPointer() );
   theRenderer->AddActor( myOutlineActor.GetPointer() );
+  theRenderer->AddActor( myNameActor.GetPointer() );
 }
 
 /*!
@@ -245,6 +291,7 @@ SALOME_Actor
   theRenderer->RemoveActor( myPreHighlightActor.GetPointer() );
   theRenderer->RemoveActor( myHighlightActor.GetPointer() );
   theRenderer->RemoveActor( myOutlineActor.GetPointer() );
+  theRenderer->RemoveActor( myNameActor.GetPointer() );
 }
 
 /*!
@@ -299,8 +346,8 @@ SALOME_Actor
 void
 SALOME_Actor
 ::SetPosition(vtkFloatingPointType _arg1, 
-             vtkFloatingPointType _arg2, 
-             vtkFloatingPointType _arg3)
+              vtkFloatingPointType _arg2, 
+              vtkFloatingPointType _arg3)
 {
   Superclass::SetPosition(_arg1,_arg2,_arg3);
 
@@ -339,6 +386,18 @@ SALOME_Actor
       myHighlightActor->SetVisibility( theVisibility && isHighlighted() && aHasIndex);
     }
   }
+
+  UpdateNameActors();
+}
+
+/*!
+  Gets know whether the actor should be displayed or not
+*/
+bool 
+SALOME_Actor
+::ShouldBeDisplayed()
+{
+  return true;
 }
 
 /*!
@@ -369,20 +428,20 @@ SALOME_Actor
       mySelector->GetIndex( getIO(), aMapIndex );
       switch( mySelectionMode ){
       case NodeSelection:
-       myHighlightActor->GetProperty()->SetRepresentationToPoints();
-       myHighlightActor->MapPoints( this, aMapIndex );
-       break;
+        myHighlightActor->GetProperty()->SetRepresentationToPoints();
+        myHighlightActor->MapPoints( this, aMapIndex );
+        break;
       case EdgeOfCellSelection:
-       myHighlightActor->GetProperty()->SetRepresentationToWireframe();
-       myHighlightActor->MapEdge( this, aMapIndex );
-       break;
+        myHighlightActor->GetProperty()->SetRepresentationToWireframe();
+        myHighlightActor->MapEdge( this, aMapIndex );
+        break;
       case CellSelection:
       case EdgeSelection:
       case FaceSelection:
       case VolumeSelection:
-       myHighlightActor->GetProperty()->SetRepresentationToSurface();
-       myHighlightActor->MapCells( this, aMapIndex );
-       break;
+        myHighlightActor->GetProperty()->SetRepresentationToSurface();
+        myHighlightActor->MapCells( this, aMapIndex );
+        break;
       }
       myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
     }
@@ -399,7 +458,8 @@ SALOME_Actor
 ::highlight(bool theIsHighlight)
 {
   vtkFloatingPointType aBounds[6];
-  GetInput()->GetBounds(aBounds);
+  vtkDataSet * aDataSet = GetHighlightedDataSet();
+  aDataSet->GetBounds(aBounds);
   myOutline->SetBounds(aBounds);
   myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
 
@@ -413,8 +473,8 @@ SALOME_Actor
 bool
 SALOME_Actor
 ::PreHighlight(vtkInteractorStyle *theInteractorStyle, 
-              SVTK_SelectionEvent* theSelectionEvent,
-              bool theIsHighlight)
+               SVTK_SelectionEvent* theSelectionEvent,
+               bool theIsHighlight)
 {
   if ( !GetPickable() )
     return false;
@@ -423,46 +483,51 @@ SALOME_Actor
   //
   myPreHighlightActor->SetVisibility( false );
   bool anIsPreselected = myIsPreselected;
-  
+  SetPreSelected( false );
+
   Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
   bool anIsChanged = (mySelectionMode != aSelectionMode);
 
+  myPreHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
+
   vtkFloatingPointType x = theSelectionEvent->myX;
   vtkFloatingPointType y = theSelectionEvent->myY;
   vtkFloatingPointType z = 0.0;
 
   if( !theIsHighlight ) {
-    SetPreSelected( false );
-    vtkActorCollection* theActors = aRenderer->GetActors();
-    theActors->InitTraversal();
-    while( vtkActor *ac = theActors->GetNextActor() )
-      if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
-       if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
-         anActor->SetPreSelected( false );
-
+    if ( hasIO() ) {
+      VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+      vtkActorCollection* theActors = aCopy.GetActors();
+      theActors->InitTraversal();
+      while( vtkActor *ac = theActors->GetNextActor() )
+       if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
+         if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+           anActor->SetPreSelected( false );
+    }
   }else{
-    switch(aSelectionMode){
+    switch(aSelectionMode) {
     case NodeSelection: 
     {
+      SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
       myPointPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myPointPicker->GetPointId();
       if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
-       int anObjId = GetNodeObjId( aVtkId );
-       myIsPreselected = (anObjId >= 0);
-       if(myIsPreselected){
-         const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
-         int anExtent = aMapIndex.Extent();
-         anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1));
-         if(anIsChanged){
-           TColStd_IndexedMapOfInteger aMapIndex;
-           aMapIndex.Add( anObjId );
-           
-           myPreHighlightActor->GetProperty()->SetRepresentationToPoints();
-           myPreHighlightActor->MapPoints( this, aMapIndex );
-         }
-         myPreHighlightActor->SetVisibility( true );
-       }
+        int anObjId = GetNodeObjId( aVtkId );
+        myIsPreselected = (anObjId >= 0);
+        if(myIsPreselected){
+          const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+          int anExtent = aMapIndex.Extent();
+          anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
+          if(anIsChanged){
+            TColStd_IndexedMapOfInteger aMapIndex;
+            aMapIndex.Add( anObjId );
+            
+            myPreHighlightActor->GetProperty()->SetRepresentationToPoints();
+            myPreHighlightActor->MapPoints( this, aMapIndex );
+          }
+          myPreHighlightActor->SetVisibility( true );
+        }
       }
       break;
     }
@@ -471,71 +536,76 @@ SALOME_Actor
     case FaceSelection:
     case VolumeSelection: 
     {
+      SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
       myCellPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myCellPicker->GetCellId();
       if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) && hasIO() ) {
-       int anObjId = GetElemObjId (aVtkId );
-       if ( anObjId >= 0 ) {
-         myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId);
-         if(myIsPreselected){
-           const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
-           int anExtent = aMapIndex.Extent();
-           anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1));
-           if(anIsChanged){
-             TColStd_IndexedMapOfInteger aMapIndex;
-             aMapIndex.Add( anObjId );
-             
-             myPreHighlightActor->GetProperty()->SetRepresentationToSurface();
-             myPreHighlightActor->MapCells( this, aMapIndex );
-           }
-           myPreHighlightActor->SetVisibility( true );
-         }
-       }
+        int anObjId = GetElemObjId (aVtkId );
+        if ( anObjId >= 0 ) {
+          myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId);
+          if(myIsPreselected){
+            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+            int anExtent = aMapIndex.Extent();
+            anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
+            if(anIsChanged){
+              TColStd_IndexedMapOfInteger aMapIndex;
+              aMapIndex.Add( anObjId );
+              
+              myPreHighlightActor->GetProperty()->SetRepresentationToSurface();
+              myPreHighlightActor->MapCells( this, aMapIndex );
+            }
+            myPreHighlightActor->SetVisibility( true );
+          }
+        }
       }
       break;
     }
     case EdgeOfCellSelection:
     {
+      SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
       myCellPicker->Pick( x, y, z, aRenderer );
       
       int aVtkId = myCellPicker->GetCellId();
       if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) {
-       int anObjId = GetElemObjId( aVtkId );
-       if ( anObjId >= 0 ) {
-         int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
-         myIsPreselected = anEdgeId < 0;
-         if(myIsPreselected){
-           const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
-           int anExtent = aMapIndex.Extent();
-           anIsChanged |= (anExtent == 0 || anExtent == 1);
-           anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
-           if(anIsChanged){
-             TColStd_IndexedMapOfInteger aMapIndex;
-             aMapIndex.Add( anObjId );
-             aMapIndex.Add( anEdgeId );
-
-             myPreHighlightActor->GetProperty()->SetRepresentationToWireframe();
-             myPreHighlightActor->MapEdge( this, aMapIndex );
-           }
-           myPreHighlightActor->SetVisibility( true );
-         }
-       }
+        int anObjId = GetElemObjId( aVtkId );
+        if ( anObjId >= 0 ) {
+          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+          myIsPreselected = anEdgeId < 0;
+          if(myIsPreselected){
+            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+            int anExtent = aMapIndex.Extent();
+            anIsChanged |= (anExtent == 0 || anExtent == 1);
+            anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
+            if(anIsChanged){
+              TColStd_IndexedMapOfInteger aMapIndex;
+              aMapIndex.Add( anObjId );
+              aMapIndex.Add( anEdgeId );
+
+              myPreHighlightActor->GetProperty()->SetRepresentationToWireframe();
+              myPreHighlightActor->MapEdge( this, aMapIndex );
+            }
+            myPreHighlightActor->SetVisibility( true );
+          }
+        }
       }
       break;
     }
     case ActorSelection : 
     {
       if( !mySelector->IsSelected( myIO ) ) {
-       SetPreSelected( true );
-
-       vtkActorCollection* theActors = aRenderer->GetActors();
-       theActors->InitTraversal();
-       while( vtkActor *anAct = theActors->GetNextActor() ) {
-         if( anAct != this )
-           if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
-             if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
-               anActor->SetPreSelected( true );
+        SetPreSelected( true );
+
+       if ( hasIO() ) {
+         VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+         vtkActorCollection* theActors = aCopy.GetActors();
+         theActors->InitTraversal();
+         while( vtkActor *anAct = theActors->GetNextActor() ) {
+           if( anAct != this )
+             if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
+               if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+                 anActor->SetPreSelected( true );
+         }
        }
       }
     }
@@ -556,10 +626,10 @@ SALOME_Actor
 bool
 SALOME_Actor
 ::Highlight(vtkInteractorStyle *theInteractorStyle, 
-           SVTK_SelectionEvent* theSelectionEvent,
-           bool theIsHighlight)
+            SVTK_SelectionEvent* theSelectionEvent,
+            bool theIsHighlight)
 {
-  if ( !GetPickable() )
+  if ( !GetPickable() || !mySelector )
     return false;
 
   myOutlineActor->SetVisibility( false );
@@ -576,6 +646,8 @@ SALOME_Actor
   if ( !theIsHighlight )
     return true;
 
+  myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
+
   vtkFloatingPointType x = theSelectionEvent->myX;
   vtkFloatingPointType y = theSelectionEvent->myY;
   vtkFloatingPointType z = 0.0;
@@ -583,15 +655,16 @@ SALOME_Actor
   if( !theSelectionEvent->myIsRectangle ) {
     switch(aSelectionMode){
     case NodeSelection: {
+      SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
       myPointPicker->Pick( x, y, z, aRenderer );
 
       int aVtkId = myPointPicker->GetPointId();
       if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
-       int anObjId = GetNodeObjId( aVtkId );
-       if( anObjId >= 0 ) {
-         mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
-         mySelector->AddIObject( this );
-       }
+        int anObjId = GetNodeObjId( aVtkId );
+        if( hasIO() && anObjId >= 0 ) {
+          mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+          mySelector->AddIObject( this );
+        }
       }
       break;
     }
@@ -600,44 +673,48 @@ SALOME_Actor
     case FaceSelection:
     case VolumeSelection: 
     {
+      SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
       myCellPicker->Pick( x, y, z, aRenderer );
     
       int aVtkId = myCellPicker->GetCellId();
       if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
-       int anObjId = GetElemObjId( aVtkId );
-       if( anObjId >= 0 ) {
-         if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
-           mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
-           mySelector->AddIObject( this );
-         }
-       }
+        int anObjId = GetElemObjId( aVtkId );
+        if( anObjId >= 0 ) {
+          if ( hasIO() && CheckDimensionId(aSelectionMode,this,anObjId) ) {
+            mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+            mySelector->AddIObject( this );
+          }
+        }
       }
       break;
     }
     case EdgeOfCellSelection: 
     {
+      SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
       myCellPicker->Pick( x, y, z, aRenderer );
     
       int aVtkId = myCellPicker->GetCellId();
       if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
-       int anObjId = GetElemObjId( aVtkId );
-       if( anObjId >= 0 ) {
-         int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
-         if( anEdgeId < 0 ) {
-           mySelector->AddOrRemoveIndex( myIO, anObjId, false );
-           mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
-           mySelector->AddIObject( this );
-         } 
-       }
+        int anObjId = GetElemObjId( aVtkId );
+        if( anObjId >= 0 ) {
+          int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+          if( hasIO() && anEdgeId < 0 ) {
+            mySelector->AddOrRemoveIndex( myIO, anObjId, false );
+            mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
+            mySelector->AddIObject( this );
+          
+        }
       }
       break;
     }
     case ActorSelection : 
     {
-      if( mySelector->IsSelected( myIO ) && anIsShift )
-       mySelector->RemoveIObject( this );
-      else {
-       mySelector->AddIObject( this );
+      if ( hasIO() ) {
+       if( mySelector->IsSelected( myIO ) && anIsShift )
+         mySelector->RemoveIObject( this );
+       else {
+         mySelector->AddIObject( this );
+       }
       }
       break;
     }
@@ -658,33 +735,34 @@ SALOME_Actor
 
     switch(aSelectionMode){
     case NodeSelection: {
-      myPointRectPicker->InitializePickList();
-      myPointRectPicker->AddPickList(this);
+
+      SVTK::TPickLimiter aPickLimiter( myPointRectPicker, this );
       myPointRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
 
       const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myPointRectPicker->GetPointIdsMap();
       SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
       TColStd_MapOfInteger anIndexes;
       if(aMapIter != aVectorIdsMap.end()){
-       const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
-       vtkIdType anEnd = aVectorIds.size();
-       for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
-         int aPointId = aVectorIds[anId];
-         if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) {
-           int anObjId = GetNodeObjId( aPointId );
-           anIndexes.Add( anObjId );
-         }
-       }
+        const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
+        vtkIdType anEnd = aVectorIds.size();
+        for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
+          int aPointId = aVectorIds[anId];
+          if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) {
+            int anObjId = GetNodeObjId( aPointId );
+            anIndexes.Add( anObjId );
+          }
+        }
       }
       
-      if( !anIndexes.IsEmpty() ) {
-       mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
-       mySelector->AddIObject( this );
-       anIndexes.Clear();
+      if ( hasIO() ) {
+       if( !anIndexes.IsEmpty() ) {
+         mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+         mySelector->AddIObject( this );
+         anIndexes.Clear();
+       }
+       else if ( !anIsShift )
+         mySelector->RemoveIObject( this );
       }
-      else
-       mySelector->RemoveIObject( this );
-
       break;
     }
     case ActorSelection :
@@ -694,22 +772,22 @@ SALOME_Actor
 
       bool anIsPicked = true;
       for( int i = 0; i <= 1; i++ ) {
-       for( int j = 2; j <= 3; j++ ) {
-         for( int k = 4; k <= 5; k++ ) {
-           aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 );
-           aRenderer->WorldToDisplay();
-           aRenderer->GetDisplayPoint( aPnt );
-
-           if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) {
-             anIsPicked = false;
-             break;
-           }
-         }
-       }
+        for( int j = 2; j <= 3; j++ ) {
+          for( int k = 4; k <= 5; k++ ) {
+            aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 );
+            aRenderer->WorldToDisplay();
+            aRenderer->GetDisplayPoint( aPnt );
+
+            if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) {
+              anIsPicked = false;
+              break;
+            }
+          }
+        }
       }
 
       if( anIsPicked )
-       mySelector->AddIObject(this);
+        mySelector->AddIObject(this);
 
       break;
     }
@@ -718,30 +796,37 @@ SALOME_Actor
     case FaceSelection:
     case VolumeSelection: 
     {
-      myCellRectPicker->InitializePickList();
-      myCellRectPicker->AddPickList(this);
+      SVTK::TPickLimiter aPickLimiter( myCellRectPicker, this );
       myCellRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
 
       const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myCellRectPicker->GetCellIdsMap();
       SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
       TColStd_MapOfInteger anIndexes;
       if(aMapIter != aVectorIdsMap.end()){
-       const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
-       vtkIdType anEnd = aVectorIds.size();
-       for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
-         int aCellId = aVectorIds[anId];
-         if ( !mySelector->IsValid( this, aCellId ) )
-           continue;
-
-         int anObjId = GetElemObjId( aCellId );
-         if( anObjId != -1 )
-           if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
-             anIndexes.Add(anObjId);
-           }
+        const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
+        vtkIdType anEnd = aVectorIds.size();
+        for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
+          int aCellId = aVectorIds[anId];
+          if ( !mySelector->IsValid( this, aCellId ) )
+            continue;
+
+          int anObjId = GetElemObjId( aCellId );
+          if( anObjId != -1 )
+            if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
+              anIndexes.Add(anObjId);
+            }
+        }
+      }
+      
+      if ( hasIO() ) {
+       if( !anIndexes.IsEmpty() ) {
+         mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+         mySelector->AddIObject( this );
+         anIndexes.Clear();
        }
+       else if ( !anIsShift )
+         mySelector->RemoveIObject( this );
       }
-      mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
-      mySelector->AddIObject( this );
     }
     default:
       break;
@@ -753,6 +838,98 @@ SALOME_Actor
   return true;
 }
 
+/*!
+  To get flag of displaying of name actor
+  \return flag to display or not to display name actor
+*/
+bool
+SALOME_Actor
+::IsDisplayNameActor() const
+{
+  return myIsDisplayNameActor;
+}
+
+/*!
+  To set flag of displaying of name actor
+  \param theIsDisplayNameActor flag to display or not to display name actor
+*/
+void
+SALOME_Actor
+::SetIsDisplayNameActor(bool theIsDisplayNameActor)
+{
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+  bool isShowGroupNames = aResourceMgr->booleanValue("VTKViewer", "show_group_names", false);
+  myIsDisplayNameActor = theIsDisplayNameActor && isShowGroupNames;
+  UpdateNameActors();
+}
+
+/*!
+  To set text of name actor
+  \param theText - text of name actor
+*/
+void
+SALOME_Actor
+::SetNameActorText(const char* theText)
+{
+  myNameActor->SetText(theText);
+}
+
+/*!
+  To set offset of name actor
+  \param theOffset - offset of name actor
+*/
+void
+SALOME_Actor
+::SetNameActorOffset(int theOffset[2])
+{
+  myNameActor->SetOffset(theOffset);
+}
+
+/*!
+  To get size of name actor
+  \param theRenderer - renderer
+  \param theSize - size of name actor
+*/
+void
+SALOME_Actor
+::GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const
+{
+  myNameActor->GetSize(theRenderer, theSize);
+}
+
+/*!
+  Update visibility of name actors
+*/
+void
+SALOME_Actor
+::UpdateNameActors()
+{
+  if( vtkRenderer* aRenderer = GetRenderer() )
+  {
+    int anOffset[2] = { 0, 0 };
+    VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+    vtkActorCollection* aCollection = aCopy.GetActors();
+    for( int anIndex = 0, aNbItems = aCollection->GetNumberOfItems(); anIndex < aNbItems; anIndex++ )
+    {
+      if( SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>( aCollection->GetItemAsObject( anIndex ) ) )
+      {
+        if( anActor->IsDisplayNameActor() )
+        {
+          anActor->SetNameActorOffset( anOffset );
+          if( anActor->GetVisibility() )
+          {
+            int aSize[2];
+            anActor->GetNameActorSize( aRenderer, aSize );
+            anOffset[0] = anOffset[0] + aSize[0];
+            anOffset[1] = anOffset[1] + aSize[1];
+          }
+        }
+      }
+    }
+  }
+  myNameActor->SetVisibility( GetVisibility() && IsDisplayNameActor() );
+}
+
 /*!
   To set up a picker for nodal selection (initialized by SVTK_Renderer::AddActor)
   \param thePointPicker - new picker
@@ -816,3 +993,62 @@ SALOME_Actor
 {
   myHighlightActor->SetProperty(theProperty);
 }
+
+/*!
+  Set standard point marker
+  \param theMarkerType type of the marker
+  \param theMarkerScale scale of the marker
+*/
+void
+SALOME_Actor
+::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+  myPreHighlightActor->SetMarkerStd( theMarkerType, theMarkerScale );
+  myHighlightActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+  Set custom point marker
+  \param theMarkerId id of the marker texture
+  \param theMarkerTexture marker texture
+*/
+void
+SALOME_Actor
+::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+  myPreHighlightActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+  myHighlightActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+  Get type of the point marker
+  \return type of the point marker
+*/
+VTK::MarkerType
+SALOME_Actor
+::GetMarkerType()
+{
+  return myPreHighlightActor->GetMarkerType();
+}
+
+/*!
+  Get scale of the point marker
+  \return scale of the point marker
+*/
+VTK::MarkerScale
+SALOME_Actor
+::GetMarkerScale()
+{
+  return myPreHighlightActor->GetMarkerScale();
+}
+
+/*!
+  Get texture identifier of the point marker
+  \return texture identifier of the point marker
+ */
+int
+SALOME_Actor
+::GetMarkerTexture()
+{
+  return myPreHighlightActor->GetMarkerTexture();
+}
index a8c9ac999134dd011d9694ad704b4e8de281cfac..bb86575c7bcc7016a991637132825937869c6bcc 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SALOME_ACTOR_H
 #define SALOME_ACTOR_H
 
@@ -39,16 +38,20 @@ class Handle(SALOME_InteractiveObject);
 #undef min
 #undef max
 
-#include "VTKViewer_Actor.h"
+#include <VTKViewer_Actor.h>
+#include <VTKViewer_MarkerDef.h>
 
 #include <vtkSmartPointer.h>
 
+class vtkAbstractPicker;
 class vtkPointPicker;
 class vtkCellPicker;
 class vtkOutlineSource;
 class vtkInteractorStyle;
 class vtkRenderWindowInteractor;
 
+class VTKViewer_FramedTextActor;
+
 class SVTK_Actor;
 class SVTK_RectPicker;
 class SVTK_InteractorStyle;
@@ -104,8 +107,8 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   virtual
   void
   SetPosition(vtkFloatingPointType _arg1, 
-             vtkFloatingPointType _arg2, 
-             vtkFloatingPointType _arg3);
+              vtkFloatingPointType _arg2, 
+              vtkFloatingPointType _arg3);
 
   //! Apply additional position
   virtual
@@ -118,6 +121,11 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   void
   SetVisibility( int );
 
+  //! Gets know whether the actor should be displayed or not
+  virtual
+  bool
+  ShouldBeDisplayed();
+
   //----------------------------------------------------------------------------
   //! To publish the actor an all its internal devices
   virtual
@@ -165,15 +173,72 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   virtual
   bool
   PreHighlight(vtkInteractorStyle* theInteractorStyle, 
-              SVTK_SelectionEvent* theSelectionEvent,
-              bool theIsHighlight);
+               SVTK_SelectionEvent* theSelectionEvent,
+               bool theIsHighlight);
 
   //! To process highlight (called from #SVTK_InteractorStyle)
   virtual 
   bool
   Highlight(vtkInteractorStyle* theInteractorStyle, 
-           SVTK_SelectionEvent* theSelectionEvent,
-           bool theIsHighlight);
+            SVTK_SelectionEvent* theSelectionEvent,
+            bool theIsHighlight);
+
+  //----------------------------------------------------------------------------
+  //! To get flag of displaying of name actor
+  virtual
+  bool
+  IsDisplayNameActor() const;
+
+  //! To set flag of displaying of name actor
+  virtual
+  void
+  SetIsDisplayNameActor(bool theIsDisplayNameActor);
+
+  //! To set text of name actor
+  virtual
+  void
+  SetNameActorText(const char* theText);
+
+  //! To set offset of name actor
+  virtual
+  void
+  SetNameActorOffset(int theOffset[2]);
+
+  //! To get size of name actor
+  virtual
+  void
+  GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const;
+
+  //! To update visibility of name actors
+  virtual
+  void
+  UpdateNameActors();
+
+  //----------------------------------------------------------------------------
+  //! Set standard point marker
+  virtual
+  void
+  SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+  //! Set custom point marker
+  virtual
+  void
+  SetMarkerTexture( int, VTK::MarkerTexture );
+
+  //! Get type of the point marker
+  virtual
+  VTK::MarkerType
+  GetMarkerType();
+
+  //! Get scale of the point marker
+  virtual
+  VTK::MarkerScale
+  GetMarkerScale();
+
+  //! Get texture identifier of the point marker
+  virtual
+  int
+  GetMarkerTexture();
 
   //----------------------------------------------------------------------------
   //! To set up a picker for nodal selection (initialized by #SVTK_Renderer::AddActor)
@@ -228,8 +293,22 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
 
   vtkSmartPointer<VTKViewer_Actor> myOutlineActor;
   vtkSmartPointer<vtkOutlineSource> myOutline;
+
+  bool myIsDisplayNameActor;
+  vtkSmartPointer<VTKViewer_FramedTextActor> myNameActor;
 };
 
+namespace SVTK
+{
+  class SVTK_EXPORT TPickLimiter
+  {
+    vtkAbstractPicker* myPicker;
+  public:
+    TPickLimiter(vtkAbstractPicker*, SALOME_Actor*);
+    ~TPickLimiter();
+  };
+}
+
 #ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
index 1d9850573a02455a6b075f003f527ec7f2fe833c..932056349314ba4cbb4a1e88e6eca22a9e30b8ce 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
-//  Module :
-//  $Header$
-//
+
 #include "SVTK.h"
 #include "SVTK_Prs.h"
 #include "SVTK_Actor.h"
index 8cd598065086af2c0681618ad340ad2559849c45..862cc236e70d8efd051a53f428afbc8607ddeba4 100755 (executable)
@@ -1,31 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_H
 #define SVTK_H
 
 #include "VTKViewer.h"
 
 #ifdef WIN32
-#  ifdef SVTK_EXPORTS
+#  if defined SVTK_EXPORTS
 #    define SVTK_EXPORT __declspec(dllexport)
 #  else
 #   define SVTK_EXPORT __declspec(dllimport)
diff --git a/src/SVTK/SVTK.pro b/src/SVTK/SVTK.pro
deleted file mode 100644 (file)
index 8567a08..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SVTK
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-VTKHOME = $$(VTKHOME)
-VTK_INCLUDES = $${VTKHOME}/include/vtk
-
-VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets   -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-OCC_LIBS = 
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../VTKViewer
-LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lVTKViewer $${OCC_LIBS} $${VTK_LIBS}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += SVTK_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = SVTK.h
-HEADERS += SVTK_Prs.h
-HEADERS += SVTK_Actor.h
-HEADERS += SALOME_Actor.h
-HEADERS += SVTK_RectPicker.h
-HEADERS += SVTK_DeviceActor.h
-HEADERS += SVTK_DialogBase.h
-HEADERS += SVTK_FontWidget.h
-HEADERS += SVTK_CubeAxesActor2D.h
-HEADERS += SVTK_Functor.h
-HEADERS += SVTK_View.h
-HEADERS += SVTK_ViewManager.h
-HEADERS += SVTK_ViewModel.h
-HEADERS += SVTK_ViewWindow.h
-HEADERS += SVTK_Renderer.h
-HEADERS += SVTK_InteractorStyle.h
-HEADERS += SVTK_KeyFreeInteractorStyle.h
-HEADERS += SVTK_RenderWindowInteractor.h
-HEADERS += SVTK_GenericRenderWindowInteractor.h
-HEADERS += SVTK_Selector.h
-HEADERS += SVTK_Selection.h
-HEADERS += SVTK_SelectionEvent.h
-HEADERS += SVTK_SpaceMouse.h
-HEADERS += SVTK_Event.h
-HEADERS += SVTK_ViewModelBase.h
-HEADERS += SVTK_SetRotationPointDlg.h
-HEADERS += SVTK_ViewParametersDlg.h
-HEADERS += SVTK_ComboAction.h
-HEADERS += SVTK_Extension.h
-
-SOURCES  = SVTK_Prs.cxx
-SOURCES += SVTK_Actor.cxx
-SOURCES += SALOME_Actor.cxx
-SOURCES += SVTK_RectPicker.cxx
-SOURCES += SVTK_DeviceActor.cxx
-SOURCES += SVTK_CubeAxesActor2D.cxx
-SOURCES += SVTK_NonIsometricDlg.cxx
-SOURCES += SVTK_UpdateRateDlg.cxx
-SOURCES += SVTK_CubeAxesDlg.cxx
-SOURCES += SVTK_DialogBase.cxx
-SOURCES += SVTK_FontWidget.cxx
-SOURCES += SVTK_Trihedron.cxx
-SOURCES += SVTK_View.cxx
-SOURCES += SVTK_ViewManager.cxx
-SOURCES += SVTK_ViewModel.cxx
-SOURCES += SVTK_Renderer.cxx
-SOURCES += SVTK_ViewWindow.cxx
-SOURCES += SVTK_InteractorStyle.cxx
-SOURCES += SVTK_KeyFreeInteractorStyle.cxx
-SOURCES += SVTK_RenderWindowInteractor.cxx
-SOURCES += SVTK_GenericRenderWindowInteractor.cxx
-SOURCES += SVTK_SpaceMouse.cxx
-SOURCES += SVTK_Selector.cxx
-SOURCES += SVTK_SetRotationPointDlg.cxx
-SOURCES += SVTK_ViewParametersDlg.cxx
-SOURCES += SVTK_ComboAction.cxx
-SOURCES += SVTK_Extension.cxx
-
-TRANSLATIONS = resources/SVTK_images.ts \
-               resources/SVTK_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 220b8e450456c810d39061f0ef037bc90a579102..2ea4910cf2fde0df5cd75ab478b27a50b699ff81 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_Actor.h"
 #include "SALOME_Actor.h"
 
 #include <vtkRenderer.h>
 
 #include <vtkCell.h>
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+#if VTK_XVERSION > 50700
+#include <vtkPolyhedron.h>
+#endif
 #include <vtkPolyData.h>
 
-using namespace std;
-
+#include "Utils_SALOME_Exception.hxx"
+#include "utilities.h"
 
 static 
 void
@@ -112,7 +117,7 @@ SVTK_Actor
 void
 SVTK_Actor
 ::MapCells(SALOME_Actor* theMapActor,
-          const TColStd_IndexedMapOfInteger& theMapIndex)
+           const TColStd_IndexedMapOfInteger& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -124,7 +129,22 @@ SVTK_Actor
   for(int ind = 1; ind <= aNbOfParts; ind++){
     int aPartId = theMapIndex( ind );
     if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
-      myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+      {
+#if VTK_XVERSION > 50700
+      if (aCell->GetCellType() != VTK_POLYHEDRON)
+#endif
+        myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+#if VTK_XVERSION > 50700
+      else
+        {
+          vtkPolyhedron *polyhedron = dynamic_cast<vtkPolyhedron*>(aCell);
+          if (!polyhedron)
+            throw SALOME_Exception(LOCALIZED ("not a polyhedron"));
+          vtkIdType *pts = polyhedron->GetFaces();
+          myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),pts[0], pts+1);
+        }
+#endif
+      }
   }
 
   UnShrink();
@@ -139,7 +159,7 @@ SVTK_Actor
 void 
 SVTK_Actor
 ::MapPoints(SALOME_Actor* theMapActor,
-           const TColStd_IndexedMapOfInteger& theMapIndex)
+            const TColStd_IndexedMapOfInteger& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -150,10 +170,10 @@ SVTK_Actor
     for(vtkIdType i = 0; i < aNbOfParts; i++){
       int aPartId = theMapIndex( i+1 );
       if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){
-       aPoints->SetPoint(i,aCoord);
-       // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
-       // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
-       myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
+        aPoints->SetPoint(i,aCoord);
+        // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
+        // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
+        myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
       }
     }
     myUnstructuredGrid->SetPoints(aPoints);
@@ -168,7 +188,7 @@ SVTK_Actor
 void
 SVTK_Actor
 ::MapEdge(SALOME_Actor* theMapActor,
-         const TColStd_IndexedMapOfInteger& theMapIndex)
+          const TColStd_IndexedMapOfInteger& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -183,14 +203,14 @@ SVTK_Actor
 
     if(aCellId > 0){
       if(vtkCell* aCell = theMapActor->GetElemCell(aCellId)){
-       if(anEdgeId < 0){
-         anEdgeId = -anEdgeId - 1;
-         int aNbOfEdges = aCell->GetNumberOfEdges();
-         if(0 <= anEdgeId || anEdgeId < aNbOfEdges){
-           if(vtkCell* anEdge = aCell->GetEdge(anEdgeId))
-             myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds());
-         }
-       }
+        if(anEdgeId < 0){
+          anEdgeId = -anEdgeId - 1;
+          int aNbOfEdges = aCell->GetNumberOfEdges();
+          if(0 <= anEdgeId || anEdgeId < aNbOfEdges){
+            if(vtkCell* anEdge = aCell->GetEdge(anEdgeId))
+              myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds());
+          }
+        }
       }
     }
   }
index eda8e2e3a558d3e3a787f3e15ef3ee0834dff75b..00e92d4ce3596dcb2b6f32ce96bd21b4e5d2e870 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_ACTOR_H
 #define SVTK_ACTOR_H
 
@@ -63,17 +64,17 @@ public:
   //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
   void
   MapCells(SALOME_Actor* theMapActor, 
-          const TColStd_IndexedMapOfInteger& theMapIndex);
+           const TColStd_IndexedMapOfInteger& theMapIndex);
 
   //! Allow to recostruct selected points from source SALOME_Actor and map of subindexes
   void 
   MapPoints(SALOME_Actor* theMapActor, 
-           const TColStd_IndexedMapOfInteger& theMapIndex);
+            const TColStd_IndexedMapOfInteger& theMapIndex);
 
   //! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes
   void 
   MapEdge(SALOME_Actor* theMapActor, 
-         const TColStd_IndexedMapOfInteger& theMapIndex);
+          const TColStd_IndexedMapOfInteger& theMapIndex);
 
   const TColStd_IndexedMapOfInteger&
   GetMapIndex() const;
index bec4331438f90594061701dac213fd40060fa2fe..d4a5a6dd5ea7549ad250423ebc46b78f24301605 100644 (file)
@@ -1,30 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header: 
-//
+
 #include "SVTK_ComboAction.h"
 
 #include <QComboBox>
index 245b132354f55468d64b83dc2b7e755377a1456f..b7a05835e7631cb997887c1b8284a165bdd131b6 100644 (file)
@@ -1,30 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header:
-//
+
 #ifndef SVTK_COMBOACTION_H
 #define SVTK_COMBOACTION_H
 
index 51c1e956e14bb3b6e329c88fa69f11a739967183..0364c257affd4ddb7e89bb834fc4e1bba2735f56 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : kernel of SALOME component
 //  File   : SVTK_CubeAxesActor2D.cxx
 //  Author : Eugeny Nikolaev
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_CubeAxesActor2D.h"
 #include "VTKViewer_Transform.h"
 
@@ -194,10 +193,10 @@ int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport)
 }
 
 static void ChangeValues(vtkFloatingPointType* aArray1,
-                        vtkFloatingPointType* aArray2,
-                        vtkFloatingPointType *aRange1,
-                        vtkFloatingPointType* aRange2,
-                        bool theY)
+                         vtkFloatingPointType* aArray2,
+                         vtkFloatingPointType *aRange1,
+                         vtkFloatingPointType* aRange2,
+                         bool theY)
 {
   vtkFloatingPointType tmp=-1000;
   if (!theY){
@@ -220,14 +219,14 @@ static void ChangeValues(vtkFloatingPointType* aArray1,
 }
 
 static void ChangeArrays(vtkFloatingPointType* xCoords,
-                        vtkFloatingPointType* yCoords,
-                        vtkFloatingPointType* zCoords,
-                        vtkFloatingPointType* xRange,
-                        vtkFloatingPointType* yRange,
-                        vtkFloatingPointType* zRange,
-                        const int xAxes,
-                        const int yAxes, 
-                        const int zAxes)
+                         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);
@@ -417,8 +416,8 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
   // if xAxes=0 yAxes=1 zAxes=2 - good situation
   if (!(xAxes == 0 && yAxes == 1 && zAxes == 2))
     ChangeArrays(xCoords,yCoords,zCoords,
-                xRange,yRange,zRange,
-                xAxes,yAxes,zAxes);
+                 xRange,yRange,zRange,
+                 xAxes,yAxes,zAxes);
 
   double aTScale[3];
   if(m_Transform.GetPointer() != NULL)
index 75b084c8c9228ba81faa9206123b18beb24ba32e..51b315903c23802ae14a358997e811bc945b1396 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : kernel of SALOME component
 //  File   : SVTK_CubeAxesActor2D.h
 //  Author : Eugeny Nikolaev
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef __SVTK_CubeAxesActor2D_h
 #define __SVTK_CubeAxesActor2D_h
 
index bcf79ef490095880823d580bedf851d6c14c2cd7..74788d8782db74f3ed1cd15e6b1113db09368093 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU VISUGUI : GUI for SMESH component
 //  File   : SVTK_CubeAxesDlg.cxx
 //  Author : Sergey LITONIN
 #include "QtxAction.h"
 #include "QtxIntSpinBox.h"
 
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QTabWidget>
 #include <QCheckBox>
 #include <QGroupBox>
 #include <QLineEdit>
-#include <QLabel>
 
 #include <vtkAxisActor2D.h>
 #include <vtkTextProperty.h>
   \internal
 */
 
-class SVTK_CubeAxesDlg::AxisWidget : public QFrame
-{
-public:
-  AxisWidget( QWidget* );
-  ~AxisWidget();
-
-  void             UseName( const bool );
-  void             SetName( const QString& );
-  void             SetNameFont( const QColor&, const int, const bool, const bool, const bool );
-  bool             ReadData( vtkAxisActor2D* );
-  bool             Apply( vtkAxisActor2D* );
-
-private:
-  // name
-  QGroupBox*       myNameGrp;
-  QLineEdit*       myAxisName;
-  SVTK_FontWidget* myNameFont;
-
-  // labels
-  QGroupBox*       myLabelsGrp;
-  QtxIntSpinBox*   myLabelNumber;
-  QtxIntSpinBox*   myLabelOffset;
-  SVTK_FontWidget* myLabelsFont;
-
-  // tick marks
-  QGroupBox*       myTicksGrp;
-  QtxIntSpinBox*   myTickLength;
-
-  friend class SVTK_CubeAxesDlg;
-};
-
 /*!
   Constructor
 */
-SVTK_CubeAxesDlg::AxisWidget::AxisWidget (QWidget* theParent)
-:  QFrame(theParent)
+SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
+: ViewerTools_AxisWidgetBase(theParent)
 {
-  QList< QLabel* > aLabels;
-
-  // "Name" grp
-
-  myNameGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("AXIS_NAME"), this);
-  myNameGrp->setCheckable( true );
-
-  QVBoxLayout* aVBox = new QVBoxLayout;
-  
-  QHBoxLayout* aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  QLabel* aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NAME"));
-  aHBox->addWidget(aLabel);
-  myAxisName = new QLineEdit;
-  aHBox->addWidget(myAxisName);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
-  aHBox->addWidget(aLabel);
-  myNameFont = new SVTK_FontWidget(myNameGrp);
-  aHBox->addWidget(myNameFont);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  myNameGrp->setLayout(aVBox);
-
-  // "Labels" grp
-
-  myLabelsGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("LABELS"), this);
-  myLabelsGrp->setCheckable( true );
-
-  aVBox = new QVBoxLayout;
-
-  aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NUMBER"));
-  aHBox->addWidget(aLabel);
-  myLabelNumber = new QtxIntSpinBox(0,25,1,myLabelsGrp);
-  aHBox->addWidget(myLabelNumber);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("OFFSET"));
-  aHBox->addWidget(aLabel);
-  myLabelOffset = new QtxIntSpinBox(0,100,1,myLabelsGrp);
-  aHBox->addWidget(myLabelOffset);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
-  aHBox->addWidget(aLabel);
-  myLabelsFont = new SVTK_FontWidget(myLabelsGrp);
-  aHBox->addWidget(myLabelsFont);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  myLabelsGrp->setLayout(aVBox);
-
-  // "Tick marks" grp
-
-  myTicksGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("TICK_MARKS"), this);
-  myTicksGrp->setCheckable( true );
-
-  aVBox = new QVBoxLayout;
-
-  aHBox = new QHBoxLayout;
-  aHBox->setSpacing(5);
-  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("LENGTH"));
-  aHBox->addWidget(aLabel);
-  myTickLength = new QtxIntSpinBox(0,100,1,myTicksGrp);
-  aHBox->addWidget(myTickLength);
-  aLabels.append(aLabel);
-  aVBox->addLayout(aHBox);
-
-  myTicksGrp->setLayout(aVBox);
-
-  // Layout
-
-  QVBoxLayout* aLay = new QVBoxLayout(this);
-  aLay->setMargin(5);
-  aLay->setSpacing(5);
-  aLay->addWidget(myNameGrp);
-  aLay->addWidget(myLabelsGrp);
-  aLay->addWidget(myTicksGrp);
-
-  // init
-  myNameGrp->setChecked( true );
-  myLabelsGrp->setChecked( true );
-  myTicksGrp->setChecked( true );
-
-  // Adjust label widths
-  QList< QLabel* >::iterator anIter;
-  int aMaxWidth = 0;
-  for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
-    aMaxWidth = qMax(aMaxWidth, (*anIter)->sizeHint().width());
-  for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
-    (*anIter)->setFixedWidth(aMaxWidth);
 }
 
 /*!
   Destructor
 */
-SVTK_CubeAxesDlg::AxisWidget::~AxisWidget()
+SVTK_AxisWidget::~SVTK_AxisWidget()
 {
 }
 
-void SVTK_CubeAxesDlg::AxisWidget::UseName(const bool toUse)
+ViewerTools_FontWidgetBase* SVTK_AxisWidget::createFontWidget( QWidget* theParent )
 {
-  myNameGrp->setChecked(toUse);
+  SVTK_FontWidget* aFontWidget = new SVTK_FontWidget( theParent );
+  aFontWidget->Initialize();
+  return aFontWidget;
 }
 
-void SVTK_CubeAxesDlg::AxisWidget::SetName(const QString& theName)
-{
-  myAxisName->setText(theName);
-}
-
-void SVTK_CubeAxesDlg::AxisWidget::SetNameFont(const QColor& theColor,
-                                              const int theFont,
-                                              const bool theIsBold,
-                                              const bool theIsItalic,
-                                              const bool theIsShadow)
-{
-  myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow);
-}
-
-bool SVTK_CubeAxesDlg::AxisWidget::ReadData(vtkAxisActor2D* theActor)
+bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
 {
   if (theActor == 0)
     return false;
@@ -292,7 +141,7 @@ bool SVTK_CubeAxesDlg::AxisWidget::ReadData(vtkAxisActor2D* theActor)
   return true;
 }
 
-bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
+bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
 {
    if (theActor == 0)
     return false;
@@ -375,88 +224,30 @@ bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
   Constructor
 */
 SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction,
-                                  SVTK_ViewWindow* theParent,
-                                  const char* theName):
-  SVTK_DialogBase(theAction,
-                 theParent, 
-                 theName),
+                                   SVTK_ViewWindow* theParent,
+                                   const char* theName):
+  ViewerTools_CubeAxesDlgBase(theAction,
+                              theParent, 
+                              theName),
   myMainWindow(theParent)
 {
-  setWindowTitle(tr("CAPTION"));
-
-  QVBoxLayout* aLay = new QVBoxLayout(this);
-  aLay->setMargin(5);
-  aLay->setSpacing(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()));
 }
 
 /*!
-  Create frame containing dialog's input fields
+  Destructor
 */
-QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent)
+SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
 {
-  QFrame* aFrame = new QFrame(theParent);
-
-  myTabWg = new QTabWidget(aFrame);
-
-  myAxes[ 0 ] = new AxisWidget(myTabWg);
-  myAxes[ 1 ] = new AxisWidget(myTabWg);
-  myAxes[ 2 ] = new AxisWidget(myTabWg);
-
-  myTabWg->addTab(myAxes[ 0 ], tr("X_AXIS"));
-  myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS"));
-  myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS"));
-
-  myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame);
-
-  QVBoxLayout* aLay = new QVBoxLayout(aFrame);
-  aLay->setMargin(0);
-  aLay->setSpacing(5);
-  aLay->addWidget(myTabWg);
-  aLay->addWidget(myIsVisible);
-
-  return aFrame;
 }
 
 /*!
-  Create frame containing buttons
+  Create axis widget
 */
-QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent)
-{
-  QFrame* aFrame = new QFrame(theParent);
-  aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
-
-  myOkBtn    = new QPushButton(tr("BUT_OK"), aFrame);
-  myApplyBtn = new QPushButton(tr("BUT_APPLY"), aFrame);
-  myCloseBtn = new QPushButton(tr("BUT_CLOSE"), aFrame);
-
-  QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
-  QHBoxLayout* aLay = new QHBoxLayout(aFrame);
-  aLay->setMargin(5);
-  aLay->setSpacing(5);
-
-  aLay->addWidget(myOkBtn);
-  aLay->addWidget(myApplyBtn);
-  aLay->addItem(aSpacer);
-  aLay->addWidget(myCloseBtn);
-
-  connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
-  connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
-  connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
-
-  return aFrame;
-}
-
-/*!
-  Destructor
-*/
-SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
+ViewerTools_AxisWidgetBase* SVTK_CubeAxesDlg::createAxisWidget( QWidget* theParent )
 {
+  SVTK_AxisWidget* anAxisWidget = new SVTK_AxisWidget( theParent );
+  anAxisWidget->initialize();
+  return anAxisWidget;
 }
 
 /*!
@@ -464,29 +255,23 @@ SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
 */
 void SVTK_CubeAxesDlg::Update()
 {
+  ViewerTools_CubeAxesDlgBase::Update();
+
   myActor = myMainWindow->GetCubeAxes();
 
-  myAxes[ 0 ]->ReadData(myActor->GetXAxisActor2D());
-  myAxes[ 1 ]->ReadData(myActor->GetYAxisActor2D());
-  myAxes[ 2 ]->ReadData(myActor->GetZAxisActor2D());
+  ((SVTK_AxisWidget*)myAxes[ 0 ])->ReadData(myActor->GetXAxisActor2D());
+  ((SVTK_AxisWidget*)myAxes[ 1 ])->ReadData(myActor->GetYAxisActor2D());
+  ((SVTK_AxisWidget*)myAxes[ 2 ])->ReadData(myActor->GetZAxisActor2D());
 
   myIsVisible->setChecked(myActor->GetVisibility() ? true : false);
 }
 
-/*!
-  Verify validity of entry data
-*/
-bool SVTK_CubeAxesDlg::isValid() const
-{
-  return true;
-}
-
 /*!
   Verify validity of entry data
 */
 bool SVTK_CubeAxesDlg::onApply()
 {
-  bool isOk = true;
+  bool isOk = ViewerTools_CubeAxesDlgBase::onApply();
 
   try
   {
@@ -494,16 +279,15 @@ bool SVTK_CubeAxesDlg::onApply()
     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());
-
+    isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 0 ])->Apply(myActor->GetXAxisActor2D());
+    isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 1 ])->Apply(myActor->GetYAxisActor2D());
+    isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 2 ])->Apply(myActor->GetZAxisActor2D());
 
-    //myActor->SetXLabel(myAxes[ 0 ]->myAxisName->text());
-    //myActor->SetYLabel(myAxes[ 1 ]->myAxisName->text());
-    //myActor->SetZLabel(myAxes[ 2 ]->myAxisName->text());
+    //myActor->SetXLabel(myAxes[ 0 ]->myAxisName->text()); // to remove?
+    //myActor->SetYLabel(myAxes[ 1 ]->myAxisName->text()); // to remove?
+    //myActor->SetZLabel(myAxes[ 2 ]->myAxisName->text()); // to remove?
 
-    //myActor->SetNumberOfLabels(myActor->GetXAxisActor2D()->GetNumberOfLabels());
+    //myActor->SetNumberOfLabels(myActor->GetXAxisActor2D()->GetNumberOfLabels()); // to remove?
     if (myIsVisible->isChecked())
       myActor->VisibilityOn();
     else
@@ -519,20 +303,3 @@ bool SVTK_CubeAxesDlg::onApply()
 
   return isOk;
 }
-
-/*!
-  SLOT called when "Ok" button pressed.
-*/
-void SVTK_CubeAxesDlg::onOk()
-{
-  if (onApply())
-    onClose();
-}
-
-/*!
-  SLOT: called when "Close" button pressed. Close dialog
-*/
-void SVTK_CubeAxesDlg::onClose()
-{
-  reject();
-}
index e481d0b49466280b0024dab8e2827e6c9ce724d2..462737c27a94148e27afd3455929dcc66f6dde64 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SVTK_CubeAxesDlg.h
 //  Author : Sergey LITONIN
 //  Module : VISU
 #ifndef SVTK_CubeAxesDlg_H
 #define SVTK_CubeAxesDlg_H
 
-#include "SVTK_DialogBase.h"
+#include "SVTK.h"
 
-class QWidget;
-class QPushButton;
-class QTabWidget;
-class QCheckBox;
+#include <ViewerTools_CubeAxesDlgBase.h>
 
-class QtxAction;
+class SVTK_ViewWindow;
 class SVTK_CubeAxesActor2D;
 
-class SVTK_FontWidget;
-class SVTK_AxisWidget;
-class SVTK_ViewWindow;
+class vtkAxisActor2D;
+
+/*!
+ * Class       : SVTK_AxisWidget
+ * Description : Axis tab widget of the "Graduated axis" dialog box
+*/
+class SVTK_EXPORT SVTK_AxisWidget : public ViewerTools_AxisWidgetBase
+{
+public:
+  SVTK_AxisWidget( QWidget* );
+  ~SVTK_AxisWidget();
+
+public:
+  bool             ReadData( vtkAxisActor2D* );
+  bool             Apply( vtkAxisActor2D* );
+
+protected:
+  virtual ViewerTools_FontWidgetBase* createFontWidget( QWidget* );
+};
 
 /*!
  * Class       : SVTK_CubeAxesDlg
  * Description : Dialog for specifynig cube axes properties
  */
-class SVTK_CubeAxesDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_CubeAxesDlg : public ViewerTools_CubeAxesDlgBase
 {
   Q_OBJECT
 
-  class AxisWidget;
-
 public:
                   SVTK_CubeAxesDlg(QtxAction* theAction,
-                                  SVTK_ViewWindow* theParent,
-                                  const char* theName);
+                                   SVTK_ViewWindow* theParent,
+                                   const char* theName);
   virtual         ~SVTK_CubeAxesDlg();
 
-  void            Update();
+  virtual void    Update();
 
 private slots:
-  void            onOk();
-  bool            onApply();
-  void            onClose();
+  virtual bool    onApply();
 
 private:
-  QWidget*        createButtonFrame( QWidget* );
-  QWidget*        createMainFrame  ( QWidget* );
-  bool            isValid() const;
+  virtual ViewerTools_AxisWidgetBase* createAxisWidget( QWidget* );
 
 private:
-  SVTK_ViewWindow *myMainWindow;
+  SVTK_ViewWindow*      myMainWindow;
   SVTK_CubeAxesActor2D* myActor;
-
-  QTabWidget*     myTabWg;
-  QCheckBox*      myIsVisible;
-
-  QPushButton*    myOkBtn;
-  QPushButton*    myApplyBtn;
-  QPushButton*    myCloseBtn;
-  AxisWidget*     myAxes[ 3 ];
 };
 
 #endif
index 786add6006705674385e2d974df73f5859b90e71..94e6ee09d79d15f24140ac2173c685a8a00460df 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SVTK OBJECT : interactive object for SVTK visualization
 //  File   : SVTK_DeviceActor.cxx
 //  Author : 
-//  Module : 
-//  $Header$
-//
+
 #include "SVTK_DeviceActor.h"
 
 #include "VTKViewer_Transform.h"
 #include <vtkPolyData.h>
 #include <vtkUnstructuredGrid.h>
 
-#include <vtkPolyDataMapper.h>
-#include <vtkDataSetMapper.h>
+#include <VTKViewer_PolyDataMapper.h>
+#include <VTKViewer_DataSetMapper.h>
 
 #include <vtkPassThroughFilter.h>
 
-using namespace std;
-
 vtkStandardNewMacro(SVTK_DeviceActor);
 
 /*!
@@ -62,13 +59,13 @@ SVTK_DeviceActor
 
   myIsShaded = true;
   myProperty = vtkProperty::New();
-  myRepresentation = SVTK::Representation::Surface;
+  myRepresentation = VTKViewer::Representation::Surface;
 
   myIsResolveCoincidentTopology = true;
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                myPolygonOffsetUnits);
+                                                                 myPolygonOffsetUnits);
 
-  myMapper = vtkDataSetMapper::New();
+  myMapper = VTKViewer_DataSetMapper::New();
 
   myShrinkFilter = vtkShrinkFilter::New();
 
@@ -141,9 +138,9 @@ SVTK_DeviceActor
     myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
 
     anId++; // 5
-    if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
+    if(VTKViewer_DataSetMapper* aMapper = dynamic_cast<VTKViewer_DataSetMapper*>(theMapper)){
       aMapper->SetInput(myPassFilter[anId]->GetOutput());
-    }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
+    }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>(theMapper)){
       aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
     }
   }
@@ -191,18 +188,18 @@ SVTK_DeviceActor
 {
   unsigned long mTime = this->Superclass::GetMTime();
 
-  mTime = max(mTime,myGeomFilter->GetMTime());
+  mTime = std::max(mTime,myGeomFilter->GetMTime());
 
-  mTime = max(mTime,myTransformFilter->GetMTime());
+  mTime = std::max(mTime,myTransformFilter->GetMTime());
 
   if(myIsShrunk)
-    mTime = max(mTime,myShrinkFilter->GetMTime());
+    mTime = std::max(mTime,myShrinkFilter->GetMTime());
 
   if(myIsFeatureEdgesEnabled)
-    mTime = max(mTime,myFeatureEdges->GetMTime());
+    mTime = std::max(mTime,myFeatureEdges->GetMTime());
 
   for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
-    max(mTime,myPassFilter[i]->GetMTime());
+    std::max(mTime,myPassFilter[i]->GetMTime());
 
   return mTime;
 }
@@ -266,7 +263,7 @@ SVTK_DeviceActor
     int numPts = aDataSet->GetNumberOfPoints();
     //It's impossible to use to apply "shrink" for "empty" dataset
     if (numCells < 1 || numPts < 1)
-           return;
+            return;
     myShrinkFilter->SetInput( aDataSet );
     myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() );
     myIsShrunk = true;
@@ -400,9 +397,9 @@ SVTK_DeviceActor
 void
 SVTK_DeviceActor
 ::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
-                      bool& theIsBoundaryEdges,
-                      bool& theIsManifoldEdges,
-                      bool& theIsNonManifoldEdges)
+                       bool& theIsBoundaryEdges,
+                       bool& theIsManifoldEdges,
+                       bool& theIsNonManifoldEdges)
 {
   theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
   theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
@@ -420,9 +417,9 @@ SVTK_DeviceActor
 void
 SVTK_DeviceActor
 ::SetFeatureEdgesFlags(bool theIsFeatureEdges,
-                      bool theIsBoundaryEdges,
-                      bool theIsManifoldEdges,
-                      bool theIsNonManifoldEdges)
+                       bool theIsBoundaryEdges,
+                       bool theIsManifoldEdges,
+                       bool theIsNonManifoldEdges)
 {
   myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
   myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
@@ -457,13 +454,14 @@ SVTK_DeviceActor
 */
 void
 SVTK_DeviceActor
-::SetRepresentation(SVTK::Representation::Type theMode)
+::SetRepresentation(VTKViewer::Representation::Type theMode)
 { 
-  using namespace SVTK::Representation;
+  using namespace VTKViewer::Representation;
   if(IsShaded()){
     switch(myRepresentation){
     case Points : 
     case Surface : 
+    case SurfaceWithEdges :
       myProperty->SetAmbient(GetProperty()->GetAmbient());
       myProperty->SetDiffuse(GetProperty()->GetDiffuse());
       myProperty->SetSpecular(GetProperty()->GetSpecular());
@@ -472,6 +470,7 @@ SVTK_DeviceActor
     switch(theMode){
     case Points : 
     case Surface : 
+    case SurfaceWithEdges :
       GetProperty()->SetAmbient(myProperty->GetAmbient());
       GetProperty()->SetDiffuse(myProperty->GetDiffuse());
       GetProperty()->SetSpecular(myProperty->GetSpecular());
@@ -501,19 +500,22 @@ SVTK_DeviceActor
     myGeomFilter->SetInside(false);
     break;
   case Surface : 
+  case SurfaceWithEdges :
     GetProperty()->SetRepresentation(VTK_SURFACE);
     myGeomFilter->SetWireframeMode(false);
     myGeomFilter->SetInside(false);
     break;
   }
 
+  SetMarkerEnabled( theMode == Points );
+
   myRepresentation = theMode;
 }
 
 /*!
   \return current representation mode
 */
-SVTK::Representation::Type 
+VTKViewer::Representation::Type 
 SVTK_DeviceActor
 ::GetRepresentation()
 {
@@ -616,7 +618,7 @@ SVTK_DeviceActor
     
     vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                  myPolygonOffsetUnits);
+                                                                   myPolygonOffsetUnits);
     Superclass::Render(ren,m);
     
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
@@ -633,7 +635,7 @@ SVTK_DeviceActor
 void
 SVTK_DeviceActor
 ::SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units)
+                             vtkFloatingPointType units)
 {
   myPolygonOffsetFactor = factor;
   myPolygonOffsetUnits = units;
@@ -646,13 +648,104 @@ SVTK_DeviceActor
 void
 SVTK_DeviceActor
 ::GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units)
+                             vtkFloatingPointType& units)
 {
   factor = myPolygonOffsetFactor;
   units = myPolygonOffsetUnits;
 }
 
-vtkDataSetMapper* SVTK_DeviceActor::GetDataSetMapper()
+VTKViewer_DataSetMapper* SVTK_DeviceActor::GetDataSetMapper()
 {
   return myMapper;
 }
+
+/*!
+ * On/Off representation 2D quadratic element as arked polygon
+ */
+void SVTK_DeviceActor::SetQuadraticArcMode(bool theFlag){
+  myGeomFilter->SetQuadraticArcMode(theFlag);
+}
+
+/*!
+ * Return true if 2D quadratic element displayed as arked polygon
+ */
+bool SVTK_DeviceActor::GetQuadraticArcMode(){
+  return myGeomFilter->GetQuadraticArcMode();
+}
+/*!
+ * Set Max angle for representation 2D quadratic element as arked polygon
+ */
+void SVTK_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+  myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
+}
+
+/*!
+ * Return Max angle of the representation 2D quadratic element as arked polygon
+ */
+vtkFloatingPointType SVTK_DeviceActor::GetQuadraticArcAngle(){
+  return myGeomFilter->GetQuadraticArcAngle();
+}
+
+/*!
+ * Set point marker enabled
+ * \param theMarkerEnabled flag to enable/disable point marker
+ */
+void SVTK_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
+{
+  myMapper->SetMarkerEnabled( theMarkerEnabled );
+}
+
+/*!
+ * Set standard point marker
+ * \param theMarkerType type of the marker
+ * \param theMarkerScale scale of the marker
+ */
+void SVTK_DeviceActor::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+  myMapper->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ * Set custom point marker
+ * \param theMarkerId id of the marker texture
+ * \param theMarkerTexture marker texture
+ */
+void SVTK_DeviceActor::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+  myMapper->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ * Get type of the point marker
+ * \return type of the point marker
+ */
+VTK::MarkerType SVTK_DeviceActor::GetMarkerType()
+{
+  return myMapper->GetMarkerType();
+}
+
+/*!
+  Get scale of the point marker
+  \return scale of the point marker
+*/
+VTK::MarkerScale SVTK_DeviceActor::GetMarkerScale()
+{
+  return myMapper->GetMarkerScale();
+}
+
+/*!
+ * Get texture identifier of the point marker
+ * \return texture identifier of the point marker
+ */
+int SVTK_DeviceActor::GetMarkerTexture()
+{
+  return myMapper->GetMarkerTexture();
+}
+
+void SVTK_DeviceActor::SetCoincident3DAllowed(bool theFlag) {
+  myGeomFilter->SetAppendCoincident3D(theFlag);
+}
+
+bool SVTK_DeviceActor::IsCoincident3DAllowed() const {
+  return myGeomFilter->GetAppendCoincident3D();
+}
index 95949133be2793a0bfeeb780f06ed60c6bc13135..12d10220fcda2fbc2cec31959e1384e59d479948 100644 (file)
@@ -1,35 +1,36 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SVTK OBJECT : interactive object for SVTK visualization
 //  File   : SVTK_DeviceActor.h
 //  Author : 
-//  Module : 
-//  $Header$
-//
+
 #ifndef SVTK_DEVICE_ACTOR_H
 #define SVTK_DEVICE_ACTOR_H
 
 #include "SVTK.h"
 #include "VTKViewer.h"
+#include "VTKViewer_Actor.h"
+#include "VTKViewer_MarkerDef.h"
 
 #include <vector>
 
@@ -44,21 +45,9 @@ class vtkCell;
 class vtkDataSet;
 class vtkShrinkFilter;
 class vtkFeatureEdges;
-class vtkDataSetMapper;
+class VTKViewer_DataSetMapper;
 class vtkPassThroughFilter;
 
-namespace SVTK
-{
-  namespace Representation
-  {
-    typedef int Type;
-    const Type Points = VTK_POINTS;
-    const Type Wireframe = VTK_WIREFRAME;
-    const Type Surface = VTK_SURFACE;
-    const Type Insideframe = Surface + 1;
-  }
-}
-
 #ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
@@ -177,15 +166,15 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   virtual
   void
   GetFeatureEdgesFlags(bool& theIsFeatureEdges,
-                      bool& theIsBoundaryEdges,
-                      bool& theIsManifoldEdges,
-                      bool& theIsNonManifoldEdges);
+                       bool& theIsBoundaryEdges,
+                       bool& theIsManifoldEdges,
+                       bool& theIsNonManifoldEdges);
   virtual
   void
   SetFeatureEdgesFlags(bool theIsFeatureEdges,
-                      bool theIsBoundaryEdges,
-                      bool theIsManifoldEdges,
-                      bool theIsNonManifoldEdges);
+                       bool theIsBoundaryEdges,
+                       bool theIsManifoldEdges,
+                       bool theIsNonManifoldEdges);
 
   virtual
   bool
@@ -199,9 +188,9 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   /** @name For representation mamnagement purpose */
   virtual
   void 
-  SetRepresentation(SVTK::Representation::Type theMode);
+    SetRepresentation(VTKViewer::Representation::Type theMode);
 
-  SVTK::Representation::Type 
+  VTKViewer::Representation::Type 
   GetRepresentation();
 
   virtual
@@ -219,14 +208,51 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   SetShaded(bool theShaded);
   //@}
 
+  /** @name For marker management purpose */
+  void
+  SetMarkerEnabled( bool );
+
+  void
+  SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+  void
+  SetMarkerTexture( int, VTK::MarkerTexture );
+
+  VTK::MarkerType
+  GetMarkerType();
+
+  VTK::MarkerScale
+  GetMarkerScale();
+
+  int
+  GetMarkerTexture();
+  //@}
+
   virtual
   void
   Render(vtkRenderer *, vtkMapper *);
 
-  vtkDataSetMapper* GetDataSetMapper();
+  VTKViewer_DataSetMapper* GetDataSetMapper();
+
+  //----------------------------------------------------------------------------
+  //! Setting for displaying quadratic elements
+  virtual void SetQuadraticArcMode(bool theFlag);
+  virtual bool GetQuadraticArcMode();
+
+  virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+  virtual vtkFloatingPointType GetQuadraticArcAngle();
+
+  virtual
+  void
+  SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
+
+  virtual
+  bool 
+  IsCoincident3DAllowed() const;
+
 
  protected:
-  SVTK::Representation::Type myRepresentation;
+  VTKViewer::Representation::Type myRepresentation;
   vtkProperty *myProperty;
   bool myIsShaded;
 
@@ -239,7 +265,7 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   std::vector<vtkPassThroughFilter*> myPassFilter;
   vtkShrinkFilter* myShrinkFilter;
   vtkFeatureEdges* myFeatureEdges;
-  vtkDataSetMapper* myMapper;
+  VTKViewer_DataSetMapper* myMapper;
 
   bool myIsShrinkable;
   bool myIsShrunk;
@@ -252,9 +278,9 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
   vtkFloatingPointType myPolygonOffsetUnits;
 
   void SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                                 vtkFloatingPointType units);
+                                  vtkFloatingPointType units);
   void GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                                 vtkFloatingPointType& units);
+                                  vtkFloatingPointType& units);
 
   SVTK_DeviceActor();
   ~SVTK_DeviceActor();
diff --git a/src/SVTK/SVTK_DialogBase.cxx b/src/SVTK/SVTK_DialogBase.cxx
deleted file mode 100644 (file)
index faf49c9..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
-//  File   : 
-//  Author : 
-//  Module : SALOME
-//  $Header$
-//
-#include "SVTK_DialogBase.h"
-
-#include "QtxAction.h"
-
-/*!
-  Constructor
-*/
-SVTK_DialogBase
-::SVTK_DialogBase(QtxAction* theAction,
-                 QWidget* theParent,
-                 const char* theName, 
-                 bool theModal, 
-                 Qt::WindowFlags theWFalgs):
-  QDialog(theParent, 
-         theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
-  myAction(theAction)
-{
-  setObjectName(theName);
-  setModal(theModal);
-
-  connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
-  connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-SVTK_DialogBase
-::~SVTK_DialogBase()
-{
-  // no need to delete child widgets, Qt does it all for us
-}
-
-void 
-SVTK_DialogBase
-::onParentShow()
-{
-  if(myAction->isChecked())
-    show();
-  else
-    hide();
-}
-
-void 
-SVTK_DialogBase
-::onParentHide()
-{
-  hide();
-}
-
-void 
-SVTK_DialogBase
-::done( int r )
-{
-  myAction->setChecked( false );
-  QDialog::done( r );
-}
diff --git a/src/SVTK/SVTK_DialogBase.h b/src/SVTK/SVTK_DialogBase.h
deleted file mode 100644 (file)
index 815f8dd..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
-//  File   : 
-//  Author : 
-//  Module : SALOME
-//  $Header$
-//
-#ifndef SVTK_DIALOGBASE_H
-#define SVTK_DIALOGBASE_H
-
-#include "SVTK.h"
-
-#include <QDialog>
-
-class QtxAction;
-
-class SVTK_EXPORT SVTK_DialogBase : public QDialog
-{
-  Q_OBJECT;
-
-public:
-  SVTK_DialogBase(QtxAction* theAction,
-                 QWidget* theParent,
-                 const char* theName = "", 
-                 bool theModal = FALSE, 
-                 Qt::WindowFlags theWFalgs = 0);
-
-  ~SVTK_DialogBase();
-
-protected slots:
-  void onParentShow();
-  void onParentHide();
-  virtual void done( int );
-
-protected:
-  QtxAction* myAction;
-};
-
-#endif // SVTK_DIALOGBASE_H
index 751c8103e52f182e36b9b29226a84288b8213ce6..f00e78242d0272ff8f63254ad45632f1261d0eb0 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : Alexander SLADKOV
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_Event_h
 #define SVTK_Event_h
 
@@ -72,6 +71,8 @@ namespace SVTK
     SetFocalPointSelected,
     StartFocalPointSelection,
     FocalPointChanged,
+    
+    OperationFinished, // rnv: invoked then SpinXY, RotateXY, DollyXY or PanXY operation is finished.
         
     LastEvent
   };
diff --git a/src/SVTK/SVTK_Extension.cxx b/src/SVTK/SVTK_Extension.cxx
deleted file mode 100755 (executable)
index a3ac825..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME VTKViewer : build VTK viewer into Salome desktop
-//  File   : SVTK_Extension.cxx
-//  Author : Sergey ANIKIN
-//  Module : SALOME
-//
-#include "SVTK_Extension.h"
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-void* SVTK::getOpenGLExtension( const char* theExtension )
-{
-#ifdef WIN32
-  return wglGetProcAddress( theExtension );
-#else
-  void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
-  return dlsym( OpenGLLibrary, theExtension );
-#endif
-}
diff --git a/src/SVTK/SVTK_Extension.h b/src/SVTK/SVTK_Extension.h
deleted file mode 100755 (executable)
index cafd2f0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef SVTK_Extension_H
-#define SVTK_Extension_H
-
-/*!
-  \file SVTK_Extension.h
-  Functions of loading OpenGL extensions.
-*/
-
-#include "SVTK.h"
-
-namespace SVTK
-{
-  SVTK_EXPORT void* getOpenGLExtension( const char* theExtension );
-}
-
-
-#endif
index 679b8257e18f1a8dfb86391746e92da72dc04717..964ecd9a6dd5ebc1835a64a54204fc77e70ea464 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU VISUGUI : GUI for SMESH component
 //  File   : 
 //  Author : Sergey LITONIN
 //
 #include "SVTK_FontWidget.h"
 
-#include <QToolButton>
 #include <QComboBox>
-#include <QColorDialog>
-#include <QCheckBox>
-#include <QHBoxLayout>
 
 #include <vtkTextProperty.h>
 
   Constructor
 */
 SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent )
-: QWidget( theParent )
+: ViewerTools_FontWidgetBase( theParent )
 {
-  myColorBtn = new QToolButton( this );
-  myColorBtn->setMinimumWidth( 20 );
-
-  myFamily = new QComboBox( this );
-  myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
-  myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
-  myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
-
-  myBold = new QCheckBox( tr( "BOLD" ), this );
-  myItalic = new QCheckBox( tr( "ITALIC" ), this );
-  myShadow = new QCheckBox( tr( "SHADOW" ), this );
-
-  QHBoxLayout* aHBLayout = new QHBoxLayout;
-  aHBLayout->setSpacing( 5 );
-  aHBLayout->addWidget(myColorBtn);
-  aHBLayout->addWidget(myFamily);
-  aHBLayout->addWidget(myBold);
-  aHBLayout->addWidget(myItalic);
-  aHBLayout->addWidget(myShadow);
-  this->setLayout(aHBLayout);
-
-  connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) );
 }
 
 /*!
@@ -76,32 +51,24 @@ SVTK_FontWidget::~SVTK_FontWidget()
 {
 }
 
-void SVTK_FontWidget::SetColor( const QColor& theColor )
+void SVTK_FontWidget::InitializeFamilies()
 {
-  QPalette palette;
-  palette.setColor(myColorBtn->backgroundRole(), theColor);
-  myColorBtn->setPalette(palette);
-}
-
-QColor SVTK_FontWidget::GetColor() const
-{
-  return myColorBtn->palette().color( myColorBtn->backgroundRole() );
-}
-
-void SVTK_FontWidget::onColor()
-{
-  QColor aColor = QColorDialog::getColor( GetColor(), this );
-  if ( aColor.isValid() )
-    SetColor( aColor );
+  myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
+  myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
+  myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
 }
 
 void SVTK_FontWidget::SetData( const QColor& theColor,
-                              const int theFamily,
-                              const bool theBold,
-                              const bool theItalic,
-                              const bool theShadow )
+                               const int theFamily,
+                               const bool theBold,
+                               const bool theItalic,
+                               const bool theShadow )
 {
-  SetColor( theColor );
+  ViewerTools_FontWidgetBase::SetData( theColor,
+                                       theFamily,
+                                       theBold,
+                                       theItalic,
+                                       theShadow );
 
   if ( theFamily == VTK_ARIAL )
     myFamily->setCurrentIndex( 0 );
@@ -109,29 +76,25 @@ void SVTK_FontWidget::SetData( const QColor& theColor,
     myFamily->setCurrentIndex( 1 );
   else
     myFamily->setCurrentIndex( 2 );
-
-  myBold->setChecked( theBold );
-  myItalic->setChecked( theItalic );
-  myShadow->setChecked( theShadow );
 }
 
 void SVTK_FontWidget::GetData( QColor& theColor,
-                              int& theFamily,
-                              bool& theBold,
-                              bool& theItalic,
-                              bool& theShadow ) const
+                               int& theFamily,
+                               bool& theBold,
+                               bool& theItalic,
+                               bool& theShadow ) const
 {
-  theColor = GetColor();
+  ViewerTools_FontWidgetBase::GetData( theColor,
+                                       theFamily,
+                                       theBold,
+                                       theItalic,
+                                       theShadow );
 
-  int anItem =myFamily->currentIndex();
+  int anItem = myFamily->currentIndex();
   if ( anItem == 0 )
     theFamily = VTK_ARIAL;
   else if ( anItem == 1 )
     theFamily = VTK_COURIER;
   else
     theFamily = VTK_TIMES;
-
-  theBold = myBold->isChecked();
-  theItalic = myItalic->isChecked();
-  theShadow = myShadow->isChecked();
 }
index 653a4ee42b8e737b61defd8737425b1725918aff..63294876a454d40d869ddf4ea92a5ee4423dd495 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : 
 //  Author : Sergey LITONIN
 //  Module : 
 
 #include "SVTK.h"
 
-#include <QWidget>
-
-class QToolButton;
-class QComboBox;
-class QCheckBox;
-class QColor;
-
+#include <ViewerTools_FontWidgetBase.h>
 
 /*!
  * Class       : SVTK_FontWidget
  * Description : Dialog for specifynig font
  */
-class SVTK_EXPORT SVTK_FontWidget : public QWidget
+class SVTK_EXPORT SVTK_FontWidget : public ViewerTools_FontWidgetBase
 {
   Q_OBJECT
 
@@ -48,22 +43,12 @@ public:
                 SVTK_FontWidget( QWidget* );
   virtual       ~SVTK_FontWidget();
 
-  void          SetColor( const QColor& );
-  QColor        GetColor() const;
-
-  void          SetData( const QColor&, const int, const bool, const bool, const bool );
-
-  void          GetData( QColor&, int&, bool&, bool&, bool& ) const;
+  virtual void  SetData( const QColor&, const int, const bool, const bool, const bool );
 
-private slots:
-  void          onColor();
+  virtual void  GetData( QColor&, int&, bool&, bool&, bool& ) const;
 
-private:
-  QToolButton*  myColorBtn;
-  QComboBox*    myFamily;
-  QCheckBox*    myBold;
-  QCheckBox*    myItalic;
-  QCheckBox*    myShadow;
+protected:
+  virtual void  InitializeFamilies();
 };
 
 #endif
index eab12cb14a4542935abfe152c7b6da33a323a447..1db773d15695cd3809fa3f31da4769b5a1f8793c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_Functor_H
 #define SVTK_Functor_H
 
@@ -28,8 +29,8 @@
 
 #include <VTKViewer_Functor.h>
 
-#include "SALOME_InteractiveObject.hxx"
-
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
 /*!
   \file SVTK_Functor.h
   This file contains numbers of functors that allows user to perform corresponding operations with existing presentations.
@@ -54,9 +55,9 @@ namespace SVTK
     {
       if ( theActor->hasIO() )
       {
-       Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
-       if ( anIO->hasEntry() )
-         return myEntry == anIO->getEntry();
+        Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+        if ( anIO->hasEntry() )
+          return myEntry == anIO->getEntry();
       }
       return false;
     }
@@ -78,8 +79,8 @@ namespace SVTK
     {
       if(theActor->hasIO())
       {
-       Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
-       return myIObject->isSame(anIO);
+        Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+        return myIObject->isSame(anIO);
       }
       return false;
     }
@@ -102,10 +103,29 @@ namespace SVTK
     void operator()(TActor* theActor) 
     {
       if(theActor->GetVisibility() && theActor->GetMapper())
-       theActor->highlight( myIsHighlight );
+        theActor->highlight( myIsHighlight );
     }
   };
 
+
+  //----------------------------------------------------------------
+  /*!
+    This collect visible IO in list
+  */
+  template<class TActor> 
+    struct TCollectIfVisible
+    {
+      SALOME_ListIO& myList;
+      //! To construct the functor
+      TCollectIfVisible (SALOME_ListIO& theList) : myList(theList)
+      {}
+      //! To calculate the functor
+      void operator()(TActor* theActor) 
+      {
+       if(theActor->GetVisibility() && theActor->hasIO())
+         myList.Append( theActor->getIO() );
+      }
+    };
 }
 
 
index e00c8dabba627c0370dbb923df1d5bf53a6b9eae..3b2200d6bb75b27a00dffc77227ddf3791939559 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_GenericRenderWindowInteractor.h"
 #include "SVTK_Selector.h"
 
@@ -33,8 +32,6 @@
 
 #include <QTimer>
 
-using namespace std;
-
 vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor);
 
 /*!
index f85df59ba5c019ca3e56e4a30a28c4bd59067cfa..0d961d3ea70d92aa452f5d4288d7068af7fac63f 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_GenericRenderWindowInteractor_h
 #define SVTK_GenericRenderWindowInteractor_h
 
index 1d5eb76ff0030be6f7611eab1adcdc25ba503837..581111ba6dfd65678fa688634b722e482d2efde5 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_ImageWriter.h"
 
 #include <QSemaphore>
@@ -38,10 +36,10 @@ static int MYDEBUG = 0;
 //----------------------------------------------------------------------------
 SVTK_ImageWriter
 ::SVTK_ImageWriter(QSemaphore* theSemaphore,
-                  vtkImageData* theImageData,
-                  const std::string& theName,
-                  int theProgressive,
-                  int theQuality):
+                   vtkImageData* theImageData,
+                   const std::string& theName,
+                   int theProgressive,
+                   int theQuality):
   mySemaphore(theSemaphore),
   myImageData(theImageData),
   myName(theName),
@@ -98,9 +96,9 @@ SVTK_ImageWriter
   myImageData->Delete();
 
   if(MYDEBUG) cout<<"SVTK_ImageWriter::run "<<
-               "- this = "<<this<<
-               //"; total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
+                "- this = "<<this<<
+                //"; total = "<<mySemaphore->total()<<
+                "; available = "<<mySemaphore->available()<<endl;
   mySemaphore->release();
 }
 
index a3d16b81028d977ce68286048c26be45322aab69..5973b9f44baf55948253c355f61859e71d61cc96 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_IMAGEWRITER_H
 #define SVTK_IMAGEWRITER_H
 
@@ -32,10 +30,10 @@ class SVTK_ImageWriter : public QThread
 {
 public:
   SVTK_ImageWriter(QSemaphore* theSemaphore,
-                  vtkImageData* theImageData,
-                  const std::string& theName,
-                  int theProgressive,
-                  int theQuality);
+                   vtkImageData* theImageData,
+                   const std::string& theName,
+                   int theProgressive,
+                   int theQuality);
 
   ~SVTK_ImageWriter();
 
index 0983a6a55cf1bd8cea7b48ce3a4f3bf7b8afb251..22e7b97ba7957953894e455f1f5d689758483653 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_ImageWriterMgr.h"
 #include "SVTK_ImageWriter.h"
 
@@ -43,8 +41,8 @@ SVTK_ImageWriterMgr
   mySemaphore = new QSemaphore(aMax);
   mySemaphore->acquire( aMax );
   if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::SVTK_ImageWriterMgr "<<
-               //"- total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
+                //"- total = "<<mySemaphore->total()<<
+                "; available = "<<mySemaphore->available()<<endl;
 }
 
 
@@ -61,16 +59,16 @@ SVTK_ImageWriterMgr
 void
 SVTK_ImageWriterMgr
 ::StartImageWriter(vtkImageData *theImageData,
-                  const std::string& theName,
-                  const int theProgressive,
-                  const int theQuality)
+                   const std::string& theName,
+                   const int theProgressive,
+                   const int theQuality)
 {
   SVTK_ImageWriter *anImageWriter = 
     new SVTK_ImageWriter(mySemaphore,
-                        theImageData,
-                        theName,
-                        theProgressive,
-                        theQuality);
+                         theImageData,
+                         theName,
+                         theProgressive,
+                         theQuality);
   myThreads.push_back(anImageWriter);
 
   anImageWriter->start();
@@ -84,8 +82,8 @@ SVTK_ImageWriterMgr
 ::Stop()
 {
   if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop "<<
-               //"- total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
+                //"- total = "<<mySemaphore->total()<<
+                "; available = "<<mySemaphore->available()<<endl;
   if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
   mySemaphore->acquire( myThreads.size() );
 
index 0167f7246d291e6cef8f86bcb038ff009cf8b482..86a4459463576a15f020a0364da15cc349967eed 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_IMAGEWRITERMGR_H
 #define SVTK_IMAGEWRITERMGR_H
 
@@ -38,9 +36,9 @@ class SVTK_ImageWriterMgr
   
   void
   StartImageWriter(vtkImageData *theImageData,
-                  const std::string& theName,
-                  const int theProgressive,
-                  const int theQuality);
+                   const std::string& theName,
+                   const int theProgressive,
+                   const int theQuality);
 
   void
   Stop();
index 6c8a04fd09d11ede478ee8226c6d2de0d4f794fa..e7026d8c63f7ac04f1ef9fa44c21609498ad653c 100644 (file)
@@ -1,32 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_InteractorStyle.h"
 
+#include "VTKViewer_Algorithm.h"
 #include "VTKViewer_Utilities.h"
 #include "SVTK_GenericRenderWindowInteractor.h"
 
 #include <algorithm>
 #include <iostream>
 
-using namespace std;
-
 namespace
 {
   inline void GetEventPosition(vtkRenderWindowInteractor* theInteractor,
-                              int& theX, 
-                              int& theY)
+                               int& theX, 
+                               int& theY)
   {
     theInteractor->GetEventPosition(theX,theY);
     theY = theInteractor->GetSize()[1] - theY - 1;
@@ -91,7 +89,8 @@ SVTK_InteractorStyle::SVTK_InteractorStyle():
   myControllerIncrement(SVTK_ControllerIncrement::New()),
   myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
   myHighlightSelectionPointActor(SVTK_Actor::New()),
-  myRectBand(0)
+  myRectBand(0),
+  myIsAdvancedZoomingEnabled(false)
 {
   myPointPicker->Delete();
 
@@ -252,8 +251,8 @@ void SVTK_InteractorStyle::RotateXY(int dx, int dy)
   double ryf = double(dy) * aDeltaElevation * this->MotionFactor;
   vtkMatrix4x4* aMatrix = cam->GetViewTransformMatrix();
   const double anAxis[3] = {-aMatrix->GetElement(0,0), // mkr : 27.11.2006 : PAL14011 - Strange behaviour in rotation in VTK Viewer.
-                           -aMatrix->GetElement(0,1), 
-                           -aMatrix->GetElement(0,2)};
+                            -aMatrix->GetElement(0,1), 
+                            -aMatrix->GetElement(0,2)};
   
   aTransform->RotateWXYZ(ryf, anAxis);
             
@@ -268,12 +267,14 @@ void SVTK_InteractorStyle::RotateXY(int dx, int dy)
   GetCurrentRenderer()->ResetCameraClippingRange(); 
 
   this->Render();
+  this->InvokeEvent(SVTK::OperationFinished,NULL);
 }
 
 void SVTK_InteractorStyle::PanXY(int x, int y, int oldX, int oldY)
 {
   TranslateView(x, y, oldX, oldY);   
   this->Render();
+  this->InvokeEvent(SVTK::OperationFinished,NULL);
 }
 
 void SVTK_InteractorStyle::DollyXY(int dx, int dy)
@@ -287,14 +288,29 @@ void SVTK_InteractorStyle::DollyXY(int dx, int dy)
   double zoomFactor = pow((double)1.1, dxf + dyf);
   
   vtkCamera *aCam = GetCurrentRenderer()->GetActiveCamera();
-  if (aCam->GetParallelProjection())
+  if (aCam->GetParallelProjection()) {
+    int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
+    if( IsAdvancedZoomingEnabled() ) { // zoom relatively to the cursor
+      int* aSize = GetCurrentRenderer()->GetRenderWindow()->GetSize();
+      int w = aSize[0];
+      int h = aSize[1];
+      x0 = w / 2;
+      y0 = h / 2;
+      x1 = myOtherPoint.x();
+      y1 = h - myOtherPoint.y();
+      TranslateView( x0, y0, x1, y1 );
+    }
     aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
+    if( IsAdvancedZoomingEnabled() )
+      TranslateView( x1, y1, x0, y0 );
+  }
   else{
     aCam->Dolly(zoomFactor); // Move camera in/out along projection direction
     GetCurrentRenderer()->ResetCameraClippingRange(); 
   }
 
   this->Render();
+  this->InvokeEvent(SVTK::OperationFinished,NULL);
 }
 
 void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
@@ -305,9 +321,9 @@ void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
     return;
 
   double newAngle = atan2((double)(y - GetCurrentRenderer()->GetCenter()[1]),
-                         (double)(x - GetCurrentRenderer()->GetCenter()[0]));
+                          (double)(x - GetCurrentRenderer()->GetCenter()[0]));
   double oldAngle = atan2((double)(oldY -GetCurrentRenderer()->GetCenter()[1]),
-                         (double)(oldX - GetCurrentRenderer()->GetCenter()[0]));
+                          (double)(oldX - GetCurrentRenderer()->GetCenter()[0]));
   
   newAngle *= this->RadianToDegree;
   oldAngle *= this->RadianToDegree;
@@ -317,6 +333,7 @@ void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
   cam->OrthogonalizeViewUp();
       
   this->Render();
+  this->InvokeEvent(SVTK::OperationFinished,NULL);
 }
 
 
@@ -337,8 +354,8 @@ void SVTK_InteractorStyle::OnMouseMove()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnMouseMove( this->Interactor->GetControlKey(),
-                    this->Interactor->GetShiftKey(),
-                    x, y );
+                     this->Interactor->GetShiftKey(),
+                     x, y );
 }
 
 /*!
@@ -349,8 +366,8 @@ void SVTK_InteractorStyle::OnLeftButtonDown()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnLeftButtonDown( this->Interactor->GetControlKey(),
-                         this->Interactor->GetShiftKey(),
-                         x, y );
+                          this->Interactor->GetShiftKey(),
+                          x, y );
 }
 
 /*!
@@ -361,8 +378,8 @@ void SVTK_InteractorStyle::OnLeftButtonUp()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnLeftButtonUp( this->Interactor->GetControlKey(),
-                       this->Interactor->GetShiftKey(),
-                       x, y );
+                        this->Interactor->GetShiftKey(),
+                        x, y );
 }
 
 /*!
@@ -373,8 +390,8 @@ void SVTK_InteractorStyle::OnMiddleButtonDown()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnMiddleButtonDown( this->Interactor->GetControlKey(),
-                           this->Interactor->GetShiftKey(),
-                           x, y );
+                            this->Interactor->GetShiftKey(),
+                            x, y );
 }
 
 /*!
@@ -385,8 +402,8 @@ void SVTK_InteractorStyle::OnMiddleButtonUp()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnMiddleButtonUp( this->Interactor->GetControlKey(),
-                         this->Interactor->GetShiftKey(),
-                         x, y );
+                          this->Interactor->GetShiftKey(),
+                          x, y );
 }
 
 /*!
@@ -397,8 +414,8 @@ void SVTK_InteractorStyle::OnRightButtonDown()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnRightButtonDown( this->Interactor->GetControlKey(),
-                          this->Interactor->GetShiftKey(),
-                          x, y );
+                           this->Interactor->GetShiftKey(),
+                           x, y );
 }
 
 /*!
@@ -409,16 +426,36 @@ void SVTK_InteractorStyle::OnRightButtonUp()
   int x, y;
   GetEventPosition( this->Interactor, x, y );
   this->OnRightButtonUp( this->Interactor->GetControlKey(),
-                        this->Interactor->GetShiftKey(),
-                        x, y );
+                         this->Interactor->GetShiftKey(),
+                         x, y );
+}
+
+/*!
+  To handle mouse wheel forward event (reimplemented from #vtkInteractorStyle)
+*/
+void SVTK_InteractorStyle::OnMouseWheelForward()
+{
+  int x, y;
+  GetEventPosition( this->Interactor, x, y );
+  myOtherPoint = QPoint(x, y);
+}
+
+/*!
+  To handle mouse wheel backward event (reimplemented from #vtkInteractorStyle)
+*/
+void SVTK_InteractorStyle::OnMouseWheelBackward()
+{
+  int x, y;
+  GetEventPosition( this->Interactor, x, y );
+  myOtherPoint = QPoint(x, y);
 }
 
 /*!
   To handle mouse move event
 */
 void SVTK_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), 
-                                      int shift,
-                                      int x, int y) 
+                                       int shift,
+                                       int x, int y) 
 {
   myShiftState = shift;
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
@@ -431,7 +468,7 @@ void SVTK_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
   To handle left mouse button down event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
-                                           int x, int y) 
+                                            int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -450,68 +487,68 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
     if (ctrl)
       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
     else if ( myCurrRotationPointType == SVTK::StartPointSelection ||
-             myCurrFocalPointType == SVTK::StartFocalPointSelection )
+              myCurrFocalPointType == SVTK::StartFocalPointSelection )
     {
       SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
 
-      SALOME_Actor* anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+      bool isPicked = false;
+      vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
       
-      if ( anActor )
+      if( anActorCollection )
       {
-       myPointPicker->Pick( aSelectionEvent->myX,
-                            aSelectionEvent->myY, 
-                            0.0, 
-                            GetCurrentRenderer() );
-       int aVtkId = myPointPicker->GetPointId();
-       if ( aVtkId >= 0 )
-       {
-         int anObjId = anActor->GetNodeObjId( aVtkId );
-         vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
-         
-         if (myCurrRotationPointType == SVTK::StartPointSelection) {
-           myCurrRotationPointType = SVTK::SetRotateSelected;
-         
-           // invoke event for update coordinates in SVTK_SetRotationPointDlg
-           InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
-         }
-         else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
-           myCurrFocalPointType = SVTK::SetFocalPointSelected;
-         
-           // invoke event for update coordinates in SVTK_ViewParameterDlg
-           InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
-         }
-       }
-       else
-       {
-         if (myCurrRotationPointType == SVTK::StartPointSelection) {
-           // invoke event with no data (for SVTK_SetRotationPointDlg)
-           InvokeEvent(SVTK::RotationPointChanged,0);
-           myCurrRotationPointType = myPrevRotationPointType;
-         }
-         else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
-           // invoke event with no data (for SVTK_ViewParameterDlg)
-           InvokeEvent(SVTK::FocalPointChanged,0);
-           myCurrFocalPointType = myPrevFocalPointType;
-         }
-       }
+        anActorCollection->InitTraversal();
+        while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+        {
+          if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+          {
+            SVTK::TPickLimiter aPickLimiter( myPointPicker, anActor );
+            myPointPicker->Pick( aSelectionEvent->myX,
+                                 aSelectionEvent->myY, 
+                                 0.0, 
+                                 GetCurrentRenderer() );
+            int aVtkId = myPointPicker->GetPointId();
+            if ( aVtkId >= 0 )
+            {
+              int anObjId = anActor->GetNodeObjId( aVtkId );
+              vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
+              
+              if (myCurrRotationPointType == SVTK::StartPointSelection) {
+                myCurrRotationPointType = SVTK::SetRotateSelected;
+                
+                // invoke event for update coordinates in SVTK_SetRotationPointDlg
+                InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+              }
+              else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+                myCurrFocalPointType = SVTK::SetFocalPointSelected;
+                
+                // invoke event for update coordinates in SVTK_ViewParameterDlg
+                InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
+              }
+
+              isPicked = true;
+              break;
+            }
+          }
+        }
       }
-      else
+
+      if( !isPicked )
       {
-       if (myCurrRotationPointType == SVTK::StartPointSelection) {
-         // invoke event with no data (for SVTK_SetRotationPointDlg)
-         InvokeEvent(SVTK::RotationPointChanged,0);
-         myCurrRotationPointType = myPrevRotationPointType;
-       }
-       else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
-         // invoke event with no data (for SVTK_ViewParameterDlg)
-         InvokeEvent(SVTK::FocalPointChanged,0);
-         myCurrFocalPointType = myPrevFocalPointType;
-       }
+        if (myCurrRotationPointType == SVTK::StartPointSelection) {
+          // invoke event with no data (for SVTK_SetRotationPointDlg)
+          InvokeEvent(SVTK::RotationPointChanged,0);
+          myCurrRotationPointType = myPrevRotationPointType;
+        }
+        else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+          // invoke event with no data (for SVTK_ViewParameterDlg)
+          InvokeEvent(SVTK::FocalPointChanged,0);
+          myCurrFocalPointType = myPrevFocalPointType;
+        }
       }
     
       myHighlightSelectionPointActor->SetVisibility( false );
       if(GetCurrentRenderer() != NULL)
-       GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
+        GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
 
       GetRenderWidget()->setCursor(myDefCursor); 
     }
@@ -526,9 +563,9 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
   To handle left mouse button up event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
-                                         int shift, 
-                                         int vtkNotUsed(x),
-                                         int vtkNotUsed(y))
+                                          int shift, 
+                                          int vtkNotUsed(x),
+                                          int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -542,8 +579,8 @@ void SVTK_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
   To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnMiddleButtonDown(int ctrl,
-                                             int shift, 
-                                             int x, int y) 
+                                              int shift, 
+                                              int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -570,9 +607,9 @@ void SVTK_InteractorStyle::OnMiddleButtonDown(int ctrl,
   To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
-                                           int shift, 
-                                           int vtkNotUsed(x),
-                                           int vtkNotUsed(y))
+                                            int shift, 
+                                            int vtkNotUsed(x),
+                                            int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -587,8 +624,8 @@ void SVTK_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
   To handle right mouse button down event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnRightButtonDown(int ctrl,
-                                            int shift, 
-                                            int x, int y) 
+                                             int shift, 
+                                             int x, int y) 
 {
   this->FindPokedRenderer(x, y);
   if(GetCurrentRenderer() == NULL)
@@ -614,9 +651,9 @@ void SVTK_InteractorStyle::OnRightButtonDown(int ctrl,
   To handle right mouse button up event (reimplemented from vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
-                                          int shift, 
-                                          int vtkNotUsed(x),
-                                          int vtkNotUsed(y))
+                                           int shift, 
+                                           int vtkNotUsed(x),
+                                           int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -775,8 +812,8 @@ void SVTK_InteractorStyle::startPointSelection()
     vtkFloatingPointType aColor[3];
     GetCurrentRenderer()->GetBackground( aColor );
     myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
-                                                           1. - aColor[1],
-                                                           1. - aColor[2]);
+                                                            1. - aColor[1],
+                                                            1. - aColor[2]);
   }
 
   setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
@@ -794,8 +831,8 @@ void SVTK_InteractorStyle::startFocalPointSelection()
     vtkFloatingPointType aColor[3];
     GetCurrentRenderer()->GetBackground( aColor );
     myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
-                                                           1. - aColor[1],
-                                                           1. - aColor[2]);
+                                                            1. - aColor[1],
+                                                            1. - aColor[2]);
   }
 
   setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
@@ -858,9 +895,9 @@ void SVTK_InteractorStyle::startGlobalPan()
   Fits viewer contents to rect
 */
 void SVTK_InteractorStyle::fitRect(const int left, 
-                                  const int top, 
-                                  const int right, 
-                                  const int bottom)
+                                   const int top, 
+                                   const int right, 
+                                   const int bottom)
 {
   if (GetCurrentRenderer() == NULL) 
     return;
@@ -956,10 +993,10 @@ void SVTK_InteractorStyle::setCursor(const int operation)
     case VTK_INTERACTOR_STYLE_CAMERA_NONE:
     default:
       if ( myCurrRotationPointType == SVTK::StartPointSelection ||
-          myCurrFocalPointType == SVTK::StartFocalPointSelection )
-       GetRenderWidget()->setCursor(myHandCursor);
+           myCurrFocalPointType == SVTK::StartFocalPointSelection )
+        GetRenderWidget()->setCursor(myHandCursor);
       else
-       GetRenderWidget()->setCursor(myDefCursor); 
+        GetRenderWidget()->setCursor(myDefCursor); 
       myCursorState = false;
       break;
   }
@@ -1029,55 +1066,69 @@ void SVTK_InteractorStyle::onFinishOperation()
       }
       else {
         if (myPoint == myOtherPoint)
-         {
-           // process point selection
-           this->FindPokedRenderer(aSelectionEvent->myX, aSelectionEvent->myY);
-           Interactor->StartPickCallback();
-           
-           SALOME_Actor* anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
-
-           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 );
-             }
-           myLastHighlitedActor = anActor;
-         } 
-       else 
-         {
-           //processing rectangle selection
-           Interactor->StartPickCallback();
-           GetSelector()->StartPickCallback();
-           aSelectionEvent->myIsRectangle = true;
-
-           if(!myShiftState)
-             GetSelector()->ClearIObjects();
-
-           vtkActorCollection* aListActors = GetCurrentRenderer()->GetActors();
-           aListActors->InitTraversal();
-           while(vtkActor* aActor = aListActors->GetNextActor())
-             {
-               if(aActor->GetVisibility())
-                 {
-                   if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
-                     {
-                       if(aSActor->hasIO())
-                         aSActor->Highlight( this, aSelectionEvent, true );
-                     }
-                 }
-             }
-         }
-       Interactor->EndPickCallback();
-       GetSelector()->EndPickCallback();
+          {
+            // process point selection
+            this->FindPokedRenderer(aSelectionEvent->myX, aSelectionEvent->myY);
+            Interactor->StartPickCallback();
+            
+            SALOME_Actor* aHighlightedActor = NULL;
+            vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+
+            aSelectionEvent->myIsRectangle = false;
+
+            if(!myShiftState)
+              GetSelector()->ClearIObjects();
+
+            if( anActorCollection )
+            {
+              anActorCollection->InitTraversal();
+              while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+              {
+                if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+                {
+                  if( anActor->Highlight( this, aSelectionEvent, true ) )
+                  {
+                    aHighlightedActor = anActor;
+                    break;
+                  }
+                }
+              }
+            }
+
+            if( !aHighlightedActor )
+            {
+              if(myLastHighlitedActor.GetPointer() && myLastHighlitedActor.GetPointer() != aHighlightedActor)
+                myLastHighlitedActor->Highlight( this, aSelectionEvent, false );
+            }
+            myLastHighlitedActor = aHighlightedActor;
+          } 
+        else 
+          {
+            //processing rectangle selection
+            Interactor->StartPickCallback();
+            GetSelector()->StartPickCallback();
+            aSelectionEvent->myIsRectangle = true;
+
+            if(!myShiftState)
+              GetSelector()->ClearIObjects();
+
+            VTK::ActorCollectionCopy aCopy(GetCurrentRenderer()->GetActors());
+            vtkActorCollection* aListActors = aCopy.GetActors();
+            aListActors->InitTraversal();
+            while(vtkActor* aActor = aListActors->GetNextActor())
+              {
+                if(aActor->GetVisibility())
+                  {
+                    if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
+                      {
+                        if(aSActor->hasIO())
+                          aSActor->Highlight( this, aSelectionEvent, true );
+                      }
+                  }
+              }
+          }
+        Interactor->EndPickCallback();
+        GetSelector()->EndPickCallback();
       } 
     } 
     break;
@@ -1164,40 +1215,63 @@ void SVTK_InteractorStyle::onCursorMove(QPoint mousePos)
 
   bool anIsChanged = false;
 
-  SALOME_Actor *anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+  SALOME_Actor* aPreHighlightedActor = NULL;
+  vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
 
   if ( myCurrRotationPointType == SVTK::StartPointSelection ||
        myCurrFocalPointType == SVTK::StartFocalPointSelection )
   {
     myHighlightSelectionPointActor->SetVisibility( false );
 
-    if ( anActor )
+    if( anActorCollection )
     {
-      myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
-      int aVtkId = myPointPicker->GetPointId();
-      if ( aVtkId >= 0 ) {
-       int anObjId = anActor->GetNodeObjId( aVtkId );
-
-       TColStd_IndexedMapOfInteger aMapIndex;
-       aMapIndex.Add( anObjId );
-       myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
-
-       myHighlightSelectionPointActor->SetVisibility( true );
-       anIsChanged = true;
+      anActorCollection->InitTraversal();
+      while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+      {
+        if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+        {
+          SVTK::TPickLimiter aPickLimiter( myPointPicker, anActor );
+          myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
+          int aVtkId = myPointPicker->GetPointId();
+          if ( aVtkId >= 0 ) {
+            int anObjId = anActor->GetNodeObjId( aVtkId );
+
+            TColStd_IndexedMapOfInteger aMapIndex;
+            aMapIndex.Add( anObjId );
+            myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
+
+            myHighlightSelectionPointActor->SetVisibility( true );
+            anIsChanged = true;
+            break;
+          }
+        }
       }
     }
   }
   else {
-    if (anActor){
-      anIsChanged |= anActor->PreHighlight( this, aSelectionEvent, true );
+    if( anActorCollection )
+    {
+      anActorCollection->InitTraversal();
+      while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+      {
+        if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+        {
+          anIsChanged = anActor->PreHighlight( this, aSelectionEvent, true );
+          if( anActor->isPreselected() )
+          {
+            aPreHighlightedActor = anActor;
+            break;
+          }
+        }
+      }
     }
 
-    if(myLastPreHighlitedActor.GetPointer() && myLastPreHighlitedActor.GetPointer() != anActor)
+    if(myLastPreHighlitedActor.GetPointer() && myLastPreHighlitedActor.GetPointer() != aPreHighlightedActor)
       anIsChanged |= myLastPreHighlitedActor->PreHighlight( this, aSelectionEvent, false );   
 
   }
   
-  myLastPreHighlitedActor = anActor;
+  myLastPreHighlitedActor = aPreHighlightedActor;
 
   if(anIsChanged)
     this->Render();
@@ -1233,19 +1307,22 @@ void SVTK_InteractorStyle::Place(const int theX, const int theY)
 */
 void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
 {
+  if (GetCurrentRenderer() == NULL)
+    return;
+
   vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera();
   double viewFocus[4], focalDepth, viewPoint[3];
   vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3];
   cam->GetFocalPoint(viewFocus);
 
   this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
-                             viewFocus[2], viewFocus);
+                              viewFocus[2], viewFocus);
   focalDepth = viewFocus[2];
 
   this->ComputeDisplayToWorld(double(toX), double(toY),
-                             focalDepth, newPickPoint);
+                              focalDepth, newPickPoint);
   this->ComputeDisplayToWorld(double(fromX),double(fromY),
-                             focalDepth, oldPickPoint);
+                              focalDepth, oldPickPoint);
   
   // camera motion is reversed
   motionVector[0] = oldPickPoint[0] - newPickPoint[0];
@@ -1255,11 +1332,11 @@ void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
   cam->GetFocalPoint(viewFocus);
   cam->GetPosition(viewPoint);
   cam->SetFocalPoint(motionVector[0] + viewFocus[0],
-                    motionVector[1] + viewFocus[1],
-                    motionVector[2] + viewFocus[2]);
+                     motionVector[1] + viewFocus[1],
+                     motionVector[2] + viewFocus[2]);
   cam->SetPosition(motionVector[0] + viewPoint[0],
-                  motionVector[1] + viewPoint[1],
-                  motionVector[2] + viewPoint[2]);
+                   motionVector[1] + viewPoint[1],
+                   motionVector[2] + viewPoint[2]);
 }
 
 void SVTK_InteractorStyle::IncrementalPan( const int incrX, const int incrY )
@@ -1341,19 +1418,19 @@ void SVTK_InteractorStyle::OnTimer()
     {
       if ( !myBBFirstCheck )
       {
-       if ( fabs(aCurrBBCenter[0]-myBBCenter[0]) > 1e-38 ||
-            fabs(aCurrBBCenter[1]-myBBCenter[1]) > 1e-38 ||
-            fabs(aCurrBBCenter[2]-myBBCenter[2]) > 1e-38 ) {
-         // bounding box was changed => send SVTK::RotationPointChanged event
-         // invoke event for update coordinates in SVTK_SetRotationPointDlg
-         InvokeEvent(SVTK::BBCenterChanged,(void*)aCurrBBCenter);
-         for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
-       }
+        if ( fabs(aCurrBBCenter[0]-myBBCenter[0]) > 1e-38 ||
+             fabs(aCurrBBCenter[1]-myBBCenter[1]) > 1e-38 ||
+             fabs(aCurrBBCenter[2]-myBBCenter[2]) > 1e-38 ) {
+          // bounding box was changed => send SVTK::RotationPointChanged event
+          // invoke event for update coordinates in SVTK_SetRotationPointDlg
+          InvokeEvent(SVTK::BBCenterChanged,(void*)aCurrBBCenter);
+          for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
+        }
       }
       else 
       {
-       for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
-       myBBFirstCheck = false;
+        for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
+        myBBFirstCheck = false;
       }
     }
   }
@@ -1430,9 +1507,9 @@ void SVTK_InteractorStyle::endDrawRect()
   Main process event method (reimplemented from #vtkInteractorStyle)
 */
 void SVTK_InteractorStyle::ProcessEvents( vtkObject* object,
-                                         unsigned long event,
-                                         void* clientData, 
-                                         void* callData )
+                                          unsigned long event,
+                                          void* clientData, 
+                                          void* callData )
 {
   if ( clientData ) {
     vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
@@ -1443,140 +1520,140 @@ void SVTK_InteractorStyle::ProcessEvents( vtkObject* object,
     if ( self ) {
       switch ( event ) {
       case SVTK::SpaceMouseMoveEvent : 
-       self->onSpaceMouseMove( (double*)callData ); 
-       return;
+        self->onSpaceMouseMove( (double*)callData ); 
+        return;
       case SVTK::SpaceMouseButtonEvent : 
-       self->onSpaceMouseButton( *((int*)callData) ); 
-       return;
+        self->onSpaceMouseButton( *((int*)callData) ); 
+        return;
       case SVTK::PanLeftEvent: 
-       self->IncrementalPan(-aSpeedIncrement, 0);
-       return;
+        self->IncrementalPan(-aSpeedIncrement, 0);
+        return;
       case SVTK::PanRightEvent:
-       self->IncrementalPan(aSpeedIncrement, 0);
-       return;
+        self->IncrementalPan(aSpeedIncrement, 0);
+        return;
       case SVTK::PanUpEvent:
-       self->IncrementalPan(0, aSpeedIncrement);
-       return;
+        self->IncrementalPan(0, aSpeedIncrement);
+        return;
       case SVTK::PanDownEvent:
-       self->IncrementalPan(0, -aSpeedIncrement);
-       return;
+        self->IncrementalPan(0, -aSpeedIncrement);
+        return;
       case SVTK::ZoomInEvent:
-       self->IncrementalZoom(aSpeedIncrement);
-       return;
+        self->IncrementalZoom(aSpeedIncrement);
+        return;
       case SVTK::ZoomOutEvent:
-       self->IncrementalZoom(-aSpeedIncrement);
-       return;
+        self->IncrementalZoom(-aSpeedIncrement);
+        return;
       case SVTK::RotateLeftEvent: 
-       self->IncrementalRotate(-aSpeedIncrement, 0);
-       return;
+        self->IncrementalRotate(-aSpeedIncrement, 0);
+        return;
       case SVTK::RotateRightEvent:
-       self->IncrementalRotate(aSpeedIncrement, 0);
-       return;
+        self->IncrementalRotate(aSpeedIncrement, 0);
+        return;
       case SVTK::RotateUpEvent:
-       self->IncrementalRotate(0, -aSpeedIncrement);
-       return;
+        self->IncrementalRotate(0, -aSpeedIncrement);
+        return;
       case SVTK::RotateDownEvent:
-       self->IncrementalRotate(0, aSpeedIncrement);
-       return;
+        self->IncrementalRotate(0, aSpeedIncrement);
+        return;
       case SVTK::PlusSpeedIncrementEvent:
-       self->ControllerIncrement()->Increase();
-       return;
+        self->ControllerIncrement()->Increase();
+        return;
       case SVTK::MinusSpeedIncrementEvent:
-       self->ControllerIncrement()->Decrease();
-       return;
+        self->ControllerIncrement()->Decrease();
+        return;
       case SVTK::SetSpeedIncrementEvent:
-       self->ControllerIncrement()->SetStartValue(*((int*)callData));
-       return;
+        self->ControllerIncrement()->SetStartValue(*((int*)callData));
+        return;
 
       case SVTK::SetSMDecreaseSpeedEvent:
-       self->mySMDecreaseSpeedBtn = *((int*)callData);
-       return;
+        self->mySMDecreaseSpeedBtn = *((int*)callData);
+        return;
       case SVTK::SetSMIncreaseSpeedEvent:
-       self->mySMIncreaseSpeedBtn = *((int*)callData);
-       return;
+        self->mySMIncreaseSpeedBtn = *((int*)callData);
+        return;
       case SVTK::SetSMDominantCombinedSwitchEvent:
-       self->mySMDominantCombinedSwitchBtn = *((int*)callData);
-       return;
+        self->mySMDominantCombinedSwitchBtn = *((int*)callData);
+        return;
 
       case SVTK::StartZoom:
-       self->startZoom();
-       return;
+        self->startZoom();
+        return;
       case SVTK::StartPan:
-       self->startPan();
-       return;
+        self->startPan();
+        return;
       case SVTK::StartRotate:
-       self->startRotate();
-       return;
+        self->startRotate();
+        return;
       case SVTK::StartGlobalPan:
-       self->startGlobalPan();
-       return;
+        self->startGlobalPan();
+        return;
       case SVTK::StartFitArea:
-       self->startFitArea();
-       return;
+        self->startFitArea();
+        return;
 
       case SVTK::SetRotateGravity:
-       if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
-       {
-         self->myHighlightSelectionPointActor->SetVisibility( false );
-         if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
-         self->GetRenderWidget()->setCursor(self->myDefCursor); 
-       }
-       self->myPrevRotationPointType = self->myCurrRotationPointType;
-       self->myCurrRotationPointType = SVTK::SetRotateGravity;
-       if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) 
-         // invoke event for update coordinates in SVTK_SetRotationPointDlg
-         self->InvokeEvent(SVTK::BBCenterChanged,(void*)aCenter);
-       return;
+        if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+        {
+          self->myHighlightSelectionPointActor->SetVisibility( false );
+          if( self->GetCurrentRenderer() != NULL )
+            self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+          self->GetRenderWidget()->setCursor(self->myDefCursor); 
+        }
+        self->myPrevRotationPointType = self->myCurrRotationPointType;
+        self->myCurrRotationPointType = SVTK::SetRotateGravity;
+        if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) 
+          // invoke event for update coordinates in SVTK_SetRotationPointDlg
+          self->InvokeEvent(SVTK::BBCenterChanged,(void*)aCenter);
+        return;
       case SVTK::StartPointSelection:
-       self->startPointSelection();
-       return;
+        self->startPointSelection();
+        return;
 
       case SVTK::ChangeRotationPoint:
-       if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
-       {
-         self->myHighlightSelectionPointActor->SetVisibility( false );
-         if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
-         self->GetRenderWidget()->setCursor(self->myDefCursor); 
-       }
-       self->myPrevRotationPointType = self->myCurrRotationPointType;
-       self->myCurrRotationPointType = SVTK::SetRotateSelected;
-       aSelectedPoint = (vtkFloatingPointType*)callData;
-       self->myRotationPointX = aSelectedPoint[0];
-       self->myRotationPointY = aSelectedPoint[1];
-       self->myRotationPointZ = aSelectedPoint[2];
-       return;
+        if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+        {
+          self->myHighlightSelectionPointActor->SetVisibility( false );
+          if( self->GetCurrentRenderer() != NULL )
+            self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+          self->GetRenderWidget()->setCursor(self->myDefCursor); 
+        }
+        self->myPrevRotationPointType = self->myCurrRotationPointType;
+        self->myCurrRotationPointType = SVTK::SetRotateSelected;
+        aSelectedPoint = (vtkFloatingPointType*)callData;
+        self->myRotationPointX = aSelectedPoint[0];
+        self->myRotationPointY = aSelectedPoint[1];
+        self->myRotationPointZ = aSelectedPoint[2];
+        return;
 
       case SVTK::SetFocalPointGravity:
-       if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
-       {
-         self->myHighlightSelectionPointActor->SetVisibility( false );
-         if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
-         self->GetRenderWidget()->setCursor(self->myDefCursor); 
-       }
-       self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
-       if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
-         // invoke event for update coordinates in SVTK_ViewParameterDlg
-         self->InvokeEvent(SVTK::FocalPointChanged,(void*)aCenter);
-       }
-       return;
+        if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
+        {
+          self->myHighlightSelectionPointActor->SetVisibility( false );
+          if( self->GetCurrentRenderer() != NULL )
+            self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+          self->GetRenderWidget()->setCursor(self->myDefCursor); 
+        }
+        self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
+        if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
+          // invoke event for update coordinates in SVTK_ViewParameterDlg
+          self->InvokeEvent(SVTK::FocalPointChanged,(void*)aCenter);
+        }
+        return;
       case SVTK::StartFocalPointSelection:
-       self->startFocalPointSelection();
-       return;
+        self->startFocalPointSelection();
+        return;
 
       case SVTK::SetFocalPointSelected:
-       if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
-       {
-         self->myHighlightSelectionPointActor->SetVisibility( false );
-         if( self->GetCurrentRenderer() != NULL )
-           self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
-         self->GetRenderWidget()->setCursor(self->myDefCursor); 
-       }
-       self->myPrevFocalPointType = self->myCurrFocalPointType;
-       self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
-       return;
+        if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
+        {
+          self->myHighlightSelectionPointActor->SetVisibility( false );
+          if( self->GetCurrentRenderer() != NULL )
+            self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+          self->GetRenderWidget()->setCursor(self->myDefCursor); 
+        }
+        self->myPrevFocalPointType = self->myCurrFocalPointType;
+        self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
+        return;
       }
     }
   }
index 9053b430d34518836a77335d2e971f15bbd4778b..38c7278a7ba8979220e2be9404f1898d5b16f516 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_InteractorStyle.h
 //  Author : Christophe ATTANASIO
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef __SVTK_InteractorStyle_h
 #define __SVTK_InteractorStyle_h
 
@@ -126,6 +125,7 @@ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{
 };
 
 class vtkPointPicker;
+class vtkTDxInteractorStyle;
 
 class SALOME_Actor;
 
@@ -158,7 +158,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
 
   typedef boost::shared_ptr<SVTK_SelectionEvent> PSelectionEvent;
 
-  
+  void SetTDxStyle(vtkTDxInteractorStyle*){} 
 
   //! Generate special #SVTK_SelectionEvent
   virtual SVTK_SelectionEvent* GetSelectionEvent();
@@ -199,6 +199,12 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   //! To handle right mouse button up event (reimplemented from #vtkInteractorStyle)
   virtual void OnRightButtonUp();
 
+  //! To handle mouse wheel forward event (reimplemented from #vtkInteractorStyle)
+  virtual void OnMouseWheelForward();
+
+  //! To handle mouse wheel backward event (reimplemented from #vtkInteractorStyle)
+  virtual void OnMouseWheelBackward();
+
   //! To handle keyboard event (reimplemented from #vtkInteractorStyle)
   virtual void OnChar();
 
@@ -227,6 +233,9 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
 
   int   CurrentState() const { return State; }
 
+  void SetAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+  bool IsAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
   protected:
   SVTK_InteractorStyle();
   ~SVTK_InteractorStyle();
@@ -264,9 +273,9 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   static 
   void
   ProcessEvents(vtkObject* object, 
-               unsigned long event,
-               void* clientData, 
-               void* callData );
+                unsigned long event,
+                void* clientData, 
+                void* callData );
 
   float MotionFactor;
   float RadianToDegree;                 // constant: for conv from deg to rad
@@ -349,6 +358,8 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   bool                            myBBFirstCheck;
 
   QRubberBand*                    myRectBand; //!< selection rectangle rubber band
+
+  bool                            myIsAdvancedZoomingEnabled;
 };
 
 #ifdef WIN32
index 2ffedddfeaed14f4cdff08218305af29bba9d254..4bdb61401ee680b62fa268ae468b85399170a7b0 100644 (file)
@@ -1,30 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_KeyFreeInteractorStyle.cxx
 //  Author : Christophe ATTANASIO
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_KeyFreeInteractorStyle.h"
 #include "SVTK_Selector.h"
 
@@ -53,7 +49,7 @@ SVTK_KeyFreeInteractorStyle::~SVTK_KeyFreeInteractorStyle()
 
 //----------------------------------------------------------------------------
 void SVTK_KeyFreeInteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
-                                                  int x, int y) 
+                                                   int x, int y) 
 {
   myIsLeftButtonDown = true;
 
@@ -78,10 +74,10 @@ void SVTK_KeyFreeInteractorStyle::OnLeftButtonDown(int ctrl, int shift,
   else {
     if (!(ctrl||shift)){
       if (myIsMidButtonDown){
-       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+        startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
       }
       else{
-       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
+        startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
       }
     }
   }
@@ -90,8 +86,8 @@ void SVTK_KeyFreeInteractorStyle::OnLeftButtonDown(int ctrl, int shift,
 
 //----------------------------------------------------------------------------
 void SVTK_KeyFreeInteractorStyle::OnMiddleButtonDown(int ctrl,
-                                                    int shift, 
-                                                    int x, int y) 
+                                                     int shift, 
+                                                     int x, int y) 
 {
   myIsMidButtonDown = true;
 
@@ -116,10 +112,10 @@ void SVTK_KeyFreeInteractorStyle::OnMiddleButtonDown(int ctrl,
   else {
     if (!(ctrl||shift)){
       if ( myIsLeftButtonDown ){
-       startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+        startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
       }
       else{
-       startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
+        startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
       }
     }
   }
index 3b44baa84b8fc242fa795f87b4772c844821d0ab..90085e29bf707892b366c88faf44a30df387dd9d 100644 (file)
@@ -1,34 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_KeyFreeInteractorStyle.h
 //  Author : Christophe ATTANASIO
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef __SVTK_KeyFreeInteractorStyle_h
 #define __SVTK_KeyFreeInteractorStyle_h
 
-
 #include "SVTK.h"
 
 #include "SVTK_InteractorStyle.h"
index 9596001ca7c00c0c7f3c72c0c0fa49bfde4f874d..4034b6e21bfefc4ead1e7f290877f5aef88b3e54 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_NonIsometricDlg.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_Renderer.h"
 #include <QPushButton>
 #include <QGridLayout>
 
-using namespace std;
-
 /*!
   Constructor
 */
 SVTK_NonIsometricDlg
 ::SVTK_NonIsometricDlg(QtxAction* theAction,
-                      SVTK_ViewWindow* theParent,
-                      const char* theName):
-  SVTK_DialogBase(theAction,
-                 theParent, 
-                 theName),
+                       SVTK_ViewWindow* theParent,
+                       const char* theName):
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   m_MainWindow(theParent)
 {
   setWindowTitle(tr("DLG_TITLE"));
index 7958fc24adf27721bff6a9fa4061b3eb010ce70d..c2c2dab381975a0caa53b30b8ed84bc6fbade30a 100644 (file)
@@ -1,34 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_NONISOMETRICDLG_H
 #define SVTK_NONISOMETRICDLG_H
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 class SVTK_ViewWindow;
 
@@ -38,14 +37,14 @@ class QtxAction;
 class QPushButton;
 
 
-class SVTK_NonIsometricDlg : public SVTK_DialogBase
+class SVTK_NonIsometricDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
 public:
   SVTK_NonIsometricDlg(QtxAction* theAction,
-                      SVTK_ViewWindow* theParent,
-                      const char* theName);
+                       SVTK_ViewWindow* theParent,
+                       const char* theName);
 
   ~SVTK_NonIsometricDlg();
 
index 34651fe477be8a513f3c6890d11e4eb95bb57c23..be88973dab71329c122efbc8886cf79c594e9bf6 100644 (file)
@@ -1,36 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_Prs.cxx
 //  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_Prs.h"
 
 #include <vtkActorCollection.h>
 
-using namespace std;
-
 /*!
   Default constructor
 */
index e867f5c8b7948f35aa4f08b0b3c29c92178c4ae5..e2bf6f369fee9237bda53e6fe155c5a25271822f 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_Prs.h
 //  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_Prs_H
 #define SVTK_Prs_H
 
index 52b08a14d7edc17ba6ca778fe52b7fbceed004a2..0be0147b3995793612310677d48c8f1289e9c000 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_Recorder.h"
 
 #include "SVTK_ImageWriter.h"
@@ -60,11 +58,10 @@ namespace
   inline
   void
   GetNameJPEG(const std::string& thePreffix,  
-             const int theIndex,
-             std::string& theName)
+              const int theIndex,
+              std::string& theName)
   {
-    using namespace std;
-    ostringstream aStream;
+    std::ostringstream aStream;
     aStream<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";
     theName = aStream.str();
   }
@@ -116,9 +113,12 @@ SVTK_Recorder
 ::CheckExistAVIMaker()
 {
   myErrorStatus = 0;
-  using namespace std;
-  ostringstream aStream;
-  aStream<<"which "<<myNameAVIMaker<<" >& /dev/null";
+  std::ostringstream aStream;
+#ifndef WIN32
+  aStream<<"which "<<myNameAVIMaker<<" 2> /dev/null";
+#else
+  aStream<<"setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in ("<<myNameAVIMaker<<"%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
   std::string anAVIMakeCheck = aStream.str();
   int iErr = system(anAVIMakeCheck.c_str());
   if(iErr != 0)
@@ -241,16 +241,16 @@ SVTK_Recorder
 void
 SVTK_Recorder
 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* vtkNotUsed(theCallData))
+                unsigned long theEvent,
+                void* theClientData, 
+                void* vtkNotUsed(theCallData))
 {
   if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){ 
     if(SVTK_Recorder* aSelf = dynamic_cast<SVTK_Recorder*>(anObj)){
       if(theEvent==vtkCommand::EndEvent){
-       if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
-         aSelf->DoRecord();
-       }
+        if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
+          aSelf->DoRecord();
+        }
       }
     }
   }
@@ -322,9 +322,9 @@ SVTK_Recorder
 inline 
 int
 GetFrameIndex(double theStartTime,
-             double theFPS)
+              double theFPS)
 {
-  double aTimeNow = vtkTimerLog::GetCurrentTime();
+  double aTimeNow = vtkTimerLog::GetUniversalTime();
   double aDelta = aTimeNow - theStartTime;
   return int(aDelta*theFPS);
 }
@@ -338,7 +338,7 @@ SVTK_Recorder
 
   if(myFrameIndex < 0){
     myFrameIndex = 0;
-    myTimeStart = vtkTimerLog::GetCurrentTime();
+    myTimeStart = vtkTimerLog::GetUniversalTime();
   }else{
     int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
     if(aFrameIndex <= myFrameIndex)
@@ -350,8 +350,8 @@ SVTK_Recorder
       myFrameIndexes.back() = abs(myFrameIndexes.back());
       double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
       if(MYDEBUG) 
-       cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
-         "; aPauseTime = "<<aPauseTime<<endl;
+        cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+          "; aPauseTime = "<<aPauseTime<<endl;
       myTimeStart += aPauseTime;
     }
 
@@ -399,8 +399,8 @@ SVTK_Recorder
   anImageData->UpdateInformation();
   int *anExtent = anImageData->GetWholeExtent();
   anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
-                              anExtent[2], anExtent[3],
-                              0,0);
+                               anExtent[2], anExtent[3],
+                               0,0);
   anImageData->UpdateData();
 }
 
@@ -432,10 +432,19 @@ SVTK_Recorder
       myNbWrittenFrames++;
       std::string anCurrentName;
       GetNameJPEG(myName,anIndex,anCurrentName);
+  #ifndef WIN32
       aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
+  #else
+      aStream<<"COPY /Y "<<QString::fromStdString(anInitialName).replace("/","\\\\").toStdString()<<
+                 " "<<QString::fromStdString(anCurrentName).replace("/","\\\\").toStdString()<<" > NUL";
+  #endif
       if(anIndex + 1 < aFinishIndex)
-       aStream<<" \\";
-      aStream<<endl;
+  #ifndef WIN32
+        aStream<<" \\";
+        aStream<<endl;
+  #else
+        aStream<<" & ";
+  #endif
     }
     std::string aString(aStream.str());
     system(aString.c_str());
@@ -457,10 +466,11 @@ SVTK_Recorder
     //" -f "<<int(myNbFPS)<<" "<<
     " -f "<<myNbFPS<<" "<<
     " -n "<<myNbWrittenFrames<<" "<<
-    " -j "<<myName<<"_\%06d.jpeg "<<
-    "| yuv2lav"<<
-    " -o "<<myName;
-   
+    " -j \""<<myName<<"_\%06d.jpeg\" "<<
+    "| yuv2lav"<<" -o \""<<myName<<"\"";
+#ifdef WIN32
+  aStream<<" -f aA";   
+#endif
   std::string aString(aStream.str());
   myErrorStatus = system(aString.c_str());
 
@@ -469,12 +479,20 @@ SVTK_Recorder
   QFileInfo aFileInfo(myName.c_str());
   QString aDirPath = aFileInfo.absoluteDir().path();
   QString aBaseName = aFileInfo.fileName();
-  QString aCommand = 
-    QString("(cd ") + aDirPath + 
+  QString aCommand;
+#ifndef WIN32
+  aCommand = QString("(cd ") + aDirPath + 
     "; ls " +
     " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
     " | xargs rm " +
     ")";
+#else
+  QString tmpFile = QString("_") + aBaseName + "_tempfile";
+  QString diskName = aDirPath.split("/")[0];
+  aCommand = diskName + " && (cd " + aDirPath.replace("/","\\\\") + 
+       " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile + 
+       ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
 
   if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
   system((const char*)aCommand.toLatin1());
index 436974787be8fda7d22ec9955d446ff5a41e6ff1..bfc2aaced5e2c822fc3ba876258c0fa878abd343 100755 (executable)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_RECORDER_H
 #define SVTK_RECORDER_H
 
@@ -120,9 +118,9 @@ protected :
   static
   void
   ProcessEvents(vtkObject* theObject, 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* theCallData);
+                unsigned long theEvent,
+                void* theClientData, 
+                void* theCallData);
 
 protected :
   int myState;
index 3f76101faeb47731005864818ce2e008a8e660a8..ea08acf51fc5193a2ae5bd13ef06461bfaac8957 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_RecorderDlg.h"
 #include "SVTK_Recorder.h"
 
@@ -156,15 +154,15 @@ void SVTK_RecorderDlg::onHelp()
   if (app)
     app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
   else {
-               QString platform;
+                QString platform;
 #ifdef WIN32
-               platform = "winapplication";
+                platform = "winapplication";
 #else
-               platform = "application";
+                platform = "application";
 #endif
     SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
-                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+                             QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
   }
   */
 }
@@ -176,7 +174,7 @@ bool SVTK_RecorderDlg::onBrowseFile()
   aFilter.append( tr( "FLT_ALL_FILES" ) );
 
   QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
-                                                tr( "FILE_NAME" ), false );
+                                                 tr( "FILE_NAME" ), false );
 
   if( aFileName.isNull() )
     return false;
index 5f1468308720313dfbe3ba3559b7b9058b3009b8..d1f8961dab547ac438d90d8843daa0c54e997640 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_RECORDERDLG_H
 #define SVTK_RECORDERDLG_H
 
index 1030e3db388b46e1a629e305cee3aced9dcdea19..77640da9dfb25848443216f8087ca546e09b232b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_RectPicker.cxx
 //  Author : 
@@ -64,11 +65,11 @@ namespace
   inline
   int
   Check(float* theZPtr,
-       int theSelection[4],
-       vtkFloatingPointType theTolerance,
-       vtkFloatingPointType theDZ,
-       int theDX,
-       int theDY)
+        int theSelection[4],
+        vtkFloatingPointType theTolerance,
+        vtkFloatingPointType theDZ,
+        int theDX,
+        int theDY)
   {
     int aRet = 0;
     vtkFloatingPointType aZ = -1.0;
@@ -80,7 +81,7 @@ namespace
       // the selection window.
       aZ = GetZ(theZPtr,theSelection,theDX,theDY);
       if(aZ > theTolerance && aZ < 1.0 - theTolerance){
-       aRet = fabs(aZ - theDZ) <= theTolerance;
+        aRet = fabs(aZ - theDZ) <= theTolerance;
       }
     }
 
@@ -92,11 +93,11 @@ namespace
   //----------------------------------------------------------------------------
   void
   SelectVisiblePoints(int theSelection[4],
-                     vtkRenderer *theRenderer,
-                     vtkDataSet *theInput,
-                     SVTK_RectPicker::TVectorIds& theVisibleIds,
-                     SVTK_RectPicker::TVectorIds& theInVisibleIds,
-                     vtkFloatingPointType theTolerance)
+                      vtkRenderer *theRenderer,
+                      vtkDataSet *theInput,
+                      SVTK_RectPicker::TVectorIds& theVisibleIds,
+                      SVTK_RectPicker::TVectorIds& theInVisibleIds,
+                      vtkFloatingPointType theTolerance)
   {
     theVisibleIds.clear();
     theInVisibleIds.clear();
@@ -115,7 +116,7 @@ namespace
     // and handle the transformation ourselves.
     vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
     aMatrix->DeepCopy( theRenderer->GetActiveCamera()->
-                      GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
+                       GetCompositeProjectionTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
 
     // We grab the z-buffer for the selection region all at once and probe the resulting array.
     float *aZPtr = theRenderer->GetRenderWindow()->
@@ -132,7 +133,7 @@ namespace
     for(int iY = theSelection[1]; iY <= theSelection[3];  iY++){
       //cout<<iY<<"\t";
       for(int iX = theSelection[0]; iX <= theSelection[2];  iX++){
-       //cout<<std::setprecision(4)<<GetZ(aZPtr,theSelection,iX,iY)<<"\t";
+        //cout<<std::setprecision(4)<<GetZ(aZPtr,theSelection,iX,iY)<<"\t";
       }
       //cout<<endl;
     }
@@ -145,10 +146,10 @@ namespace
       vtkFloatingPointType aView[4];
       aMatrix->MultiplyPoint(aX,aView);
       if(aView[3] == 0.0)
-       continue;
+        continue;
       theRenderer->SetViewPoint(aView[0]/aView[3], 
-                               aView[1]/aView[3],
-                               aView[2]/aView[3]);
+                                aView[1]/aView[3],
+                                aView[2]/aView[3]);
       theRenderer->ViewToDisplay();
 
       vtkFloatingPointType aDX[3];
@@ -158,52 +159,52 @@ namespace
       if(aDX[0] >= theSelection[0] && aDX[0] <= theSelection[2] &&
          aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3])
       {
-       //cout<<"aPntId "<<aPntId<<"; aDX = {"<<aDX[0]<<", "<<aDX[1]<<", "<<aDX[2]<<"}\n";
-       int aDX0 = int(aDX[0]);
-       int aDX1 = int(aDX[1]);
-
-       int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aDX0,aDX1);
-       if(aRet > 0)
-         goto ADD_VISIBLE;
-       if(aRet < 0)
-         goto ADD_INVISIBLE;
-
-       static int aMaxRadius = 5;
-       for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){
-         int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius};
-         for(int i = 0; i <= aRadius; i++){
-           int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]);
-           if(aRet > 0)
-             goto ADD_VISIBLE;
-           if(aRet < 0)
-             goto ADD_INVISIBLE;
-         }
-         for(int i = 0; i <= aRadius; i++){
-           int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++);
-           if(aRet > 0)
-             goto ADD_VISIBLE;
-           if(aRet < 0)
-             goto ADD_INVISIBLE;
-         }
-         for(int i = 0; i <= aRadius; i++){
-           int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]);
-           if(aRet > 0)
-             goto ADD_VISIBLE;
-           if(aRet < 0)
-             goto ADD_INVISIBLE;
-         }
-         for(int i = 0; i <= aRadius; i++){
-           int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--);
-           if(aRet > 0)
-             goto ADD_VISIBLE;
-           if(aRet < 0)
-             goto ADD_INVISIBLE;
-         }
-       }
-       if(false)
-         ADD_VISIBLE : theVisibleIds.push_back(aPntId);
-       if(false)
-         ADD_INVISIBLE : theInVisibleIds.push_back(aPntId);
+        //cout<<"aPntId "<<aPntId<<"; aDX = {"<<aDX[0]<<", "<<aDX[1]<<", "<<aDX[2]<<"}\n";
+        int aDX0 = int(aDX[0]);
+        int aDX1 = int(aDX[1]);
+
+        int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aDX0,aDX1);
+        if(aRet > 0)
+          goto ADD_VISIBLE;
+        if(aRet < 0)
+          goto ADD_INVISIBLE;
+
+        static int aMaxRadius = 5;
+        for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){
+          int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius};
+          for(int i = 0; i <= aRadius; i++){
+            int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]);
+            if(aRet > 0)
+              goto ADD_VISIBLE;
+            if(aRet < 0)
+              goto ADD_INVISIBLE;
+          }
+          for(int i = 0; i <= aRadius; i++){
+            int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++);
+            if(aRet > 0)
+              goto ADD_VISIBLE;
+            if(aRet < 0)
+              goto ADD_INVISIBLE;
+          }
+          for(int i = 0; i <= aRadius; i++){
+            int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]);
+            if(aRet > 0)
+              goto ADD_VISIBLE;
+            if(aRet < 0)
+              goto ADD_INVISIBLE;
+          }
+          for(int i = 0; i <= aRadius; i++){
+            int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--);
+            if(aRet > 0)
+              goto ADD_VISIBLE;
+            if(aRet < 0)
+              goto ADD_INVISIBLE;
+          }
+        }
+        if(false)
+          ADD_VISIBLE : theVisibleIds.push_back(aPntId);
+        if(false)
+          ADD_INVISIBLE : theInVisibleIds.push_back(aPntId);
       }
     }//for all points
 
@@ -218,7 +219,7 @@ namespace
   inline
   void
   GetCenter(const vtkFloatingPointType theBounds[6],
-           vtkFloatingPointType theCenter[3])
+            vtkFloatingPointType theCenter[3])
   {
     theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0;
     theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0;
@@ -227,10 +228,10 @@ namespace
 
   void
   SelectVisibleCells(int theSelection[4],
-                    vtkRenderer *theRenderer,
-                    vtkDataSet *theInput,
-                    SVTK_RectPicker::TVectorIds& theVectorIds,
-                    vtkFloatingPointType theTolerance)
+                     vtkRenderer *theRenderer,
+                     vtkDataSet *theInput,
+                     SVTK_RectPicker::TVectorIds& theVectorIds,
+                     vtkFloatingPointType theTolerance)
   {
     theVectorIds.clear();
 
@@ -243,11 +244,11 @@ namespace
     SVTK_RectPicker::TVectorIds aVisiblePntIds;
     SVTK_RectPicker::TVectorIds anInVisiblePntIds;
     SelectVisiblePoints(theSelection,
-                       theRenderer,
-                       theInput,
-                       aVisiblePntIds,
-                       anInVisiblePntIds,
-                       theTolerance);
+                        theRenderer,
+                        theInput,
+                        aVisiblePntIds,
+                        anInVisiblePntIds,
+                        theTolerance);
 
     typedef std::set<vtkIdType> TIdsSet;
     TIdsSet aVisibleIds(aVisiblePntIds.begin(),aVisiblePntIds.end());
@@ -260,7 +261,7 @@ namespace
     // and handle the transformation ourselves.
     vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
     aMatrix->DeepCopy(theRenderer->GetActiveCamera()->
-                     GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
+                      GetCompositeProjectionTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
 
     for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){
       vtkCell* aCell = theInput->GetCell(aCellId);
@@ -276,11 +277,11 @@ namespace
       aMatrix->MultiplyPoint(aX,aView);
 
       if(aView[3] == 0.0)
-       continue;
+        continue;
 
       theRenderer->SetViewPoint(aView[0]/aView[3], 
-                               aView[1]/aView[3],
-                               aView[2]/aView[3]);
+                                aView[1]/aView[3],
+                                aView[2]/aView[3]);
       theRenderer->ViewToDisplay();
 
       vtkFloatingPointType aDX[3];
@@ -291,19 +292,19 @@ namespace
          aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3])
       {
 
-       //cout<<"aCellId = "<<aCellId<<": ";
-       vtkIdType aNumPts = aCell->GetNumberOfPoints();
-       bool anIsVisible = true;
-       for(vtkIdType anId = 0; anId < aNumPts; anId++){
-         vtkIdType aPntId = aCell->GetPointId(anId);
-         //cout<<aPntId<<"; ";
-         anIsVisible = aVisibleIds.find(aPntId) != aVisibleIds.end();
-         if(!anIsVisible)
-           break;
-       }
-       //cout<<"\t"<<anIsVisible<<"\n";
-       if(anIsVisible)
-         theVectorIds.push_back(aCellId);
+        //cout<<"aCellId = "<<aCellId<<": ";
+        vtkIdType aNumPts = aCell->GetNumberOfPoints();
+        bool anIsVisible = true;
+        for(vtkIdType anId = 0; anId < aNumPts; anId++){
+          vtkIdType aPntId = aCell->GetPointId(anId);
+          //cout<<aPntId<<"; ";
+          anIsVisible = aVisibleIds.find(aPntId) != aVisibleIds.end();
+          if(!anIsVisible)
+            break;
+        }
+        //cout<<"\t"<<anIsVisible<<"\n";
+        if(anIsVisible)
+          theVectorIds.push_back(aCellId);
       }
     }//for all parts
   }
@@ -311,10 +312,10 @@ namespace
   //----------------------------------------------------------------------------
   void
   CalculatePickPosition(vtkRenderer *theRenderer,
-                       vtkFloatingPointType theSelectionX, 
-                       vtkFloatingPointType theSelectionY, 
-                       vtkFloatingPointType theSelectionZ,
-                       vtkFloatingPointType thePickPosition[3])
+                        vtkFloatingPointType theSelectionX, 
+                        vtkFloatingPointType theSelectionY, 
+                        vtkFloatingPointType theSelectionZ,
+                        vtkFloatingPointType thePickPosition[3])
   {
     // Convert the selection point into world coordinates.
     //
@@ -323,7 +324,7 @@ namespace
     vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint();
     if ( aWorldCoords[3] != 0.0 ) {
       for (int i=0; i < 3; i++) {
-       thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3];
+        thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3];
       }
     }
   }
@@ -359,8 +360,8 @@ SVTK_RectPicker
        vtkRenderer *theRenderer)
 {
   return Pick(theSelection[0], theSelection[1], theSelection[2], 
-             theSelection2[0], theSelection2[1], theSelection2[2],
-             theRenderer);
+              theSelection2[0], theSelection2[1], theSelection2[2],
+              theRenderer);
 }
 
 int 
@@ -400,10 +401,10 @@ SVTK_RectPicker
   // Convert the selection point into world coordinates.
   //
   CalculatePickPosition(theRenderer,
-                       theSelectionX,
-                       theSelectionY,
-                       aSelectionZ,
-                       this->PickPosition);
+                        theSelectionX,
+                        theSelectionY,
+                        aSelectionZ,
+                        this->PickPosition);
 
   this->SelectionPoint2[0] = theSelectionX2;
   this->SelectionPoint2[1] = theSelectionY2;
@@ -412,10 +413,10 @@ SVTK_RectPicker
   // Convert the selection point into world coordinates.
   //
   CalculatePickPosition(theRenderer,
-                       theSelectionX2,
-                       theSelectionY2,
-                       aSelectionZ,
-                       this->PickPosition2);
+                        theSelectionX2,
+                        theSelectionY2,
+                        aSelectionZ,
+                        this->PickPosition2);
 
   // Invoke start pick method if defined
   this->InvokeEvent(vtkCommand::StartPickEvent,NULL);
@@ -424,7 +425,7 @@ SVTK_RectPicker
   if ( this->PickFromList ) 
     aProps = this->GetPickList();
   else 
-    aProps = theRenderer->GetProps();
+    aProps = theRenderer->GetViewProps();
 
   aProps->InitTraversal();
   while ( vtkProp* aProp = aProps->GetNextProp() ) {
@@ -433,44 +434,44 @@ SVTK_RectPicker
       vtkMapper *aMapper = NULL;
       bool anIsPickable = false;
       vtkActor* anActor = NULL;
-      vtkProp *aPropCandidate = aPath->GetLastNode()->GetProp();
+      vtkProp *aPropCandidate = aPath->GetLastNode()->GetViewProp();
       if ( aPropCandidate->GetPickable() && aPropCandidate->GetVisibility() ) {
         anIsPickable = true;
-       anActor = vtkActor::SafeDownCast(aPropCandidate);
-       if ( anActor ) {
+        anActor = vtkActor::SafeDownCast(aPropCandidate);
+        if ( anActor ) {
           aMapper = anActor->GetMapper();
           if ( anActor->GetProperty()->GetOpacity() <= 0.0 )
-           anIsPickable = false;
-       }
+            anIsPickable = false;
+        }
       }
       if ( anIsPickable  &&  aMapper && aMapper->GetInput()) {
-       int aSelectionPoint[4] = {int(theSelectionX),
-                                 int(theSelectionY),
-                                 int(theSelectionX2),
-                                 int(theSelectionY2)};
-       if ( this->PickPoints ) {
-         TVectorIds& aVisibleIds = myPointIdsMap[anActor];
-         TVectorIds anInVisibleIds;
-         SelectVisiblePoints(aSelectionPoint,
-                             theRenderer,
-                             aMapper->GetInput(),
-                             aVisibleIds,
-                             anInVisibleIds,
-                             this->Tolerance);
-         if ( aVisibleIds.empty() ) {
-           myPointIdsMap.erase(myPointIdsMap.find(anActor));
-         }
-       } else {
-         TVectorIds& aVectorIds = myCellIdsMap[anActor];
-         SelectVisibleCells(aSelectionPoint,
-                            theRenderer,
-                            aMapper->GetInput(),
-                            aVectorIds,
-                            this->Tolerance);
-         if ( aVectorIds.empty() ) {
-           myCellIdsMap.erase(myCellIdsMap.find(anActor));
-         }
-       }
+        int aSelectionPoint[4] = {int(theSelectionX),
+                                  int(theSelectionY),
+                                  int(theSelectionX2),
+                                  int(theSelectionY2)};
+        if ( this->PickPoints ) {
+          TVectorIds& aVisibleIds = myPointIdsMap[anActor];
+          TVectorIds anInVisibleIds;
+          SelectVisiblePoints(aSelectionPoint,
+                              theRenderer,
+                              aMapper->GetInput(),
+                              aVisibleIds,
+                              anInVisibleIds,
+                              this->Tolerance);
+          if ( aVisibleIds.empty() ) {
+            myPointIdsMap.erase(myPointIdsMap.find(anActor));
+          }
+        } else {
+          TVectorIds& aVectorIds = myCellIdsMap[anActor];
+          SelectVisibleCells(aSelectionPoint,
+                             theRenderer,
+                             aMapper->GetInput(),
+                             aVectorIds,
+                             this->Tolerance);
+          if ( aVectorIds.empty() ) {
+            myCellIdsMap.erase(myCellIdsMap.find(anActor));
+          }
+        }
       }
     }
   }
@@ -495,4 +496,3 @@ SVTK_RectPicker
 {
   return myCellIdsMap;
 }
-
index a7c2a3934721356f2a24ae80d7cdb226c334f368..1e9975e9467a4c674a79f848572a31badf15594e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_RectPicker.h
 //  Author : 
index 5493554750fb3faf98e0680230fe2deaa7ed679a..314406dd6d6838ded80eb302ca430ab52c67bf97 100644 (file)
@@ -1,32 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_RenderWindowInteractor.h"
-//#include "SVTK_GenericRenderWindowInteractor.h"
 
 #include "SVTK_InteractorStyle.h"
 #include "SVTK_Renderer.h"
@@ -56,9 +54,7 @@
 #include <vtkPicker.h>
 #include <vtkCamera.h>
 
-using namespace std;
-
-static bool GENERATE_SUIT_EVENTS = false;
+static bool GENERATE_SUIT_EVENTS = true;
 static bool FOCUS_UNDER_MOUSE = false;
 
 
@@ -67,7 +63,7 @@ static bool FOCUS_UNDER_MOUSE = false;
 */
 QVTK_RenderWindowInteractor
 ::QVTK_RenderWindowInteractor(QWidget* theParent, 
-                             const char* theName):
+                              const char* theName):
   QWidget(theParent),
   myRenderWindow(vtkRenderWindow::New())
 {
@@ -147,6 +143,14 @@ QVTK_RenderWindowInteractor
   GetDevice()->InvokeEvent(theEvent,theCallData);
 }
 
+/*!
+  Get paint engine for the scene
+*/
+QPaintEngine* QVTK_RenderWindowInteractor::paintEngine() const
+{
+  return 0;
+}
+
 /*!
   Need for initial contents display on Win32
 */
@@ -213,13 +217,13 @@ QVTK_RenderWindowInteractor
       aRenderers->InitTraversal();
       double aCoeff = 1.0;
       if(vtkRenderer *aRenderer = aRenderers->GetNextItem()) {
-       vtkCamera *aCamera = aRenderer->GetActiveCamera();
-       double aScale = aCamera->GetParallelScale();
-       if((aWidth - width())*(aHeight - height()) > 0)
-         aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight));
-       else
-         aCoeff = double(aWidth)/double(width());
-       aCamera->SetParallelScale(aScale*aCoeff);
+        vtkCamera *aCamera = aRenderer->GetActiveCamera();
+        double aScale = aCamera->GetParallelScale();
+        if((aWidth - width())*(aHeight - height()) > 0)
+          aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight));
+        else
+          aCoeff = double(aWidth)/double(width());
+        aCamera->SetParallelScale(aScale*aCoeff);
       }
     }
   }
@@ -245,9 +249,9 @@ QVTK_RenderWindowInteractor
 ::mouseMoveEvent( QMouseEvent* event ) 
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
-                                       event->y(),
-                                       event->modifiers() & Qt::ControlModifier,
-                                       event->modifiers() & Qt::ShiftModifier);
+                                        event->y(),
+                                        event->modifiers() & Qt::ControlModifier,
+                                        event->modifiers() & Qt::ShiftModifier);
   GetDevice()->MouseMoveEvent();
 }
 
@@ -260,9 +264,9 @@ QVTK_RenderWindowInteractor
 ::mousePressEvent( QMouseEvent* event ) 
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
-                                       event->y(),
-                                       event->modifiers() & Qt::ControlModifier,
-                                       event->modifiers() & Qt::ShiftModifier);
+                                        event->y(),
+                                        event->modifiers() & Qt::ControlModifier,
+                                        event->modifiers() & Qt::ShiftModifier);
   if( event->button() & Qt::LeftButton )
     GetDevice()->LeftButtonPressEvent();
   else if( event->button() & Qt::MidButton )
@@ -280,9 +284,9 @@ QVTK_RenderWindowInteractor
 ::mouseReleaseEvent( QMouseEvent *event )
 {
   GetDevice()->SetEventInformationFlipY(event->x(), 
-                                       event->y(),
-                                       event->modifiers() & Qt::ControlModifier,
-                                       event->modifiers() & Qt::ShiftModifier);
+                                        event->y(),
+                                        event->modifiers() & Qt::ControlModifier,
+                                        event->modifiers() & Qt::ShiftModifier);
 
   if( event->button() & Qt::LeftButton )
     GetDevice()->LeftButtonReleaseEvent();
@@ -311,6 +315,14 @@ QVTK_RenderWindowInteractor
 {
   activateWindow();
   setFocus();
+  GetDevice()->SetEventInformationFlipY(event->x(), 
+                                        event->y(),
+                                        event->modifiers() & Qt::ControlModifier,
+                                        event->modifiers() & Qt::ShiftModifier);
+  if ( event->delta()>0)
+    GetDevice()->MouseWheelForwardEvent();
+  else
+    GetDevice()->MouseWheelBackwardEvent();
 }
 
 
@@ -322,8 +334,8 @@ QVTK_RenderWindowInteractor
 ::keyPressEvent( QKeyEvent* event ) 
 {
   GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
-                                     event->modifiers() & Qt::ShiftModifier,
-                                     event->key());
+                                      event->modifiers() & Qt::ShiftModifier,
+                                      event->key());
   GetDevice()->KeyPressEvent();
   GetDevice()->CharEvent();
 }
@@ -336,8 +348,8 @@ QVTK_RenderWindowInteractor
 ::keyReleaseEvent( QKeyEvent * event ) 
 {
   GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
-                                     event->modifiers() & Qt::ShiftModifier,
-                                     event->key());
+                                      event->modifiers() & Qt::ShiftModifier,
+                                      event->key());
   GetDevice()->KeyReleaseEvent();
 }
 
@@ -440,13 +452,13 @@ QVTK_RenderWindowInteractor
       switch ( type )
       {
       case SVTK_SpaceMouse::SpaceMouseMove:
-             GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data );
-             break;
+              GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data );
+              break;
       case SVTK_SpaceMouse::SpaceButtonPress:
-             GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button );
-             break;
+              GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button );
+              break;
       case SVTK_SpaceMouse::SpaceButtonRelease:
-             break;
+              break;
       }
       return true; // stop handling the event
     }
@@ -462,7 +474,7 @@ QVTK_RenderWindowInteractor
 */
 SVTK_RenderWindowInteractor
 ::SVTK_RenderWindowInteractor(QWidget* theParent, 
-                              const char* theName):
+                               const char* theName):
   QVTK_RenderWindowInteractor(theParent,theName),
   myEventCallbackCommand(vtkCallbackCommand::New())
 {
@@ -480,8 +492,8 @@ SVTK_RenderWindowInteractor
 void
 SVTK_RenderWindowInteractor
 ::Initialize(vtkGenericRenderWindowInteractor* theDevice,
-            SVTK_Renderer* theRenderer,
-            SVTK_Selector* theSelector)
+             SVTK_Renderer* theRenderer,
+             SVTK_Selector* theSelector)
 {
   QVTK_RenderWindowInteractor::Initialize(theDevice);
   SetRenderer(theRenderer);
@@ -622,8 +634,8 @@ SVTK_RenderWindowInteractor
 
   if(mySelector.GetPointer())
     mySelector->AddObserver(vtkCommand::EndPickEvent, 
-                           myEventCallbackCommand.GetPointer(), 
-                           myPriority);
+                            myEventCallbackCommand.GetPointer(), 
+                            myPriority);
 }
 
 /*!
@@ -632,9 +644,9 @@ SVTK_RenderWindowInteractor
 void 
 SVTK_RenderWindowInteractor
 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* vtkNotUsed(theCallData))
+                unsigned long theEvent,
+                void* theClientData, 
+                void* vtkNotUsed(theCallData))
 {
   SVTK_RenderWindowInteractor* self = reinterpret_cast<SVTK_RenderWindowInteractor*>(theClientData);
 
index 53aabeb2e1c211afcbf8d878ba665df037c9f54b..65bbd8bdc7ac23f29728d4752ed18b68034e5729 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_RenderWindowInteractor_h
 #define SVTK_RenderWindowInteractor_h
 
@@ -68,7 +67,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget
 
  public:
   QVTK_RenderWindowInteractor(QWidget* theParent, 
-                             const char* theName);
+                              const char* theName);
 
   ~QVTK_RenderWindowInteractor();
 
@@ -88,6 +87,9 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget
   void
   InvokeEvent(unsigned long theEvent, void* theCallData);
 
+  //! Get paint engine for the scene
+  virtual QPaintEngine* paintEngine() const;
+
  public slots:
    //! Need for initial contents display on Win32
   virtual void show();
@@ -146,7 +148,7 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto
 
  public:
   SVTK_RenderWindowInteractor(QWidget* theParent, 
-                             const char* theName);
+                              const char* theName);
 
   ~SVTK_RenderWindowInteractor();
 
@@ -154,8 +156,8 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto
   virtual
   void
   Initialize(vtkGenericRenderWindowInteractor* theDevice,
-            SVTK_Renderer* theRenderer,
-            SVTK_Selector* theSelector);
+             SVTK_Renderer* theRenderer,
+             SVTK_Selector* theSelector);
 
   //----------------------------------------------------------------------------
   //! To get corresponding SVTK_Renderer instance
@@ -235,9 +237,9 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto
   static
   void
   ProcessEvents(vtkObject* theObject, 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* theCallData);
+                unsigned long theEvent,
+                void* theClientData, 
+                void* theCallData);
 
   // Used to process VTK events
   vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
index 369520b1ece46540132695bffbfee35a805758e3..6584727de0fc0b63c587616a942a126021fd79ac 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
-//  Module :
-//  $Header$
-//
+
 #include "SVTK_Renderer.h"
 
 #include "SVTK_Trihedron.h"
 
 #include "SALOME_Actor.h"
 #include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_Utilities.h"
+#include "VTKViewer_OpenGLRenderer.h"
 
 #include <vtkCamera.h>
-#include <vtkRenderer.h>
 #include <vtkTextProperty.h>
 #include <vtkObjectFactory.h>
 #include <vtkCallbackCommand.h>
@@ -61,7 +61,7 @@ vtkStandardNewMacro(SVTK_Renderer);
 */
 SVTK_Renderer
 ::SVTK_Renderer():
-  myDevice(vtkRenderer::New()),
+  myDevice(VTKViewer_OpenGLRenderer::New()),
   myInteractor(NULL),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
@@ -104,6 +104,9 @@ SVTK_Renderer
   myHighlightProperty->SetLineWidth(SALOME_LINE_WIDTH+2);
   myHighlightProperty->SetRepresentationToPoints();
 
+  // Bug 0020123, note 0005217 - Problem with zoom
+  GetDevice()->SetNearClippingPlaneTolerance( 0.00001 );
+
   myTrihedron->Delete();
   myCubeAxes->Delete();
   myEventCallbackCommand->Delete();
@@ -140,14 +143,14 @@ SVTK_Renderer
   myEventCallbackCommand->SetClientData(this);
   myEventCallbackCommand->SetCallback(SVTK_Renderer::ProcessEvents);
   GetDevice()->AddObserver(vtkCommand::ConfigureEvent,
-                          myEventCallbackCommand.GetPointer(), 
-                          myPriority);
+                           myEventCallbackCommand.GetPointer(), 
+                           myPriority);
   GetDevice()->AddObserver(vtkCommand::ResetCameraEvent,
-                          myEventCallbackCommand.GetPointer(), 
-                          myPriority);
+                           myEventCallbackCommand.GetPointer(), 
+                           myPriority);
   GetDevice()->AddObserver(vtkCommand::ResetCameraClippingRangeEvent,
-                          myEventCallbackCommand.GetPointer(), 
-                          myPriority);
+                           myEventCallbackCommand.GetPointer(), 
+                           myPriority);
 }
 
 /*!
@@ -156,7 +159,8 @@ SVTK_Renderer
 SVTK_Renderer
 ::~SVTK_Renderer()
 {
-  vtkActorCollection* anActors = GetDevice()->GetActors();
+  VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
   vtkActorCollection* anActors2 = vtkActorCollection::New();
 
   anActors->InitTraversal();
@@ -183,9 +187,9 @@ SVTK_Renderer
 void 
 SVTK_Renderer
 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* vtkNotUsed(theCallData))
+                unsigned long theEvent,
+                void* theClientData, 
+                void* vtkNotUsed(theCallData))
 {
   SVTK_Renderer* self = reinterpret_cast<SVTK_Renderer*>(theClientData);
 
@@ -218,7 +222,7 @@ SVTK_Renderer
 void 
 SVTK_Renderer
 ::Initialize(vtkRenderWindowInteractor* theInteractor,
-            SVTK_Selector* theSelector)
+             SVTK_Selector* theSelector)
 {
   myInteractor = theInteractor;
   mySelector = theSelector;
@@ -230,7 +234,7 @@ SVTK_Renderer
 */
 void
 SVTK_Renderer
-::AddActor(VTKViewer_Actor* theActor)
+::AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
 {
   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
     anActor->SetInteractor(myInteractor);
@@ -247,7 +251,10 @@ SVTK_Renderer
     anActor->SetHighlightProperty(myHighlightProperty.GetPointer());
 
     anActor->AddToRender(GetDevice());
-    AdjustActors();
+    anActor->UpdateNameActors();
+
+    if(theIsAdjustActors)
+      AdjustActors();
   }
 }
 
@@ -256,7 +263,7 @@ SVTK_Renderer
 */
 void
 SVTK_Renderer
-::RemoveActor(VTKViewer_Actor* theActor)
+::RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
 {
   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
     // Order of the calls are important because VTKViewer_Actor::RemoveFromRender
@@ -275,7 +282,9 @@ SVTK_Renderer
     anActor->SetHighlightProperty(NULL);
 
     anActor->RemoveFromRender(GetDevice());
-    AdjustActors();
+
+    if(theIsAdjustActors)
+      AdjustActors();
   }
 }
 
@@ -309,12 +318,13 @@ SVTK_Renderer
   myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] );
   AdjustActors();
 
-  vtkActorCollection* anActors = GetDevice()->GetActors();
+  VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
   anActors->InitTraversal();
   while(vtkActor* anAct = anActors->GetNextActor())
     if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct))
       if(anActor->isHighlighted() && !anActor->IsInfinitive())
-       anActor->highlight(true);
+        anActor->highlight(true);
 }
 
 /*!
@@ -323,9 +333,9 @@ SVTK_Renderer
 void
 SVTK_Renderer
 ::SetSelectionProp(const double& theRed, 
-                  const double& theGreen, 
-                  const double& theBlue, 
-                  const int& theWidth) 
+                   const double& theGreen, 
+                   const double& theBlue, 
+                   const int& theWidth) 
 {
   myHighlightProperty->SetColor( theRed, theGreen, theBlue );
   myHighlightProperty->SetLineWidth( theWidth );
@@ -338,9 +348,9 @@ SVTK_Renderer
 void
 SVTK_Renderer
 ::SetPreselectionProp(const double& theRed, 
-                     const double& theGreen, 
-                     const double& theBlue, 
-                     const int& theWidth) 
+                      const double& theGreen, 
+                      const double& theBlue, 
+                      const int& theWidth) 
 {
   myPreHighlightProperty->SetColor( theRed, theGreen, theBlue );
   myPreHighlightProperty->SetLineWidth( theWidth );
@@ -353,8 +363,8 @@ SVTK_Renderer
 void
 SVTK_Renderer
 ::SetSelectionTolerance(const double& theTolNodes, 
-                       const double& theTolCell,
-                       const double& theTolObjects)
+                        const double& theTolCell,
+                        const double& theTolObjects)
 {
   myPointPicker->SetTolerance( theTolNodes );
   myCellPicker->SetTolerance( theTolCell );
@@ -407,28 +417,29 @@ SVTK_Renderer
     vtkFloatingPointType aSize = myTrihedron->GetSize();
     if ( IsTrihedronRelative() )
       {
-       ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize);
-       myTrihedron->SetSize(aSize);
+        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();
+    VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+    vtkActorCollection* anActors = aCopy.GetActors();
     anActors->InitTraversal();
     while(vtkActor* anAct = anActors->GetNextActor()){
       if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
-       if(anActor->IsResizable())
-         anActor->SetSize(0.5*aSize);
+        if(anActor->IsResizable())
+          anActor->SetSize(0.5*aSize);
         if(anActor->GetVisibility() && !anActor->IsInfinitive()){
-         vtkFloatingPointType *aBounds = anActor->GetBounds();
+          vtkFloatingPointType *aBounds = anActor->GetBounds();
           if(CheckBndBox(aBounds))
-           for(int i = 0; i < 5; i = i + 2){
-             if(aBounds[i] < aNewBndBox[i]) 
-               aNewBndBox[i] = aBounds[i];
-             if(aBounds[i+1] > aNewBndBox[i+1]) 
-               aNewBndBox[i+1] = aBounds[i+1];
-           }
+            for(int i = 0; i < 5; i = i + 2){
+              if(aBounds[i] < aNewBndBox[i]) 
+                aNewBndBox[i] = aBounds[i];
+              if(aBounds[i+1] > aNewBndBox[i+1]) 
+                aNewBndBox[i+1] = aBounds[i+1];
+            }
         }
       }
     }
@@ -744,6 +755,31 @@ SVTK_Renderer
   this->OnFitAll();
 }
 
+
+/*!
+  To rotate view 90 degrees clockwise
+*/
+void
+SVTK_Renderer
+::onClockWiseView()
+{
+  vtkCamera* aCamera = GetDevice()->GetActiveCamera(); 
+  aCamera->Roll(-90);
+  aCamera->OrthogonalizeViewUp();
+}
+
+/*!
+  To rotate view 90 degrees counterclockwise
+*/
+void
+SVTK_Renderer
+::onAntiClockWiseView()
+{
+  vtkCamera* aCamera = GetDevice()->GetActiveCamera(); 
+  aCamera->Roll(90);
+  aCamera->OrthogonalizeViewUp();
+}
+
 /*!
   To reset direction of the camera to right view
 */
index 2d53e263f22d040bde73c0d64c47ffec7e58f28a..edf79ada1cb9521716e3b6243326ab80cd4549db 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_Renderer_h
 #define SVTK_Renderer_h
 
@@ -77,18 +76,18 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   virtual
   void 
   Initialize(vtkRenderWindowInteractor* theInteractor,
-            SVTK_Selector* theSelector);
+             SVTK_Selector* theSelector);
 
   //----------------------------------------------------------------------------
   //! Publishes pointed actor into the renderer
   virtual
   void 
-  AddActor(VTKViewer_Actor* theActor);
+  AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
 
   //! Removes pointed actor from the renderer
   virtual
   void 
-  RemoveActor(VTKViewer_Actor* theActor);
+  RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
 
   //! Get special container that keeps scaling of the scene 
   VTKViewer_Transform* 
@@ -107,22 +106,22 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   //! Applies color and size (PointSize and LineWidth) of primitives in selection mode
   void
   SetSelectionProp(const double& theRed = 1, 
-                  const double& theGreen = 1,
-                  const double& theBlue = 0, 
-                  const int& theWidth = 5);
+                   const double& theGreen = 1,
+                   const double& theBlue = 0, 
+                   const int& theWidth = 5);
 
   //! Applies color and size (PointSize and LineWidth) of primitives in preselection mode
   void
   SetPreselectionProp(const double& theRed = 0, 
-                     const double& theGreen = 1,
-                     const double& theBlue = 1, 
-                     const int& theWidth = 5);
+                      const double& theGreen = 1,
+                      const double& theBlue = 1, 
+                      const int& theWidth = 5);
 
   //! Setup requested tolerance for the picking
   void
   SetSelectionTolerance(const double& theTolNodes = 0.025, 
-                       const double& theTolCell = 0.001,
-                       const double& theTolObjects = 0.025);
+                        const double& theTolCell = 0.001,
+                        const double& theTolObjects = 0.025);
 
   //----------------------------------------------------------------------------
   //! Adjust all intenal actors (trihedron and graduated rules) to the scene
@@ -203,7 +202,13 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   //! To reset direction of the camera to left view
   void OnLeftView();     
 
- protected:
+  //! To rotate view 90 degrees clockwise
+  void onClockWiseView();
+
+  //! To rotate view 90 degrees counterclockwise
+  void onAntiClockWiseView();
+
+protected:
   SVTK_Renderer();
   ~SVTK_Renderer();
 
index 8e087f4caac56d5d5ac68cecd07eedfce959424e..a985fc397f9612b568807bbe5d7e7f637001e051 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SELECTION_H
 #define SVTK_SELECTION_H
 
index 22fc91e5e3d34e00883d524e67379be7f75c465e..68c1c40715812ec2548cbff1577dbd2d5ebcdce8 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SVTK_SelectionEvent.h
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SELECTIONEVENT_H
 #define SVTK_SELECTIONEVENT_H
 
index 6bbf7d15eccf6548685e32f6633b1fe01fedeac1..b0eecd33481996ed83f51b6b549dd7b8fce2ce24 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_SelectorDef.h"
 
 #include <VTKViewer_Filter.h>
 #include <vtkCellPicker.h>
 
 
-/*!
-  Find first SALOME_Actor from the end of actors collection
-*/
-inline
-SALOME_Actor* 
-GetLastSALOMEActor(vtkActorCollection* theCollection)
-{
-  if (theCollection) {
-    for (int i = theCollection->GetNumberOfItems() - 1; i >= 0; i--) {
-      if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theCollection->GetItemAsObject(i)))
-       if (anActor->hasIO())
-         return anActor;
-    }
-  }
-  return NULL;
-}
-
-
 /*!
   \return new SVTK_Selector
 */
@@ -79,6 +60,7 @@ SVTK_SelectorDef
   myCellPicker(vtkCellPicker::New())
 {
   mySelectionMode = ActorSelection;
+  myDynamicPreselection = true;
 
   myPicker->Delete();
   myCellPicker->Delete();
@@ -287,7 +269,7 @@ SVTK_SelectorDef
 void 
 SVTK_SelectorDef
 ::GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-           TColStd_IndexedMapOfInteger& theIndex)
+            TColStd_IndexedMapOfInteger& theIndex)
 {
   TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
   if(anIter != myMapIOSubIndex.end())
@@ -304,7 +286,7 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                 int theIndex) const
+                  int theIndex) const
 {
   TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
   if(anIter != myMapIOSubIndex.end()){
@@ -346,8 +328,8 @@ static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theI
 bool
 SVTK_SelectorDef
 ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_IndexedMapOfInteger& theIndices, 
-                   bool theIsModeShift)
+                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    bool theIsModeShift)
 {
   TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
   if(aMapIter == myMapIOSubIndex.end()){
@@ -381,8 +363,8 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_MapOfInteger& theIndices, 
-                   bool theIsModeShift)
+                    const TColStd_MapOfInteger& theIndices, 
+                    bool theIsModeShift)
 {
   TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
   if(aMapIter == myMapIOSubIndex.end()){
@@ -417,8 +399,8 @@ SVTK_SelectorDef
 bool 
 SVTK_SelectorDef
 ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   int theIndex, 
-                   bool theIsModeShift)
+                    int theIndex, 
+                    bool theIsModeShift)
 {
   TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO);
   if(anIter == myMapIOSubIndex.end()){
@@ -453,7 +435,7 @@ SVTK_SelectorDef
 void
 SVTK_SelectorDef
 ::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-              int theIndex)
+               int theIndex)
 {
   if(IsIndexSelected(theIO,theIndex)){
     TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO);
@@ -515,8 +497,8 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::IsValid(SALOME_Actor* theActor,
-         const TFilterID theId,
-         const bool theIsNode) const
+          const TFilterID theId,
+          const bool theIsNode) const
 {
   TFilters::const_iterator anIter = myFilters.begin();
   for(; anIter != myFilters.end(); ++anIter){
@@ -544,43 +526,50 @@ SVTK_SelectorDef
   return Handle(VTKViewer_Filter)();
 }
 
-SALOME_Actor*
+vtkActorCollection*
 SVTK_SelectorDef
 ::Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const
 {
-  bool anAdvancedSelectionAlgorithm = true;
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-  if ( aResourceMgr )
-    anAdvancedSelectionAlgorithm = aResourceMgr->booleanValue( "VTKViewer", "use_advanced_selection_algorithm", true );
-
-  SALOME_Actor* anActor = NULL;
   vtkActorCollection* aListActors = NULL;
-  if ( anAdvancedSelectionAlgorithm ) {
+
+  if ( GetDynamicPreSelection() ) {
     myCellPicker->Pick(theEvent->myX,
-                      theEvent->myY, 
-                      0.0,
-                      theRenderer);
+                       theEvent->myY, 
+                       0.0,
+                       theRenderer);
   
     aListActors = myCellPicker->GetActors();
-    anActor = GetLastSALOMEActor(aListActors);
   }
 
-  if ( !anActor ) {
+  if ( !aListActors || !aListActors->GetNumberOfItems() ) {
     myPicker->Pick(theEvent->myX,
-                  theEvent->myY, 
-                  0.0,
-                  theRenderer);
+                   theEvent->myY, 
+                   0.0,
+                   theRenderer);
     aListActors = myPicker->GetActors();
-    anActor = GetLastSALOMEActor(aListActors);
   }
   
-  return anActor;
+  return aListActors;
 }
 
 void
 SVTK_SelectorDef
 ::SetTolerance(const double& theTolerance) 
 {
-  myPicker->SetTolerance(theTolerance);        
+  myPicker->SetTolerance(theTolerance);         
   myCellPicker->SetTolerance(theTolerance);
 }
+
+void
+SVTK_SelectorDef
+::SetDynamicPreSelection( bool theIsDynPreselect )
+{
+  myDynamicPreselection = theIsDynPreselect;
+}
+
+bool
+SVTK_SelectorDef
+::GetDynamicPreSelection() const
+{
+  return myDynamicPreselection;
+}
index d6d3bfc509b3159ed3f34a81279288dc2c1403d4..e61563ca3e1c93918df8855f8d7d174dc79a411f 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SELECTOR_H
 #define SVTK_SELECTOR_H
 
@@ -41,6 +40,7 @@ class Handle(VTKViewer_Filter);
 
 class SALOME_Actor;
 class SVTK_SelectionEvent;
+class vtkActorCollection;
 class vtkRenderer;
 class Handle(SALOME_InteractiveObject);
 
@@ -128,40 +128,40 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-           TColStd_IndexedMapOfInteger& theIndex ) = 0;
-       
+            TColStd_IndexedMapOfInteger& theIndex ) = 0;
+        
   //! Change indices of subselection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_IndexedMapOfInteger& theIndices, 
-                   bool theIsModeShift) = 0;
+                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    bool theIsModeShift) = 0;
 
   //! Change indexes of subslection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_MapOfInteger& theIndices, 
-                   bool theIsModeShift) = 0;
+                    const TColStd_MapOfInteger& theIndices, 
+                    bool theIsModeShift) = 0;
 
   //! Change index of subslection for given #SALOME_InteractiveObject
   virtual
   bool
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   int theIndex, 
-                   bool theIsModeShift) = 0;
+                    int theIndex, 
+                    bool theIsModeShift) = 0;
 
   //! Change index of subslection for given #SALOME_InteractiveObject
   virtual
   void 
   RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-              int theIndex) = 0;
+               int theIndex) = 0;
 
   //! Check, if the given index is present in subselection 
   virtual
   bool 
   IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                 int theIndex) const = 0;
+                  int theIndex) const = 0;
 
   //! Clear subselection
   virtual
@@ -195,8 +195,8 @@ public:
   virtual
   bool
   IsValid(SALOME_Actor* theActor,
-         const int theId,
-         const bool theIsNode = false) const = 0;
+          const int theId,
+          const bool theIsNode = false) const = 0;
   
   //----------------------------------------------------------------------------
   virtual
@@ -210,12 +210,20 @@ public:
 
   //----------------------------------------------------------------------------
   virtual
-  SALOME_Actor*
+  vtkActorCollection*
   Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
 
   virtual
   void
   SetTolerance(const double& theTolerance) = 0;
+
+  virtual
+  void
+  SetDynamicPreSelection( bool theIsDynPreselect ) = 0;
+
+  virtual
+  bool
+  GetDynamicPreSelection() const = 0;
 };
 
 
index bbb513c772d63b5b7fbe0974a9ae40f84b83be14..cbbe12091b8da241f48b84f1a7c2e367bac19594 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOME_Selection.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SELECTORDEF_H
 #define SVTK_SELECTORDEF_H
 
@@ -107,31 +106,31 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-           TColStd_IndexedMapOfInteger& theIndex );
-       
+            TColStd_IndexedMapOfInteger& theIndex );
+        
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_IndexedMapOfInteger& theIndices, 
-                   bool theIsModeShift);
+                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    bool theIsModeShift);
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   const TColStd_MapOfInteger& theIndices, 
-                   bool theIsModeShift);
+                    const TColStd_MapOfInteger& theIndices, 
+                    bool theIsModeShift);
   virtual
   bool
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                   int theIndex, 
-                   bool theIsModeShift);
+                    int theIndex, 
+                    bool theIsModeShift);
   virtual
   void 
   RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-              int theIndex);
+               int theIndex);
   virtual
   bool 
   IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                 int theIndex) const;
+                  int theIndex) const;
   virtual
   void 
   ClearIndex();
@@ -156,8 +155,8 @@ public:
   virtual
   bool
   IsValid(SALOME_Actor* theActor,
-         const TFilterID theId,
-         const bool theIsNode = false) const;
+          const TFilterID theId,
+          const bool theIsNode = false) const;
   
   //----------------------------------------------------------------------------
   virtual
@@ -170,21 +169,31 @@ public:
 
   //----------------------------------------------------------------------------
   virtual
-  SALOME_Actor*
+  vtkActorCollection*
   Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const;
 
   virtual
   void
   SetTolerance(const double& theTolerance);
 
+  virtual
+  void
+  SetDynamicPreSelection( bool theIsDynPreselect );
+
+  virtual
+  bool
+  GetDynamicPreSelection() const;
+
 private:
   int mySelectionMode;
 
+  bool myDynamicPreselection;
+
   struct TIOLessThan
   {
     bool 
     operator()(const Handle(SALOME_InteractiveObject)& theRightIO,
-              const Handle(SALOME_InteractiveObject)& theLeftIO) const
+               const Handle(SALOME_InteractiveObject)& theLeftIO) const
     {
       return strcmp(theRightIO->getEntry(),theLeftIO->getEntry()) < 0;
     }
index f7d2fafd3426c6306f84cd9b5457504621d7e07e..174a6bae0d422fdb83f3867ad3080e5656b67f97 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_SetRotationPointDlg.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 
 #include <vtkCallbackCommand.h>
 
-using namespace std;
-
 /*!
   Constructor
 */
 SVTK_SetRotationPointDlg
 ::SVTK_SetRotationPointDlg(QtxAction* theAction,
-                          SVTK_ViewWindow* theParent,
-                          const char* theName):
-  SVTK_DialogBase(theAction,
-                 theParent, 
-                 theName),
+                           SVTK_ViewWindow* theParent,
+                           const char* theName):
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   myMainWindow(theParent),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
@@ -209,9 +206,9 @@ SVTK_SetRotationPointDlg
 void 
 SVTK_SetRotationPointDlg
 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* theCallData)
+                unsigned long theEvent,
+                void* theClientData, 
+                void* theCallData)
 {
   SVTK_SetRotationPointDlg* self = reinterpret_cast<SVTK_SetRotationPointDlg*>(theClientData);
   vtkFloatingPointType* aCoord = (vtkFloatingPointType*)theCallData;
@@ -219,14 +216,14 @@ SVTK_SetRotationPointDlg
   switch ( theEvent ) {
   case SVTK::BBCenterChanged:
     if ( self->myIsBBCenter->isChecked()
-        ||
-        IsBBEmpty(self->myMainWindow->getRenderer()) )
+         ||
+         IsBBEmpty(self->myMainWindow->getRenderer()) )
     {
       if ( aCoord )
       {
-       self->myX->setText( QString::number(aCoord[0]) );
-       self->myY->setText( QString::number(aCoord[1]) );
-       self->myZ->setText( QString::number(aCoord[2]) );
+        self->myX->setText( QString::number(aCoord[0]) );
+        self->myY->setText( QString::number(aCoord[1]) );
+        self->myZ->setText( QString::number(aCoord[2]) );
       }
     }
     break;
@@ -310,12 +307,12 @@ SVTK_SetRotationPointDlg
 {
   if ( !myIsBBCenter->isChecked() ) {
     if ( mySelectPoint->isChecked()
-        &&
-        ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+         &&
+         ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
       mySelectPoint->toggle();
     vtkFloatingPointType aCenter[3] = {myX->text().toDouble(), 
-                                      myY->text().toDouble(), 
-                                      myZ->text().toDouble()};
+                                       myY->text().toDouble(), 
+                                       myZ->text().toDouble()};
     myMainWindow->activateSetRotationSelected((void*)aCenter);
   }
   else
index c1611cbf581ae01d3f5058d12e08b565c3462633..ab49b055ad18daff4cd5cb860640a08850b1a37f 100755 (executable)
@@ -1,36 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SETROTATIONPOINTDLG_H
 #define SVTK_SETROTATIONPOINTDLG_H
 
 #include "SVTK.h"
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 
@@ -47,14 +46,14 @@ class QCheckBox;
 class vtkCallbackCommand;
 class vtkObject;
 
-class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
 public:
   SVTK_SetRotationPointDlg(QtxAction* theAction,
-                          SVTK_ViewWindow* theParent,
-                          const char* theName);
+                           SVTK_ViewWindow* theParent,
+                           const char* theName);
 
   ~SVTK_SetRotationPointDlg();
   
index c8a99ee07691fcad1cc2605040ea90406cc83a83..b77788fa079a26f43399b7d90db9b8fe599c36fb 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_SpaceMouse.cxx
 //  Author : Alexander SLADKOV
-//  Module : SALOME
-//  $Header$
-//
+
 #include <string.h>
 #include <math.h>
 #include <stdio.h>
@@ -120,8 +119,8 @@ int SVTK_SpaceMouse::setWindow( Display *display, Window window )
 
   PropReturn = NULL;
   XGetWindowProperty( display, root, XCommandEvent, 0,1, 0,
-                     AnyPropertyType, &type, &format, &NItems,
-                     &BytesReturn, &PropReturn );
+                      AnyPropertyType, &type, &format, &NItems,
+                      &BytesReturn, &PropReturn );
 
   win = InputFocus;
   if ( PropReturn != NULL ) {
@@ -172,7 +171,7 @@ int SVTK_SpaceMouse::close(Display *display)
   Custom event handler
 */
 int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent* spaceMouseEvent,
-                   double scale, double rScale )
+                    double scale, double rScale )
 {
   if ( !spaceMouseOn )
     return 0;
@@ -181,17 +180,17 @@ int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent
     if ( xEvent->xclient.message_type == XMotionEvent ) {
       spaceMouseEvent->type = SpaceMouseMove;
       spaceMouseEvent->data[ x ] =
-       xEvent->xclient.data.s[2] * scale;
+        xEvent->xclient.data.s[2] * scale;
       spaceMouseEvent->data[ y ] =
-       xEvent->xclient.data.s[3] * scale;
+        xEvent->xclient.data.s[3] * scale;
       spaceMouseEvent->data[ z ] =
-       xEvent->xclient.data.s[4] * scale;
+        xEvent->xclient.data.s[4] * scale;
       spaceMouseEvent->data[ a ] =
-       xEvent->xclient.data.s[5] * rScale;
+        xEvent->xclient.data.s[5] * rScale;
       spaceMouseEvent->data[ b ] =
-       xEvent->xclient.data.s[6] * rScale;
+        xEvent->xclient.data.s[6] * rScale;
       spaceMouseEvent->data[ c ] =
-       xEvent->xclient.data.s[7] * rScale;
+        xEvent->xclient.data.s[7] * rScale;
       spaceMouseEvent->period = xEvent->xclient.data.s[8];
       return 1;
     }
index 2d8e289589a7c74113e21133ac8ad596935cc168..12d0a8742c4238c89ace8950d8ec181ba77635fe 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : SVTK_SpaceMouse.h
 //  Author : Alexander SLADKOV
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_SpaceMouse_h
 #define SVTK_SpaceMouse_h
 
index ed6ad07d130369c259a89f298fd2b83edfd3ae8d..2ec23dad086bd527c1fe84c1456c32984d32ef0e 100644 (file)
@@ -1,27 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_Trihedron.h"
 #include "SALOME_Actor.h"
 
+#include "VTKViewer_Algorithm.h"
+
 #include <vtkObjectFactory.h>
 #include <vtkActorCollection.h>
 #include <vtkRenderer.h>
@@ -44,18 +47,21 @@ int
 SVTK_Trihedron
 ::GetVisibleActorCount(vtkRenderer* theRenderer)
 {
-  vtkActorCollection* aCollection = theRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+  vtkActorCollection* aCollection = aCopy.GetActors();
   aCollection->InitTraversal();
   int aCount = 0;
   while(vtkActor* aProp = aCollection->GetNextActor()) {
     if(aProp->GetVisibility())
+    {
       if(SALOME_Actor* anActor = SALOME_Actor::SafeDownCast(aProp)) {
         if(!anActor->IsInfinitive()) 
-         aCount++;
+          aCount++;
       }
-      else if ( !OwnActor( anActor ) ) {
-       aCount++;
+      else if ( !OwnActor( aProp ) ) {
+        aCount++;
       }
+    }
   }
   return aCount;
 }
index 847301c72561c7d60d8f0864fa0be65cab8d1c8a..80de3bc87f0afd4e8b7dcf22c2bf99c3be037672 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_TRIHEDRON_H
 #define SVTK_TRIHEDRON_H
 
index eaf1be83bdb5a3e60a088afd79be9afbd31bd902..48e580fa2a52f106fa29d0ceefa9ae98ae358f99 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SVTK_UpdateRateDlg.h"
 
 #include "SVTK_ViewWindow.h"
@@ -53,8 +52,6 @@
 static vtkFloatingPointType OFF_UPDATE_RATE = 0.00001;
 static vtkFloatingPointType FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
 
-using namespace std;
-
 namespace
 {
   //----------------------------------------------------------------------------
@@ -65,10 +62,10 @@ namespace
     if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
       vtkFloatingPointType aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
       if(aLastRenderTimeInSeconds > FLOAT_TOLERANCE){
-       std::ostringstream aStr;
-       vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds;
-       aStr<<aFPS;
-       return QString(aStr.str().c_str());
+        std::ostringstream aStr;
+        vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds;
+        aStr<<aFPS;
+        return QString(aStr.str().c_str());
       }
     }
     return "Inf";
@@ -90,9 +87,9 @@ namespace
     operator()(vtkActor* theActor)
     {
       if(theActor->GetVisibility()){
-       myVTKMultiplier += theActor->GetAllocatedRenderTime();
-       if(dynamic_cast<SALOME_Actor*>(theActor))
-         mySALOMEMultiplier += theActor->GetAllocatedRenderTime();
+        myVTKMultiplier += theActor->GetAllocatedRenderTime();
+        if(dynamic_cast<SALOME_Actor*>(theActor))
+          mySALOMEMultiplier += theActor->GetAllocatedRenderTime();
       }
     }
   };
@@ -102,16 +99,17 @@ namespace
   inline
   vtkFloatingPointType 
   AdjustUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor,
-                  vtkFloatingPointType theUpdateRate)
+                   vtkFloatingPointType theUpdateRate)
   {
     if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
-      if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
-       TRenderTimeMultiplier aMultiplier;
-       using namespace VTK;
-       aMultiplier = ForEach<vtkActor>(anActorCollection,
-                                       aMultiplier);
-       if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE)
-         theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier;
+      VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+      if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
+        TRenderTimeMultiplier aMultiplier;
+        using namespace VTK;
+        aMultiplier = ForEach<vtkActor>(anActorCollection,
+                                        aMultiplier);
+        if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE)
+          theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier;
       }
     }
     return theUpdateRate;
@@ -130,11 +128,11 @@ namespace
     operator()(SALOME_Actor* theActor)
     {
       if(theActor->GetVisibility()){
-       if(vtkMapper *aMapper = theActor->GetMapper()){
-         if(vtkDataSet *aDataSet = aMapper->GetInput()){
-           myCounter += aDataSet->GetNumberOfCells();
-         }
-       }
+        if(vtkMapper *aMapper = theActor->GetMapper()){
+          if(vtkDataSet *aDataSet = aMapper->GetInput()){
+            myCounter += aDataSet->GetNumberOfCells();
+          }
+        }
       }
     }
   };
@@ -146,12 +144,13 @@ namespace
   GetNumberOfCells(SVTK_RenderWindowInteractor* theRWInteractor)
   {
     if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
-      if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
-       TCellsCounter aCounter;
-       using namespace VTK;
-       aCounter = ForEach<SALOME_Actor>(anActorCollection,
-                                        aCounter);
-       return QString::number(aCounter.myCounter);
+      VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+      if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
+        TCellsCounter aCounter;
+        using namespace VTK;
+        aCounter = ForEach<SALOME_Actor>(anActorCollection,
+                                         aCounter);
+        return QString::number(aCounter.myCounter);
       }
     }
     
@@ -164,11 +163,11 @@ namespace
 */
 SVTK_UpdateRateDlg
 ::SVTK_UpdateRateDlg(QtxAction* theAction,
-                    SVTK_ViewWindow* theParent,
-                    const char* theName):
-  SVTK_DialogBase(theAction,
-                 theParent, 
-                 theName),
+                     SVTK_ViewWindow* theParent,
+                     const char* theName):
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
   myRWInteractor(theParent->GetInteractor()),
@@ -293,8 +292,8 @@ SVTK_UpdateRateDlg
   myEventCallbackCommand->SetCallback(SVTK_UpdateRateDlg::ProcessEvents);
   vtkRenderer *aRenderer = myRWInteractor->getRenderer();
   aRenderer->AddObserver(vtkCommand::EndEvent,
-                        myEventCallbackCommand.GetPointer(), 
-                        myPriority);
+                         myEventCallbackCommand.GetPointer(), 
+                         myPriority);
 }
 
 /*!
@@ -312,9 +311,9 @@ SVTK_UpdateRateDlg
 void 
 SVTK_UpdateRateDlg
 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-               unsigned long theEvent,
-               void* theClientData, 
-               void* vtkNotUsed(theCallData))
+                unsigned long theEvent,
+                void* theClientData, 
+                void* vtkNotUsed(theCallData))
 {
   SVTK_UpdateRateDlg* self = reinterpret_cast<SVTK_UpdateRateDlg*>(theClientData);
 
index 1357b6434c5f901068ee26f8b40ee4f4944d3b66..385a3874ffbe54ce72a413a33fcb0681329ffcb5 100644 (file)
@@ -1,34 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef SVTK_UPDATERATEDLG_H
 #define SVTK_UPDATERATEDLG_H
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 
@@ -45,14 +44,14 @@ class vtkCallbackCommand;
 class vtkObject;
 
 
-class SVTK_UpdateRateDlg : public SVTK_DialogBase
+class SVTK_UpdateRateDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
 public:
   SVTK_UpdateRateDlg(QtxAction* theAction,
-                    SVTK_ViewWindow* theParent,
-                    const char* theName);
+                     SVTK_ViewWindow* theParent,
+                     const char* theName);
 
   ~SVTK_UpdateRateDlg();
 
index 8174f0c4f5e23ab963563e3247ec7b4331e835f9..03a9070fef207b3991dc4ada76c3cb8ff6b5a4f5 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SALOME_Actor.h"
 
 #include "SVTK_View.h"
@@ -38,6 +37,7 @@
 
 #include <vtkActorCollection.h>
 #include <vtkRenderer.h>
+#include <vtkProperty.h>
 
 /*!
   Constructor
@@ -50,21 +50,21 @@ SVTK_SignalHandler
   SVTK_RenderWindowInteractor* anInteractor = theMainWindow->GetInteractor();
 
   connect(anInteractor,SIGNAL(KeyPressed(QKeyEvent*)),
-         this,SIGNAL(KeyPressed(QKeyEvent*)) );
+          this,SIGNAL(KeyPressed(QKeyEvent*)) );
   connect(anInteractor,SIGNAL(KeyReleased(QKeyEvent*)),
-         this,SIGNAL(KeyReleased(QKeyEvent*)));
+          this,SIGNAL(KeyReleased(QKeyEvent*)));
   connect(anInteractor,SIGNAL(MouseButtonPressed(QMouseEvent*)),
-         this,SIGNAL(MouseButtonPressed(QMouseEvent*)));
+          this,SIGNAL(MouseButtonPressed(QMouseEvent*)));
   connect(anInteractor,SIGNAL(MouseButtonReleased(QMouseEvent*)),
-         this,SIGNAL(MouseButtonReleased(QMouseEvent*)));
+          this,SIGNAL(MouseButtonReleased(QMouseEvent*)));
   connect(anInteractor,SIGNAL(MouseDoubleClicked(QMouseEvent*)),
-         this,SIGNAL(MouseDoubleClicked(QMouseEvent*)));
+          this,SIGNAL(MouseDoubleClicked(QMouseEvent*)));
   connect(anInteractor,SIGNAL(MouseMove(QMouseEvent*)),
-         this,SIGNAL(MouseMove(QMouseEvent*)));
+          this,SIGNAL(MouseMove(QMouseEvent*)));
   connect(anInteractor,SIGNAL(contextMenuRequested(QContextMenuEvent*)),
-         this,SIGNAL(contextMenuRequested(QContextMenuEvent*)));
+          this,SIGNAL(contextMenuRequested(QContextMenuEvent*)));
   connect(anInteractor,SIGNAL(selectionChanged()),
-         this,SIGNAL(selectionChanged()));
+          this,SIGNAL(selectionChanged()));
 }
 
 /*!
@@ -129,7 +129,7 @@ namespace SVTK
     operator()( SALOME_Actor* theActor) 
     {
       if(theActor->GetMapper() && theActor->hasIO()){
-       theActor->Highlight( myIsHighlight );
+        theActor->Highlight( myIsHighlight );
       }
     }
   };
@@ -142,18 +142,19 @@ void
 SVTK_SignalHandler
 ::onSelectionChanged()
 {
-  vtkActorCollection* anActors = myMainWindow->getRenderer()->GetActors();
+  VTK::ActorCollectionCopy aCopy(myMainWindow->getRenderer()->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
 
   using namespace SVTK;
   ForEach<SALOME_Actor>(anActors,
-                       THighlightAction( false ));
+                        THighlightAction( false ));
   SVTK_Selector* aSelector = myMainWindow->GetSelector();
   const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
   SALOME_ListIteratorOfListIO anIter(aListIO);
   for(; anIter.More(); anIter.Next()){
     ForEachIf<SALOME_Actor>(anActors,
-                           TIsSameIObject<SALOME_Actor>(anIter.Value()),
-                           THighlightAction(true));
+                            TIsSameIObject<SALOME_Actor>(anIter.Value()),
+                            THighlightAction(true));
   }
 
   myMainWindow->Repaint(false);
@@ -184,8 +185,9 @@ SVTK_View
 ::unHighlightAll() 
 {
   using namespace SVTK;
-  ForEach<SALOME_Actor>(getRenderer()->GetActors(),
-                       THighlightAction( false ));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEach<SALOME_Actor>(aCopy.GetActors(),
+                        THighlightAction( false ));
   Repaint();
 }
 
@@ -198,13 +200,14 @@ SVTK_View
 void
 SVTK_View
 ::highlight( const Handle(SALOME_InteractiveObject)& theIO, 
-            bool theIsHighlight, 
-            bool theIsUpdate ) 
+             bool theIsHighlight, 
+             bool theIsUpdate ) 
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>( theIO ),
-                         THighlightAction(theIsHighlight));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>( theIO ),
+                          THighlightAction(theIsHighlight));
   Repaint();
 }
 
@@ -217,9 +220,10 @@ SVTK_View
 ::FindIObject(const char* theEntry) 
 {
   using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
   SALOME_Actor* anActor = 
-    Find<SALOME_Actor>(getRenderer()->GetActors(),
-                      TIsSameEntry<SALOME_Actor>(theEntry));
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameEntry<SALOME_Actor>(theEntry));
   if(anActor != NULL)
     return anActor->getIO();
  
@@ -232,9 +236,9 @@ SVTK_View
 void
 SVTK_View
 ::SetSelectionProp(const double& theRed, 
-                  const double& theGreen, 
-                  const double& theBlue, 
-                  const int& theWidth) 
+                   const double& theGreen, 
+                   const double& theBlue, 
+                   const int& theWidth) 
 {
   GetRenderer()->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -245,9 +249,9 @@ SVTK_View
 void
 SVTK_View
 ::SetPreselectionProp(const double& theRed, 
-                     const double& theGreen, 
-                     const double& theBlue, 
-                     const int& theWidth) 
+                      const double& theGreen, 
+                      const double& theBlue, 
+                      const int& theWidth) 
 {
   GetRenderer()->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -258,8 +262,8 @@ SVTK_View
 void
 SVTK_View
 ::SetSelectionTolerance(const double& theTolNodes, 
-                       const double& theTolCell,
-                       const double& theTolObjects)
+                        const double& theTolCell,
+                        const double& theTolObjects)
 {
   GetRenderer()->SetSelectionTolerance(theTolNodes, theTolCell, theTolObjects);
 }
@@ -273,12 +277,32 @@ SVTK_View
 ::isInViewer(const Handle(SALOME_InteractiveObject)& theIObject)
 {
   using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
   SALOME_Actor* anActor = 
-    Find<SALOME_Actor>(getRenderer()->GetActors(),
-                      TIsSameIObject<SALOME_Actor>(theIObject));
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameIObject<SALOME_Actor>(theIObject));
   return anActor != NULL;
 }
 
+namespace SVTK
+{
+  struct TIsActorVisibleAction
+  {
+    bool& myResult;
+    TIsActorVisibleAction(bool& theResult): 
+      myResult(theResult)
+    {
+      myResult = false;
+    }
+    void
+    operator()(SALOME_Actor* theActor)
+    {
+      if( !myResult )
+        myResult = theActor->GetVisibility();
+    }
+  };
+}
+
 /*!
   \return true if object is displayed in viewer
   \param theIO - object to be checked
@@ -288,10 +312,12 @@ SVTK_View
 ::isVisible(const Handle(SALOME_InteractiveObject)& theIObject)
 {
   using namespace SVTK;
-  SALOME_Actor* anActor = 
-    Find<SALOME_Actor>(getRenderer()->GetActors(),
-                      TIsSameIObject<SALOME_Actor>(theIObject));
-  return anActor != NULL && anActor->GetVisibility();
+  bool aResult;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TIsActorVisibleAction(aResult));
+  return aResult;
 }
 
 /*!
@@ -302,13 +328,14 @@ SVTK_View
 void
 SVTK_View
 ::rename(const Handle(SALOME_InteractiveObject)& theIObject, 
-        const QString& theName)
+         const QString& theName)
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetFunction<SALOME_Actor,const char*,const char*>
-                         (&SALOME_Actor::setName,theName.toLatin1().data()));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetFunction<SALOME_Actor,const char*,const char*>
+                          (&SALOME_Actor::setName,theName.toLatin1().data()));
 }
 
 /*!
@@ -331,8 +358,12 @@ SVTK_View
 {
   if(theMode == 0) 
     ChangeRepresentationToWireframe();
-  else 
+  else if (theMode == 1)
     ChangeRepresentationToSurface();
+  else if (theMode == 2) {
+    ChangeRepresentationToSurfaceWithEdges();
+    theMode++;
+  }
   myDisplayMode = theMode;
 }
 
@@ -344,13 +375,14 @@ SVTK_View
 void
 SVTK_View
 ::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject, 
-                int theMode)
+                 int theMode)
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetFunction<SALOME_Actor,int>
-                         (&SALOME_Actor::setDisplayMode,theMode));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetFunction<SALOME_Actor,int>
+                          (&SALOME_Actor::setDisplayMode,theMode));
 }
 
 /*!
@@ -360,7 +392,8 @@ void
 SVTK_View
 ::ChangeRepresentationToWireframe()
 {
-  ChangeRepresentationToWireframe(getRenderer()->GetActors());
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ChangeRepresentationToWireframe(aCopy.GetActors());
 }
 
 /*!
@@ -370,7 +403,19 @@ void
 SVTK_View
 ::ChangeRepresentationToSurface()
 {
-  ChangeRepresentationToSurface(getRenderer()->GetActors());
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ChangeRepresentationToSurface(aCopy.GetActors());
+}
+
+/*!
+  Change all actors to shading with edges
+*/
+void
+SVTK_View
+::ChangeRepresentationToSurfaceWithEdges()
+{
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors());
 }
 
 /*!
@@ -383,8 +428,8 @@ SVTK_View
 {
   using namespace SVTK;
   ForEach<SALOME_Actor>(theCollection,
-                       TSetFunction<SALOME_Actor,int>
-                       (&SALOME_Actor::setDisplayMode,0));
+                        TSetFunction<SALOME_Actor,int>
+                        (&SALOME_Actor::setDisplayMode,0));
   Repaint();
 }
 
@@ -398,8 +443,23 @@ SVTK_View
 {
   using namespace SVTK;
   ForEach<SALOME_Actor>(theCollection,
-                       TSetFunction<SALOME_Actor,int>
-                       (&SALOME_Actor::setDisplayMode,1));
+                        TSetFunction<SALOME_Actor,int>
+                        (&SALOME_Actor::setDisplayMode,1));
+  Repaint();
+}
+
+/*!
+  Change to shading with edges a list of vtkactor
+  theCollection - list of vtkactor
+*/
+void
+SVTK_View
+::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection)
+{
+  using namespace SVTK;
+  ForEach<SALOME_Actor>(theCollection,
+                        TSetFunction<SALOME_Actor,int>
+                        (&SALOME_Actor::setDisplayMode,3));
   Repaint();
 }
 
@@ -432,8 +492,9 @@ SVTK_View
 ::EraseAll()
 {   
   using namespace SVTK;
-  ForEach<SALOME_Actor>(getRenderer()->GetActors(),
-                       TErase());
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEach<SALOME_Actor>(aCopy.GetActors(),
+                        TErase());
   Repaint();
 }
 
@@ -445,8 +506,9 @@ SVTK_View
 ::DisplayAll()
 { 
   using namespace SVTK;
-  ForEach<SALOME_Actor>(getRenderer()->GetActors(),
-                       TSetVisibility<SALOME_Actor>(true));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEach<SALOME_Actor>(aCopy.GetActors(),
+                        TSetVisibility<SALOME_Actor>(true));
   Repaint();
 }
 
@@ -458,7 +520,7 @@ SVTK_View
 void
 SVTK_View
 ::Erase(SALOME_Actor* theActor, 
-       bool theIsUpdate)
+        bool theIsUpdate)
 {
   SVTK::TErase()(theActor);
 
@@ -475,12 +537,13 @@ SVTK_View
 void
 SVTK_View
 ::Erase(const Handle(SALOME_InteractiveObject)& theIObject, 
-       bool theIsUpdate)
+        bool theIsUpdate)
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TErase());
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TErase());
   if(theIsUpdate)
     Repaint();
 }
@@ -491,7 +554,7 @@ SVTK_View
 void
 SVTK_View
 ::Display(SALOME_Actor* theActor, 
-         bool theIsUpdate)
+          bool theIsUpdate)
 {
   GetRenderer()->AddActor(theActor);
   theActor->SetVisibility(true);
@@ -506,12 +569,13 @@ SVTK_View
 void
 SVTK_View
 ::Display(const Handle(SALOME_InteractiveObject)& theIObject, 
-         bool theIsUpdate)
+          bool theIsUpdate)
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetVisibility<SALOME_Actor>(true));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetVisibility<SALOME_Actor>(true));
 
   if(theIsUpdate)
     Repaint();
@@ -551,12 +615,13 @@ namespace SVTK
 void
 SVTK_View
 ::Remove(const Handle(SALOME_InteractiveObject)& theIObject, 
-        bool theIsUpdate)
+         bool theIsUpdate)
 {
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TRemoveAction(GetRenderer()));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TRemoveAction(GetRenderer()));
   if(theIsUpdate)
     Repaint();
 }
@@ -567,7 +632,7 @@ SVTK_View
 void
 SVTK_View
 ::Remove(SALOME_Actor* theActor, 
-        bool theIsUpdate)
+         bool theIsUpdate)
 {
   GetRenderer()->RemoveActor(theActor);
   if(theIsUpdate)
@@ -582,7 +647,8 @@ SVTK_View
 ::RemoveAll(bool theIsUpdate)
 {
   vtkRenderer* aRenderer = getRenderer();
-  if(vtkActorCollection* anActors = aRenderer->GetActors()){
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  if(vtkActorCollection* anActors = aCopy.GetActors()){
     anActors->InitTraversal();
     while(vtkActor *anAct = anActors->GetNextActor()){
       if(SALOME_Actor* aSAct = SALOME_Actor::SafeDownCast(anAct)){
@@ -605,9 +671,10 @@ SVTK_View
 ::GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject) 
 {
   using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
   SALOME_Actor* anActor = 
-    Find<SALOME_Actor>(getRenderer()->GetActors(),
-                      TIsSameIObject<SALOME_Actor>(theIObject));
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameIObject<SALOME_Actor>(theIObject));
   if(anActor)
     return 1.0 - anActor->GetOpacity();
   return -1.0;
@@ -622,14 +689,15 @@ SVTK_View
 void
 SVTK_View
 ::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, 
-                 float theTrans)
+                  float theTrans)
 {
   vtkFloatingPointType anOpacity = 1.0 - theTrans;
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetFunction<SALOME_Actor,vtkFloatingPointType>
-                         (&SALOME_Actor::SetOpacity,anOpacity));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetFunction<SALOME_Actor,vtkFloatingPointType>
+                          (&SALOME_Actor::SetOpacity,anOpacity));
 }
 
 /*!
@@ -640,15 +708,16 @@ SVTK_View
 void
 SVTK_View
 ::SetColor(const Handle(SALOME_InteractiveObject)& theIObject,
-          const QColor& theColor) 
+           const QColor& theColor) 
 {
   vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.};
 
   using namespace SVTK;
-  ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
-                         TIsSameIObject<SALOME_Actor>(theIObject),
-                         TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
-                         (&SALOME_Actor::SetColor,aColor));
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
+                          (&SALOME_Actor::SetColor,aColor));
 }
 
 
@@ -661,9 +730,10 @@ SVTK_View
 ::GetColor(const Handle(SALOME_InteractiveObject)& theIObject) 
 {
   using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
   SALOME_Actor* anActor = 
-    Find<SALOME_Actor>(getRenderer()->GetActors(),
-                      TIsSameIObject<SALOME_Actor>(theIObject));
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameIObject<SALOME_Actor>(theIObject));
   if(anActor){
     vtkFloatingPointType r,g,b;
     anActor->GetColor(r,g,b);
@@ -673,3 +743,53 @@ SVTK_View
   return QColor(0,0,0);
 }
 
+/*!
+  Change material
+  \param theIObject - object
+  \param thePropF - property contained new properties of material
+*/
+void
+SVTK_View
+::SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
+             vtkProperty* thePropF)
+{
+  using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  std::vector<vtkProperty*> aProps;
+  aProps.push_back( thePropF );
+  ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+                          TIsSameIObject<SALOME_Actor>(theIObject),
+                          TSetFunction<SALOME_Actor,std::vector<vtkProperty*> >
+                          (&SALOME_Actor::SetMaterial,aProps));
+}
+
+/*!
+  Get current front material
+  \param theIObject - object
+  \return property contained material properties of the given object
+*/
+vtkProperty* 
+SVTK_View
+::GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject)
+{
+  using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  SALOME_Actor* anActor = 
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameIObject<SALOME_Actor>(theIObject));
+  if(anActor)
+    return anActor->GetMaterial();
+  return NULL;
+}
+
+/*!
+  \Collect objects visible in viewer
+  \param theList - visible objects collection
+*/
+void SVTK_View::GetVisible( SALOME_ListIO& theList )
+{
+  using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  ForEach<SALOME_Actor>(aCopy.GetActors(),
+                        TCollectIfVisible<SALOME_Actor>(theList));
+}
index 7f3bf8a64fc857a9d06bed315854efb76eff45a1..0542c24f9fa231426ae3ef84847a6848d81c4656 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_VIEW_H
 #define SVTK_VIEW_H
 
 #endif
 
 #include "SVTK.h"
-#include "SALOME_InteractiveObject.hxx"
+
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
 
 #include <QObject>
 
 class vtkActorCollection;
 class vtkRenderer;
+class vtkProperty;
 
 class SVTK_ViewWindow;
 class SVTK_Renderer;
@@ -125,8 +129,8 @@ public:
   //! To highlight a VTK presentation with the same #SALOME_InteractiveObject
   void
   highlight(const Handle(SALOME_InteractiveObject)& IObject, 
-           bool highlight, 
-           bool immediatly = true);
+            bool highlight, 
+            bool immediatly = true);
 
   //! To unhighlight all VTK presentations
   void
@@ -146,7 +150,7 @@ public:
 
   void
   rename(const Handle(SALOME_InteractiveObject)& IObject, 
-        const QString& newName);
+         const QString& newName);
   
   //----------------------------------------------------------------------------
   // Displaymode management
@@ -161,7 +165,7 @@ public:
   //! Switch representation wireframe/shading
   void
   SetDisplayMode(const Handle(SALOME_InteractiveObject)& IObject, 
-                int theMode);
+                 int theMode);
 
   //! Change all actors to wireframe
   void 
@@ -171,6 +175,10 @@ public:
   void
   ChangeRepresentationToSurface();
 
+  //! Change all actors to surface with edges
+  void
+  ChangeRepresentationToSurfaceWithEdges();
+
   //! Change to wireframe a list of vtkactor
   void
   ChangeRepresentationToWireframe(vtkActorCollection* theListofActors);
@@ -179,10 +187,14 @@ public:
   void
   ChangeRepresentationToSurface(vtkActorCollection* theListofActors);
 
+  //! Change to surface with edges a list of vtkactor
+  void
+  ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theListofActors);
+
   //! Change transparency
   void
   SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject,
-                 float trans);
+                  float trans);
 
   //! Get current transparency
   float 
@@ -191,12 +203,21 @@ public:
   //! Change color
   void
   SetColor(const Handle(SALOME_InteractiveObject)& theIObject,
-          const QColor& theColor);
+           const QColor& theColor);
 
   //! Get current color
   QColor
   GetColor(const Handle(SALOME_InteractiveObject)& theIObject);
 
+  //! Change material
+  void
+  SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
+             vtkProperty* thePropF);
+
+  //! Get current material
+  vtkProperty* 
+  GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject);
+
   //----------------------------------------------------------------------------
   // Erase Display functions
   //! To erase all existing VTK presentations
@@ -214,15 +235,15 @@ public:
   //! To erase VTK presentation with defined #SALOME_InteractiveObject
   void
   Erase(const Handle(SALOME_InteractiveObject)& IObject, 
-       bool immediatly = true);
+        bool immediatly = true);
   void
   Remove(const Handle(SALOME_InteractiveObject)& IObject, 
-        bool immediatly = true);
+         bool immediatly = true);
 
   //! To display VTK presentation with defined #SALOME_InteractiveObject
   void
   Display(const Handle(SALOME_InteractiveObject)& IObject, 
-         bool immediatly = true);
+          bool immediatly = true);
 
   //! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers
   void
@@ -231,38 +252,42 @@ public:
   //! To display the VTK presentation
   void
   Display(SALOME_Actor* SActor, 
-         bool immediatly = true);
+          bool immediatly = true);
 
   //! To erase the VTK presentation
   void
   Erase(SALOME_Actor* SActor, 
-       bool immediatly = true);
+        bool immediatly = true);
 
   //! To remove the VTK presentation
   void
   Remove(SALOME_Actor* SActor, 
-        bool updateViewer = true);
+         bool updateViewer = true);
+
+  //! Collect objects visible in viewer
+  void
+  GetVisible( SALOME_ListIO& theList );
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
   void
   SetSelectionProp(const double& theRed = 1, 
-                  const double& theGreen = 1,
-                  const double& theBlue = 0, 
-                  const int& theWidth = 5);
+                   const double& theGreen = 1,
+                   const double& theBlue = 0, 
+                   const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
   void
   SetPreselectionProp(const double& theRed = 0, 
-                     const double& theGreen = 1,
-                     const double& theBlue = 1, 
-                     const int& theWidth = 5);
+                      const double& theGreen = 1,
+                      const double& theBlue = 1, 
+                      const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
   void
   SetSelectionTolerance(const double& theTolNodes = 0.025, 
-                       const double& theTolCell = 0.001,
-                       const double& theTolObjects = 0.025);
+                        const double& theTolCell = 0.001,
+                        const double& theTolObjects = 0.025);
 
  protected:  
   int myDisplayMode;
index 2b25de28ae54046dbb0259c22a84876d9bd6fa02..c350a9ae582ea26dc446489b979be8d346065a38 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_ViewManager.h"
 #include "SVTK_ViewModel.h"
 
index 7ac3fd35644dd57bc2be862c97e0347a44326145..b03baa8634a7ca44e583a656fb483ac2f6b0bf21 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_VIEWMANAGER_H
 #define SVTK_VIEWMANAGER_H
 
index f49b3ebd1921ecf54ed5c7a2c27687275c6404a6..e8ab931714936dbd03c0c98f5aa104512782eef1 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include <QMenu>
 #include <QColorDialog>
 #include <QToolBar>
@@ -35,6 +36,7 @@
 //#include "SVTK_MainWindow.h"
 #include "SVTK_Prs.h"
 
+#include "VTKViewer_Algorithm.h"
 #include "VTKViewer_ViewModel.h"
 
 #include "SUIT_ViewModel.h"
 
 #include "SALOME_Actor.h"
 
-#include <QtxActionToolMgr.h>
+#include "QtxActionToolMgr.h"
+#include "QtxBackgroundTool.h"
+
+// VSR: Uncomment below line to allow texture background support in VTK viewer
+#define VTK_ENABLE_TEXTURED_BACKGROUND
+
 
 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
@@ -73,13 +80,17 @@ SVTK_Viewer::SVTK_Viewer()
 {
   myTrihedronSize = 105;
   myTrihedronRelative = true;
+  myIsStaticTrihedronVisible = true;
   myIncrementSpeed = 10;
   myIncrementMode = 0;
   myProjMode = 0;
   myStyle = 0;
+  myZoomingStyle = 0;
+  myDynamicPreSelection = false;
   mySpaceBtn[0] = 1;
   mySpaceBtn[1] = 2;
   mySpaceBtn[2] = 9;
+  myDefaultBackground = Qtx::BackgroundData( Qt::black );
 }
 
 /*!
@@ -89,33 +100,68 @@ SVTK_Viewer::~SVTK_Viewer()
 {
 }
 
-/*!
-  \return background color
-*/
+/*! Get data for supported background modes: gradient types, identifiers and supported image formats */
+QString SVTK_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+  gradList << tr( "GT_HORIZONTALGRADIENT" )
+           << tr( "GT_VERTICALGRADIENT" )
+           << tr( "GT_FIRSTDIAGONALGRADIENT" )
+           << tr( "GT_SECONDDIAGONALGRADIENT" )
+           << tr( "GT_FIRSTCORNERGRADIENT" )
+           << tr( "GT_SECONDCORNERGRADIENT" )
+           << tr( "GT_THIRDCORNERGRADIENT" )
+           << tr( "GT_FOURTHCORNERGRADIENT" );
+  idList   << HorizontalGradient
+           << VerticalGradient
+           << FirstDiagonalGradient
+           << SecondDiagonalGradient
+           << FirstCornerGradient
+           << SecondCornerGradient
+           << ThirdCornerGradient
+           << FourthCornerGradient;
+#ifdef VTK_ENABLE_TEXTURED_BACKGROUND
+  txtList  << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+  return tr("BG_IMAGE_FILES");
+}
+
+//! Get background color of the viewer [obsolete]
 QColor SVTK_Viewer::backgroundColor() const
 {
-  return myBgColor;
+  return background().color();
+}
+
+//! Set background color to the viewer [obsolete]
+void SVTK_Viewer::setBackgroundColor( const QColor& c )
+{
+  Qtx::BackgroundData bg = background();
+  bg.setColor( c );
+  setBackground( bg );
 }
 
 /*!
-  Changes background color
-  \param theColor - new background color
+  \return background data
 */
-void SVTK_Viewer::setBackgroundColor( const QColor& theColor )
+Qtx::BackgroundData SVTK_Viewer::background() const
 {
-  if ( !theColor.isValid() )
-    return;
+  return myDefaultBackground;
+}
 
+/*!
+  Changes background
+  \param theBackground - new background data
+*/
+void SVTK_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+  myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black );
   QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
     if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
       if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
-       aView->setBackgroundColor(theColor);
+        aView->setBackground(myDefaultBackground);
       }
     }
-  }
-
-  myBgColor = theColor;
+  }  
 }
 
 /*!Create new instance of view window on desktop \a theDesktop.
@@ -126,17 +172,20 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
   TViewWindow* aViewWindow = new TViewWindow(theDesktop);
   aViewWindow->Initialize(this);
 
-  aViewWindow->setBackgroundColor( backgroundColor() );
+  aViewWindow->setBackground( background() );
   aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
+  aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
   aViewWindow->SetProjectionMode( projectionMode() );
   aViewWindow->SetInteractionStyle( interactionStyle() );
+  aViewWindow->SetZoomingStyle( zoomingStyle() );
+  aViewWindow->SetDynamicPreSelection( dynamicPreSelection() );
   aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
   aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
 
   connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ), 
-         this,  SLOT(onActorAdded(VTKViewer_Actor*)));
+          this,  SLOT(onActorAdded(VTKViewer_Actor*)));
   connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ), 
-         this,  SLOT(onActorRemoved(VTKViewer_Actor*)));
+          this,  SLOT(onActorRemoved(VTKViewer_Actor*)));
 
   return aViewWindow;
 }
@@ -172,11 +221,36 @@ void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bo
     for ( uint i = 0; i < aViews.count(); i++ )
     {
       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
-             aView->SetTrihedronSize( theSize, theRelative );
+              aView->SetTrihedronSize( theSize, theRelative );
     }
   }
 }
 
+/*!
+  \return visibility status of the static trihedron
+*/
+bool SVTK_Viewer::isStaticTrihedronVisible() const
+{
+  return myIsStaticTrihedronVisible;
+}
+
+/*!
+  Sets visibility status of the static trihedron
+  \param theIsVisible - new visibility status
+*/
+void SVTK_Viewer::setStaticTrihedronVisible( const bool theIsVisible )
+{
+  myIsStaticTrihedronVisible = theIsVisible;
+
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+        aView->SetStaticTrihedronVisible( theIsVisible );
+    }
+  }
+}
 
 /*!
   \return projection mode
@@ -200,8 +274,8 @@ void SVTK_Viewer::setProjectionMode( const int theMode )
       QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
       for ( uint i = 0; i < aViews.count(); i++ )
       {
-       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
-         aView->SetProjectionMode( theMode );
+        if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+          aView->SetProjectionMode( theMode );
       }
     }
   }
@@ -228,7 +302,59 @@ void SVTK_Viewer::setInteractionStyle( const int theStyle )
     for ( uint i = 0; i < aViews.count(); i++ )
     {
       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
-       aView->SetInteractionStyle( theStyle );
+        aView->SetInteractionStyle( theStyle );
+    }
+  }
+}
+
+/*!
+  \return zooming style
+*/
+int SVTK_Viewer::zoomingStyle() const
+{
+  return myZoomingStyle;
+}
+
+/*!
+  Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+  \param theStyle - new zooming style
+*/
+void SVTK_Viewer::setZoomingStyle( const int theStyle )
+{
+  myZoomingStyle = theStyle;
+  
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+        aView->SetZoomingStyle( theStyle );
+    }
+  }
+}
+
+/*!
+  \return dynamic preselection
+*/
+bool SVTK_Viewer::dynamicPreSelection() const
+{
+  return myDynamicPreSelection;
+}
+
+/*!
+  Sets dynamic preselection
+  \param theMode - new dynamic preselection mode
+*/
+void SVTK_Viewer::setDynamicPreSelection( const bool theMode )
+{
+  myDynamicPreSelection = theMode;
+  
+  if (SUIT_ViewManager* aViewManager = getViewManager()) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for ( uint i = 0; i < aViews.count(); i++ )
+    {
+      if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+        aView->SetDynamicPreSelection( theMode );
     }
   }
 }
@@ -264,7 +390,7 @@ void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode )
     for ( uint i = 0; i < aViews.count(); i++ )
     {
       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
-       aView->SetIncrementalSpeed( theValue, theMode );
+        aView->SetIncrementalSpeed( theValue, theMode );
     }
   }
 }
@@ -295,7 +421,7 @@ void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, co
     for ( uint i = 0; i < aViews.count(); i++ )
     {
       if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
-       aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
+        aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
     }
   }
 }
@@ -327,7 +453,7 @@ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
 {
   thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
 
   thePopup->addSeparator();
 
@@ -391,12 +517,32 @@ void SVTK_Viewer::onDumpView()
 /*!
   SLOT: called if background color is to be changed changed, passes new color to view port
 */
-void SVTK_Viewer::onChangeBgColor()
+void SVTK_Viewer::onChangeBackground()
 {
-  if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
-    QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
-    setBackgroundColor(aColor);
-  }
+  SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(myViewManager->getActiveView());
+  if ( !aView )
+    return;
+
+  // get supported gradient types
+  QStringList gradList;
+  QIntList    idList, txtList;
+  QString     formats = backgroundData( gradList, idList, txtList );
+
+  // invoke dialog box
+  Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(),  // initial background
+                                                                  aView,                // parent for dialog box
+                                                                  txtList,              // allowed texture modes
+                                                                  true,                 // enable solid color mode
+                                                                  true,                 // enable gradient mode
+                                                                  false,                // disable custom gradient mode
+                                                                  !txtList.isEmpty(),   // enable texture mode
+                                                                  gradList,             // gradient names
+                                                                  idList,               // gradient identifiers
+                                                                  formats );            // image formats
+
+  // set chosen background data to the viewer
+  if ( bgData.isValid() )
+    aView->setBackground( bgData );
 }
 
 /*!
@@ -417,29 +563,31 @@ void SVTK_Viewer::Display( const SALOME_VTKPrs* prs )
       // _PTR(Study) aStudy(getStudyDS());
       anActorCollection->InitTraversal();
       while(vtkActor* anActor = anActorCollection->GetNextActor()){
-       if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
-         // Set visibility flag
+        if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+          if(!anAct->ShouldBeDisplayed())
+            continue;
+          // Set visibility flag
           // Temporarily commented to avoid awful dependecy on SALOMEDS
           // TODO: better mechanism of storing display/erse status in a study
           // should be provided...
-         //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-         //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
-         //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
-         //}
-         // just display the object
-         QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
-         for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-           if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
-             if(SVTK_View* aView = aViewWindow->getView()){
-               aView->Display(anAct,false);
-               if(anAct->IsSetCamera()){
-                 vtkRenderer* aRenderer = aView->getRenderer();
-                 anAct->SetCamera( aRenderer->GetActiveCamera() );
-               }
-             }
-           }
-         }
-       }
+          //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+          //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+          //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
+          //}
+          // just display the object
+          QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+            if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
+              if(SVTK_View* aView = aViewWindow->getView()){
+                aView->Display(anAct,false);
+                if(anAct->IsSetCamera()){
+                  vtkRenderer* aRenderer = aView->getRenderer();
+                  anAct->SetCamera( aRenderer->GetActiveCamera() );
+                }
+              }
+            }
+          }
+        }
       }
     }
   }
@@ -459,31 +607,33 @@ void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced )
     if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
       // get SALOMEDS Study
       // Temporarily commented to avoid awful dependecy on SALOMEDS
-      // TODO: better mechanism of storing display/erse status in a study
+      // TODO: better mechanism of storing display/erase status in a study
       // should be provided...
       //_PTR(Study) aStudy(getStudyDS());
       anActorCollection->InitTraversal();
       while(vtkActor* anActor = anActorCollection->GetNextActor())
-       if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
-         // Set visibility flag
+        if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+          // Set visibility flag
           // Temporarily commented to avoid awful dependecy on SALOMEDS
-          // TODO: better mechanism of storing display/erse status in a study
+          // TODO: better mechanism of storing display/erase status in a study
           // should be provided...
-         //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-         //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
-         //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
-         //}
-         // just display the object
-         QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
-         for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
-           if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
-             if(SVTK_View* aView = aViewWindow->getView())
-               if ( forced )
-                 aView->Remove(anAct,false);
-               else
-                 aView->Erase(anAct,forced);
-         }
-       }
+          //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+          //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+          //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+          //}
+          // just display the object
+          QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+            if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
+              if(SVTK_View* aView = aViewWindow->getView())
+              {
+                if ( forced )
+                  aView->Remove(anAct,false);
+                else
+                  aView->Erase(anAct,forced);
+              }
+          }
+        }
     }
   }
 }
@@ -502,33 +652,34 @@ void SVTK_Viewer::EraseAll( const bool forced )
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
     if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
       if(SVTK_View* aView = aViewWindow->getView()){
-       vtkRenderer* aRenderer =  aView->getRenderer();
-       vtkActorCollection* anActorCollection = aRenderer->GetActors();
-       anActorCollection->InitTraversal();
-       while(vtkActor* anActor = anActorCollection->GetNextActor()){
-         if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
-           // Set visibility flag
+        vtkRenderer* aRenderer =  aView->getRenderer();
+        VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+        vtkActorCollection* anActorCollection = aCopy.GetActors();
+        anActorCollection->InitTraversal();
+        while(vtkActor* anActor = anActorCollection->GetNextActor()){
+          if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+            // Set visibility flag
             // Temporarily commented to avoid awful dependecy on SALOMEDS
             // TODO: better mechanism of storing display/erse status in a study
             // should be provided...
-           //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-           //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
-           //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
-           if(forced)
-             aRenderer->RemoveActor(anAct);
-           else{
-             // just erase actor
-             anAct->SetVisibility( false );
-             // erase dependent actors
-             vtkActorCollection* aCollection = vtkActorCollection::New();
-             anAct->GetChildActors( aCollection );
-             aCollection->InitTraversal();
-             while(vtkActor* aSubAct = aCollection->GetNextActor())
-               aSubAct->SetVisibility( false );
-             aCollection->Delete();
-           }
-         }
-       }
+            //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+            //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
+            //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+            if(forced)
+              aRenderer->RemoveActor(anAct);
+            else{
+              // just erase actor
+              anAct->SetVisibility( false );
+              // erase dependent actors
+              vtkActorCollection* aCollection = vtkActorCollection::New();
+              anAct->GetChildActors( aCollection );
+              aCollection->InitTraversal();
+              while(vtkActor* aSubAct = aCollection->GetNextActor())
+                aSubAct->SetVisibility( false );
+              aCollection->Delete();
+            }
+          }
+        }
       }
   }
   Repaint();
@@ -544,37 +695,22 @@ SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry )
   if ( entry ) {
     if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(getViewManager()->getActiveView()))
       if(SVTK_View* aView = aViewWindow->getView()){
-       vtkRenderer* aRenderer =  aView->getRenderer();
-       vtkActorCollection* theActors = aRenderer->GetActors();
-       theActors->InitTraversal();
-       vtkActor* ac;
-       while( ( ac = theActors->GetNextActor() ) ) {
-         SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
-         if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
-           prs->AddObject( ac );
-         }
-       }
+        vtkRenderer* aRenderer =  aView->getRenderer();
+        VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+        vtkActorCollection* theActors = aCopy.GetActors();
+        theActors->InitTraversal();
+        vtkActor* ac;
+        while( ( ac = theActors->GetNextActor() ) ) {
+          SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
+          if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
+            prs->AddObject( ac );
+          }
+        }
       }
   }
   return prs;
 }
 
-/*!
-  Auxiliary method called before displaying of objects
-*/
-void SVTK_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
-  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
@@ -592,6 +728,21 @@ bool SVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& io )
   return true;
 }
 
+/*!
+  \Collect objects visible in viewer
+  \param theList - visible objects collection
+*/
+void SVTK_Viewer::GetVisible( SALOME_ListIO& theList )
+{
+  // here we collect object if it is disaplaed even one view
+  QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+  for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+    if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+      if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
+        if(SVTK_View* aView = aViewWnd->getView())
+          aView->GetVisible( theList );
+}
+
 /*!
   Updates current viewer
 */
@@ -602,7 +753,7 @@ void SVTK_Viewer::Repaint()
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
     if(TViewWindow* aViewWindow = dynamic_cast<TViewWindow*>(aViews.at(i)))
       if(SVTK_View* aView = aViewWindow->getView())
-       aView->Repaint();
+        aView->Repaint();
 }
  
 
index 1dda8f65a0cea301ce0702191f95690fa5b67356..b0671426579f64dee52375bc5cc0ef5b73b17a49 100644 (file)
@@ -1,32 +1,36 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_VIEWMODEL_H
 #define SVTK_VIEWMODEL_H
 
 #include "SVTK.h"
 #include "SVTK_ViewModelBase.h"
 
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include "Qtx.h"
+
+#include <SALOME_Prs.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
 
 #include <QColor>
 #include <QMap>
@@ -42,10 +46,24 @@ class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
   Q_OBJECT;
 
 public:
+  /*! supported gradient types */
+  enum { 
+    HorizontalGradient,
+    VerticalGradient,
+    FirstDiagonalGradient,
+    SecondDiagonalGradient,
+    FirstCornerGradient,
+    SecondCornerGradient,
+    ThirdCornerGradient,
+    FourthCornerGradient,
+    LastGradient = FourthCornerGradient,
+  };
+
   typedef SVTK_ViewWindow TViewWindow;
   
   //! Define string representation of the viewer type
-  static QString Type() { return "VTKViewer"; }
+  static QString           Type() { return "VTKViewer"; }
+  static QString           backgroundData( QStringList&, QIntList&, QIntList& );
 
   SVTK_Viewer();
   virtual ~SVTK_Viewer();
@@ -62,12 +80,18 @@ public:
   //! See #SUIT_ViewModel::getType
   virtual QString getType() const { return Type(); }
 
-  //! Get background color of the viewer
+  //! Get background color of the viewer [obsolete]
   QColor backgroundColor() const;
 
-  //! Set background color to the viewer
+  //! Set background color to the viewer [obsolete]
   void setBackgroundColor( const QColor& );
 
+  //! Get background color of the viewer
+  Qtx::BackgroundData background() const;
+
+  //! Set background color to the viewer
+  void setBackground( const Qtx::BackgroundData& );
+
   //! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
   vtkFloatingPointType trihedronSize() const;
 
@@ -77,6 +101,12 @@ public:
   //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
   void setTrihedronSize( const vtkFloatingPointType, const bool = true );
 
+  //! Get visibility status of the static trihedron
+  bool isStaticTrihedronVisible() const;
+
+  //! Set visibility status of the static trihedron
+  void setStaticTrihedronVisible( const bool );
+
   //! Gets projection mode
   int projectionMode() const;
 
@@ -89,6 +119,18 @@ public:
   //! Sets interaction style
   void setInteractionStyle( const int );
 
+  //! Gets zooming style
+  int zoomingStyle() const;
+
+  //! Sets zooming style
+  void setZoomingStyle( const int );
+
+  //! Gets dynamic preselection
+  bool dynamicPreSelection() const;
+
+  //! Sets dynamic preselection
+  void setDynamicPreSelection( const bool );
+
   //! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
   int incrementalSpeed() const;
 
@@ -124,15 +166,12 @@ public:
   //! See #SALOME_View::EraseAll( const bool = false )
   void EraseAll( const bool = false );
 
+  //! See #SALOME_View::getVisible( SALOME_ListIO& )
+  virtual void GetVisible( SALOME_ListIO& );
+
   //! See #SALOME_View::CreatePrs( const char* entry = 0 )
   SALOME_Prs* CreatePrs( const char* entry = 0 );
 
-  //! See #SALOME_View::BeforeDisplay( SALOME_Displayer* d )
-  virtual void BeforeDisplay( SALOME_Displayer* d );
-
-  //! See #SALOME_View::AfterDisplay( SALOME_Displayer* d )
-  virtual void AfterDisplay( SALOME_Displayer* d );
-
   //! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
   virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
 
@@ -149,7 +188,7 @@ protected slots:
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
   void onDumpView();
-  void onChangeBgColor();
+  void onChangeBackground();
 
   void onActorAdded(VTKViewer_Actor*);
   void onActorRemoved(VTKViewer_Actor*);
@@ -157,17 +196,19 @@ protected slots:
 private:
   void updateToolBars();
 
-
-  QColor myBgColor;
+  Qtx::BackgroundData  myDefaultBackground;
   vtkFloatingPointType myTrihedronSize;
-  bool   myTrihedronRelative;
-  bool   mySelectionEnabled;
-  bool   myMultiSelectionEnabled;
-  int    myIncrementSpeed;
-  int    myIncrementMode;
-  int    myProjMode;
-  int    myStyle;
-  int    mySpaceBtn[3];
+  bool                 myTrihedronRelative;
+  bool                 myIsStaticTrihedronVisible;
+  bool                 mySelectionEnabled;
+  bool                 myMultiSelectionEnabled;
+  int                  myIncrementSpeed;
+  int                  myIncrementMode;
+  int                  myProjMode;
+  int                  myStyle;
+  int                  myZoomingStyle;
+  bool                 myDynamicPreSelection;
+  int                  mySpaceBtn[3];
 };
 
 #endif
index f1bfcceb71329b00b3fbc26fe31fb5b3c8cfcbbc..5ea0e8ec11ae1f27f5ab2bb6e8ec6ce255dc8f25 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_SELECTIONCHANGED_H
 #define SVTK_SELECTIONCHANGED_H
 
index b4c4cabd9f1ae95c681d6de6bd49a64e1f083a5c..c0a7091b4eeb3f622c0d64dcc7b8590394d3ad73 100755 (executable)
@@ -1,30 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header: 
-//
+
 #include "SVTK_ViewParameterDlg.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include <vtkCamera.h>
 #include <vtkGenericRenderWindowInteractor.h>
 
-using namespace std;
-
 /*!
   Constructor
 */
 SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction,
-                                            SVTK_ViewWindow* theParent,
-                                            const char* theName):
-  SVTK_DialogBase(theAction, theParent, theName),
+                                             SVTK_ViewWindow* theParent,
+                                             const char* theName):
+  ViewerTools_DialogBase(theAction, theParent, theName),
   myMainWindow(theParent),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
@@ -415,9 +409,9 @@ void SVTK_ViewParameterDlg::addObserver()
   Processes events
 */
 void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
-                                         unsigned long theEvent,
-                                         void* theClientData, 
-                                         void* theCallData)
+                                          unsigned long theEvent,
+                                          void* theClientData, 
+                                          void* theCallData)
 {
   SVTK_ViewParameterDlg* self = reinterpret_cast<SVTK_ViewParameterDlg*>(theClientData);
   vtkFloatingPointType* aCoord;
@@ -566,8 +560,8 @@ void SVTK_ViewParameterDlg::onFocalCoordChanged()
 
   vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
   aCamera->SetFocalPoint(myFocalX->text().toDouble(),
-                        myFocalY->text().toDouble(),
-                        myFocalZ->text().toDouble());
+                         myFocalY->text().toDouble(),
+                         myFocalZ->text().toDouble());
 
   aCamera->OrthogonalizeViewUp();
   myRWInteractor->getRenderer()->ResetCameraClippingRange();
@@ -586,8 +580,8 @@ void SVTK_ViewParameterDlg::onCameraCoordChanged()
 
   vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
   aCamera->SetPosition(myCameraX->text().toDouble(),
-                      myCameraY->text().toDouble(),
-                      myCameraZ->text().toDouble());
+                       myCameraY->text().toDouble(),
+                       myCameraZ->text().toDouble());
 
   aCamera->OrthogonalizeViewUp();
   myRWInteractor->getRenderer()->ResetCameraClippingRange();
@@ -618,8 +612,8 @@ void SVTK_ViewParameterDlg::onViewDirectionChanged()
 
   vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
   aCamera->SetViewUp(myViewDirX->text().toDouble(),
-                    myViewDirY->text().toDouble(),
-                    myViewDirZ->text().toDouble());
+                     myViewDirY->text().toDouble(),
+                     myViewDirZ->text().toDouble());
 
   // update view
   myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
@@ -716,7 +710,7 @@ void SVTK_ViewParameterDlg::updateCoordinates()
     // recompute focal point
     if (computePoint(pos, dir, dist, pnt)) {
       if (mySelectPoint->isChecked())
-       mySelectPoint->toggle();
+        mySelectPoint->toggle();
       myBusy = true;
       myFocalX->setText(QString::number(pnt[0]));
       myFocalY->setText(QString::number(pnt[1]));
@@ -728,9 +722,9 @@ void SVTK_ViewParameterDlg::updateCoordinates()
 }
 
 bool SVTK_ViewParameterDlg::computePoint(const double start[3], 
-                                        const double dir[3], 
-                                        const double dist, 
-                                        double result[3])
+                                         const double dir[3], 
+                                         const double dist, 
+                                         double result[3])
 {
   double d = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]);
   if ( d < 0.0002 ) return false;
index 3a6f3e8b03ff72e4c30fed3b524a2173a53aa88f..a4ef4fe285e980796df6ab8ddd813d0dc6b5cf40 100755 (executable)
@@ -1,36 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : 
 //  Author : 
-//  Module : SALOME
-//  $Header:
-//
+
 #ifndef SVTK_VIEWPARAMETERDLG_H
 #define SVTK_VIEWPARAMETERDLG_H
 
 #include "SVTK.h"
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 #include <vtkTimeStamp.h>
@@ -49,14 +45,14 @@ class QButtonGroup;
 class vtkCallbackCommand;
 class vtkObject;
 
-class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
 public:
   SVTK_ViewParameterDlg(QtxAction* theAction,
-                       SVTK_ViewWindow* theParent,
-                       const char* theName);
+                        SVTK_ViewWindow* theParent,
+                        const char* theName);
 
   ~SVTK_ViewParameterDlg();
   
@@ -106,7 +102,7 @@ protected:
 
   void setEnabled(QFrame* theWidget, const bool theState);
   bool computePoint(const double start[3], const double dir[3], 
-                   const double dist, double result[3]);
+                    const double dist, double result[3]);
   void updateProjection();
   void updateCoordinates();
 
index b5b67ddc70039a84d004374bd5053e0e0758fa06..3a81fc72a29871a7ed2a78224cedd9ff22767375 100755 (executable)
@@ -1,34 +1,40 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SVTK_NonIsometricDlg.h"
 #include "SVTK_UpdateRateDlg.h"
 #include "SVTK_CubeAxesDlg.h"
 #include "SVTK_SetRotationPointDlg.h"
 #include "SVTK_ViewParameterDlg.h"
+#include "SVTK_ViewModel.h"
+#include "VTKViewer_Texture.h"
+#include "VTKViewer_OpenGLRenderer.h"
 
 #include "SALOME_Actor.h"
 
+#include <QMenu>
 #include <QToolBar>
 #include <QEvent>
+#include <QFileInfo>
 #include <QXmlStreamWriter>
 #include <QXmlStreamReader>
 #include <QXmlStreamAttributes>
 #include <vtkAxisActor2D.h>
 #include <vtkGL2PSExporter.h>
 #include <vtkInteractorStyle.h>
+#include <vtkProperty.h>
+#include <vtkCallbackCommand.h>
+#include <vtkJPEGReader.h>
+#include <vtkBMPReader.h>
+#include <vtkTIFFReader.h>
+#include <vtkPNGReader.h>
+#include <vtkMetaImageReader.h>
+#include <vtkImageMapToColors.h>
+#include <vtkTexture.h>
 
 #include "QtxAction.h"
 
@@ -53,6 +68,7 @@
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Accel.h"
 #include "SUIT_OverrideCursor.h"
+#include "SUIT_ViewManager.h"
 #include "QtxActionToolMgr.h"
 #include "QtxMultiAction.h"
 
@@ -66,7 +82,6 @@
 #include "SVTK_Event.h"
 #include "SVTK_Renderer.h"
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModelBase.h"
 #include "SVTK_InteractorStyle.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_GenericRenderWindowInteractor.h"
 #include "SVTK_Recorder.h"
 #include "SVTK_RecorderDlg.h"
 
+#include "vtkPVAxesWidget.h"
+#include "vtkPVAxesActor.h"
+
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "VTKViewer_Algorithm.h"
 #include "SVTK_Functor.h"
 
+#include <OpenGLUtils_FrameBuffer.h>
+
 
 namespace SVTK
 {
@@ -114,7 +134,8 @@ SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
   SUIT_ViewWindow(theDesktop),
   myView(NULL),
   myDumpImage(QImage()),
-  myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New())
+  myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New()),
+  myEventCallbackCommand(vtkCallbackCommand::New())
 {
   setWindowFlags( windowFlags() & ~Qt::Window );
   // specific of vtkSmartPointer
@@ -128,7 +149,9 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
 {
   myInteractor = new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor");
   
-  SVTK_Selector* aSelector = SVTK_Selector::New();
+  SVTK_Selector* aSelector = SVTK_Selector::New(); 
+  aSelector->SetDynamicPreSelection( SUIT_Session::session()->resourceMgr()->
+                                    booleanValue( "VTKViewer", "dynamic_preselection", true ) );
   
   SVTK_GenericRenderWindowInteractor* aDevice = SVTK_GenericRenderWindowInteractor::New();
   aDevice->SetRenderWidget(myInteractor);
@@ -143,10 +166,10 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   aRenderer->Delete();
   aSelector->Delete();
   
-  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this );
-  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), -1, this );
+  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false, Qt::AllToolBarAreas, -1, this );
+  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), false, Qt::AllToolBarAreas, -1, this );
   
-  createActions( SUIT_Session::session()->activeApplication()->resourceMgr() );
+  createActions( SUIT_Session::session()->resourceMgr() );
   createToolBar();
   
   SetEventDispatcher(myInteractor->GetDevice());
@@ -158,14 +181,15 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   myUpdateRateDlg = new SVTK_UpdateRateDlg( getAction( UpdateRate ), this, "SVTK_UpdateRateDlg" );
   myNonIsometricDlg = new SVTK_NonIsometricDlg( getAction( NonIsometric ), this, "SVTK_NonIsometricDlg" );
   myCubeAxesDlg = new SVTK_CubeAxesDlg( getAction( GraduatedAxes ), this, "SVTK_CubeAxesDlg" );
+  myCubeAxesDlg->initialize();
   mySetRotationPointDlg = new SVTK_SetRotationPointDlg
     ( getAction( ChangeRotationPointId ), this, "SVTK_SetRotationPointDlg" );
   myViewParameterDlg = new SVTK_ViewParameterDlg
     ( getAction( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
   
-  SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
-  myInteractor->PushInteractorStyle(aStyle);
-  aStyle->Delete();
+  myDefaultInteractorStyle = SVTK_InteractorStyle::New();
+  myInteractor->PushInteractorStyle(myDefaultInteractorStyle);
+  myDefaultInteractorStyle->Delete();
   
   myRecorder = SVTK_Recorder::New();
   
@@ -177,10 +201,39 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   
   setCentralWidget(myInteractor);
   
+  myAxesWidget = vtkPVAxesWidget::New();
+  myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
+  myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
+  myAxesWidget->SetInteractor(myInteractor->GetDevice());
+  myAxesWidget->SetEnabled(1);
+  myAxesWidget->SetInteractive(0);
+
+  vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor();
+  anAxesActor->GetXAxisTipProperty()->SetColor(   1.0, 0.0, 0.0 );
+  anAxesActor->GetXAxisShaftProperty()->SetColor( 1.0, 0.0, 0.0 );
+  anAxesActor->GetXAxisLabelProperty()->SetColor( 1.0, 0.0, 0.0 );
+  anAxesActor->GetYAxisTipProperty()->SetColor(   0.0, 1.0, 0.0 );
+  anAxesActor->GetYAxisShaftProperty()->SetColor( 0.0, 1.0, 0.0 );
+  anAxesActor->GetYAxisLabelProperty()->SetColor( 0.0, 1.0, 0.0 );
+  anAxesActor->GetZAxisTipProperty()->SetColor(   0.0, 0.0, 1.0 );
+  anAxesActor->GetZAxisShaftProperty()->SetColor( 0.0, 0.0, 1.0 );
+  anAxesActor->GetZAxisLabelProperty()->SetColor( 0.0, 0.0, 1.0 );
+
   myView = new SVTK_View(this);
   Initialize(myView,theModel);
+
+
+  myEventCallbackCommand->SetClientData(this);
+  myEventCallbackCommand->SetCallback(SVTK_ViewWindow::ProcessEvents);
+  myEventCallbackCommand->Delete();
+
+  GetInteractor()->GetInteractorStyle()->AddObserver(SVTK::OperationFinished, 
+                                                    myEventCallbackCommand.GetPointer(), 0.0);
+
+
   
   myInteractor->getRenderWindow()->Render();
+  setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
   onResetView();
 }
 
@@ -188,7 +241,7 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   To initialize #SVTK_ViewWindow instance
 */
 void SVTK_ViewWindow::Initialize(SVTK_View* theView,
-                                SVTK_ViewModelBase* theModel)
+                                 SVTK_ViewModelBase* theModel)
 {
   connect(theView,SIGNAL(KeyPressed(QKeyEvent*)),
           this,SLOT(onKeyPressed(QKeyEvent*)) );
@@ -205,14 +258,17 @@ void SVTK_ViewWindow::Initialize(SVTK_View* theView,
   connect(theView,SIGNAL(contextMenuRequested(QContextMenuEvent*)),
           this,SIGNAL(contextMenuRequested(QContextMenuEvent *)));
   connect(theView,SIGNAL(selectionChanged()),
-         theModel,SLOT(onSelectionChanged()));
+          theModel,SLOT(onSelectionChanged()));
 }
 
 /*!
   Destructor
 */
 SVTK_ViewWindow::~SVTK_ViewWindow()
-{}
+{
+  myRecorder->Delete();
+  myAxesWidget->Delete();
+}
 
 
 /*!
@@ -278,6 +334,7 @@ void SVTK_ViewWindow::onFrontView()
 {
   GetRenderer()->OnFrontView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -287,6 +344,7 @@ void SVTK_ViewWindow::onBackView()
 {
   GetRenderer()->OnBackView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -296,6 +354,7 @@ void SVTK_ViewWindow::onTopView()
 {
   GetRenderer()->OnTopView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -305,6 +364,7 @@ void SVTK_ViewWindow::onBottomView()
 {
   GetRenderer()->OnBottomView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -314,6 +374,7 @@ void SVTK_ViewWindow::onLeftView()
 {
   GetRenderer()->OnLeftView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -323,6 +384,27 @@ void SVTK_ViewWindow::onRightView()
 {
   GetRenderer()->OnRightView();
   Repaint();
+  emit transformed( this );
+}
+
+/*!
+  \brief Rotate view 90 degrees clockwise
+*/
+void SVTK_ViewWindow::onClockWiseView()
+{
+  GetRenderer()->onClockWiseView();
+  Repaint();
+  emit transformed( this );
+}
+
+/*!
+  \brief Rotate view 90 degrees conterclockwise
+*/
+void SVTK_ViewWindow::onAntiClockWiseView()
+{
+  GetRenderer()->onAntiClockWiseView();
+  Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -332,6 +414,7 @@ void SVTK_ViewWindow::onResetView()
 {
   GetRenderer()->OnResetView();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -341,6 +424,7 @@ void SVTK_ViewWindow::onFitAll()
 {
   GetRenderer()->OnFitAll();
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -383,8 +467,8 @@ void SVTK_ViewWindow::unHighlightAll()
   \param theIsUpdate - update current viewer
 */
 void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO, 
-                               bool theIsHighlight, 
-                               bool theIsUpdate ) 
+                                bool theIsHighlight, 
+                                bool theIsUpdate ) 
 {
   myView->highlight( theIO, theIsHighlight, theIsUpdate );
 }
@@ -422,7 +506,7 @@ Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEnt
   \param theImmediatly - update viewer
 */
 void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
-                             bool theImmediatly) 
+                              bool theImmediatly) 
 {
   myView->Display(theIO,theImmediatly);
 }
@@ -433,7 +517,7 @@ void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
   \param theImmediatly - update viewer
 */
 void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
-                           bool theImmediatly) 
+                            bool theImmediatly) 
 {
   myView->Erase(theIO,theImmediatly);
 }
@@ -464,26 +548,167 @@ void SVTK_ViewWindow::EraseAll()
 }
 
 /*!
-  Sets background color
+  Sets background color [obsolete]
   \param color - new background color
 */
-void SVTK_ViewWindow::setBackgroundColor( const QColor& theColor )
+void SVTK_ViewWindow::setBackgroundColor( const QColor& c )
 {
-  getRenderer()->SetBackground(theColor.red()/255.0, 
-                              theColor.green()/255.0,
-                              theColor.blue()/255.0);
+  Qtx::BackgroundData bg = background();
+  bg.setColor( c );
+  setBackground( bg );
 }
 
 /*!
-  \return background color of viewer
+  \return background color of viewer [obsolete]
 */
 QColor SVTK_ViewWindow::backgroundColor() const
 {
-  vtkFloatingPointType aBackgroundColor[3];
-  getRenderer()->GetBackground(aBackgroundColor);
-  return QColor(int(aBackgroundColor[0]*255), 
-               int(aBackgroundColor[1]*255), 
-               int(aBackgroundColor[2]*255));
+  return background().color();
+}
+
+/*!
+  Sets background data
+  \param bgData - new background data
+*/
+void SVTK_ViewWindow::setBackground( const Qtx::BackgroundData& bgData )
+{
+  bool ok = false;
+
+  if ( bgData.isValid() ) {
+    switch ( bgData.mode() ) {
+    case Qtx::ColorBackground:
+      {
+       QColor c = bgData.color();
+       if ( c.isValid() ) {
+         // show solid-colored background
+         getRenderer()->SetTexturedBackground( false );  // cancel texture mode
+         getRenderer()->SetGradientBackground( false );  // cancel gradient mode
+         getRenderer()->SetBackground( c.red()/255.0,
+                                       c.green()/255.0,
+                                       c.blue()/255.0 ); // set background color
+         ok = true;
+       }
+       break;
+      }
+    case Qtx::SimpleGradientBackground:
+      {
+        QColor c1, c2;
+        int type = bgData.gradient( c1, c2 );
+        if ( c1.isValid() )
+        {
+          if ( !c2.isValid() )
+            c2 = c1;
+
+          // show two-color gradient background
+          getRenderer()->SetTexturedBackground( false );    // cancel texture mode
+          getRenderer()->SetGradientBackground( true );     // switch to gradient mode
+
+          VTKViewer_OpenGLRenderer* aRenderer =
+            VTKViewer_OpenGLRenderer::SafeDownCast( getRenderer() );
+          if( aRenderer )
+          {
+            aRenderer->SetGradientType( type );
+            aRenderer->SetBackground( c1.redF(), c1.greenF(), c1.blueF() );
+            aRenderer->SetBackground2( c2.redF(), c2.greenF(), c2.blueF() );
+            ok = true;
+          }
+        }
+        break;
+      }
+    case Qtx::CustomGradientBackground:
+      {
+       // NOT IMPLEMENTED YET
+       getRenderer()->SetTexturedBackground( false );  // cancel texture mode
+       getRenderer()->SetGradientBackground( false );  // cancel gradient mode
+       // .........
+       break;
+      }
+    default:
+      break;
+    }
+    if ( bgData.isTextureShown() ) {
+      QString fileName;
+      int textureMode = bgData.texture( fileName );
+      QFileInfo fi( fileName );
+      if ( !fileName.isEmpty() && fi.exists() ) {
+       // read texture from file
+       QString extension = fi.suffix().toLower();
+       vtkImageReader2* aReader = 0;
+       if ( extension == "jpg" || extension == "jpeg" )
+         aReader = vtkJPEGReader::New();
+       else if ( extension == "bmp" )
+         aReader = vtkBMPReader::New();
+       else if ( extension == "tif" || extension == "tiff" )
+         aReader = vtkTIFFReader::New();
+       else if ( extension == "png" )
+         aReader = vtkPNGReader::New();
+       else if ( extension == "mhd" || extension == "mha" )
+         aReader = vtkMetaImageReader::New();           
+       if ( aReader ) {
+         // create texture
+         aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+         aReader->Update();      
+         VTKViewer_Texture* aTexture = VTKViewer_Texture::New();           
+         vtkImageMapToColors* aMap = 0;
+         vtkAlgorithmOutput* anOutput;
+         /*
+         // special processing for BMP reader
+         vtkBMPReader* aBMPReader = (vtkBMPReader*)aReader;
+         if ( aBMPReader ) {
+         // Special processing for BMP file
+         aBMPReader->SetAllow8BitBMP(1);
+           
+         aMap = vtkImageMapToColors::New();
+         aMap->SetInputConnection( aBMPReader->GetOutputPort() );
+         aMap->SetLookupTable( (vtkScalarsToColors*)aBMPReader->GetLookupTable() );
+         aMap->SetOutputFormatToRGB();
+           
+         anOutput = aMap->GetOutputPort();
+         }
+         else {
+         }
+         */
+         anOutput = aReader->GetOutputPort( 0 );
+         aTexture->SetInputConnection( anOutput );
+         // set texture mode
+         // VSR: Currently, VTK only supports Stretch mode, so below code will give
+         // the same results for all modes
+         switch ( textureMode ) {
+         case Qtx::TileTexture:
+           aTexture->SetPosition((int)VTKViewer_Texture::Tiled);
+           break;
+         case Qtx::StretchTexture:
+           aTexture->SetPosition((int)VTKViewer_Texture::Stretched);
+           break;
+         case Qtx::CenterTexture:
+           aTexture->SetPosition((int)VTKViewer_Texture::Centered);
+         default:
+           break;
+         }
+         // show textured background
+         getRenderer()->SetTexturedBackground( true );
+         getRenderer()->SetBackgroundTexture( aTexture );
+         
+         // clean-up resources
+         if ( aMap )
+           aMap->Delete();
+         aReader->Delete();
+         aTexture->Delete();
+         ok = true;
+       }
+      }
+    }
+  }
+  if ( ok )
+    myBackground = bgData;
+}
+
+/*!
+  \return background data of viewer
+*/
+Qtx::BackgroundData SVTK_ViewWindow::background() const
+{
+  return myBackground;
 }
 
 
@@ -541,6 +766,7 @@ void SVTK_ViewWindow::SetScale( double theScale[3] )
 {
   GetRenderer()->SetScale( theScale );
   Repaint();
+  emit transformed( this );
 }
 
 /*!
@@ -652,6 +878,24 @@ void SVTK_ViewWindow::SetInteractionStyle(const int theStyle)
   onSwitchInteractionStyle( theStyle==1 );
 }
 
+/*!
+  Sets actual zooming style
+  \param theStyle - type of zooming style ( 0 - standard, 1 - advanced (at cursor) )
+*/
+void SVTK_ViewWindow::SetZoomingStyle(const int theStyle)
+{
+  onSwitchZoomingStyle( theStyle==1 );
+}
+
+/*!
+  Switch dynamic preselection on / off
+  \param theDynPreselection - dynamic pre-selection mode
+*/
+void SVTK_ViewWindow::SetDynamicPreSelection( bool theDynPreselection )
+{
+  onSwitchDynamicPreSelection( theDynPreselection );
+}
+
 /*!
   Switches "keyboard free" interaction style on/off
 */
@@ -664,8 +908,8 @@ void SVTK_ViewWindow::onSwitchInteractionStyle(bool theOn)
       // keep the same style extensions
       SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)GetInteractorStyle();
       if ( aStyle ) {
-       myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
-       myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
+        myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
+        myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
       }
 
       PushInteractorStyle(myKeyFreeInteractorStyle.GetPointer());
@@ -682,6 +926,35 @@ void SVTK_ViewWindow::onSwitchInteractionStyle(bool theOn)
   if ( a->isChecked() != theOn ) a->setChecked( theOn );
 }
 
+/*!
+  Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void SVTK_ViewWindow::onSwitchZoomingStyle( bool theOn )
+{
+  if( myDefaultInteractorStyle.GetPointer() )
+    myDefaultInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+  if( myKeyFreeInteractorStyle.GetPointer() )
+    myKeyFreeInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+
+  // update action state if method is called outside
+  QtxAction* a = getAction( SwitchZoomingStyleId );
+  if ( a->isChecked() != theOn )
+    a->setChecked( theOn );
+}
+
+/*!
+  Toogles dynamic preselection on/off
+*/
+void SVTK_ViewWindow::onSwitchDynamicPreSelection( bool theOn )
+{
+  GetSelector()->SetDynamicPreSelection( theOn );
+
+  // update action state if method is called outside
+  QtxAction* a = getAction( SwitchDynamicPreselectionId );
+  if ( a->isChecked() != theOn )
+    a->setChecked( theOn );
+}
+
 /*!
   Sets incremental speed
   \param theValue - new incremental speed
@@ -700,8 +973,8 @@ void SVTK_ViewWindow::SetIncrementalSpeed(const int theValue, const int theMode)
   \param theBtn3 - spacemouse button for the "dominant combined switch"
 */
 void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1, 
-                                          const int theBtn2,
-                                          const int theBtn3)
+                                           const int theBtn2,
+                                           const int theBtn3)
 {
   int val = theBtn1;
   myEventDispatcher->InvokeEvent(SVTK::SetSMDecreaseSpeedEvent, &val);
@@ -747,6 +1020,15 @@ void SVTK_ViewWindow::onAdjustCubeAxes()
   GetRenderer()->OnAdjustCubeAxes();
 }
 
+void SVTK_ViewWindow::synchronize(SVTK_ViewWindow* otherViewWindow )
+{
+  if ( otherViewWindow ) {
+    bool blocked = blockSignals( true );
+    doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+    blockSignals( blocked );
+  }
+}
+
 /*!
   Emits key pressed
 */
@@ -799,9 +1081,10 @@ void SVTK_ViewWindow::onMouseDoubleClicked( QMouseEvent* event )
   Redirect the request to #SVTK_Renderer::AddActor
 */
 void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor, 
-                               bool theUpdate )
+                                bool theUpdate,
+                                bool theIsAdjustActors )
 {
-  GetRenderer()->AddActor(theActor);
+  GetRenderer()->AddActor(theActor, theIsAdjustActors);
   if(theUpdate) 
     Repaint();
   emit actorAdded(theActor);
@@ -811,9 +1094,10 @@ void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
   Redirect the request to #SVTK_Renderer::RemoveActor
 */
 void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, 
-                                  bool theUpdate )
+                                   bool theUpdate,
+                                   bool theIsAdjustActors )
 {
-  GetRenderer()->RemoveActor(theActor);
+  GetRenderer()->RemoveActor(theActor, theIsAdjustActors);
   if(theUpdate) 
     Repaint();
   emit actorRemoved(theActor);
@@ -826,6 +1110,31 @@ QImage SVTK_ViewWindow::dumpViewContent()
   int aWidth = aSize[0];
   int aHeight = aSize[1];
   
+  OpenGLUtils_FrameBuffer aFrameBuffer;
+  if( aFrameBuffer.init( aWidth, aHeight ) )
+  {
+    glPushAttrib( GL_VIEWPORT_BIT );
+    glViewport( 0, 0, aWidth, aHeight );
+    aFrameBuffer.bind();
+
+    // draw scene
+    aWindow->Render();
+
+    aFrameBuffer.unbind();
+    glPopAttrib();
+
+    QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+
+    aFrameBuffer.bind();
+    glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
+    aFrameBuffer.unbind();
+
+    anImage = anImage.rgbSwapped();
+    anImage = anImage.mirrored();
+    return anImage;
+  }
+
+  // if frame buffers are unsupported, use old functionality
   unsigned char *aData = 
     aWindow->GetRGBACharPixelData( 0, 0, aWidth-1, aHeight-1, 0 );
   
@@ -844,6 +1153,7 @@ QImage SVTK_ViewWindow::dumpView()
   if( myDumpImage.isNull() )
     return dumpViewContent();
   
+  RefreshDumpImage();
   return myDumpImage;
 }
 
@@ -898,9 +1208,9 @@ void SVTK_ViewWindow::RefreshDumpImage()
   Redirect the request to #SVTK_Renderer::SetSelectionProp
 */
 void SVTK_ViewWindow::SetSelectionProp(const double& theRed, 
-                                      const double& theGreen, 
-                                      const double& theBlue, 
-                                      const int& theWidth) 
+                                       const double& theGreen, 
+                                       const double& theBlue, 
+                                       const int& theWidth) 
 {
   myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -909,9 +1219,9 @@ void SVTK_ViewWindow::SetSelectionProp(const double& theRed,
   Redirect the request to #SVTK_Renderer::SetSelectionProp
 */
 void SVTK_ViewWindow::SetPreselectionProp(const double& theRed, 
-                                         const double& theGreen, 
-                                         const double& theBlue, 
-                                         const int& theWidth) 
+                                          const double& theGreen, 
+                                          const double& theBlue, 
+                                          const int& theWidth) 
 {
   myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
 }
@@ -920,12 +1230,28 @@ void SVTK_ViewWindow::SetPreselectionProp(const double& theRed,
   Redirect the request to #SVTK_Renderer::SetSelectionTolerance
 */
 void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes, 
-                                           const double& theTolItems,
-                                           const double& theTolObjects)
+                                            const double& theTolItems,
+                                            const double& theTolObjects)
 {
   myView->SetSelectionTolerance(theTolNodes, theTolItems, theTolObjects);
 }
 
+/*!
+  Get visibility status of the static trihedron
+*/
+bool SVTK_ViewWindow::IsStaticTrihedronVisible() const
+{
+  return (bool)myAxesWidget->GetEnabled();
+}
+
+/*!
+  Set visibility status of the static trihedron
+*/
+void SVTK_ViewWindow::SetStaticTrihedronVisible( const bool theIsVisible )
+{
+  myAxesWidget->SetEnabled( (int)theIsVisible );
+}
+
 /*!
   Performs action
   \param accelAction - action
@@ -1002,7 +1328,7 @@ void getGradAxisVisualParams( QXmlStreamWriter& writer, vtkAxisActor2D* actor, Q
   writer.writeEndElement();
 
   //params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, 
-  //             title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
+  //              title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
 
   // Labels
   isVisible = actor->GetLabelVisibility();
@@ -1039,7 +1365,7 @@ void getGradAxisVisualParams( QXmlStreamWriter& writer, vtkAxisActor2D* actor, Q
   writer.writeEndElement();
   writer.writeEndElement();
   //  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 );
+  //                           color[0], color[1], color[2], font, bold, italic, shadow );
 
   // Tick marks
   isVisible = actor->GetTickVisibility();
@@ -1281,6 +1607,10 @@ QString SVTK_ViewWindow::getVisualParameters()
   aWriter.writeAttribute("Size", QString::number(GetTrihedronSize()));
   aWriter.writeEndElement();
 
+  aWriter.writeStartElement("Background");
+  aWriter.writeAttribute("Value",  QString( "%1" ).arg( Qtx::backgroundToString(background()) ));
+  aWriter.writeEndElement();
+
   aWriter.writeEndElement();
   aWriter.writeEndDocument();
 
@@ -1306,8 +1636,9 @@ void SVTK_ViewWindow::setVisualParameters( const QString& parameters )
 /*!
   The method restores visual parameters of this view from a formated string
 */
-void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
+void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly )
 {
+  
   double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
 
   QXmlStreamReader aReader(parameters);
@@ -1318,47 +1649,64 @@ void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
     if (aReader.isStartElement()) {
       QXmlStreamAttributes aAttr = aReader.attributes();
       //printf("### Name = %s\n", qPrintable(aReader.name().toString()));
-      if (aReader.name() == "Position") {      
-       pos[0] = aAttr.value("X").toString().toDouble();
-       pos[1] = aAttr.value("Y").toString().toDouble();
-       pos[2] = aAttr.value("Z").toString().toDouble();
-       //printf("#### Position %f; %f; %f\n", pos[0], pos[1], pos[2]);
-      } else if (aReader.name() == "FocalPoint") {
-       focalPnt[0] = aAttr.value("X").toString().toDouble();
-       focalPnt[1] = aAttr.value("Y").toString().toDouble();
-       focalPnt[2] = aAttr.value("Z").toString().toDouble();
-       //printf("#### FocalPoint %f; %f; %f\n", focalPnt[0], focalPnt[1], focalPnt[2]);
-      } else if (aReader.name() == "ViewUp") {
-       viewUp[0] = aAttr.value("X").toString().toDouble();
-       viewUp[1] = aAttr.value("Y").toString().toDouble();
-       viewUp[2] = aAttr.value("Z").toString().toDouble();
-       //printf("#### ViewUp %f; %f; %f\n", viewUp[0], viewUp[1], viewUp[2]);
-      } else if (aReader.name() == "ViewScale") {
-       parScale = aAttr.value("Parallel").toString().toDouble();
-       scale[0] = aAttr.value("X").toString().toDouble();
-       scale[1] = aAttr.value("Y").toString().toDouble();
-       scale[2] = aAttr.value("Z").toString().toDouble();
-       //printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
-      } else if (aReader.name() == "DisplayCubeAxis") {
-       if (aAttr.value("Show") == "0")
-         gradAxesActor->VisibilityOff();
-       else
-         gradAxesActor->VisibilityOn();
-      } else if (aReader.name() == "GraduatedAxis") {
-       if(aAttr.value("Axis") == "X") 
-         setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
-       else if(aAttr.value("Axis") == "Y")
-         setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
-       else if(aAttr.value("Axis") == "Z")
-         setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
-      } else if (aReader.name() == "Trihedron") {
-       if (aAttr.value("isShown") == "0")
-         GetTrihedron()->VisibilityOff();
-       else
-         GetTrihedron()->VisibilityOn();
-       SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+      if (aReader.name() == "Position") {       
+        pos[0] = aAttr.value("X").toString().toDouble();
+        pos[1] = aAttr.value("Y").toString().toDouble();
+        pos[2] = aAttr.value("Z").toString().toDouble();
+        //printf("#### Position %f; %f; %f\n", pos[0], pos[1], pos[2]);
+      }
+      else if (aReader.name() == "FocalPoint") {
+        focalPnt[0] = aAttr.value("X").toString().toDouble();
+        focalPnt[1] = aAttr.value("Y").toString().toDouble();
+        focalPnt[2] = aAttr.value("Z").toString().toDouble();
+        //printf("#### FocalPoint %f; %f; %f\n", focalPnt[0], focalPnt[1], focalPnt[2]);
+      }
+      else if (aReader.name() == "ViewUp") {
+        viewUp[0] = aAttr.value("X").toString().toDouble();
+        viewUp[1] = aAttr.value("Y").toString().toDouble();
+        viewUp[2] = aAttr.value("Z").toString().toDouble();
+        //printf("#### ViewUp %f; %f; %f\n", viewUp[0], viewUp[1], viewUp[2]);
+      }
+      else if (aReader.name() == "ViewScale") {
+        parScale = aAttr.value("Parallel").toString().toDouble();
+        scale[0] = aAttr.value("X").toString().toDouble();
+        scale[1] = aAttr.value("Y").toString().toDouble();
+        scale[2] = aAttr.value("Z").toString().toDouble();
+        //printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
+      } 
+      else if (aReader.name() == "DisplayCubeAxis") {
+       if ( !baseParamsOnly ) {
+         if (aAttr.value("Show") == "0")
+           gradAxesActor->VisibilityOff();
+         else
+           gradAxesActor->VisibilityOn();
+       }
+      }
+      else if (aReader.name() == "GraduatedAxis") {
+       if ( !baseParamsOnly ) {
+         if(aAttr.value("Axis") == "X") 
+           setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
+         else if(aAttr.value("Axis") == "Y")
+           setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
+         else if(aAttr.value("Axis") == "Z")
+           setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
+       }
+      } 
+      else if (aReader.name() == "Trihedron") {
+       if ( !baseParamsOnly ) {
+         if (aAttr.value("isShown") == "0")
+           GetTrihedron()->VisibilityOff();
+         else
+           GetTrihedron()->VisibilityOn();
+         SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+       }
       }
-    } 
+      else if (aReader.name() == "Background") {
+       if ( !baseParamsOnly ) {
+         setBackground( Qtx::stringToBackground( aAttr.value("Value").toString() ) );
+       }
+      }
+    }
   }
   if (!aReader.hasError()) {
     vtkCamera* camera = getRenderer()->GetActiveCamera();
@@ -1366,8 +1714,10 @@ void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
     camera->SetFocalPoint( focalPnt );
     camera->SetViewUp( viewUp );
     camera->SetParallelScale( parScale );
-    SetScale( scale );
-  } else {
+    GetRenderer()->SetScale( scale );
+    //SetScale( scale );
+  }
+  else {
     QStringList paramsLst = parameters.split( '*' );
     if ( paramsLst.size() >= nNormalParams ) {
       // 'reading' list of parameters
@@ -1391,32 +1741,37 @@ void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
       camera->SetFocalPoint( focalPnt );
       camera->SetViewUp( viewUp );
       camera->SetParallelScale( parScale );
-      SetScale( scale );
+      GetRenderer()->SetScale( scale );
+      //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();
-      } else if ( paramsLst.size() == nAllParams ) {
-       if ( paramsLst[90].toUShort() )
-         GetTrihedron()->VisibilityOn();
-       else
-         GetTrihedron()->VisibilityOff();
-       
-       SetTrihedronSize(paramsLst[91].toDouble());
+      if ( !baseParamsOnly ) {
+       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();
+       }
+       else if ( paramsLst.size() == nAllParams ) {
+         if ( paramsLst[90].toUShort() )
+           GetTrihedron()->VisibilityOn();
+         else
+           GetTrihedron()->VisibilityOff();
+        
+         SetTrihedronSize(paramsLst[91].toDouble());
+       }
       }
     }
   }
+  Repaint();
 }
 
 
@@ -1479,8 +1834,14 @@ void SVTK_ViewWindow::activateStartPointSelection()
 */
 void SVTK_ViewWindow::onPerspectiveMode()
 {
+  bool anIsParallelMode = toolMgr()->action( ParallelModeId )->isChecked();
+
+  // advanced zooming is not available in perspective mode
+  if( QtxAction* anAction = getAction( SwitchZoomingStyleId ) )
+    anAction->setEnabled( anIsParallelMode );
+
   vtkCamera* aCamera = getRenderer()->GetActiveCamera();
-  aCamera->SetParallelProjection(toolMgr()->action( ParallelModeId )->isChecked());
+  aCamera->SetParallelProjection(anIsParallelMode);
   GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
 }
 
@@ -1499,56 +1860,56 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // Dump view
   anAction = new QtxAction(tr("MNU_DUMP_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
-                          tr( "MNU_DUMP_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
+                           tr( "MNU_DUMP_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onDumpView()));
   mgr->registerAction( anAction, DumpId );
 
   // FitAll
   anAction = new QtxAction(tr("MNU_FITALL"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
-                          tr( "MNU_FITALL" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
+                           tr( "MNU_FITALL" ), 0, this);
   anAction->setStatusTip(tr("DSC_FITALL"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
   mgr->registerAction( anAction, FitAllId );
 
   // FitRect
   anAction = new QtxAction(tr("MNU_FITRECT"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
-                          tr( "MNU_FITRECT" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
+                           tr( "MNU_FITRECT" ), 0, this);
   anAction->setStatusTip(tr("DSC_FITRECT"));
   connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
   mgr->registerAction( anAction, FitRectId );
 
   // Zoom
   anAction = new QtxAction(tr("MNU_ZOOM_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
-                          tr( "MNU_ZOOM_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
+                           tr( "MNU_ZOOM_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
   mgr->registerAction( anAction, ZoomId );
 
   // Panning
   anAction = new QtxAction(tr("MNU_PAN_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
-                          tr( "MNU_PAN_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
+                           tr( "MNU_PAN_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_PAN_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
   mgr->registerAction( anAction, PanId );
 
   // Global Panning
   anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
-                          tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
+                           tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
   mgr->registerAction( anAction, GlobalPanId );
 
   // Change rotation point
   anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
-                          tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
+                           tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
@@ -1556,75 +1917,100 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // Rotation
   anAction = new QtxAction(tr("MNU_ROTATE_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
-                          tr( "MNU_ROTATE_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
+                           tr( "MNU_ROTATE_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
   mgr->registerAction( anAction, RotationId );
 
   // Projections
   anAction = new QtxAction(tr("MNU_FRONT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
-                          tr( "MNU_FRONT_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
+                           tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
   anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, FrontId );
 
   anAction = new QtxAction(tr("MNU_BACK_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
-                          tr( "MNU_BACK_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
+                           tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
   anAction->setStatusTip(tr("DSC_BACK_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, BackId );
 
   anAction = new QtxAction(tr("MNU_TOP_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
-                          tr( "MNU_TOP_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
+                           tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
   anAction->setStatusTip(tr("DSC_TOP_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, TopId );
 
   anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
-                          tr( "MNU_BOTTOM_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
+                           tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
   anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, BottomId );
 
   anAction = new QtxAction(tr("MNU_LEFT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
-                          tr( "MNU_LEFT_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
+                           tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
   anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, LeftId );
 
   anAction = new QtxAction(tr("MNU_RIGHT_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
-                          tr( "MNU_RIGHT_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
+                           tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
   anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, RightId );
 
+  // rotate anticlockwise
+  anAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"),
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
+                           tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+  anAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+  connect(anAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+  this->addAction(anAction);
+  mgr->registerAction( anAction, AntiClockWiseId );
+
+  // rotate clockwise
+  anAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"),
+                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
+                           tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+  anAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+  connect(anAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+  this->addAction(anAction);
+  mgr->registerAction( anAction, ClockWiseId );
+
   // Reset
   anAction = new QtxAction(tr("MNU_RESET_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
-                          tr( "MNU_RESET_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
+                           tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
   anAction->setStatusTip(tr("DSC_RESET_VIEW"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
+  this->addAction(anAction);
   mgr->registerAction( anAction, ResetId );
 
   // onViewTrihedron: Shows - Hides Trihedron
   anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
-                          tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+                           tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
   anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
   connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
   mgr->registerAction( anAction, ViewTrihedronId );
 
   // onNonIsometric: Manage non-isometric params
   anAction = new QtxAction(tr("MNU_SVTK_SCALING"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
-                          tr( "MNU_SVTK_SCALING" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
+                           tr( "MNU_SVTK_SCALING" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
@@ -1632,8 +2018,8 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // onGraduatedAxes: Manage graduated axes params
   anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
-                          tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
+                           tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
@@ -1641,8 +2027,8 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // onGraduatedAxes: Manage graduated axes params
   anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
-                          tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
+                           tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
@@ -1650,16 +2036,16 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // Set perspective mode group
   anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
-                          tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
+                           tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
   mgr->registerAction( anAction, ParallelModeId );
 
   anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
-                          tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
+                           tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
@@ -1671,34 +2057,63 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // View Parameters
   anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
-                          tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
+                           tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
   anAction->setStatusTip(tr("DSC_VIEWPARAMETERS_VIEW"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
   mgr->registerAction( anAction, ViewParametersId );
 
+  // Synchronize View 
+  anAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"), 
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SYNCHRONIZE" ) ),
+                           tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+  anAction->setMenu( new QMenu( this ) );
+  anAction->setCheckable(true);
+  connect(anAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+  connect(anAction, SIGNAL(triggered(bool)), this, SLOT(onSynchronizeView(bool)));
+  mgr->registerAction( anAction, SynchronizeId );
+
   // Switch between interaction styles
   anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"), 
-                          theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
-                          tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+                           tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_STYLE_SWITCH"));
   anAction->setCheckable(true);
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
   mgr->registerAction( anAction, SwitchInteractionStyleId );
 
+  // Switch between zooming styles
+  anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"), 
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ZOOMING_STYLE_SWITCH" ) ),
+                           tr( "MNU_SVTK_ZOOMING_STYLE_SWITCH" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_ZOOMING_STYLE_SWITCH"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+  mgr->registerAction( anAction, SwitchZoomingStyleId );
+
+  // Turn on/off dynamic pre-selection
+  anAction = new QtxAction(tr("MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH"), 
+                           theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_DYNAMIC_PRESLECTION_SWITCH" ) ),
+                           tr( "MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_DYNAMIC_PRESLECTION_SWITCH"));
+  anAction->setCheckable(true);
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchDynamicPreSelection(bool)));
+  mgr->registerAction( anAction, SwitchDynamicPreselectionId );
+
   // Start recording
   myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"), 
-                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
-                               tr( "MNU_SVTK_RECORDING_START" ), 0, this);
+                                theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
+                                tr( "MNU_SVTK_RECORDING_START" ), 0, this);
   myStartAction->setStatusTip(tr("DSC_SVTK_RECORDING_START"));
   connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStartRecording() ) );
   mgr->registerAction( myStartAction, StartRecordingId );
 
   // Play recording
   myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"), 
-                              theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
-                              tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
+                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
+                               tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
   myPlayAction->setStatusTip(tr("DSC_SVTK_RECORDING_PLAY"));
   myPlayAction->setEnabled( false );
   connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPlayRecording() ) );
@@ -1706,8 +2121,8 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // Pause recording
   myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"), 
-                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
-                               tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
+                                theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
+                                tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
   myPauseAction->setStatusTip(tr("DSC_SVTK_RECORDING_PAUSE"));
   myPauseAction->setEnabled( false );
   connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPauseRecording() ) );
@@ -1715,8 +2130,8 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
 
   // Stop recording
   myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"), 
-                              theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
-                              tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
+                               theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
+                               tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
   myStopAction->setStatusTip(tr("DSC_SVTK_RECORDING_STOP"));
   myStopAction->setEnabled( false );
   connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStopRecording() ) );
@@ -1732,6 +2147,8 @@ void SVTK_ViewWindow::createToolBar()
   
   mgr->append( DumpId, myToolBar );
   mgr->append( SwitchInteractionStyleId, myToolBar );
+  mgr->append( SwitchZoomingStyleId, myToolBar );
+  mgr->append( SwitchDynamicPreselectionId, myToolBar );
   mgr->append( ViewTrihedronId, myToolBar );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
@@ -1758,6 +2175,9 @@ void SVTK_ViewWindow::createToolBar()
   aViewsAction->insertAction( getAction( RightId ) );
   mgr->append( aViewsAction, myToolBar );
 
+  mgr->append( AntiClockWiseId, myToolBar );
+  mgr->append( ClockWiseId, myToolBar );
+
   mgr->append( ResetId, myToolBar );
 
   mgr->append( UpdateRate, myToolBar );
@@ -1765,7 +2185,10 @@ void SVTK_ViewWindow::createToolBar()
   mgr->append( GraduatedAxes, myToolBar );
 
   mgr->append( ViewParametersId, myToolBar );
+  mgr->append( SynchronizeId, myToolBar );
+
   mgr->append( toolMgr()->separator(), myToolBar );
+
   mgr->append( ParallelModeId, myToolBar );
   mgr->append( ProjectionModeId, myToolBar );
 
@@ -1938,3 +2361,150 @@ void SVTK_ViewWindow::hideEvent( QHideEvent * theEvent )
   emit Hide( theEvent );
 }
 
+void SVTK_ViewWindow::synchronizeView( SVTK_ViewWindow* viewWindow, int id )
+{
+  SVTK_ViewWindow* otherViewWindow = 0;
+  QList<SVTK_ViewWindow*> compatibleViews;
+
+  bool isSync = viewWindow->toolMgr()->action( SynchronizeId )->isChecked();
+
+  int vwid = viewWindow->getId();
+  
+  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+  if ( !app ) return;
+
+  QList<SUIT_ViewManager*> wmlist;
+  app->viewManagers( viewWindow->getViewManager()->getType(), wmlist );
+
+  foreach( SUIT_ViewManager* wm, wmlist ) {
+    QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+
+    foreach( SUIT_ViewWindow* vw, vwlist ) {
+      SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+      if ( !vtkVW ) continue;
+      if ( vtkVW->getId() == id ) 
+       otherViewWindow = vtkVW;
+      else if ( vtkVW != viewWindow )
+       compatibleViews.append( vtkVW );
+    }
+  }
+
+  if ( isSync && id ) {
+    // remove all possible disconnections
+    foreach( SVTK_ViewWindow* vw, compatibleViews ) {
+      // disconnect target view
+      vw->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), viewWindow, SLOT( synchronize( SVTK_ViewPort* ) ) );
+      viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), vw, SLOT( synchronize( SVTK_ViewPort* ) ) );
+      if ( otherViewWindow ) {
+       // disconnect source view
+       vw->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewPort* ) ) );
+       otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), vw, SLOT( synchronize( SVTK_ViewPort* ) ) );
+      }
+      QAction* a = vw->toolMgr()->action( SynchronizeId );
+      if ( a ) {
+       int anid = a->data().toInt();
+       if ( a->isChecked() && ( anid == id || anid == vwid ) ) {
+         bool blocked = a->blockSignals( true );
+         a->setChecked( false );
+         a->blockSignals( blocked );
+       }
+      }
+    }
+    if ( otherViewWindow ) {
+      // reconnect source and target view
+      otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), viewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+      viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+      otherViewWindow->connect( viewWindow, SIGNAL( transformed( SVTK_ViewWindow* ) ), SLOT( synchronize( SVTK_ViewWindow* ) ) );
+      viewWindow->connect( otherViewWindow, SIGNAL( transformed( SVTK_ViewWindow* ) ), SLOT( synchronize( SVTK_ViewWindow* ) ) );
+      // synchronize target view with source view
+      viewWindow->doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+      viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+      otherViewWindow->toolMgr()->action( SynchronizeId )->setData( viewWindow->getId() );
+      if ( !otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
+       bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
+       otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( true );
+       otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+      }
+    }
+  }
+  else if ( otherViewWindow ) {
+    // reconnect source and target view
+    otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), viewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+    viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+    viewWindow->doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+    viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+    if ( otherViewWindow->toolMgr()->action( SynchronizeId )->data().toInt() == viewWindow->getId() && otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
+      bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
+      otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( false );
+      otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+    }
+  }
+}
+
+/*!
+  "Synchronize View" action slot.
+*/
+void SVTK_ViewWindow::onSynchronizeView(bool checked)
+{
+  QAction* a = qobject_cast<QAction*>( sender() );
+  if ( a ) {
+    synchronizeView( this, a->data().toInt() );
+  }
+}
+
+/*!
+  Update list of available view for the "Synchronize View" action
+*/
+void SVTK_ViewWindow::updateSyncViews()
+{
+  QAction* anAction = toolMgr()->action( SynchronizeId );
+  if ( anAction && anAction->menu() ) {
+    int currentId = anAction->data().toInt();
+    anAction->menu()->clear();
+    SUIT_Application* app = SUIT_Session::session()->activeApplication();
+    if ( app ) { 
+      QList<SUIT_ViewManager*> wmlist;
+      app->viewManagers( getViewManager()->getType(), wmlist );
+      foreach( SUIT_ViewManager* wm, wmlist ) {
+       QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+       foreach ( SUIT_ViewWindow* vw, vwlist ) {
+         SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+         if ( !vtkVW || vtkVW == this ) continue;
+         QAction* a = anAction->menu()->addAction( vtkVW->windowTitle() );
+          if ( vtkVW->getId() == currentId ) {
+            QFont f = a->font();
+           f.setBold( true );
+           a->setFont( f );
+         }
+         a->setData( vtkVW->getId() );
+         connect( a, SIGNAL( triggered(bool) ), this, SLOT( onSynchronizeView(bool) ) );
+       }
+      }
+    }
+    if ( anAction->menu()->actions().isEmpty() ) {
+      anAction->setData( 0 );
+      anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+    }
+  }
+}
+
+
+/*!
+  Emit transformed signal.
+*/
+void SVTK_ViewWindow::emitTransformed() {
+  transformed(this);
+}
+
+/*!
+  Processes events
+*/
+void SVTK_ViewWindow::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+                                   unsigned long theEvent,
+                                   void* theClientData,
+                                   void* theCallData)
+{
+  SVTK_ViewWindow* self = reinterpret_cast<SVTK_ViewWindow*>(theClientData);
+  if(self)
+    self->emitTransformed();
+}
index 3a07a757c419e2d18e6c14cbdbe119cef6c4ffd1..15c977e3eb0044b13232d805fb57a047ff0b4381 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SVTK_VIEWWINDOW_H
 #define SVTK_VIEWWINDOW_H
 
@@ -28,6 +29,7 @@
 
 #include "SVTK.h"
 #include "SVTK_Selection.h"
+#include "Qtx.h"
 #include "SUIT_ViewWindow.h"
 
 #include "SALOME_InteractiveObject.hxx"
@@ -42,7 +44,6 @@ class VTKViewer_Actor;
 class VTKViewer_Trihedron;
 
 class SVTK_ViewModelBase;
-//class SVTK_MainWindow;
 class SVTK_Selector;
 class SVTK_View;
 
@@ -52,16 +53,21 @@ class vtkRenderer;
 class vtkRenderWindow;
 class vtkRenderWindowInteractor;
 class vtkInteractorStyle;
+class vtkCallbackCommand;
+
 class SVTK_RenderWindowInteractor;
 class SVTK_Renderer;
 class SVTK_NonIsometricDlg;
 class SVTK_UpdateRateDlg;
 class SVTK_CubeAxesDlg;
 class SVTK_SetRotationPointDlg;
+class SVTK_InteractorStyle;
 class SVTK_KeyFreeInteractorStyle;
 class SVTK_ViewParameterDlg;
 class SVTK_Recorder;
 
+class vtkPVAxesWidget;
+
 class vtkObject;
 class QtxAction;
 
@@ -90,57 +96,62 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Get #SVTK_View
   SVTK_View* getView();
 
-  //! Get #SVTK_MainWindow
-  //SVTK_MainWindow* getMainWindow();
-
-  //! Redirect the request to #SVTK_MainWindow::getRenderWindow
+  //! Get render window
   vtkRenderWindow* getRenderWindow();
 
-  //! Redirect the request to #SVTK_MainWindow::getInteractor
+  //! Get interactor
   vtkRenderWindowInteractor* getInteractor() const;
 
-  //! Redirect the request to #SVTK_MainWindow::getInteractor
+  //! Get SVTK interactor
   SVTK_RenderWindowInteractor*  GetInteractor() const;
 
+  //! Get current interactor style
   vtkInteractorStyle* GetInteractorStyle() const;
 
-  //! Redirect the request to #SVTK_RenderWindowInteractor::PushInteractorStyle
+  //! Add interactor style to the stack of styles
   void PushInteractorStyle(vtkInteractorStyle* theStyle);
 
-  //! Redirect the request to #SVTK_RenderWindowInteractor::PopInteractorStyle
+  //! Remove last interactor style from the stack of styles
   void PopInteractorStyle();
 
-  //! Redirect the request to #SVTK_MainWindow::getRenderer 
+  //! Get renderer
   vtkRenderer* getRenderer() const;
-
+  
+  //! Get SVTK renderer
   SVTK_Renderer* GetRenderer() const;
 
-  //! Redirect the request to #SVTK_MainWindow::GetSelector 
+  //! Get selector
   SVTK_Selector* GetSelector() const;
   
-  //! Redirect the request to #SVTK_Selector::SelectionMode
+  //! Set selection mode
   Selection_Mode SelectionMode() const;
   
   //! Change selection mode
   virtual void SetSelectionMode(Selection_Mode theMode);
 
-  //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor 
+  //! Set background color [obsolete] 
   virtual void setBackgroundColor( const QColor& );
 
-  //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor 
+  //! Get background color [obsolete]
   QColor backgroundColor() const;
 
-  //! Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
+  //! Set background
+  virtual void setBackground( const Qtx::BackgroundData& );
+
+  //! Get background
+  Qtx::BackgroundData background() const;
+
+  //! Return \c true if "display trihedron" flag is set
   bool isTrihedronDisplayed();
 
-  //! Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
+  //! Return \c true if "show graduated axes" flag is set
   bool isCubeAxesDisplayed();
  
   /*  interactive object management */
   //! Redirect the request to #SVTK_View::highlight (to support old code)
   virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO, 
-                        bool theIsHighlight = true, 
-                        bool theIsUpdate = true);
+                         bool theIsHighlight = true, 
+                         bool theIsUpdate = true);
 
   //! Redirect the request to #SVTK_View::unHighlightAll (to support old code)
   virtual void unHighlightAll();
@@ -155,18 +166,18 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //----------------------------------------------------------------------------
   Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry);
   
-  /* display */                
+  /* display */         
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_View::Display (to support old code)
   virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
-                      bool theImmediatly = true);
+                       bool theImmediatly = true);
 
   //! Redirect the request to #SVTK_View::DisplayOnly (to support old code)
   virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
 
   //! Redirect the request to #SVTK_View::Erase (to support old code)
   virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
-                    bool theImmediatly = true);
+                     bool theImmediatly = true);
 
   //! Redirect the request to #SVTK_View::DisplayAll (to support old code)
   virtual void DisplayAll();
@@ -186,11 +197,13 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
 
   //! Redirect the request to #SVTK_Renderer::AddActor
   virtual void AddActor(VTKViewer_Actor* theActor,
-                       bool theIsUpdate = false);
+                        bool theIsUpdate = false,
+                        bool theIsAdjustActors = true);
 
   //! Redirect the request to #SVTK_Renderer::RemoveActor
   virtual void RemoveActor(VTKViewer_Actor* theActor,
-                          bool theIsUpdate = false);
+                           bool theIsUpdate = false,
+                           bool theIsAdjustActors = true);
 
   //----------------------------------------------------------------------------
   //! Redirect the request to #SVTK_Renderer::AdjustActors
@@ -208,34 +221,46 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Redirect the request to #SVTK_Renderer::SetTrihedronSize
   virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
 
-  //! Redirect the request to #SVTK_MainWindow::SetIncrementalSpeed
+  //! Set incremental speed
   virtual void SetIncrementalSpeed( const int, const int = 0 );
 
-  //! Redirect the request to #SVTK_MainWindow::SetProjectionMode
+  //! Set current projection mode
   virtual void SetProjectionMode( const int );
 
-  //! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
+  //! Set interactive style
   virtual void SetInteractionStyle( const int );
 
-  //! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
+  //! Set zooming style
+  virtual void SetZoomingStyle( const int );
+
+  //! Set dynamic preselection on/off
+  virtual void SetDynamicPreSelection( bool );
+
+  //! Customize space mouse buttons
   virtual void SetSpacemouseButtons( const int, const int, const int );
 
-  //! Redirect the request to #SVTK_Renderer::SetSelectionProp
+  //! Set selection properties
   virtual void SetSelectionProp(const double& theRed = 1, 
-                               const double& theGreen = 1,
-                               const double& theBlue = 0, 
-                               const int& theWidth = 5);
+                                const double& theGreen = 1,
+                                const double& theBlue = 0, 
+                                const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetPreselectionProp
   virtual void SetPreselectionProp(const double& theRed = 0, 
-                                  const double& theGreen = 1,
-                                  const double& theBlue = 1, 
-                                  const int& theWidth = 5);
+                                   const double& theGreen = 1,
+                                   const double& theBlue = 1, 
+                                   const int& theWidth = 5);
 
   //! Redirect the request to #SVTK_Renderer::SetSelectionTolerance
   virtual void SetSelectionTolerance(const double& theTolNodes = 0.025, 
-                                    const double& theTolCell = 0.001,
-                                    const double& theTolObjects = 0.025);
+                                     const double& theTolCell = 0.001,
+                                     const double& theTolObjects = 0.025);
+
+  //! Get visibility status of the static trihedron
+  bool IsStaticTrihedronVisible() const;
+
+  //! Set visibility status of the static trihedron
+  virtual void SetStaticTrihedronVisible( const bool );
 
   //! Methods to save/restore visual parameters of a view (pan, zoom, etc.)
   virtual QString getVisualParameters();
@@ -246,6 +271,8 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
 
   virtual void RefreshDumpImage();
 
+  void emitTransformed();
+
   //! To invoke a VTK event on #SVTK_RenderWindowInteractor instance
   void InvokeEvent(unsigned long theEvent, void* theCallData);
   
@@ -285,6 +312,8 @@ public slots:
   void onViewParameters(bool theIsActivate);
 
   void onSwitchInteractionStyle(bool theOn);
+  void onSwitchZoomingStyle(bool theOn);
+  void onSwitchDynamicPreSelection(bool theOn);
 
   void onStartRecording();
   void onPlayRecording();
@@ -295,6 +324,7 @@ signals:
  void selectionChanged();
  void actorAdded(VTKViewer_Actor*);
  void actorRemoved(VTKViewer_Actor*);
+ void transformed(SVTK_ViewWindow*);
 
 public slots:
   //! Redirect the request to #SVTK_Renderer::OnFrontView
@@ -315,6 +345,12 @@ public slots:
   //! Redirect the request to #SVTK_Renderer::OnLeftView
   virtual void onLeftView();     
 
+  //! Redirect the request to #SVTK_Renderer::onClockWiseView
+  virtual void onClockWiseView();
+
+  //! Redirect the request to #SVTK_Renderer::onAntiClockWiseView
+  virtual void onAntiClockWiseView();
+
   //! Redirect the request to #SVTK_Renderer::OnResetView
   virtual void onResetView();     
 
@@ -332,7 +368,9 @@ public slots:
 
   //! Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
   virtual void onAdjustCubeAxes();
-
+  
+  virtual void synchronize(SVTK_ViewWindow*);
+    
 protected slots:
   void onKeyPressed(QKeyEvent* event);
   void onKeyReleased(QKeyEvent* event);
@@ -343,9 +381,15 @@ protected slots:
 
 protected:
   virtual void Initialize(SVTK_View* theView,
-                         SVTK_ViewModelBase* theModel);
+                          SVTK_ViewModelBase* theModel);
+
+  // Main process event method
+  static void ProcessEvents(vtkObject* object,
+                            unsigned long event,
+                            void* clientdata,
+                            void* calldata);
 
-  void doSetVisualParameters( const QString& );
+  void doSetVisualParameters( const QString&, bool = false );
   void SetEventDispatcher(vtkObject* theDispatcher);
 
   QImage dumpViewContent();
@@ -360,24 +404,27 @@ protected:
   void createActions(SUIT_ResourceMgr* theResourceMgr);
 
   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, 
-        ChangeRotationPointId, RotationId,
-         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, 
+         ChangeRotationPointId, RotationId,
+         FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId,
         ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
-        ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
-        StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
-
+         ParallelModeId, ProjectionModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
+         SwitchZoomingStyleId,SwitchDynamicPreselectionId,
+         StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
 
   SVTK_View* myView;
-  //SVTK_MainWindow* myMainWindow;
   SVTK_ViewModelBase* myModel;
 
   SVTK_RenderWindowInteractor* myInteractor;
+  vtkSmartPointer<SVTK_InteractorStyle> myDefaultInteractorStyle;
   vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
 
   QString myVisualParams; // used for delayed setting of view parameters 
 
   vtkSmartPointer<vtkObject> myEventDispatcher;
 
+  // Used to process events
+  vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
   SVTK_NonIsometricDlg* myNonIsometricDlg;
   SVTK_UpdateRateDlg* myUpdateRateDlg;
   SVTK_CubeAxesDlg* myCubeAxesDlg;
@@ -396,6 +443,16 @@ protected:
   int myToolBar;
   int myRecordingToolBar;
 
+  vtkPVAxesWidget* myAxesWidget;
+  Qtx::BackgroundData myBackground;
+
+private slots:
+  void onSynchronizeView(bool);
+  void updateSyncViews();
+
+private:
+  static void synchronizeView( SVTK_ViewWindow*, int );
+
 private:
   QImage myDumpImage;
 };
diff --git a/src/SVTK/resources/SVTK_images.po b/src/SVTK/resources/SVTK_images.po
deleted file mode 100644 (file)
index 7656ce5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  VISU VISUGUI : GUI of VISU component
-#  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 <EMAIL@ADDRESS>\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"
-
-msgid "ICON_UPDATE_RATE"
-msgstr "view_update_rate.png"
index 146bb8cf7f92763a33d289a8c1f2a7eef9b48827..362ffef6e05bce95d7672a7ea037e7b622a830a7 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>ICON_SVTK_STYLE_SWITCH</source>
         <translation>vtk_view_style_switch.png</translation>
     </message>
+    <message>
+        <source>ICON_SVTK_ZOOMING_STYLE_SWITCH</source>
+        <translation>vtk_view_zooming_style_switch.png</translation>
+    </message>
     <message>
         <source>ICON_SVTK_RECORDING_START</source>
         <translation>vtk_view_recording_start.png</translation>
         <source>ICON_SVTK_RECORDING_STOP</source>
         <translation>vtk_view_recording_stop.png</translation>
     </message>
+    <message>
+        <source>ICON_SVTK_SYNCHRONIZE</source>
+        <translation>vtk_view_sync.png</translation>
+    </message>
+    <message>
+        <source>ICON_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+        <translation>vtk_view_highlight.png</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/SVTK/resources/SVTK_msg_en.po b/src/SVTK/resources/SVTK_msg_en.po
deleted file mode 100755 (executable)
index 7c39b83..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-#  File   : SALOMEGUI_msg_en.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-31 13:25+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change the point, around which the rotation is performed"
-
-msgid "MNU_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change Rotation Point"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTK_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "SVTK_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "SVTK_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "SVTK_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "SVTK_ViewManager::VTK_VIEW_TITLE"
-msgstr "VTK scene:%1 - viewer:%2"
-
-msgid "MNU_SHOW_TRIHEDRON"
-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_SetRotationPointDlg::DLG_TITLE"
-msgstr "Set Rotation Point"
-
-msgid "SVTK_SetRotationPointDlg::USE_BBCENTER"
-msgstr "Use Bounding Box Center"
-
-msgid "SVTK_SetRotationPointDlg::LBL_TOORIGIN"
-msgstr "Set to Origin"
-
-msgid "SVTK_SetRotationPointDlg::LBL_SELECTPOINT"
-msgstr "Select Point from View"
-
-msgid "SVTK_SetRotationPointDlg::LBL_CENTER_OF_BOUNDING_BOX"
-msgstr "Center of bounding box"
-
-msgid "SVTK_SetRotationPointDlg::LBL_ORIGIN"
-msgstr "Origin of the coordinate system"
-
-msgid "SVTK_SetRotationPointDlg::LBL_SELECTED_POINT"
-msgstr "Selected point"
-
-msgid "SVTK_SetRotationPointDlg::LBL_X"
-msgstr "X :"
-
-msgid "SVTK_SetRotationPointDlg::LBL_Y"
-msgstr "Y :"
-
-msgid "SVTK_SetRotationPointDlg::LBL_Z"
-msgstr "Z :"
-
-msgid "SVTK_SetRotationPointDlg::RBUTTONGROUP_TITLE"
-msgstr "The rotation point type"
-
-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, -"
-
index a747d7b2bac011bd75db250d809e547495ff807d..a991c7902f0a53369eca663978d50ff0dc7a14e5 100644 (file)
@@ -1,29 +1,24 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
+    <message>
+        <source>DSC_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate view counterclockwise</translation>
+    </message>
+    <message>
+        <source>DSC_CLOCKWISE_VIEW</source>
+        <translation>Rotate View Clockwise</translation>
+    </message>
+    <message>
+        <source>MNU_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate counterclockwise</translation>
+    </message>
+    <message>
+        <source>MNU_CLOCKWISE_VIEW</source>
+        <translation>Rotate clockwise</translation>
+    </message>
     <message>
         <source>MNU_FRONT_VIEW</source>
         <translation>Front</translation>
         <source>DSC_VIEWPARAMETERS_VIEW</source>
         <translation>Change the parameters of the view</translation>
     </message>
+    <message>
+        <source>MNU_SYNCHRONIZE_VIEW</source>
+        <translation>Synchronize</translation>
+    </message>
+    <message>
+        <source>DSC_SYNCHRONIZE_VIEW</source>
+        <translation>Synchronize view</translation>
+    </message>
+    <message>
+        <source>MNU_SYNC_NO_VIEW</source>
+        <translation>[ No appropriate view ]</translation>
+    </message>
     <message>
         <source>MNU_SVTK_PARALLEL_MODE</source>
         <translation>Orthogonal Mode</translation>
     </message>
     <message>
         <source>DSC_SVTK_STYLE_SWITCH</source>
-        <translation>Interactiion style switch</translation>
+        <translation>Interaction style switch</translation>
     </message>
     <message>
         <source>MNU_SVTK_STYLE_SWITCH</source>
         <translation>Interaction Style Switch</translation>
     </message>
-</context>
-<context>
-    <name>SVTK_CubeAxesDlg</name>
-    <message>
-        <source>X_AXIS</source>
-        <translation>X axis</translation>
-    </message>
-    <message>
-        <source>Y_AXIS</source>
-        <translation>Y axis</translation>
-    </message>
-    <message>
-        <source>Z_AXIS</source>
-        <translation>Z axis</translation>
-    </message>
-    <message>
-        <source>CAPTION</source>
-        <translation>Graduated axes</translation>
-    </message>
-    <message>
-        <source>IS_VISIBLE</source>
-        <translation>Is visible</translation>
-    </message>
-    <message>
-        <source>FONT</source>
-        <translation>Font</translation>
-    </message>
-    <message>
-        <source>NAME</source>
-        <translation>Name</translation>
-    </message>
     <message>
-        <source>TICK_MARKS</source>
-        <translation>Tick marks</translation>
+        <source>DSC_SVTK_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zooming style switch</translation>
     </message>
     <message>
-        <source>LABELS</source>
-        <translation>Labels</translation>
+        <source>MNU_SVTK_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zomming style switch</translation>
     </message>
     <message>
-        <source>LENGTH</source>
-        <translation>Length</translation>
+        <source>DSC_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+        <translation>Dynamic preselection switch</translation>
     </message>
     <message>
-        <source>NUMBER</source>
-        <translation>Number</translation>
-    </message>
-    <message>
-        <source>OFFSET</source>
-        <translation>Offset</translation>
-    </message>
-    <message>
-        <source>AXIS_NAME</source>
-        <translation>Axis name</translation>
+        <source>MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+        <translation>Dynamic preselection switch</translation>
     </message>
 </context>
 <context>
     <name>SVTK_FontWidget</name>
-    <message>
-        <source>BOLD</source>
-        <translation>Bold</translation>
-    </message>
     <message>
         <source>ARIAL</source>
         <translation>Arial</translation>
         <source>TIMES</source>
         <translation>Times</translation>
     </message>
-    <message>
-        <source>ITALIC</source>
-        <translation>Italic</translation>
-    </message>
-    <message>
-        <source>SHADOW</source>
-        <translation>Shadow</translation>
-    </message>
     <message>
         <source>COURIER</source>
         <translation>Courier</translation>
     </message>
     <message>
         <source>DSC_SVTK_RECORDING_PLAY</source>
-        <translation>Play recording</translation>
+        <translation>Continue recording</translation>
     </message>
     <message>
         <source>MNU_SVTK_RECORDING_PLAY</source>
-        <translation>Play recording</translation>
+        <translation>Continue recording</translation>
     </message>
     <message>
         <source>DSC_SVTK_RECORDING_PAUSE</source>
@@ -534,11 +490,11 @@ Please, refer to the documentation.</translation>
         <source>LBL_TOBBCENTER</source>
         <translation>Set to Bounding Box Center</translation>
     </message>
-      <message>
+    <message>
         <source>LBL_TOORIGIN</source>
         <translation>Set to Origin</translation>
     </message>
-  <message>
+    <message>
         <source>LBL_SELECTPOINT</source>
         <translation>Select Point from View</translation>
     </message>
@@ -552,7 +508,7 @@ Please, refer to the documentation.</translation>
     </message>
     <message>
         <source>WORLD_COORDINATES</source>
-        <translation>World Coordinates</translation>
+        <translation>Absolute Coordinates</translation>
     </message>
     <message>
         <source>FOCAL_RELATIVE</source>
@@ -636,8 +592,44 @@ Please, refer to the documentation.</translation>
         <translation>Show toolbar</translation>
     </message>
     <message>
-        <source>MEN_CHANGE_BACKGROUD</source>
+        <source>MEN_CHANGE_BACKGROUND</source>
         <translation>Change background...</translation>
     </message>
+    <message>
+        <source>GT_HORIZONTALGRADIENT</source>
+        <translation>Horizontal gradient</translation>
+    </message>
+    <message>
+        <source>GT_VERTICALGRADIENT</source>
+        <translation>Vertical gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTDIAGONALGRADIENT</source>
+        <translation>First diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDDIAGONALGRADIENT</source>
+        <translation>Second diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTCORNERGRADIENT</source>
+        <translation>First corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDCORNERGRADIENT</source>
+        <translation>Second corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_THIRDCORNERGRADIENT</source>
+        <translation>Third corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_FOURTHCORNERGRADIENT</source>
+        <translation>Fourth corner gradient</translation>
+    </message>
+    <message>
+        <source>BG_IMAGE_FILES</source>
+        <translation>Image files (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
+    </message>
 </context>
 </TS>
index cd4a634ea84ec2a4e88ffa9a12c0484416822107..8ec07496c39c40f6a80f9cb8c9a44e2d23493458 100755 (executable)
@@ -1,34 +1,37 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : SalomeApp
 #  $Header$
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+SUBDIRS=pluginsdemo
+
 if CPPUNIT_IS_OK
 if GUI_ENABLE_CORBA
-  SUBDIRS = Test
+  SUBDIRS += Test
 endif
 endif
 
@@ -94,13 +97,19 @@ MOC_FILES =                                 \
 
 nodist_libSalomeApp_la_SOURCES = $(MOC_FILES)
 
+# python modules
+salomepython_PYTHON = salome_pluginsmanager.py
+
+dist_salomescript_DATA = addvars2notebook.py
+
 dist_salomeres_DATA =          \
        resources/SalomeApp.ini \
        resources/SalomeApp.xml
 
 nodist_salomeres_DATA =                \
        SalomeApp_images.qm     \
-       SalomeApp_msg_en.qm
+       SalomeApp_msg_en.qm     \
+       SalomeApp_msg_fr.qm
 
 libSalomeApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES)   \
        $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@     \
@@ -109,8 +118,8 @@ libSalomeApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES)        \
        -I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../ObjBrowser   \
        -I$(srcdir)/../PyConsole -I$(srcdir)/../TOOLSGUI                        \
        -I$(srcdir)/../PyInterp -I$(srcdir)/../Session -I$(top_builddir)/idl    \
-       -I$(srcdir)/../Event -I$(srcdir)/../CASCatch                            \
-       -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @LIBXML_INCLUDES@
+       -I$(srcdir)/../Event -I$(srcdir)/../CASCatch  -I$(srcdir)/../Prs        \
+       @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @LIBXML_INCLUDES@
 libSalomeApp_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) 
 libSalomeApp_la_LIBADD  = $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDSClient               \
        ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la ../ObjBrowser/libObjBrowser.la     \
@@ -119,4 +128,4 @@ libSalomeApp_la_LIBADD  = $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalome
        ../SVTK/libSVTK.la ../SOCC/libSOCC.la ../PyInterp/libPyInterp.la                        \
        ../PyConsole/libPyConsole.la ../LogWindow/libLogWindow.la                               \
        ../LightApp/libLightApp.la ../TOOLSGUI/libToolsGUI.la ../Session/libSalomeSession.la    \
-       ../Event/libEvent.la ../CASCatch/libCASCatch.la $(CAS_KERNEL)
+       ../Event/libEvent.la ../CASCatch/libCASCatch.la ../Prs/libSalomePrs.la $(CAS_KERNEL)
index 51d8ed6b688847e79a8a3593c218ded40178164f..f81e06be5e89f303fcb55bcd5f93632a7791b615 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      SalomeApp.h
 // Created:   November, 2004
 // Author:    OCC team
@@ -31,7 +32,7 @@
 //
 #ifdef WIN32
 
-#ifdef SALOMEAPP_EXPORTS
+#if defined SALOMEAPP_EXPORTS || defined SalomeApp_EXPORTS
 #define SALOMEAPP_EXPORT __declspec(dllexport)
 #else
 #define SALOMEAPP_EXPORT __declspec(dllimport)
diff --git a/src/SalomeApp/SalomeApp.pro b/src/SalomeApp/SalomeApp.pro
deleted file mode 100644 (file)
index a5d6eca..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = SalomeApp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-QWT_INCLUDES = $$(QWTHOME)/include
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-VTK_INCLUDES = $$(VTKHOME)/include/vtk
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-
-INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${QWT_INCLUDES} $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} ../LightApp ../CAM ../Qtx ../SUIT ../OBJECT ../SVTK ../STD ../VTKViewer ../PyConsole ../TOOLSGUI ../PyInterp ../Session ../../idl ../Event ../../salome_adm/unix $${CORBA_INCLUDES} #../ObjBrowser
-
-LIBS += $${QT_MT_LIBS} $${PYTHON_LIBS} $${KERNEL_LDFLAGS} -lOpUtil -lSALOMELocalTrace -lSalomeDSClient -L../../lib -lsuit -lstd -lCAM -lSalomePrs -lSPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPyConsole -lLogWindow -lLightApp -lToolsGUI $${CAS_KERNEL} #-lObjBrowser
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += SALOMEAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
-
-HEADERS  = SalomeApp.h
-HEADERS += SalomeApp_Application.h
-HEADERS += SalomeApp_DataModel.h
-HEADERS += SalomeApp_DataObject.h
-HEADERS += SalomeApp_LoadStudiesDlg.h
-HEADERS += SalomeApp_Module.h
-HEADERS += SalomeApp_Study.h
-HEADERS += SalomeApp_ExceptionHandler.h
-HEADERS += SalomeApp_Tools.h
-HEADERS += SalomeApp_ImportOperation.h
-HEADERS += SalomeApp_Filter.h
-HEADERS += SalomeApp_TypeFilter.h
-HEADERS += SalomeApp_StudyPropertiesDlg.h
-HEADERS += SalomeApp_CheckFileDlg.h
-HEADERS += SalomeApp_VisualState.h
-
-SOURCES  = SalomeApp_Module.cxx
-SOURCES += SalomeApp_Application.cxx
-SOURCES += SalomeApp_DataModel.cxx
-SOURCES += SalomeApp_DataObject.cxx
-SOURCES += SalomeApp_LoadStudiesDlg.cxx
-SOURCES += SalomeApp_Study.cxx
-SOURCES += SalomeApp_ExceptionHandler.cxx
-SOURCES += SalomeApp_PyInterp.cxx
-SOURCES += SalomeApp_Tools.cxx
-SOURCES += SalomeApp_ImportOperation.cxx
-SOURCES += SalomeApp_Filter.cxx
-SOURCES += SalomeApp_TypeFilter.cxx
-SOURCES += SalomeApp_StudyPropertiesDlg.cxx
-SOURCES += SalomeApp_ListView.cxx
-SOURCES += SalomeApp_CheckFileDlg.cxx
-SOURCES += SalomeApp_VisualState.cxx
-
-TRANSLATIONS = resources/SalomeApp_images.ts \
-               resources/SalomeApp_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 2c66cbdd71240e1ab49431ff7a4cfaf214c34239..d446757b2476856394e8157fbf13de74d5f6ec20 100644 (file)
@@ -1,28 +1,37 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
 #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_ExitDlg.h"
 
 #include <LightApp_Application.h>
+#include <LightApp_Module.h>
 #include <LightApp_Preferences.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_NameDlg.h>
 #include <LightApp_DataOwner.h>
+#include <LightApp_Displayer.h>
 
 #include <CAM_Module.h>
 
@@ -52,6 +63,9 @@
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_TreeModel.h>
+#include <SUIT_ViewWindow.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
 
 #include <QtxTreeView.h>
 
 #include <QListWidget>
 #include <QGridLayout>
 #include <QMenu>
+#include <QtDebug>
 
 #include <SALOMEDSClient_ClientFactory.hxx>
+#include <Basics_Utils.hxx>
 
-#include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_Prs.h>
+
 
 #include <ToolsGUI_CatalogGeneratorDlg.h>
 #include <ToolsGUI_RegWidget.h>
@@ -141,8 +159,9 @@ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
 SalomeApp_Application::SalomeApp_Application()
   : LightApp_Application()
 {
-  connect( desktop(), SIGNAL( message( const QString& ) ),
-          this,      SLOT( onDesktopMessage( const QString& ) ) );
+  connect( desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+           this,      SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+
   setNoteBook(0);
 }
 
@@ -172,7 +191,7 @@ void SalomeApp_Application::start()
     for (int i = 1; i < qApp->argc(); i++) {
       QRegExp rxs ("--study-hdf=(.+)");
       if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
-       QString file = rxs.capturedTexts()[1];
+        QString file = rxs.capturedTexts()[1];
         QFileInfo fi ( file );
         QString extension = fi.suffix().toLower();
         if ( extension == "hdf" && fi.exists() )
@@ -195,29 +214,48 @@ void SalomeApp_Application::start()
     // import/execute python scripts
     if ( pyfiles.count() > 0 && activeStudy() ) {
       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
-      if ( appStudy ) {
-       _PTR(Study) aStudy = appStudy->studyDS();
-       if ( !aStudy->GetProperties()->IsLocked() ) {
+      PyConsole_Console* pyConsole = pythonConsole();
+      if ( appStudy && pyConsole ) {
+        _PTR(Study) aStudy = appStudy->studyDS();
+        if ( !aStudy->GetProperties()->IsLocked() ) {
           for (uint j = 0; j < pyfiles.count(); j++ ) {
             QFileInfo fi ( pyfiles[j] );
-           PyConsole_Console* pyConsole = pythonConsole();
-           if ( pyConsole ) {
-              QString extension = fi.suffix().toLower();
-              if ( fi.exists() ) {
-                // execute python script
-                QString command = QString( "execfile(\"%1\")" ).arg( fi.absoluteFilePath() );
-                pyConsole->exec( command );
+            QFileInfo fipy ( pyfiles[j] + ".py" );
+            QString command = QString( "execfile(r\"%1\")" );
+            if ( fi.isAbsolute() ) {
+              if ( fi.exists() )
+                pyConsole->exec( command.arg( fi.absoluteFilePath() ) );
+              else if ( fipy.exists() )
+                pyConsole->exec( command.arg( fipy.absoluteFilePath() ) );
+              else
+                qDebug() << "Can't execute file" << pyfiles[j];
+            }
+            else {
+              bool found = false;
+              QStringList dirs;
+              dirs << QDir::currentPath();
+              if ( ::getenv( "PYTHONPATH" ) )
+                dirs += QString( ::getenv( "PYTHONPATH" ) ).split( QRegExp( "[:|;]" ) );
+              foreach( QString dir, dirs ) {
+                qDebug() << "try" << QFileInfo( dir, pyfiles[j] ).absoluteFilePath();
+                qDebug() << "try" << QFileInfo( dir, pyfiles[j] + ".py" ).absoluteFilePath();
+                if ( QFileInfo( dir, pyfiles[j] ).exists() ) {
+                  pyConsole->exec( command.arg( QFileInfo( dir, pyfiles[j] ).absoluteFilePath() ) );
+                  found = true;
+                  break;
+                }
+                else if ( QFileInfo( dir, pyfiles[j] + ".py" ).exists() ) {
+                  pyConsole->exec( command.arg( QFileInfo( dir, pyfiles[j] + ".py" ).absoluteFilePath() ) );
+                  found = true;
+                  break;
+                }
               }
-              else {
-                // import python module
-                QString command = QString( "import %1" ).arg( pyfiles[j] );
-               if ( extension == "py" )
-                 command = QString( "import %1" ).arg( fi.completeBaseName() );
-                pyConsole->exec( command );
+              if ( !found ) {
+                qDebug() << "Can't execute file" << pyfiles[j];
               }
             }
           }
-       }
+        }
       }
     }
   }
@@ -233,13 +271,13 @@ void SalomeApp_Application::createActions()
   //! Save GUI state
   // "Save GUI State" command is moved to VISU module
   //  createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
-  //           tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
-  //           0, desk, false, this, SLOT( onSaveGUIState() ) );
+  //            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" ), QIcon(),
-               tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
-               Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) );
+                tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
+                Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) );
 
   //! NoteBook
   createAction(NoteBookId, tr( "TOT_DESK_FILE_NOTEBOOK" ), QIcon(),
@@ -248,29 +286,29 @@ void SalomeApp_Application::createActions()
 
   //! Load script
   createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIcon(),
-               tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
-               Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) );
+                tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
+                Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) );
 
   //! Properties
   createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIcon(),
-               tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
-               Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) );
+                tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
+                Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) );
 
   //! Catalog Generator
   createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ),  QIcon(),
-               tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
-               Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) );
+                tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
+                Qt::ALT+Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) );
 
   //! Registry Display
   createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ),  QIcon(),
-               tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
-               /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
+                tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
+                /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
 
   //SRN: BugID IPAL9021, add an action "Load"
   createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
                 resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
-               tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
-               Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+                tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
+                Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
   //SRN: BugID IPAL9021: End
 
 
@@ -294,6 +332,31 @@ void SalomeApp_Application::createActions()
   createMenu( CatalogGenId, toolsMenu, 10, -1 );
   createMenu( RegDisplayId, toolsMenu, 10, -1 );
   createMenu( separator(), toolsMenu, -1, 15, -1 );
+
+  createExtraActions();
+
+  // import Python module that manages SALOME plugins
+  PyGILState_STATE gstate = PyGILState_Ensure();
+  PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
+  PyObject* res=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",0,"salome",tr("MEN_DESK_PLUGINS_TOOLS").toStdString().c_str(),tr("MEN_DESK_PLUGINS").toStdString().c_str());
+  if(res==NULL)
+    PyErr_Print();
+  Py_XDECREF(res);
+  PyGILState_Release(gstate);
+  // end of SALOME plugins loading
+
+}
+
+
+/*!Set desktop:*/
+void SalomeApp_Application::setDesktop( SUIT_Desktop* desk )
+{
+  LightApp_Application::setDesktop( desk );
+
+  if ( desk ) {
+    connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+             this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+  }
 }
 
 /*!
@@ -334,9 +397,9 @@ void SalomeApp_Application::onLoadDoc()
      while ( it.hasNext() && !isAlreadyOpen ) {
        SUIT_Application* aApp = it.next();
        if( !aApp || !aApp->activeStudy() )
-        continue;
+         continue;
        if ( aApp->activeStudy()->studyName() == studyName )
-        isAlreadyOpen = true;
+         isAlreadyOpen = true;
      }
 
      if ( !isAlreadyOpen )
@@ -360,6 +423,33 @@ void SalomeApp_Application::onLoadDoc()
   }
 }
 
+/*!SLOT. Create new study and load script*/
+void SalomeApp_Application::onNewWithScript()
+{
+  QStringList filtersList;
+  filtersList.append(tr("PYTHON_FILES_FILTER"));
+  filtersList.append(tr("ALL_FILES_FILTER"));
+
+  QString anInitialPath = "";
+  if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+    anInitialPath = QDir::currentPath();
+
+  QString aFile = SUIT_FileDlg::getFileName( desktop(), anInitialPath, filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
+
+  if ( !aFile.isEmpty() )
+  {
+    onNewDoc();
+
+    QString command = QString("execfile(r\"%1\")").arg(aFile);
+
+    PyConsole_Console* pyConsole = pythonConsole();
+
+    if ( pyConsole )
+      pyConsole->exec( command );
+  }
+}
+
+
 /*!SLOT. Load document with \a aName.*/
 bool SalomeApp_Application::onLoadDoc( const QString& aName )
 {
@@ -375,7 +465,7 @@ bool SalomeApp_Application::onLoadDoc( const QString& aName )
     bool isAlreadyOpen = false;
     SalomeApp_Application* aApp = 0;
     for ( QList<SUIT_Application*>::iterator it = aAppList.begin();
-         it != aAppList.end() && !isAlreadyOpen; ++it ) {
+          it != aAppList.end() && !isAlreadyOpen; ++it ) {
       aApp = dynamic_cast<SalomeApp_Application*>( *it );
       if ( aApp && aApp->activeStudy()->studyName() == aName )
         isAlreadyOpen = true;
@@ -411,8 +501,8 @@ void SalomeApp_Application::onCopy()
     {
       _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
       try {
-       studyMgr()->Copy(so);
-       onSelectionChanged();
+        studyMgr()->Copy(so);
+        onSelectionChanged();
       }
       catch(...) {
       }
@@ -434,8 +524,8 @@ void SalomeApp_Application::onPaste()
 
   if ( stdDS->GetProperties()->IsLocked() ) {
     SUIT_MessageBox::warning( desktop(),
-                             QObject::tr("WRN_WARNING"),
-                             QObject::tr("WRN_STUDY_LOCKED") );
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_STUDY_LOCKED") );
     return;
   }
 
@@ -444,9 +534,9 @@ void SalomeApp_Application::onPaste()
     {
       _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
       try {
-       studyMgr()->Paste(so);
-       updateObjectBrowser( true );
-       updateActions(); //SRN: BugID IPAL9377, case 3
+        studyMgr()->Paste(so);
+        updateObjectBrowser( true );
+        updateActions(); //SRN: BugID IPAL9377, case 3
       }
       catch(...) {
       }
@@ -470,17 +560,18 @@ void SalomeApp_Application::onCloseDoc( bool ask )
     _PTR(Study) stdDS = study->studyDS();
     if(stdDS && stdDS->IsStudyLocked()) {
       if ( SUIT_MessageBox::question( desktop(),
-                                     QObject::tr( "WRN_WARNING" ),
-                                     QObject::tr( "CLOSE_LOCKED_STUDY" ),
-                                     SUIT_MessageBox::Yes | SUIT_MessageBox::No,
-                                     SUIT_MessageBox::No) == SUIT_MessageBox::No ) return;
+                                      QObject::tr( "WRN_WARNING" ),
+                                      QObject::tr( "CLOSE_LOCKED_STUDY" ),
+                                      SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+                                      SUIT_MessageBox::No) == SUIT_MessageBox::No ) return;
 
     }
   }
 
-  LightApp_Application::onCloseDoc( ask );
   if(myNoteBook && myNoteBook->isVisible())
-     myNoteBook->hide();
+    myNoteBook->hide();
+
+  LightApp_Application::onCloseDoc( ask );
 }
 
 /*!Sets enable or disable some actions on selection changed.*/
@@ -535,10 +626,10 @@ void SalomeApp_Application::onDeleteInvalidReferences()
     {
       _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
       while( aRefObj && aRefObj->ReferencedObject( anObj ) )
-       aRefObj = anObj;
+        aRefObj = anObj;
 
       if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
-        aStudyBuilder->RemoveReference( aSObject );
+         aStudyBuilder->RemoveReference( aSObject );
     }
   updateObjectBrowser();
 }
@@ -594,7 +685,7 @@ void SalomeApp_Application::updateCommandsStatus()
   a = action(NoteBookId);
   if( a )
     a->setEnabled( activeStudy() );
-  
+
   // Load script menu
   a = action( LoadScriptId );
   if ( a )
@@ -629,10 +720,12 @@ public:
     {
       QWidget *hB = new QWidget( this );
       myPublishChk = new QCheckBox( tr("PUBLISH_IN_STUDY") );
+      myMultiFileChk = new QCheckBox( tr("MULTI_FILE_DUMP") );
       mySaveGUIChk = new QCheckBox( tr("SAVE_GUI_STATE") );
 
       QHBoxLayout *layout = new QHBoxLayout;
       layout->addWidget(myPublishChk);
+      layout->addWidget(myMultiFileChk);
       layout->addWidget(mySaveGUIChk);
       hB->setLayout(layout);
 
@@ -647,6 +740,7 @@ public:
     }
   }
   QCheckBox* myPublishChk;
+  QCheckBox* myMultiFileChk;
   QCheckBox* mySaveGUIChk;
 };
 
@@ -661,12 +755,10 @@ class DumpStudyFileValidator : public SUIT_FileValidator
 bool DumpStudyFileValidator::canSave(const QString& file, bool permissions)
 {
   QFileInfo fi( file );
-  QString name = fi.fileName(); 
-  
-  if ( name.indexOf( QRegExp("[-!?#*&]") ) >= 0 ) {
+  if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) {
     SUIT_MessageBox::critical( parent(),
-                              QObject::tr("WRN_WARNING"),
-                              QObject::tr("WRN_FILE_NAME_BAD") );
+                               QObject::tr("WRN_WARNING"),
+                               QObject::tr("WRN_FILE_NAME_BAD") );
     return false;
   }
   return SUIT_FileValidator::canSave( file, permissions);
@@ -682,40 +774,43 @@ void SalomeApp_Application::onDumpStudy( )
   QStringList aFilters;
   aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
 
+  bool anIsPublish = true;
+  bool anIsMultiFile = false;
+  bool anIsSaveGUI = true;
+
+  if ( SUIT_ResourceMgr* aResourceMgr = resourceMgr() ) {
+    anIsPublish   = aResourceMgr->booleanValue( "Study", "pydump_publish", anIsPublish );
+    anIsMultiFile = aResourceMgr->booleanValue( "Study", "multi_file_dump", anIsMultiFile );
+    anIsSaveGUI   = aResourceMgr->booleanValue( "Study", "pydump_save_gui", anIsSaveGUI );
+  }
+
   DumpStudyFileDlg fd( desktop() );
   fd.setValidator( new DumpStudyFileValidator( &fd ) );
   fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
   fd.setFilters( aFilters );
-  fd.myPublishChk->setChecked( true );
-  fd.mySaveGUIChk->setChecked( true );
+  fd.myPublishChk->setChecked( anIsPublish );
+  fd.myMultiFileChk->setChecked( anIsMultiFile );
+  fd.mySaveGUIChk->setChecked( anIsSaveGUI );
   if ( fd.exec() == QDialog::Accepted )
   {
     QString aFileName = fd.selectedFile();
-    
+
     bool toPublish = fd.myPublishChk->isChecked();
+    bool isMultiFile = fd.myMultiFileChk->isChecked();
     bool toSaveGUI = fd.mySaveGUIChk->isChecked();
-    
+
     if ( !aFileName.isEmpty() ) {
       QFileInfo aFileInfo(aFileName);
       if( aFileInfo.isDir() ) // IPAL19257
-       return;
-
-      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.absolutePath().toStdString(),
-                                   aFileInfo.baseName().toStdString(), toPublish);
-      if ( toSaveGUI )
-       appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
+        return;
+      
+      // Issue 21377 - dump study implementation moved to SalomeApp_Study class
+      bool res = appStudy->dump( aFileName, toPublish, isMultiFile, toSaveGUI );
+
       if ( !res )
-       SUIT_MessageBox::warning( desktop(),
-                                 QObject::tr("WRN_WARNING"),
-                                 tr("WRN_DUMP_STUDY_FAILED") );
+        SUIT_MessageBox::warning( desktop(),
+                                  QObject::tr("WRN_WARNING"),
+                                  tr("WRN_DUMP_STUDY_FAILED") );
     }
   }
 }
@@ -748,15 +843,15 @@ void SalomeApp_Application::onLoadScript( )
 
   if ( aStudy->GetProperties()->IsLocked() ) {
     SUIT_MessageBox::warning( desktop(),
-                             QObject::tr("WRN_WARNING"),
-                             QObject::tr("WRN_STUDY_LOCKED") );
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_STUDY_LOCKED") );
     return;
   }
 
   QStringList filtersList;
   filtersList.append(tr("PYTHON_FILES_FILTER"));
   filtersList.append(tr("ALL_FILES_FILTER"));
-  
+
   QString anInitialPath = "";
   if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
     anInitialPath = QDir::currentPath();
@@ -765,7 +860,7 @@ void SalomeApp_Application::onLoadScript( )
 
   if ( !aFile.isEmpty() )
   {
-    QString command = QString("execfile(\"%1\")").arg(aFile);
+    QString command = QString("execfile(r\"%1\")").arg(aFile);
 
     PyConsole_Console* pyConsole = pythonConsole();
 
@@ -781,8 +876,7 @@ void SalomeApp_Application::onSaveGUIState()
   if ( study ) {
     SalomeApp_VisualState( this ).storeState();
     updateSavePointDataObjects( study );
-    // temporary commented
-    //objectBrowser()->updateTree( study->root() );
+    updateObjectBrowser();
   }
   updateActions();
 }
@@ -810,6 +904,13 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
       // temporary commented
       //ob->setUpdater( new SalomeApp_Updater() );
 
+#ifdef WITH_SALOMEDS_OBSERVER
+      //do not activate the automatic update of Qt tree through signal/slot
+      ob->setAutoUpdate(false);
+      //activate update of modified objects only
+      ob->setUpdateModified(true);
+#endif
+
       connect( ob, SIGNAL( doubleClicked( SUIT_DataObject* ) ), this, SLOT( onDblClick( SUIT_DataObject* ) ) );
 
       QString
@@ -835,6 +936,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
       ob->setAutoSizeFirstColumn(autoSizeFirst);
       ob->setAutoSizeColumns(autoSize);
       ob->setResizeOnExpandItem(resizeOnExpandItem);
+      ob->setProperty( "shortcut", QKeySequence( "Alt+Shift+O" ) );
 
       // temporary commented
       /*
@@ -848,9 +950,9 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
 
       // temporary commented
       /*
-       ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
-       ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
-       ob->resize( desktop()->width()/3, ob->height() );
+        ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
+        ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
+        ob->resize( desktop()->width()/3, ob->height() );
       */
     }
   }
@@ -858,8 +960,11 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
   {
     PyConsole_Console* pyCons = new PyConsole_Console( desktop(), new SalomeApp_PyInterp() );
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
+    pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
+    pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
+    pyCons->setProperty( "shortcut", QKeySequence( "Alt+Shift+P" ) );
     wid = pyCons;
-    pyCons->resize( pyCons->width(), desktop()->height()/4 );
+    //pyCons->resize( pyCons->width(), desktop()->height()/4 );
     pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
   return wid;
@@ -876,10 +981,10 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref )
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
   int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
   int defCols = pref->addPreference( tr( "PREF_GROUP_DEF_COLUMNS" ), obTab );
-  for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+  for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
   {
-    pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-1 ).toLatin1() ), defCols,
-                         LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i ) );
+    pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-SalomeApp_DataObject::EntryId ).toLatin1() ), defCols,
+                         LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i-1 ) );
   }
   pref->setItemProperty( "orientation", Qt::Vertical, defCols );
 
@@ -887,6 +992,12 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref )
   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" );
+  pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
+  pref->addPreference( tr( "PREF_PYDUMP_PUBLISH" ), studyGroup, LightApp_Preferences::Bool, "Study", "pydump_publish" );
+  pref->addPreference( tr( "PREF_PYDUMP_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file_dump" );
+  pref->addPreference( tr( "PREF_PYDUMP_SAVE_GUI" ), studyGroup, LightApp_Preferences::Bool, "Study", "pydump_save_gui" );
+  pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
+  pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
 }
 
 /*!Update desktop title.*/
@@ -904,11 +1015,11 @@ void SalomeApp_Application::updateDesktopTitle() {
       if ( study ) {
         _PTR(Study) stdDS = study->studyDS();
         if(stdDS) {
-         if ( stdDS->GetProperties()->IsLocked() ) {
-           aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) );
-         } else {
-           aTitle += QString( " - [%1]" ).arg( sName );
-         }
+          if ( stdDS->GetProperties()->IsLocked() ) {
+            aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) );
+          } else {
+            aTitle += QString( " - [%1]" ).arg( sName );
+          }
         }
       }
     }
@@ -921,7 +1032,7 @@ int SalomeApp_Application::closeChoice( const QString& docName )
 {
   int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ),
                                           tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"),
-                                         tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
+                                          tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
 
   int res = CloseCancel;
   if ( answer == 0 )
@@ -962,27 +1073,30 @@ int SalomeApp_Application::openChoice( const QString& aName )
 {
   int choice = LightApp_Application::openChoice( aName );
 
-  if ( choice == OpenNew ) // The document isn't already open.
-  {
-    bool exist = false;
-    std::vector<std::string> lst = studyMgr()->GetOpenStudies();
-    for ( uint i = 0; i < lst.size() && !exist; i++ )
-    {
-      if ( aName == QString( lst[i].c_str() ) )
-        exist = true;
-    }
-
-    // The document already exists in the study manager.
-    // Do you want to reload it?
-    if ( exist )
-    {
-      int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ),
-                                             SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
-      if ( answer == SUIT_MessageBox::Yes )
-       choice = OpenRefresh;
-      else
-       choice = OpenCancel;
+  if ( QFileInfo( aName ).exists() ) {
+    if ( choice == OpenNew ) { // The document isn't already open.
+      bool exist = false;
+      std::vector<std::string> lst = studyMgr()->GetOpenStudies();
+      for ( uint i = 0; i < lst.size() && !exist; i++ ) {
+        if ( aName == QString( lst[i].c_str() ) )
+          exist = true;
+      }
+      // The document already exists in the study manager.
+      // Do you want to reload it?
+      if ( exist ) {
+        int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ),
+                                                SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
+        if ( answer == SUIT_MessageBox::Yes )
+          choice = OpenRefresh;
+        else
+          choice = OpenCancel;
+      }
     }
+  } else { // file is not exist on disk
+    SUIT_MessageBox::warning( desktop(),
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toLatin1().data()));
+    return false;
   }
 
   return choice;
@@ -999,8 +1113,8 @@ bool SalomeApp_Application::openAction( const int aChoice, const QString& aName
       _PTR(Study) aStudy = studyMgr()->GetStudyByName( aName.toStdString() );
       if ( aStudy )
       {
-       studyMgr()->Close( aStudy );
-       choice = OpenNew;
+        studyMgr()->Close( aStudy );
+        choice = OpenNew;
       }
     }
   default:
@@ -1029,7 +1143,8 @@ bool SalomeApp_Application::openAction( const int aChoice, const QString& aName
 QMap<int, QString> SalomeApp_Application::activateModuleActions() const
 {
   QMap<int, QString> opmap = LightApp_Application::activateModuleActions();
-  opmap.insert( LoadStudyId,  tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+  opmap.insert( LoadStudyId,     tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+  opmap.insert( NewAndScriptId,  tr( "ACTIVATE_MODULE_OP_SCRIPT" ) );
   return opmap;
 }
 
@@ -1044,10 +1159,17 @@ QMap<int, QString> SalomeApp_Application::activateModuleActions() const
 */
 void SalomeApp_Application::moduleActionSelected( const int id )
 {
-  if ( id == LoadStudyId )
+  switch ( id ) {
+  case LoadStudyId:
     onLoadDoc();
-  else
+    break;
+  case NewAndScriptId:
+    onNewWithScript();
+    break;
+  default:
     LightApp_Application::moduleActionSelected( id );
+    break;
+  }
 }
 
 /*!Gets CORBA::ORB_var*/
@@ -1069,29 +1191,15 @@ SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
 /*!Create and return SALOME_NamingService.*/
 SALOME_NamingService* SalomeApp_Application::namingService()
 {
-  static SALOME_NamingService* _ns = new SALOME_NamingService( orb() );
-  return _ns;
+  static SALOME_NamingService _ns(orb());
+  return &_ns;
 }
 
 /*!Create and return SALOME_LifeCycleCORBA.*/
 SALOME_LifeCycleCORBA* SalomeApp_Application::lcc()
 {
-  static SALOME_LifeCycleCORBA* _lcc = new SALOME_LifeCycleCORBA( namingService() );
-  return _lcc;
-}
-
-/*!Return default engine IOR for light modules*/
-QString SalomeApp_Application::defaultEngineIOR()
-{
-  /// Look for a default module engine (needed for CORBAless modules to use SALOMEDS persistence)
-  QString anIOR( "" );
-  CORBA::Object_ptr anEngine = namingService()->Resolve( "/SalomeAppEngine" );
-  if ( !CORBA::is_nil( anEngine ) )
-  {
-    CORBA::String_var objStr = orb()->object_to_string( anEngine );
-    anIOR = QString( objStr.in() );
-  }
-  return anIOR;
+  static SALOME_LifeCycleCORBA _lcc( namingService() );
+  return &_lcc;
 }
 
 /*!Private SLOT. On preferences.*/
@@ -1119,6 +1227,10 @@ void SalomeApp_Application::onProperties()
 /*!Insert items in popup, which necessary for current application*/
 void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
 {
+  LightApp_SelectionMgr* mgr = selectionMgr();
+  bool cacheIsOn = mgr->isSelectionCacheEnabled();
+  mgr->setSelectionCacheEnabled( true );
+
   LightApp_Application::contextMenuPopup( type, thePopup, title );
 
   // temporary commented
@@ -1128,7 +1240,6 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop
 
   // Get selected objects
   SALOME_ListIO aList;
-  LightApp_SelectionMgr* mgr = selectionMgr();
   mgr->selectedObjects( aList, QString(), false );
 
   // add GUI state commands: restore, rename
@@ -1136,7 +1247,8 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop
        QString( aList.First()->getEntry() ).startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) {
     thePopup->addSeparator();
     thePopup->addAction( tr( "MEN_RESTORE_VS" ), this, SLOT( onRestoreGUIState() ) );
-    thePopup->addAction( tr( "MEN_RENAME_VS" ),  this, SLOT( onRenameGUIState() ) );
+    thePopup->addAction( tr( "MEN_RENAME_VS" ),  objectBrowser(),
+                         SLOT( onStartEditing() ), objectBrowser()->shortcutKey(SUIT_DataBrowser::RenameShortcut) );
     thePopup->addAction( tr( "MEN_DELETE_VS" ),  this, SLOT( onDeleteGUIState() ) );
   }
 
@@ -1153,10 +1265,10 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop
     {
       _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
       while( aRefObj && aRefObj->ReferencedObject( anObj ) )
-       aRefObj = anObj;
+        aRefObj = anObj;
 
       if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
-       isInvalidRefs = true;
+        isInvalidRefs = true;
     }
 
   // Add "Delete reference" item to popup
@@ -1167,24 +1279,49 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop
     return;
   }
 
-  aList.Clear();
-  mgr->selectedObjects( aList );
-
   // "Activate module" item should appear only if it's necessary
-  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();
-  if (currentModule && currentModule->moduleName() == aModuleTitle)
-    return;
-  if ( !aModuleTitle.isEmpty() )
-    thePopup->addAction( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
+  if ( aList.Extent() == 1 ) {
+    aList.Clear();
+    mgr->selectedObjects( aList );
+
+    Handle(SALOME_InteractiveObject) aIObj = aList.First();
+
+    // add extra popup menu (defined in XML)
+    if ( myExtActions.size() > 0 ) {
+      // Use only first selected object
+      SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+      if ( study ) {
+       _PTR(Study) stdDS = study->studyDS();
+       if ( stdDS ) {
+         _PTR(SObject) aSO = stdDS->FindObjectID( aIObj->getEntry() );
+         if ( aSO ) {
+           _PTR( GenericAttribute ) anAttr;
+           std::string auid = "AttributeUserID";
+           auid += Kernel_Utils::GetGUID(Kernel_Utils::ObjectdID);
+           if ( aSO->FindAttribute( anAttr, auid ) ) {
+             _PTR(AttributeUserID) aAttrID = anAttr;
+             QString aId = aAttrID->Value().c_str();
+             if ( myExtActions.contains( aId ) ) {
+               thePopup->addAction(myExtActions[aId]);
+             }
+           }
+         }
+       }
+      }
+    }
+
+    // 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" ) ) ) {
+      QString aModuleName( aIObj->getComponentDataType() );
+      QString aModuleTitle = moduleTitle( aModuleName );
+      CAM_Module* currentModule = activeModule();
+      if ( ( !currentModule || currentModule->moduleName() != aModuleTitle ) && !aModuleTitle.isEmpty() )
+       thePopup->addAction( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
+    }
+  }
+
+  mgr->setSelectionCacheEnabled( cacheIsOn );
 }
 
 /*!Update obect browser:
@@ -1202,16 +1339,19 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
     {
       for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() )
       {
-       _PTR(SComponent) aComponent ( it->Value() );
-
-       if ( aComponent->ComponentDataType() == "Interface Applicative" )
-         continue; // skip the magic "Interface Applicative" component
+        _PTR(SComponent) aComponent ( it->Value() );
 
-        getWindow( WT_ObjectBrowser );
-       const bool isAutoUpdate = objectBrowser()->autoUpdate();
-       objectBrowser()->setAutoUpdate( false );
-       SalomeApp_DataModel::synchronize( aComponent, study );
-       objectBrowser()->setAutoUpdate( isAutoUpdate );
+#ifndef WITH_SALOMEDS_OBSERVER
+        // with GUI observers this check is not needed anymore
+        if ( aComponent->ComponentDataType() == study->getVisualComponentName().toLatin1().constData() )
+          continue; // skip the magic "Interface Applicative" component
+#endif
+        if ( !objectBrowser() )
+          getWindow( WT_ObjectBrowser );
+        const bool isAutoUpdate = objectBrowser()->autoUpdate();
+        objectBrowser()->setAutoUpdate( false );
+        SalomeApp_DataModel::synchronize( aComponent, study );
+        objectBrowser()->setAutoUpdate( isAutoUpdate );
       }
     }
   }
@@ -1243,28 +1383,22 @@ void SalomeApp_Application::onRegDisplay()
 /*!find original object by double click on item */
 void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj )
 {
-  SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( theObj );
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+  // Issue 21379: References are supported at LightApp_DataObject level
+  LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( theObj );
 
-  if( study && obj )
+  if( obj && obj->isReference() )
   {
-    QString entry = obj->entry();
-    _PTR(SObject) sobj = study->studyDS()->FindObjectID( entry.toStdString() ), ref;
+    QString entry = obj->refEntry();
 
-    if( sobj && sobj->ReferencedObject( ref ) )
-    {
-      entry = ref->GetID().c_str();
-      
-      SUIT_DataOwnerPtrList aList;
-      aList.append( new LightApp_DataOwner( entry ) );
-      selectionMgr()->setSelected( aList, false );
+    SUIT_DataOwnerPtrList aList;
+    aList.append( new LightApp_DataOwner( entry ) );
+    selectionMgr()->setSelected( aList, false );
+    
+    SUIT_DataBrowser* ob = objectBrowser();
 
-      SUIT_DataBrowser* ob = objectBrowser();
-      
-      QModelIndexList aSelectedIndexes = ob->selectedIndexes();
-      if ( !aSelectedIndexes.isEmpty() )
-       ob->treeView()->scrollTo( aSelectedIndexes.first() );
-    }
+    QModelIndexList aSelectedIndexes = ob->selectedIndexes();
+    if ( !aSelectedIndexes.isEmpty() )
+      ob->treeView()->scrollTo( aSelectedIndexes.first() );
   }
 }
 
@@ -1283,14 +1417,17 @@ 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;
+  if( aList.Extent() > 0 ) {
+    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;
+  }
+  return -1;
 }
 
 /*!Called on Restore GUI State popup command*/
@@ -1302,26 +1439,6 @@ void SalomeApp_Application::onRestoreGUIState()
   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<SalomeApp_Study*>( activeStudy() );
-  if ( !study )
-    return;
-
-  QString newName = LightApp_NameDlg::getName( desktop(), study->getNameOfSavePoint( savePoint ) );
-  if ( !newName.isNull() && !newName.isEmpty() ) {
-    study->setNameOfSavePoint( savePoint, newName );
-    updateSavePointDataObjects( study );
-    // temporary commented
-    //objectBrowser()->updateTree( study->root() );
-  }
-}
-
-
 /*!Called on Delete GUI State popup command*/
 void SalomeApp_Application::onDeleteGUIState()
 {
@@ -1341,6 +1458,10 @@ void SalomeApp_Application::onStudyCreated( SUIT_Study* study )
 {
   LightApp_Application::onStudyCreated( study );
 
+  connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+           this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
+
+
   objectBrowserColumnsVisibility();
 }
 
@@ -1361,6 +1482,9 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 {
   LightApp_Application::onStudyOpened( study );
 
+  connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+           this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
+
   objectBrowserColumnsVisibility();
 
   // temporary commented
@@ -1373,10 +1497,11 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study )
 /*! updateSavePointDataObjects: syncronize data objects that correspond to save points (gui states)*/
 void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
 {
-  // temporary commented
-  //OB_Browser* ob = objectBrowser();
 
-  if ( !study /*|| !ob */) // temporary commented
+  SUIT_DataBrowser* ob = objectBrowser();
+  LightApp_SelectionMgr* selMgr = selectionMgr();
+
+  if ( !study || !ob || !selMgr ) 
     return;
 
   // find GUI states root object
@@ -1393,7 +1518,16 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
   std::vector<int> savePoints = study->getSavePoints();
   // case 1: no more save points but they existed in study's tree
   if ( savePoints.empty() && guiRootObj ) {
+    //rnv : to fix bug "IPAL22450 TC6.3.0: sigsegv loop deleting the GUI state"
+    //    : set auto update to true for removing SalomeApp_SavePointRootObject from the SUIT_TreeModel
+    const bool isAutoUpdate = ob->autoUpdate();
+    selMgr->clearSelected();
+    ob->setAutoUpdate(true);
+    DataObjectList ch = guiRootObj->children();
+    for( int i = 0; i < ch.size(); i++ ) 
+      delete ch[i];
     delete guiRootObj;
+    ob->setAutoUpdate(isAutoUpdate);
     return;
   }
   // case 2: no more save points but root does not exist either
@@ -1430,8 +1564,16 @@ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
       mapDO.remove( savePoints[i] );
 
   // delete DataObjects that are still in the map -- their IDs were not found in data model
-  for ( QMap<int,SalomeApp_SavePointObject*>::Iterator it = mapDO.begin(); it != mapDO.end(); ++it )
-    delete it.value();
+  if( mapDO.size() > 0) {
+    //rnv : to fix bug "IPAL22450 TC6.3.0: sigsegv loop deleting the GUI state"
+    //    : set auto update to true for removing SalomeApp_SavePointObject from the SUIT_TreeModel
+    selMgr->clearSelected();
+    const bool isAutoUpdate = ob->autoUpdate();
+    ob->setAutoUpdate(true);
+    for ( QMap<int,SalomeApp_SavePointObject*>::Iterator it = mapDO.begin(); it != mapDO.end(); ++it )
+      delete it.value();
+    ob->setAutoUpdate(isAutoUpdate);
+  }
 }
 
 /*! Check data object */
@@ -1443,15 +1585,6 @@ bool SalomeApp_Application::checkDataObject(LightApp_DataObject* theObj)
   return false;
 }
 
-/*! Process standard messages from desktop */
-void SalomeApp_Application::onDesktopMessage( const QString& message )
-{
-  // update object browser
-  if ( message.toLower() == "updateobjectbrowser" ||
-       message.toLower() == "updateobjbrowser" )
-    updateObjectBrowser();
-}
-
 /*!
   Opens other study into active Study. If Study is empty - creates it.
   \param theName - name of study
@@ -1472,9 +1605,9 @@ bool SalomeApp_Application::useStudy( const QString& theName )
 void SalomeApp_Application::objectBrowserColumnsVisibility()
 {
   if ( objectBrowser() )
-    for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+    for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
     {
-      bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i ), true );
+      bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i-1 ), true );
       objectBrowser()->treeView()->setColumnHidden( i, !shown );
     }
 }
@@ -1490,3 +1623,203 @@ SalomeApp_NoteBookDlg* SalomeApp_Application::getNoteBook() const
   return myNoteBook;
 }
 
+/*!
+ * Define extra actions defined in module definition XML file.
+ * Additional popup items sections can be defined by parameter "popupitems".
+ * Supported attributes:
+ * title - title of menu item,
+ * attributelocalid - AttributeLocalId defined for selected data item where menu command has to be applied,
+ * method - method which has to be called when menu item is selected
+ * Example:
+ * <section name="MODULENAME">
+ *   <parameter name="popupitems" value="menuitem1:menuitem2:..."/>
+ * </section>
+ * <section name="importmed">
+ *   <parameter name="title" value="My menu"/>
+ *   <parameter name="objectid" value="VISU.Result"/>
+ *   <parameter name="method" value="nameOfModuleMethod"/>
+ * </section>
+ */
+void SalomeApp_Application::createExtraActions()
+{
+  myExtActions.clear();
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+  QStringList aModules;
+  modules(aModules, false);
+  foreach(QString aModile, aModules) {
+    QString aModName = moduleName(aModile);
+    QString aSectionStr = resMgr->stringValue(aModName, "popupitems", QString());
+    if (!aSectionStr.isNull()) {
+      QStringList aSections = aSectionStr.split(':');
+      foreach(QString aSection, aSections) {
+        QString aTitle = resMgr->stringValue(aSection, "title",    QString());
+        QString aId    = resMgr->stringValue(aSection, "objectid", QString());
+        QString aSlot  = resMgr->stringValue(aSection, "method",   QString());
+        if (aTitle.isEmpty() || aSlot.isEmpty() || aId.isEmpty())
+          continue;
+
+        QString aModuleName = resMgr->stringValue(aSection, "module", QString());
+        if (aModuleName.isNull())
+          aModuleName = aModName;
+
+        QAction* aAction = new QAction(aTitle, this);
+        QStringList aData;
+        aData<<aModuleName<<aSlot;
+        aAction->setData(aData);
+        connect(aAction, SIGNAL(triggered()), this, SLOT(onExtAction()));
+        myExtActions[aId] = aAction;
+      }
+    }
+  }
+}
+
+/*!
+ * Called when extra action is selected
+ */
+void SalomeApp_Application::onExtAction()
+{
+  QAction* aAction = ::qobject_cast<QAction*>(sender());
+  if (!aAction)
+    return;
+
+  QVariant aData = aAction->data();
+  QStringList aDataList = aData.value<QStringList>();
+  if (aDataList.size() != 2)
+    return;
+
+  LightApp_SelectionMgr* aSelectionMgr = selectionMgr();
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+  const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+  if (aListIO.Extent() < 1)
+    return;
+  if (!anIO->hasEntry())
+    return;
+
+  QString aEntry(anIO->getEntry());
+
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  QString aModuleTitle = moduleTitle(aDataList[0]);
+  activateModule(aModuleTitle);
+  QApplication::restoreOverrideCursor();
+
+  QCoreApplication::processEvents();
+
+  CAM_Module* aModule = activeModule();
+  if (!aModule)
+    return;
+
+  if (!QMetaObject::invokeMethod(aModule, qPrintable(aDataList[1]), Q_ARG(QString, aEntry)))
+    printf("Error: Can't Invoke method %s\n", qPrintable(aDataList[1]));
+}
+
+/*!
+ * Called when window activated
+ */
+void SalomeApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow )
+{
+  SUIT_DataBrowser* anOB = objectBrowser();
+  if( !anOB )
+    return;
+  SUIT_DataObject* rootObj = anOB->root();
+  if( !rootObj )
+    return;
+
+  DataObjectList listObj = rootObj->children( true );
+
+  SUIT_ViewModel* vmod = 0;
+  if ( SUIT_ViewManager* vman = theViewWindow->getViewManager() )
+    vmod = vman->getViewModel();
+  updateVisibilityState( listObj, vmod );
+}
+
+/*!
+  Update visibility state of given objects
+ */
+void SalomeApp_Application::updateVisibilityState( DataObjectList& theList,
+                                                   SUIT_ViewModel*  theViewModel )
+{
+  LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+
+  if(!theViewModel)
+    return;
+
+  SALOME_View* aView = dynamic_cast<SALOME_View*>( theViewModel );
+
+  if (theList.isEmpty() || !aView || !aStudy)
+    return;
+
+  for ( DataObjectList::iterator itr = theList.begin(); itr != theList.end(); ++itr ) {
+    LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>(*itr);
+
+    if (!obj || aStudy->isComponent(obj->entry()))
+      continue;
+
+    LightApp_Module* anObjModule = dynamic_cast<LightApp_Module*>(obj->module());
+    Qtx::VisibilityState anObjState = Qtx::UnpresentableState;
+
+    if(anObjModule) {
+      LightApp_Displayer* aDisplayer = anObjModule->displayer();
+      if(aDisplayer) {
+        if( aDisplayer->canBeDisplayed(obj->entry(), theViewModel->getType()) ) {
+          if(aDisplayer->IsDisplayed(obj->entry(),aView))
+            anObjState = Qtx::ShownState;
+          else
+            anObjState = Qtx::HiddenState;
+        }
+      }
+      aStudy->setVisibilityState( obj->entry(), anObjState );
+    }
+  }
+}
+
+/*!
+  Called then view manager removed
+*/
+void SalomeApp_Application::onViewManagerRemoved( SUIT_ViewManager* )
+{
+  ViewManagerList lst;
+  viewManagers(lst);
+  if( lst.count() == 1) { // in case if closed last view window
+    LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+    if(aStudy)
+      aStudy->setVisibilityStateForAll(Qtx::UnpresentableState);
+  }
+}
+
+/*!
+  Checks that an object can be renamed.
+  \param entry entry of the object
+  \brief Return \c true if object can be renamed
+*/
+bool SalomeApp_Application::renameAllowed( const QString& entry) const
+{
+  return entry.startsWith( tr( "SAVE_POINT_DEF_NAME") );
+}
+
+/*!
+  Rename object by entry.
+  \param entry entry of the object
+  \param name new name of the object
+  \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool SalomeApp_Application::renameObject( const QString& entry, const QString& name )
+{
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+
+  int savePoint = ::getSelectedSavePoint( selectionMgr() );
+
+  if(!aStudy || savePoint == -1)
+    return false;
+
+  if ( !name.isNull() && !name.isEmpty() ) {
+    aStudy->setNameOfSavePoint( savePoint, name );
+    updateSavePointDataObjects( aStudy );
+
+    //Mark study as modified
+    aStudy->Modified();
+    return true;
+  }
+  return false;
+}
index 3f18e68067473e948c30b132ccdfd585d141527e..c72468cfee188eb7932b69c2992322d3c33c790b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
@@ -33,6 +34,8 @@
 #include "SalomeApp.h"
 #include <LightApp_Application.h>
 
+#include <SUIT_DataObject.h>
+
 #include <CORBA.h>
 
 //#include <SALOMEconfig.h>
@@ -44,8 +47,9 @@
 class LightApp_Preferences;
 class SalomeApp_Study;
 class SalomeApp_NoteBookDlg;
-class SUIT_DataObject;
+class SUIT_Desktop;
 
+class SUIT_ViewModel;
 class SALOME_LifeCycleCORBA;
 
 
@@ -70,7 +74,7 @@ public:
 protected:
   enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
   enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
-  enum { LoadStudyId = LightApp_Application::OpenStudyId + 1 };
+  enum { LoadStudyId = LightApp_Application::OpenStudyId + 1, NewAndScriptId };
 
 public:
   SalomeApp_Application();
@@ -86,11 +90,12 @@ public:
 
   virtual bool                        checkDataObject(LightApp_DataObject* theObj);
 
+  virtual void                        setDesktop( SUIT_Desktop* );
+
   static CORBA::ORB_var               orb();
   static SALOMEDSClient_StudyManager* studyMgr();
   static SALOME_NamingService*        namingService();
   static SALOME_LifeCycleCORBA*       lcc();
-  static QString                      defaultEngineIOR();
 
   SUIT_ViewManager*                   newViewManager(const QString&);
   void                                updateSavePointDataObjects( SalomeApp_Study* );
@@ -103,8 +108,16 @@ public:
   virtual void                        setNoteBook(SalomeApp_NoteBookDlg* theNoteBook);
   virtual SalomeApp_NoteBookDlg*      getNoteBook() const;
 
+ //! update visibility state of objects
+  void                                updateVisibilityState( DataObjectList& theList,
+                                                             SUIT_ViewModel* theViewModel );  
+
+  virtual bool                        renameAllowed( const QString& ) const;
+  virtual bool                        renameObject( const QString&, const QString& );
+  
 public slots:
   virtual void                        onLoadDoc();
+  virtual void                        onNewWithScript();
   virtual bool                        onLoadDoc( const QString& );
   virtual void                        onCloseDoc( bool ask = true);
 
@@ -117,7 +130,9 @@ protected slots:
   void                                onStudyCreated( SUIT_Study* );
   void                                onStudySaved( SUIT_Study* );
   void                                onStudyOpened( SUIT_Study* );
-  void                                onDesktopMessage( const QString& );
+  void                                onStudyClosed( SUIT_Study* );
+  
+  void                                onViewManagerRemoved( SUIT_ViewManager* );
 
 protected:
   virtual void                        createActions();
@@ -150,14 +165,20 @@ private slots:
 
   void                                onDeleteGUIState();
   void                                onRestoreGUIState();
-  void                                onRenameGUIState();
 
   void                                onCatalogGen();
   void                                onRegDisplay();
   void                                onOpenWith();
+  void                                onExtAction();
+
+  void                                onWindowActivated( SUIT_ViewWindow* theViewWindow );
+
+private:
+  void                                createExtraActions();
 
- private:
-  SalomeApp_NoteBookDlg*             myNoteBook;
+private:
+  SalomeApp_NoteBookDlg*              myNoteBook;
+  QMap<QString, QAction*>             myExtActions; // Map <AttributeUserID, QAction>
 };
 
 #ifdef WIN32
index f9016a68c7005d2dd3ca886e5ec6649e8d1831f8..bfd35cc561ace76d3a01dca273eb5163bb0bd0b3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_CheckFileDlg.h"
 
 #include <QCheckBox>
index 74e857b6b6ca4fc72f05740c3eeca84e1a1f1383..4499ba9f96f9b55f71a7531034fe6728e530abff 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_CHECKFILEDIALOG_H
 #define SALOMEAPP_CHECKFILEDIALOG_H
 
index 381dc68aee29b99aa58460eda4a84ab48fc65a81..fc93fddf0aea1a2e4eb1e6e3060d450870de812e 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_DataObject.h"
@@ -81,6 +82,10 @@ SalomeApp_DataModelSync::SalomeApp_DataModelSync( _PTR( Study ) aStudy, SUIT_Dat
 */
 bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const
 {
+#ifdef WITH_SALOMEDS_OBSERVER
+  // with GUI observers this function is not needed anymore
+  return true;
+#endif
   kerPtr refObj;
   QString name = so->GetName().c_str();
   _PTR( GenericAttribute ) anAttr;
@@ -102,8 +107,8 @@ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const
   \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
+                                             const suitPtr& parent,
+                                             const suitPtr& after ) const
 {
   if( !isCorrect( so ) )
     return 0;
@@ -111,6 +116,7 @@ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so,
   _PTR(SComponent) aSComp( so );
   suitPtr nitem = aSComp ? new SalomeApp_ModuleObject( aSComp, 0 ) :
                            new SalomeApp_DataObject( so, 0 );
+
   if( parent ) {
     int pos = after ? parent->childPos( after ) : 0;
     parent->insertChild( nitem, pos+1 );
@@ -150,7 +156,7 @@ bool SalomeApp_DataModelSync::isEqual( const kerPtr& p, const suitPtr& q ) const
   _PTR( SComponent ) aComp( p );
   bool res = ( !p && !q ) ||
              ( lobj && !sobj && aComp ) ||
-            ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() );
+             ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() );
   return res;
 }
 
@@ -179,9 +185,28 @@ QList<kerPtr> SalomeApp_DataModelSync::children( const kerPtr& obj ) const
 {
   QList<kerPtr> ch;
 
-  _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) );
-  for( ; it->More(); it->Next() )
-    ch.append( it->Value() );
+  _PTR( GenericAttribute ) anAttr;
+  bool expandable = true;
+  if ( obj && obj->FindAttribute( anAttr, "AttributeExpandable" ) ) {
+    _PTR(AttributeExpandable) aAttrExp = anAttr;
+    expandable = aAttrExp->IsExpandable();
+  }
+
+  if ( expandable ) {
+    // tmp??
+    _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder();
+    if (aUseCaseBuilder->HasChildren(obj)) {
+      _PTR(UseCaseIterator) it ( aUseCaseBuilder->GetUseCaseIterator( obj ) );
+      for ( ; it->More(); it->Next() )
+        ch.append( it->Value() );
+    }
+    else {
+      _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) );
+      for ( ; it->More(); it->Next() )
+        ch.append( it->Value() );
+    }
+  }
+
   return ch;
 }
 
@@ -296,8 +321,8 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study )
       studyRoot = dynamic_cast<LightApp_RootObject*>( aSStudy->root() );
       QString anId = getRootEntry( aSStudy );
       if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing
-       _PTR(Study) aStudy ( aSStudy->studyDS() );
-       sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
+        _PTR(Study) aStudy ( aSStudy->studyDS() );
+        sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
       }
     }
   }
@@ -337,12 +362,20 @@ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sob
     }
   }
 
+#ifdef WITH_SALOMEDS_OBSERVER
+  SalomeApp_RootObject* root=dynamic_cast<SalomeApp_RootObject*>(study->root());
+  if(!(root->toSynchronize()))
+    return suitObj;
+#endif
+
   SalomeApp_DataModelSync sync( study->studyDS(), study->root() );
 
   if( !suitObj || dynamic_cast<SalomeApp_DataObject*>( suitObj ) )
-    return ::synchronize<kerPtr,suitPtr,SalomeApp_DataModelSync>( sobj, suitObj, sync );
+    suitObj= ::synchronize<kerPtr,suitPtr,SalomeApp_DataModelSync>( sobj, suitObj, sync );
   else
-    return 0;
+    suitObj= 0;
+
+  return suitObj;
 }
 
 /*!
index 53b2f701c48bb76d8107f1207501c23a37e27c4e..596c7d9fb5df644596d99df564dfcd6a540d62dd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
index 72fd38592ca6ee8f4a07ecc0add14157f2762cd6..796539f80ce102d42b377175f31555728e82f4b6 100644 (file)
@@ -1,27 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 // File   : SalomeApp_DataObject.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #include "SalomeApp_DataObject.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
@@ -60,7 +60,7 @@ SalomeApp_DataObject::SalomeApp_DataObject( SUIT_DataObject* parent )
   \param parent parent data object
 */
 SalomeApp_DataObject::SalomeApp_DataObject( const _PTR(SObject)& sobj, 
-                                           SUIT_DataObject* parent )
+                                            SUIT_DataObject* parent )
 : CAM_DataObject( parent ),
   LightApp_DataObject( parent )
 {
@@ -125,7 +125,7 @@ QString SalomeApp_DataObject::text( const int id ) const
 {
   QString txt;
 
-  // add "Value", "IOR", and "Reference Entry" columns
+  // Text for "Value" and "IOR" columns
   switch ( id )
   {
   case ValueId:
@@ -136,16 +136,14 @@ QString SalomeApp_DataObject::text( const int id ) const
 #endif
       txt = value( object() );
       if ( txt.isEmpty() )
-       txt = value( referencedObject() );
+        txt = value( referencedObject() );
     break;
   case IORId:
     txt = ior( referencedObject() );
     break;
-  case RefEntryId :
-    if ( isReference() )
-      txt = entry( referencedObject() );
-    break;
   default:
+    // Issue 21379: LightApp_DataObject::text() treats "Entry"
+    // and "Reference Entry" columns
     txt = LightApp_DataObject::text( id );
     break;
   }
@@ -165,20 +163,20 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const
     if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){
       _PTR(AttributePixMap) aPixAttr ( anAttr );
       if ( aPixAttr->HasPixMap() ) {
-       QString componentType = componentDataType();
-       QString pixmapID      = aPixAttr->GetPixMap().c_str();
-       // select a plugin within a component
-       QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
-       if ( plugin_pixmap.size() == 2 ) {
-         componentType = plugin_pixmap.front();
-         pixmapID      = plugin_pixmap.back();
-       }
-       QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
-       LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
-       if ( aRoot && aRoot->study() ) {
-         SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
-         return mgr->loadPixmap( componentType, pixmapName, false ); 
-       }
+        QString componentType = componentDataType();
+        QString pixmapID      = aPixAttr->GetPixMap().c_str();
+        // select a plugin within a component
+        QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
+        if ( plugin_pixmap.size() == 2 ) {
+          componentType = plugin_pixmap.front();
+          pixmapID      = plugin_pixmap.back();
+        }
+        QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
+        LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+        if ( aRoot && aRoot->study() ) {
+          SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
+          return mgr->loadPixmap( componentType, pixmapName, false ); 
+        }
       }
     }
   }
@@ -202,47 +200,44 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const
   case Foreground:
     // text color (not selected item)
     if ( isReference() ) {
-      if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
-       c = QColor( 255, 0, 0 );      // valid reference (red)
-      else
-       c = QColor( 200, 200, 200 );  // invalid reference (grayed)
+      if ( QString(referencedObject()->GetName().c_str()).isEmpty() )
+        c = QColor( 200, 200, 200 );  // invalid reference (grayed)
     }
     else if ( myObject ) {
       // get color atrtribute value
       _PTR(GenericAttribute) anAttr;
       if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) ) {
-       _PTR(AttributeTextColor) aColAttr = anAttr;
-       c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
+        _PTR(AttributeTextColor) aColAttr = anAttr;
+        c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
       }
     }
     break;
+
   case Highlight:
     // background color for the highlighted item
     if ( isReference() ) {
-      if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
-       c = QColor( 255, 0, 0 );      // valid reference (red)
-      else
-       c = QColor( 200, 200, 200 );  // invalid reference (grayed)
+      if ( QString(referencedObject()->GetName().c_str()).isEmpty() )
+        c = QColor( 200, 200, 200 );  // invalid reference (grayed)
     }
     else if ( myObject ) {
       // get color atrtribute value
       _PTR(GenericAttribute) anAttr;
       if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) {
         _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr;
-       c = QColor( (int)(aHighColAttr->TextHighlightColor().R), 
-                   (int)(aHighColAttr->TextHighlightColor().G), 
-                   (int)(aHighColAttr->TextHighlightColor().B));
+        c = QColor( (int)(aHighColAttr->TextHighlightColor().R), 
+                    (int)(aHighColAttr->TextHighlightColor().G), 
+                    (int)(aHighColAttr->TextHighlightColor().B));
       }
     }
     break;
-  case HighlightedText:
-    // text color for the highlighted item
-    if ( isReference() )
-      c = QColor( 255, 255, 255 );   // white
+  default:
     break;
   }
+
+  // Issue 21379: LightApp_DataObject::color() defines colors for valid references
   if ( !c.isValid() )
     c = LightApp_DataObject::color( role, id );
+
   return c;
 }
 
@@ -269,13 +264,13 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const
       //     with any container name, on every machine available
       Engines::MachineParameters params;
       app->lcc()->preSet(params); // --- any container name, anywhere
-      Engines::Component_var aComponent =
+      Engines::EngineComponent_var aComponent =
         app->lcc()->FindComponent(params, componentDataType().toLatin1().constData() );
       
       if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) {
-       LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
-       if ( aRoot && aRoot->study() )
-         return QString( aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) );
+        LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+        if ( aRoot && aRoot->study() )
+          return QString( (CORBA::String_var)aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) );
       }
     }
   }
@@ -283,6 +278,23 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const
   return QString( "Object \'%1\', module \'%2\', ID=%3" ).arg( name() ).arg( componentDataType() ).arg( entry() );
 }
 
+/*!
+  \brief Get font to be used for data object rendering in the item views
+  \param id column id
+  \return font to be used for the item rendering
+*/
+QFont SalomeApp_DataObject::font( const int id ) const
+{
+  QFont f = LightApp_DataObject::font( id );
+  if ( id == NameId ) {
+    if ( !expandable() && hasChildren() ) {
+      // set bold font to highlight the item which is non-expandable but has children
+      f.setBold( true );
+    }
+  }
+  return f;
+}
+
 /*!
   \brief Get component type.
   \return component type
@@ -312,8 +324,23 @@ _PTR(SObject) SalomeApp_DataObject::object() const
   return myObject;
 }
 
+/*!
+  \brief Returns the string identifier of the data objects referenced by this one.
+
+  Re-implemented from LightApp_DataObject using SALOMEDS API.
+
+  \return ID string of the referenced SObject
+*/
+QString SalomeApp_DataObject::refEntry() const
+{
+  return entry( referencedObject() );
+}
+
 /*!
   \brief Check if the data object is a reference.
+
+  Re-implemented from LightApp_DataObject using SALOMEDS API.
+
   \return \c true if this data object actually refers to another one
 */
 bool SalomeApp_DataObject::isReference() const
@@ -341,6 +368,65 @@ _PTR(SObject) SalomeApp_DataObject::referencedObject() const
   return obj;
 }
 
+/*!
+  \brief Check if object has children
+  \return \c true if object has at least one child sub-object and \c false otherwise
+*/
+bool SalomeApp_DataObject::hasChildren() const
+{
+  bool ok = false;
+
+  // tmp??
+  _PTR(UseCaseBuilder) aUseCaseBuilder = myObject->GetStudy()->GetUseCaseBuilder();
+  if (aUseCaseBuilder->IsUseCaseNode(myObject)) {
+    ok = aUseCaseBuilder->HasChildren(myObject);
+    // TODO: check name as below?
+  }
+  else {
+    _PTR(ChildIterator) it ( myObject->GetStudy()->NewChildIterator( myObject ) );
+    for ( ; it->More() && !ok; it->Next() ) {
+      _PTR(SObject) obj = it->Value();
+      if ( obj ) {
+        _PTR(SObject) refObj;
+        //if ( obj->ReferencedObject( refObj ) ) continue; // omit references
+        if ( obj->GetName() != "" ) ok = true;
+      }
+    }
+  }
+  return ok;
+}
+
+/*!
+  \brief Check if the object is expandable (e.g. in the data tree view)
+  \return \c true if object is expandable and \c false otherwise
+*/
+bool SalomeApp_DataObject::expandable() const
+{
+  bool exp = true;
+  _PTR(GenericAttribute) anAttr;
+  if ( myObject && myObject->FindAttribute( anAttr, "AttributeExpandable" ) ) {
+    _PTR(AttributeExpandable) aAttrExp = anAttr;
+    exp = aAttrExp->IsExpandable();
+  }
+  return exp;
+}
+
+/*!
+  \brief Check if the object is visible.
+  \return \c true if this object is displayable or \c false otherwise
+*/
+bool SalomeApp_DataObject::isVisible() const
+{
+  bool isDraw = true;
+  _PTR(GenericAttribute) anAttr;
+  if ( myObject && myObject->FindAttribute(anAttr, "AttributeDrawable") ) 
+  {
+    _PTR(AttributeDrawable) aAttrDraw = anAttr;
+    isDraw = aAttrDraw->IsDrawable(); 
+  }
+  return isDraw && LightApp_DataObject::isVisible() && ( !name().isEmpty() || isReference() );
+}
+
 /*!
   \brief Check if the specified column supports custom sorting.
   \param id column id
@@ -389,8 +475,8 @@ QString SalomeApp_DataObject::ior( const _PTR(SObject)& obj ) const
       _PTR(AttributeIOR) iorAttr = attr;
       if ( iorAttr )
       {
-       std::string str = iorAttr->Value();
-       txt = QString( str.c_str() );
+        std::string str = iorAttr->Value();
+        txt = QString( str.c_str() );
       }
     }
   }
@@ -440,28 +526,28 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
       {
         _PTR(Study) studyDS( aStudy->studyDS() );
 
-       bool ok = false;
-       QStringList aSectionList = aStrings.split( "|" );
-       if ( !aSectionList.isEmpty() )
-       {
-         QString aLastSection = aSectionList.last();
-         QStringList aStringList = aLastSection.split( ":" );
-         if ( !aStringList.isEmpty() )
-         {
-           ok = true;
-           for ( int i = 0, n = aStringList.size(); i < n; i++ )
-           {
-             QString aStr = aStringList[i];
-             if ( studyDS->IsVariable( aStr.toStdString() ) )
-               val.append( aStr + ", " );
-           }
-
-           if ( !val.isEmpty() )
-             val.remove( val.length() - 2, 2 );
-         }
-       }
-       if( !ok )
-         val = aStrings;
+        bool ok = false;
+        QStringList aSectionList = aStrings.split( "|" );
+        if ( !aSectionList.isEmpty() )
+        {
+          QString aLastSection = aSectionList.last();
+          QStringList aStringList = aLastSection.split( ":" );
+          if ( !aStringList.isEmpty() )
+          {
+            ok = true;
+            for ( int i = 0, n = aStringList.size(); i < n; i++ )
+            {
+              QString aStr = aStringList[i];
+              if ( studyDS->IsVariable( aStr.toStdString() ) )
+                val.append( aStr + ", " );
+            }
+
+            if ( !val.isEmpty() )
+              val.remove( val.length() - 2, 2 );
+          }
+        }
+        if( !ok )
+          val = aStrings;
       }
     }
   }
@@ -505,6 +591,27 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
   return val;
 }
 
+void SalomeApp_DataObject::insertChildAtTag( SalomeApp_DataObject* obj, int tag )
+{
+  int pos = 0;
+  int npos = qMin( tag-1,childCount() );
+  for ( int i = npos; i > 0; i-- )
+  {
+    if ( (dynamic_cast<SalomeApp_DataObject*>( childObject( i-1 ) ) )->object()->Tag() < tag )
+    {
+      pos = i;
+      break;
+    }
+  }
+  insertChildAtPos( obj, pos );
+}
+
+void SalomeApp_DataObject::updateItem()
+{
+  if ( modified() ) return;
+  setModified( true );
+}
+
 /*!
   \class SalomeApp_ModuleObject
   \brief This class is used for optimized access to the SALOMEDS-based 
@@ -530,7 +637,7 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( SUIT_DataObject* parent )
   \param parent parent data object
 */
 SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, 
-                                               SUIT_DataObject* parent )
+                                                SUIT_DataObject* parent )
 : CAM_DataObject( parent ),
   LightApp_DataObject( parent ),
   SalomeApp_DataObject( sobj, parent ),
@@ -545,8 +652,8 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj,
   \param parent parent data object
 */
 SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm, 
-                                               const _PTR(SObject)& sobj, 
-                                               SUIT_DataObject* parent )
+                                                const _PTR(SObject)& sobj, 
+                                                SUIT_DataObject* parent )
 : CAM_DataObject( parent ),
   LightApp_DataObject( parent ),
   SalomeApp_DataObject( sobj, parent ),
@@ -574,10 +681,17 @@ QString SalomeApp_ModuleObject::name() const
   \brief Get data object icon for the specified column.
   \param id column id
   \return object icon for the specified column
+  \sa CAM_ModuleObject class
 */
 QPixmap SalomeApp_ModuleObject::icon( const int id ) const
 {
-  return SalomeApp_DataObject::icon( id );
+  QPixmap p = SalomeApp_DataObject::icon( id );
+  // The module might not provide a separate small icon
+  // for Obj. Browser representation -> always try to scale it
+  // See CAM_ModuleObject::icon()
+  if ( !p.isNull() )
+    p = Qtx::scaleIcon( p, 16 );
+  return p;
 }
 
 /*!
@@ -608,7 +722,8 @@ SalomeApp_RootObject::SalomeApp_RootObject( LightApp_Study* study )
 : CAM_DataObject( 0 ),
   LightApp_DataObject( 0 ),
   SalomeApp_DataObject( 0 ),
-  LightApp_RootObject( study )
+  LightApp_RootObject( study ),
+  _toSynchronize(true)
 {
 }
 
@@ -693,8 +808,8 @@ QString SalomeApp_RootObject::toolTip( const int id ) const
   \param study study
 */
 SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent, 
-                                                     const int id, 
-                                                     SalomeApp_Study* study )
+                                                      const int id, 
+                                                      SalomeApp_Study* study )
 : LightApp_DataObject( parent ), 
   CAM_DataObject( parent ),
   myId( id ),
index 8a0462f4d297b70274b38e1d6dea700d5250e9ef..81e995df6dde4b4653f5e278210eddbe28545203 100644 (file)
@@ -1,27 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SalomeApp_DataObject.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
 #ifndef SALOMEAPP_DATAOBJECT_H
 #define SALOMEAPP_DATAOBJECT_H
 
@@ -37,9 +38,9 @@ class SALOMEAPP_EXPORT SalomeApp_DataObject : public virtual LightApp_DataObject
 public:
   //! Column id
   enum {
-    ValueId = EntryId + 1,    //!< value column
-    IORId,                    //!< IOR column
-    RefEntryId                //!< reference entry column
+    ValueId = RefEntryId + 1,    //!< value column
+    IORId,                       //!< IOR column
+    LastId                       //!< indicates last Id value
   };
 
 public:
@@ -54,17 +55,27 @@ public:
   virtual QPixmap        icon( const int = NameId ) const;
   virtual QColor         color( const ColorRole, const int = NameId ) const;
   virtual QString        toolTip( const int = NameId ) const;
+  virtual QFont          font( const int = NameId ) const;
 
   virtual _PTR(SObject)  object() const;
 
-  bool                   isReference() const;
+  virtual QString        refEntry() const;
+  virtual bool           isReference() const;
   _PTR(SObject)          referencedObject() const;
 
+  bool                   hasChildren() const;
+  bool                   expandable() const;
+
+  virtual bool           isVisible() const;
+
   virtual QString        componentDataType() const;
 
   virtual bool           customSorting( const int = NameId ) const;
   virtual bool           compare( const QVariant&, const QVariant&, const int = NameId ) const;
 
+  virtual void           insertChildAtTag( SalomeApp_DataObject*, int );
+  virtual void           updateItem();
+
 private:
   QString                ior( const _PTR(SObject)& ) const;
   QString                entry( const _PTR(SObject)& ) const;
@@ -101,6 +112,10 @@ public:
   QPixmap                icon( const int = NameId ) const;
   QColor                 color( const ColorRole, const int = NameId ) const;
   QString                toolTip( const int = NameId ) const;
+  void                   setToSynchronize(bool value){_toSynchronize=value;};
+  bool                   toSynchronize() const {return _toSynchronize;};
+protected:
+  bool _toSynchronize;
 };
 
 class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
index 42cf9e48de5fcc704deb3696e4c31c62e461e277..d80b4a6a0a95fc63a08e5bb4f0974ab5f4078cb8 100644 (file)
@@ -1,23 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
 // 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 
+// 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 
+//
+// 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 
+// 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_DoubleSpinBox.cxx
 // Author:    Oleg UVAROV
+//
+#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
 
 #include "SalomeApp_DoubleSpinBox.h"
 #include "SalomeApp_Application.h"
 
 #include <QKeyEvent>
 #include <QLineEdit>
+#include <QToolTip>
+#include <QRegExp>
+
+#include <string>
 
 /*!
   \class SalomeApp_DoubleSpinBox
@@ -49,7 +57,9 @@ SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( QWidget* parent )
   myDefaultValue( 0.0 ),
   myIsRangeSet( false ),
   myMinimum( 0.0 ),
-  myMaximum( 99.99 )
+  myMaximum( 99.99 ),
+  myAcceptNames( true ),
+  myShowTip( true )
 {
   connectSignalsAndSlots();
 }
@@ -71,7 +81,9 @@ SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double
   myDefaultValue( 0.0 ),
   myIsRangeSet( false ),
   myMinimum( min ),
-  myMaximum( max )
+  myMaximum( max ),
+  myAcceptNames( true ),
+  myShowTip( true )
 {
   connectSignalsAndSlots();
 }
@@ -87,13 +99,24 @@ SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double
   \param max spin box maximum possible value
   \param step spin box increment/decrement value
   \param parent parent object
+  \param acceptNames if true, enables variable names in the spin box
+  \param showTip if true, makes the widget show a tooltip when invalid text is entered by the user
 */
-SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
+SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, 
+                                                  double max, 
+                                                  double step, 
+                                                  int prec, 
+                                                  int dec, 
+                                                  QWidget* parent,
+                                                  bool acceptNames,
+                                                  bool showTip )
 : QtxDoubleSpinBox( min, max, step, prec, dec, parent ),
   myDefaultValue( 0.0 ),
   myIsRangeSet( false ),
   myMinimum( min ),
-  myMaximum( max )
+  myMaximum( max ),
+  myAcceptNames( acceptNames ),
+  myShowTip( showTip )
 {
   connectSignalsAndSlots();
 }
@@ -105,22 +128,49 @@ SalomeApp_DoubleSpinBox::~SalomeApp_DoubleSpinBox()
 {
 }
 
+/*!
+  \brief Perform \a steps increment/decrement steps.
+  
+  Re-implemented to handle cases when Notebook variable
+  name is specified by the user as the widget text.  
+  Otherwise, simply calls the base implementation.
+
+  \param steps number of increment/decrement steps
+*/
+void SalomeApp_DoubleSpinBox::stepBy( int steps )
+{
+  QString str  = text();
+  QString pref = prefix();
+  QString suff = suffix();
+  
+  if ( pref.length() && str.startsWith( pref ) )
+    str = str.right( str.length() - pref.length() );
+  if ( suff.length() && str.endsWith( suff ) )
+    str = str.left( str.length() - suff.length() );
+  
+  QRegExp varNameMask( "([a-z]|[A-Z]|_).*" );
+  if ( varNameMask.exactMatch( str ) )
+    return;
+
+  QtxDoubleSpinBox::stepBy( steps );
+}
+
 /*!
   \brief Connect signals and slots.
 */
 void SalomeApp_DoubleSpinBox::connectSignalsAndSlots()
 {
   connect( this, SIGNAL( editingFinished() ),
-          this, SLOT( onEditingFinished() ) );
+           this, SLOT( onEditingFinished() ) );
 
   connect( this, SIGNAL( valueChanged( const QString& ) ),
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& )),
-          this, SIGNAL( textChanged( const QString& ) ) );
+           this, SIGNAL( textChanged( const QString& ) ) );
 }
 
 /*!
@@ -182,7 +232,67 @@ QString SalomeApp_DoubleSpinBox::textFromValue( double val ) const
 */
 QValidator::State SalomeApp_DoubleSpinBox::validate( QString& str, int& pos ) const
 {
-  return QValidator::Acceptable;
+  QValidator::State res = QValidator::Invalid;
+
+  // Considering the input text as a variable name
+  // Applying Python identifier syntax:
+  // either a string starting with a letter, or a string starting with
+  // an underscore followed by at least one alphanumeric character
+  if ( isAcceptNames() ){
+    QRegExp varNameMask( "(([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*)|(_([a-z]|[A-Z]|[0-9])+([a-z]|[A-Z]|[0-9]|_)*)" );
+    if ( varNameMask.exactMatch( str ) )
+      res = QValidator::Acceptable;
+  
+    if ( res == QValidator::Invalid ){
+      varNameMask.setPattern( "_" );
+      if ( varNameMask.exactMatch( str ) )  
+        res = QValidator::Intermediate;
+    }
+  }
+  
+  // Trying to interpret the current input text as a numeric value
+  if ( res == QValidator::Invalid )
+    res = QtxDoubleSpinBox::validate( str, pos );  
+  
+  // Show tooltip in case of invalid manual input
+  if ( isShowTipOnValidate() && lineEdit()->hasFocus() ){
+    if ( res != QValidator::Acceptable ){ // san: do we need to warn the user in Intermediate state???
+      SalomeApp_DoubleSpinBox* that = const_cast<SalomeApp_DoubleSpinBox*>( this );
+      QPoint pos( size().width(), 0. );
+      QPoint globalPos = mapToGlobal( pos );
+      QString minVal = textFromValue( minimum() );
+      QString maxVal = textFromValue( maximum() );
+      
+      // Same stuff as in QtxDoubleSpinBox::textFromValue()
+      int digits = getPrecision();
+      
+      // For 'g' format, max. number of digits after the decimal point is getPrecision() - 1
+      // See also QtxDoubleSpinBox::validate()
+      if ( digits < 0 )
+        digits = qAbs( digits ) - 1;
+      
+      QString templ( isAcceptNames() ? tr( "VALID_RANGE_VAR_MSG" ) : tr( "VALID_RANGE_NOVAR_MSG" ) );
+      QString msg( templ.arg( minVal ).arg( maxVal ).arg( digits ) );
+      
+      // Add extra hints to the message (if any passed through dynamic properties)
+      QVariant propVal = property( "validity_tune_hint" );
+      if ( propVal.isValid() ){
+        QString extraInfo = propVal.toString();
+        if ( !extraInfo.isEmpty() ){
+          msg += "\n";
+          msg += extraInfo;
+        }
+      }
+      
+      QToolTip::showText( globalPos, 
+                          msg, 
+                          that );
+    }
+    else
+      QToolTip::hideText();
+  }
+      
+  return res;
 }
 
 /*!
@@ -199,11 +309,11 @@ bool SalomeApp_DoubleSpinBox::isValid( QString& msg, bool toCorrect )
     if( toCorrect )
     {
       if( aState == Incompatible )
-       msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+        msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
       else if( aState == NoVariable )
-       msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+        msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
       else if( aState == Invalid )
-       msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+        msg += tr( "ERR_INVALID_VALUE" ) + "\n";
 
       setText( myCorrectValue );
     }
@@ -244,7 +354,7 @@ void SalomeApp_DoubleSpinBox::setValue( const double value )
 {
   QtxDoubleSpinBox::setValue( value );
 
-  myCorrectValue = QString::number( value );
+  myCorrectValue = QtxDoubleSpinBox::textFromValue( value );
   myTextValue = myCorrectValue;
 }
 
@@ -267,8 +377,8 @@ SalomeApp_DoubleSpinBox::State SalomeApp_DoubleSpinBox::isValid( const QString&
   if( aSearchState == NotFound )
   {
     bool ok = false;
-    value = text.toDouble( &ok );
-    if( !ok )
+    value = locale().toDouble( text, &ok );
+    if ( !ok )
       return NoVariable;
   }
   else if( aSearchState == IncorrectType )
@@ -320,12 +430,29 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons
       std::string aName = name.toStdString();
       if( studyDS->IsVariable( aName ) )
       {
-       if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) )
-       {
-         value = studyDS->GetReal( aName );
-         return Found;
-       }
-       return IncorrectType;
+        if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) || studyDS->IsString( aName ) )
+        {
+          if( studyDS->IsString( aName ) )
+            {
+              PyConsole_Console* pyConsole = app->pythonConsole();
+              PyConsole_Interp* pyInterp = pyConsole->getInterp();
+              PyLockWrapper aLock = pyInterp->GetLockWrapper();
+              std::string command;
+              command  = "import salome_notebook ; ";
+              command += "salome_notebook.notebook.setAsReal(\"";
+              command += aName;
+              command += "\")";
+              bool aResult;
+              aResult = pyInterp->run(command.c_str());
+              if(aResult)
+                {
+                  return IncorrectType;
+                }
+            }
+          value = studyDS->GetReal( aName );
+          return Found;
+        }
+        return IncorrectType;
       }
     }
   }
@@ -350,3 +477,39 @@ void SalomeApp_DoubleSpinBox::showEvent( QShowEvent* )
 {
   setText( myTextValue );
 }
+
+/*!
+  \brief Enables or disables variable names in the spin box.
+         By default, variable names are enabled.
+  \param flag If true, variable names are enabled.
+*/
+void SalomeApp_DoubleSpinBox::setAcceptNames( const bool flag )
+{
+  myAcceptNames = flag;
+}
+
+/*!
+  \brief Returns true if the spin box accepts variable names.
+*/
+bool SalomeApp_DoubleSpinBox::isAcceptNames() const
+{
+  return myAcceptNames;
+}
+
+/*!
+  \brief Enables or disables  tooltips in case of invalid or intermediate-state input.
+         Tooltips are enabled by default.
+  \param flag If true, tooltips are enabled.
+*/
+void SalomeApp_DoubleSpinBox::setShowTipOnValidate( const bool flag )
+{
+  myShowTip = myShowTip;
+}
+
+/*!
+  \brief Returns true if tooltip should be shown in case of invalid or intermediate-state input.
+*/
+bool SalomeApp_DoubleSpinBox::isShowTipOnValidate() const
+{
+  return myShowTip;
+}
index c5b6539ca6f12e686f1b9c52ba8f42faa4d8d115..c6d43dd646f0c382aa980a209011749b8dd50f8b 100644 (file)
@@ -1,24 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
 // 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 
+// 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 
+//
+// 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 
+// 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_DoubleSpinBox.h
 // Author:    Oleg UVAROV
-
+//
 #ifndef SALOMEAPP_DOUBLESPINBOX_H
 #define SALOMEAPP_DOUBLESPINBOX_H
 
@@ -38,9 +39,11 @@ class SALOMEAPP_EXPORT SalomeApp_DoubleSpinBox : public QtxDoubleSpinBox
 public:
   SalomeApp_DoubleSpinBox( QWidget* = 0 );
   SalomeApp_DoubleSpinBox( double, double, double = 1, QWidget* = 0 );
-  SalomeApp_DoubleSpinBox( double, double, double, int, int, QWidget* = 0 );
+  SalomeApp_DoubleSpinBox( double, double, double, int, int, QWidget* = 0, bool = true, bool = true );
   virtual ~SalomeApp_DoubleSpinBox();
 
+  virtual void              stepBy( int );
+
   virtual double            valueFromText( const QString& ) const;
   virtual QString           textFromValue( double ) const;
 
@@ -55,6 +58,12 @@ public:
 
   virtual void              setText(const QString& );
 
+  void                      setAcceptNames( const bool );
+  bool                      isAcceptNames() const;
+
+  void                      setShowTipOnValidate( const bool );
+  bool                      isShowTipOnValidate() const;
+
 signals:
   void                      textChanged( const QString& );
 
@@ -86,6 +95,9 @@ private:
 
   QString                   myCorrectValue;
   QString                   myTextValue;
+
+  bool                      myAcceptNames;
+  bool                      myShowTip;
 };
 
 #endif
index 01240d878b6fd850514a36f0a56f0e4465991898..bf868e0bfe697d272807a208f2ea34fb3628b110 100644 (file)
@@ -1,26 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_ExceptionHandler.h"
+
 #include "CASCatch.hxx"
+#include "Basics_OCCTVersion.hxx"
 
 #include <OSD.hxx>
 
@@ -29,7 +32,7 @@
 
 #include <QString>
 
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
   #include <Standard_ErrorHandler.hxx>
   #include <Standard_Failure.hxx>
 #else
@@ -53,7 +56,7 @@ 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 )
 {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
   try {
     OCC_CATCH_SIGNALS;
 #else
@@ -61,7 +64,7 @@ bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
 #endif
     SUIT_ExceptionHandler::internalHandle( o, e );
   }
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
   catch(Standard_Failure) {
 #else
   CASCatch_CATCH(Standard_Failure) {
index 64a26afbe6be8f69a7309431482e6141ab8ba21a..db96e39b3a4e7f39755b1633c09b8a51276d7908 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_EXCEPTIONHANDLER_H
 #define SALOMEAPP_EXCEPTIONHANDLER_H
 
index a1f15d93680f34eb6f866945dc5df9a6e86da5aa..a1e6d448181d0bb222b864527705befbdea6957b 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      SalomeApp_ExitDlg.cxx
 // Author:    Margarita KARPUNINA, Open CASCADE S.A.S.
 //
index 3398864847a8b6c3dde6b72335243ae12ffb3177..049e72d605b261336cb98ef60f80f01235489d1a 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:      SalomeApp_ExitDlg.h
 // Author:    Margarita KARPUNINA, Open CASCADE S.A.S.
 //
index ac614dadae6552765e9eabb6f0a0a8c211d20072..f911b60d92381d363e09ae455e0f955d79dce2fc 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_Filter.h"
 
 /*!Constructor.Initialize by study.*/
index 3a1d988780775bc4a2619d9ce3a3f8472de61e98..ca69fa547be940dda98968ce2b21561e02ed98af 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_FILTER_H
 #define SALOMEAPP_FILTER_H
 
index eb1b51680587af7ebc91c4dc13494d4976488eb1..d8fd185ae4f5d5753465151420a91e8ae05c6af1 100644 (file)
@@ -1,37 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SALOMEGUI_ImportOperation.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SalomeApp_ImportOperation.h"
 #include <SUIT_Application.h>
 
-#ifndef WIN32
-using namespace std;
-#endif
-
 /*!Constructor. Do nothing.*/
 SalomeApp_ImportOperation::SalomeApp_ImportOperation( SUIT_Application* app ) :
 SUIT_Operation( app )
index 337aa9a8306348b30bdd875fcf56f0ae73b400da..29e1d185f009340a7bc7b904e1cc994d3c1c9477 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEAPP : implementation of desktop and GUI kernel
 //  File   : SalomeApp_ImportOperation.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #if !defined SALOMEAPP_IMPORTOPERATION
 #define SALOMEAPP_IMPORTOPERATION
 
index 4d3460a3bd320294afeb4e6a8580a05ec121558e..43764adbbd186de3c8ce6f2fcccbca819d219cd3 100644 (file)
@@ -1,23 +1,27 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
 // 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 
+// 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 
+//
+// 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 
+// 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_IntSpinBox.cxx
 // Author:    Oleg UVAROV
+//
+#include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
 
 #include "SalomeApp_IntSpinBox.h"
 #include "SalomeApp_Application.h"
 
 #include <QKeyEvent>
 #include <QLineEdit>
+#include <QToolTip>
+#include <QRegExp>
+
+#include <string>
 
 /*!
   \class SalomeApp_IntSpinBox
@@ -45,7 +53,9 @@
 */
 SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( QWidget* parent )
 : QtxIntSpinBox( parent ),
-  myDefaultValue( 0 )
+  myDefaultValue( 0 ),
+  myAcceptNames( true ),
+  myShowTip( true )
 {
   connectSignalsAndSlots();
 }
@@ -60,10 +70,19 @@ SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( QWidget* parent )
   \param max spin box maximum possible value
   \param step spin box increment/decrement value
   \param parent parent object
+  \param acceptNames if true, enables variable names in the spin box
+  \param showTip if true, makes the widget show a tooltip when invalid text is entered by the user
 */
-SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( int min, int max, int step, QWidget* parent )
+SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( int min, 
+                                            int max, 
+                                            int step, 
+                                            QWidget* parent,
+                                            bool acceptNames,
+                                            bool showTip )
 : QtxIntSpinBox( min, max, step, parent ),
-  myDefaultValue( 0 )
+  myDefaultValue( 0 ),
+  myAcceptNames( acceptNames ),
+  myShowTip( showTip )
 {
   connectSignalsAndSlots();
 }
@@ -75,22 +94,50 @@ SalomeApp_IntSpinBox::~SalomeApp_IntSpinBox()
 {
 }
 
+
+/*!
+  \brief Perform \a steps increment/decrement steps.
+  
+  Re-implemented to handle cases when Notebook variable
+  name is specified by the user as the widget text.  
+  Otherwise, simply calls the base implementation.
+
+  \param steps number of increment/decrement steps
+*/
+void SalomeApp_IntSpinBox::stepBy( int steps )
+{
+  QString str  = text();
+  QString pref = prefix();
+  QString suff = suffix();
+  
+  if ( pref.length() && str.startsWith( pref ) )
+    str = str.right( str.length() - pref.length() );
+  if ( suff.length() && str.endsWith( suff ) )
+    str = str.left( str.length() - suff.length() );
+  
+  QRegExp varNameMask( "([a-z]|[A-Z]|_).*" );
+  if ( varNameMask.exactMatch( str ) )
+    return;
+
+  QtxIntSpinBox::stepBy( steps );
+}
+
 /*!
   \brief Connect signals and slots.
 */
 void SalomeApp_IntSpinBox::connectSignalsAndSlots()
 {
   connect( this, SIGNAL( editingFinished() ),
-          this, SLOT( onEditingFinished() ) );
+           this, SLOT( onEditingFinished() ) );
 
   connect( this, SIGNAL( valueChanged( const QString& ) ),
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
-          this, SLOT( onTextChanged( const QString& ) ) );
+           this, SLOT( onTextChanged( const QString& ) ) );
 
   connect( lineEdit(), SIGNAL( textChanged( const QString& )),
-          this, SIGNAL( textChanged( const QString& ) ) );
+           this, SIGNAL( textChanged( const QString& ) ) );
 }
 
 /*!
@@ -152,7 +199,60 @@ QString SalomeApp_IntSpinBox::textFromValue( int val ) const
 */
 QValidator::State SalomeApp_IntSpinBox::validate( QString& str, int& pos ) const
 {
-  return QValidator::Acceptable;
+  //return QValidator::Acceptable;
+  QValidator::State res = QValidator::Invalid;
+
+  // Considering the input text as a variable name
+  // Applying Python identifier syntax:
+  // either a string starting with a letter, or a string starting with
+  // an underscore followed by at least one alphanumeric character
+  if ( isAcceptNames() ){
+    QRegExp varNameMask( "(([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*)|(_([a-z]|[A-Z]|[0-9])+([a-z]|[A-Z]|[0-9]|_)*)" );
+    if ( varNameMask.exactMatch( str ) )
+      res = QValidator::Acceptable;
+  
+    if ( res == QValidator::Invalid ){
+      varNameMask.setPattern( "_" );
+      if ( varNameMask.exactMatch( str ) )  
+        res = QValidator::Intermediate;
+    }
+  }
+  
+  // Trying to interpret the current input text as a numeric value
+  if ( res == QValidator::Invalid )
+    res = QtxIntSpinBox::validate( str, pos );  
+  
+  // Show tooltip in case of invalid manual input
+  if ( isShowTipOnValidate() && lineEdit()->hasFocus() ){
+    if ( res != QValidator::Acceptable ){ // san: do we need to warn the user in Intermediate state???
+      SalomeApp_IntSpinBox* that = const_cast<SalomeApp_IntSpinBox*>( this );
+      QPoint pos( size().width(), 0. );
+      QPoint globalPos = mapToGlobal( pos );
+      QString minVal = textFromValue( minimum() );
+      QString maxVal = textFromValue( maximum() );
+      
+      QString templ( isAcceptNames() ? tr( "VALID_RANGE_VAR_MSG" ) : tr( "VALID_RANGE_NOVAR_MSG" ) );      
+      QString msg( templ.arg( minVal ).arg( maxVal ) );
+      
+      // Add extra hints to the message (if any passed through dynamic properties)
+      QVariant propVal = property( "validity_tune_hint" );
+      if ( propVal.isValid() ){
+        QString extraInfo = propVal.toString();
+        if ( !extraInfo.isEmpty() ){
+          msg += "\n";
+          msg += extraInfo;
+        }
+      }
+  
+      QToolTip::showText( globalPos, 
+                          msg, 
+                          that );
+    }
+    else
+      QToolTip::hideText();
+  }
+      
+  return res;
 }
 
 /*!
@@ -169,11 +269,11 @@ bool SalomeApp_IntSpinBox::isValid( QString& msg, bool toCorrect )
     if( toCorrect )
     {
       if( aState == Incompatible )
-       msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+        msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
       else if( aState == NoVariable )
-       msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+        msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
       else if( aState == Invalid )
-       msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+        msg += tr( "ERR_INVALID_VALUE" ) + "\n";
 
       setText( myCorrectValue );
     }
@@ -228,7 +328,7 @@ SalomeApp_IntSpinBox::State SalomeApp_IntSpinBox::isValid( const QString& text,
     {
       text.toDouble( &ok );
       if( ok )
-       return Invalid;
+        return Invalid;
       return NoVariable;
     }
   }
@@ -278,12 +378,29 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
       std::string aName = name.toStdString();
       if( studyDS->IsVariable( aName ) )
       {
-       if( studyDS->IsInteger( aName ) )
-       {
-         value = studyDS->GetInteger( aName );
-         return Found;
-       }
-       return IncorrectType;
+        if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) )
+        {
+          if( studyDS->IsString( aName ) )
+            {
+              PyConsole_Console* pyConsole = app->pythonConsole();
+              PyConsole_Interp* pyInterp = pyConsole->getInterp();
+              PyLockWrapper aLock = pyInterp->GetLockWrapper();
+              std::string command;
+              command  = "import salome_notebook ; ";
+              command += "salome_notebook.notebook.setAsInteger(\"";
+              command += aName;
+              command += "\")";
+              bool aResult;
+              aResult = pyInterp->run(command.c_str());
+              if(aResult)
+                {
+                  return IncorrectType;
+                }
+            }
+          value = studyDS->GetInteger( aName );
+          return Found;
+        }
+        return IncorrectType;
       }
     }
   }
@@ -308,3 +425,39 @@ void SalomeApp_IntSpinBox::showEvent( QShowEvent* )
 {
   setText( myTextValue );
 }
+
+/*!
+  \brief Enables or disables variable names in the spin box.
+         By default, variable names are enabled.
+  \param flag If true, variable names are enabled.
+*/
+void SalomeApp_IntSpinBox::setAcceptNames( const bool flag )
+{
+  myAcceptNames = flag;
+}
+
+/*!
+  \brief Returns true if the spin box accepts variable names.
+*/
+bool SalomeApp_IntSpinBox::isAcceptNames() const
+{
+  return myAcceptNames;
+}
+
+/*!
+  \brief Enables or disables  tooltips in case of invalid or intermediate-state input.
+         Tooltips are enabled by default.
+  \param flag If true, tooltips are enabled.
+*/
+void SalomeApp_IntSpinBox::setShowTipOnValidate( const bool flag )
+{
+  myShowTip = myShowTip;
+}
+
+/*!
+  \brief Returns true if tooltip should be shown in case of invalid or intermediate-state input.
+*/
+bool SalomeApp_IntSpinBox::isShowTipOnValidate() const
+{
+  return myShowTip;
+}
index d15fe99c1d811f777e93a1e645366729c124abb1..423d6818cf3a04d21bb915100aeb7eb1d0f8a19c 100644 (file)
@@ -1,24 +1,25 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
 // 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 
+// 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 
+//
+// 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 
+// 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_IntSpinBox.h
 // Author:    Oleg UVAROV
-
+//
 #ifndef SALOMEAPP_INTSPINBOX_H
 #define SALOMEAPP_INTSPINBOX_H
 
@@ -37,9 +38,11 @@ class SALOMEAPP_EXPORT SalomeApp_IntSpinBox : public QtxIntSpinBox
 
 public:
   SalomeApp_IntSpinBox( QWidget* = 0 );
-  SalomeApp_IntSpinBox( int, int, int = 1, QWidget* = 0 );
+  SalomeApp_IntSpinBox( int, int, int = 1, QWidget* = 0, bool = true, bool = true );
   virtual ~SalomeApp_IntSpinBox();
 
+  virtual void              stepBy( int );
+
   virtual int               valueFromText( const QString& ) const;
   virtual QString           textFromValue( int ) const;
 
@@ -53,6 +56,12 @@ public:
 
   virtual void              setText(const QString& );
 
+  void                      setAcceptNames( const bool );
+  bool                      isAcceptNames() const;
+
+  void                      setShowTipOnValidate( const bool );
+  bool                      isShowTipOnValidate() const;
+
 signals:
   void                      textChanged( const QString& );
 
@@ -80,6 +89,9 @@ private:
 
   QString                   myCorrectValue;
   QString                   myTextValue;
+
+  bool                      myAcceptNames;
+  bool                      myShowTip;
 };
 
 #endif
index b86831fa17bc7f33f48d6b993d3ed6e171292416..19b6ad96a29cc1b6f0815d885e875474df36de86 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SalomeApp_ListView.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -89,9 +90,9 @@ SalomeApp_ListView::SalomeApp_ListView( QWidget* parent )
   viewport()->installEventFilter(this);
 
   connect(this, SIGNAL(itemSelectionChanged()),
-         this, SLOT(onSelectionChanged()));
+          this, SLOT(onSelectionChanged()));
   connect(header(), SIGNAL(sizeChange(int, int, int)),
-         this,     SLOT(onHeaderSizeChange(int, int, int)));
+          this,     SLOT(onHeaderSizeChange(int, int, int)));
 }
 
 /*!
@@ -330,10 +331,10 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok)
     if (ok) {
       aNeedsUpdate = myEditedItem->finishEditing(myEdit);
       if (aNeedsUpdate == utCancel) {
-       // something to do here on Cancel...
+        // something to do here on Cancel...
       }
       else {
-       // something to do here on OK...
+        // something to do here on OK...
       }
       // updating contents
       switch (aNeedsUpdate) {
@@ -385,9 +386,9 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok)
   \retval valid rect in success
 */
 QRect SalomeApp_ListView::tip(QPoint aPos,
-                             QString& aText,
-                             QRect& dspRect,
-                             QFont& dspFnt) const
+                              QString& aText,
+                              QRect& dspRect,
+                              QFont& dspFnt) const
 {
   QRect result( -1, -1, -1, -1 );
   SalomeApp_ListViewItem* aItem = (SalomeApp_ListViewItem*)itemAt( aPos );
@@ -396,15 +397,15 @@ QRect SalomeApp_ListView::tip(QPoint aPos,
       QRect aItemRect = aItem->itemRect(i);
       QRect aTextRect = aItem->textRect(i);
       if ( !aItem->text(i).isEmpty() &&
-          ( aItemRect.width()  > header()->sectionSize(i) ||
-            aTextRect.left()   < 0 ||
+           ( aItemRect.width()  > header()->sectionSize(i) ||
+             aTextRect.left()   < 0 ||
              aTextRect.top()    < 0 ||
              aTextRect.right()  > viewport()->width() ||
              aTextRect.bottom() > viewport()->height() ) ) {
         // calculating tip data
         aText   = aItem->tipText();
-       dspRect = aItem->tipRect();
-       dspFnt  = font();
+        dspRect = aItem->tipRect();
+        dspFnt  = font();
         if (dspRect.isValid()) {
           result  = QRect(QPoint(0, aItemRect.top()),
                           QSize(viewport()->width(), aItemRect.height()));
@@ -428,7 +429,7 @@ QTreeWidgetItem( parent )
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                              SalomeApp_ListViewItem* after) :
+                                               SalomeApp_ListViewItem* after) :
 QTreeWidgetItem( parent, after )
 {
   init();
@@ -438,8 +439,8 @@ QTreeWidgetItem( parent, after )
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                              const QStringList&    theStrings,
-                                              const bool        theEditable) :
+                                               const QStringList&    theStrings,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, theStrings)
 {
   init();
@@ -450,8 +451,8 @@ QTreeWidgetItem(parent, theStrings)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                              const QStringList&    theString,
-                                              const bool        theEditable) :
+                                               const QStringList&    theString,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, theString)
 {
   init();
@@ -462,9 +463,9 @@ QTreeWidgetItem(parent, theString)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                              SalomeApp_ListViewItem* after,
-                                              const QString&    theName,
-                                              const bool        theEditable) :
+                                               SalomeApp_ListViewItem* after,
+                                               const QString&    theName,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, after)
 {
   setData(0,Qt::DisplayRole,QVariant(theName));
@@ -476,9 +477,9 @@ QTreeWidgetItem(parent, after)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                              SalomeApp_ListViewItem* after,
-                                              const QString&    theName,
-                                              const bool        theEditable) :
+                                               SalomeApp_ListViewItem* after,
+                                               const QString&    theName,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, after)
 {
   setData(0,Qt::DisplayRole,QVariant(theName));
@@ -490,10 +491,10 @@ QTreeWidgetItem(parent, after)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
-                                              SalomeApp_ListViewItem* after,
-                                              const QString&    theName,
-                                              const QString&    theValue,
-                                              const bool        theEditable) :
+                                               SalomeApp_ListViewItem* after,
+                                               const QString&    theName,
+                                               const QString&    theValue,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, after)
 {
   setData(0,Qt::DisplayRole,QVariant(theName));
@@ -506,10 +507,10 @@ QTreeWidgetItem(parent, after)
   Constructor
 */
 SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView*     parent,
-                                              SalomeApp_ListViewItem* after,
-                                              const QString&    theName,
-                                              const QString&    theValue,
-                                              const bool        theEditable) :
+                                               SalomeApp_ListViewItem* after,
+                                               const QString&    theName,
+                                               const QString&    theValue,
+                                               const bool        theEditable) :
 QTreeWidgetItem(parent, after)
 {
   setData(0,Qt::DisplayRole,QVariant(theName));
@@ -767,9 +768,9 @@ SalomeApp_EntityEdit* SalomeApp_ListViewItem::startEditing()
       return 0;
     aWidget = new SalomeApp_EntityEdit(aListView->viewport(),
                                  anEditType,
-                                aValueType,
-                                aButtons & SalomeApp_EntityEdit::btApply,
-                                aButtons & SalomeApp_EntityEdit::btCancel);
+                                 aValueType,
+                                 aButtons & SalomeApp_EntityEdit::btApply,
+                                 aButtons & SalomeApp_EntityEdit::btCancel);
     computeEditGeometry(this, aWidget);
 
     fillWidgetWithValues(aWidget);
@@ -966,7 +967,7 @@ int SalomeApp_ComboBox::findItem(const QString& theText)
   Adds item in combo box
 */
 void SalomeApp_ComboBox::insertItem(const QString& theValue,
-                                   int            theIndex)
+                                    int            theIndex)
 {
   if (duplicatesEnabled() || findItem(theValue) < 0)
     QComboBox::insertItem(theIndex, theValue);
@@ -1046,10 +1047,10 @@ void SalomeApp_ComboBox::insertList(const TColStd_ListOfReal& theList)
   Constructor
 */
 SalomeApp_EntityEdit::SalomeApp_EntityEdit(QWidget* parent,
-                              int      controlType,
-                              int      valueType,
-                              bool     butApply,
-                              bool     butCancel) :
+                               int      controlType,
+                               int      valueType,
+                               bool     butApply,
+                               bool     butCancel) :
 QWidget(parent),
 myEdit(0),
 myCombo(0),
@@ -1185,8 +1186,8 @@ void SalomeApp_EntityEdit::setText(const QString& theText)
   Adds item in combo box, sets it current if theSetCurrent is true
 */
 void SalomeApp_EntityEdit::insertItem(const QString& theValue,
-                               bool           theSetCurrent,
-                               int            theOrder)
+                                bool           theSetCurrent,
+                                int            theOrder)
 {
   if (myCombo) {
     int aIndexAt = -1;
@@ -1208,7 +1209,7 @@ void SalomeApp_EntityEdit::insertItem(const QString& theValue,
   Adds items in combo box, sets item theCurrent as current
 */
 void SalomeApp_EntityEdit::insertList(const QStringList& theList,
-                               const int          theCurrent)
+                                const int          theCurrent)
 {
   if (myCombo)
     myCombo->insertList(theList);
@@ -1220,7 +1221,7 @@ void SalomeApp_EntityEdit::insertList(const QStringList& theList,
   Adds item in combo box, sets it current if theSetCurrent is true
 */
 void SalomeApp_EntityEdit::insertItem(const int theValue,
-                               bool      theSetCurrent)
+                                bool      theSetCurrent)
 {
   if (myCombo) {
     myCombo->insertItem(theValue);
@@ -1233,7 +1234,7 @@ void SalomeApp_EntityEdit::insertItem(const int theValue,
   Adds items in combo box, sets item theCurrent as current
 */
 void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList,
-                               const int                    theCurrent)
+                                const int                    theCurrent)
 {
   if (myCombo)
     myCombo->insertList(theList);
@@ -1251,7 +1252,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList,
   Adds item in combo box, sets it current if theSetCurrent is true
 */
 void SalomeApp_EntityEdit::insertItem(const double theValue,
-                               bool         theSetCurrent)
+                                bool         theSetCurrent)
 {
   if (myCombo) {
     myCombo->insertItem(theValue);
@@ -1264,7 +1265,7 @@ void SalomeApp_EntityEdit::insertItem(const double theValue,
   Adds items in combo box, sets item theCurrent as current
 */
 void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList,
-                               const int                 theCurrent)
+                                const int                 theCurrent)
 {
   if (myCombo)
     myCombo->insertList(theList);
index 8e1521a6d5ee0a41bfca2a7de9a92c862e60a847..2757ee768abfc3766814bb48940dc477c3af2ae0 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : SalomeApp_ListView.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -186,10 +187,10 @@ public:
 
 public:
   SalomeApp_EntityEdit( QWidget* parent, 
-                       int      controlType = etLineEdit, 
-                       int      valueType   = vtString,
-                       bool     butApply    = false, 
-                       bool     butCancel   = false);
+                        int      controlType = etLineEdit, 
+                        int      valueType   = vtString,
+                        bool     butApply    = false, 
+                        bool     butCancel   = false);
   ~SalomeApp_EntityEdit();
 
   void finishEditing();
@@ -197,18 +198,18 @@ public:
   QString getText();
   void setText(const QString& theText );
   void insertItem( const QString& theValue, 
-                  bool           theSetCurrent = false,
-                  int            theOrder = atBottom );
+                   bool           theSetCurrent = false,
+                   int            theOrder = atBottom );
   void insertList( const QStringList& theList, 
-                  const int          theCurrent = -1 );
+                   const int          theCurrent = -1 );
   void insertItem( const int theValue, 
-                  bool  theSetCurrent = false );
+                   bool  theSetCurrent = false );
   void insertList( const TColStd_ListOfInteger& theList, 
-                  const int                    theCurrent = -1 );
+                   const int                    theCurrent = -1 );
   void insertItem( const double theValue, 
-                  bool         theSetCurrent = false );
+                   bool         theSetCurrent = false );
   void insertList( const TColStd_ListOfReal& theList, 
-                  const int                 theCurrent = -1 );
+                   const int                 theCurrent = -1 );
   QWidget* getControl();
   void setFocus();
   void setValidator(const QValidator*);
@@ -241,31 +242,31 @@ class SalomeApp_ListViewItem : public QTreeWidgetItem
 public:
   SalomeApp_ListViewItem( SalomeApp_ListView* );
   SalomeApp_ListViewItem( SalomeApp_ListView*, 
-                         SalomeApp_ListViewItem* );
+                          SalomeApp_ListViewItem* );
   SalomeApp_ListViewItem( SalomeApp_ListView*,
-                         const QStringList&,
-                         const bool = false );
+                          const QStringList&,
+                          const bool = false );
   SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
-                         const QStringList&,
-                         const bool = false );
+                          const QStringList&,
+                          const bool = false );
   SalomeApp_ListViewItem( SalomeApp_ListView*,
-                         SalomeApp_ListViewItem*,
-                         const QString&,
-                         const bool = false );
+                          SalomeApp_ListViewItem*,
+                          const QString&,
+                          const bool = false );
   SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
-                         SalomeApp_ListViewItem*,
-                         const QString&,
-                         const bool = false);
+                          SalomeApp_ListViewItem*,
+                          const QString&,
+                          const bool = false);
   SalomeApp_ListViewItem( SalomeApp_ListView*,
-                         SalomeApp_ListViewItem*,
-                         const QString& theName,
-                         const QString& theValue, 
-                         const bool = false);
+                          SalomeApp_ListViewItem*,
+                          const QString& theName,
+                          const QString& theValue, 
+                          const bool = false);
   SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
-                         SalomeApp_ListViewItem*,
-                         const QString&,
-                         const QString&, 
-                         const bool = false);
+                          SalomeApp_ListViewItem*,
+                          const QString&,
+                          const QString&, 
+                          const bool = false);
   ~SalomeApp_ListViewItem();
 
   QString            fullName();
index d338c68306453da6c09d6ef3e828517b567f3076..17866cf5fd0bf6adab210d213f8545ecfa725726 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_LoadStudiesDlg.h"
 
 #include <QLabel>
@@ -74,7 +72,7 @@ SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent, const QStri
   myList = new QListWidget( this );
   myList->setMinimumSize( MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT );
   myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, 
-                                              QSizePolicy::Expanding ) );
+                                               QSizePolicy::Expanding ) );
   myList->setSelectionMode( QAbstractItemView::SingleSelection );
 
   topLayout->addWidget( lab );
@@ -84,9 +82,9 @@ SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent, const QStri
   connect( myButtonOk,   SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( myList,       SIGNAL( itemDoubleClicked( QListWidgetItem* ) ),
-                                             this, SLOT( accept() ) );
+                                              this, SLOT( accept() ) );
   connect( myList,       SIGNAL( itemSelectionChanged() ),
-                                             this, SLOT( updateState() ) );
+                                              this, SLOT( updateState() ) );
   myList->addItems( studies );
 
   updateState();
index 9637c0b10470d696308a378dbe85cda8839d6aff..7149a0664a0aee2b517bb452764bbf493b51b544 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_LOADSTUDIESDLG_H
 #define SALOMEAPP_LOADSTUDIESDLG_H
 
index 5bfa0adfae0e15a9547cfd6068596766bb0f0a76..5b4a5e2bd7ae0f3458c4cdda225b0337be2a6fa6 100644 (file)
@@ -1,32 +1,34 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #include "SalomeApp_Module.h"
 #include "SalomeApp_DataModel.h"
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Study.h"
+#include "SalomeApp_DataObject.h"
 
 #include "LightApp_Selection.h"
 
 #include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_InteractiveObject.hxx>
+          
+#include <LightApp_DataObject.h>
 
 #include <SUIT_Session.h>
+#include <SUIT_DataBrowser.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
 
 #include <QString>
 
 /*!Constructor.*/
 SalomeApp_Module::SalomeApp_Module( const QString& name )
-: LightApp_Module( name )
+  : LightApp_Module( name ),
+    myIsFirstActivate( true )
 {
 }
 
@@ -96,26 +105,26 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li
       _PTR(SObject) SO = study->studyDS()->FindObjectID( obj->getEntry() );
       if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent()->GetID().c_str() )
       { //component is selected
-       _PTR(SComponent) SC( SO->GetFatherComponent() );
-       _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) );
-       anIter->InitEx( true );
-       while( anIter->More() )
-       {
-         _PTR(SObject) valSO ( anIter->Value() );
-         _PTR(SObject) refSO;
-         if( !valSO->ReferencedObject( refSO ) )
-         {
-           QString id = valSO->GetID().c_str(),
-                   comp = SC->ComponentDataType().c_str(),
-                   val = valSO->GetName().c_str();
-
-           Handle( SALOME_InteractiveObject ) new_obj =
-             new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
-           dest.Append( new_obj );
-         }
-         anIter->Next();
-       }
-       continue;
+        _PTR(SComponent) SC( SO->GetFatherComponent() );
+        _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) );
+        anIter->InitEx( true );
+        while( anIter->More() )
+        {
+          _PTR(SObject) valSO ( anIter->Value() );
+          _PTR(SObject) refSO;
+          if( !valSO->ReferencedObject( refSO ) )
+          {
+            QString id = valSO->GetID().c_str(),
+                    comp = SC->ComponentDataType().c_str(),
+                    val = valSO->GetName().c_str();
+
+            Handle( SALOME_InteractiveObject ) new_obj =
+              new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
+            dest.Append( new_obj );
+          }
+          anIter->Next();
+        }
+        continue;
       }
     }
     dest.Append( obj );
@@ -126,12 +135,28 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li
  * \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)
+ * to store visual parameters in AttributeParameter attribut
  */
 void SalomeApp_Module::storeVisualParameters(int savePoint)
 {
 }
 
+
+/*!Activate module.*/
+bool SalomeApp_Module::activateModule( SUIT_Study* theStudy )
+{
+  bool state = LightApp_Module::activateModule( theStudy );
+
+  if (!myIsFirstActivate)
+    return state;
+  
+  updateModuleVisibilityState();
+
+  myIsFirstActivate = false;
+  
+  return state;
+}
+
 /*!
  * \brief Virtual public
  *
@@ -142,3 +167,93 @@ void SalomeApp_Module::restoreVisualParameters(int savePoint)
 {
 }
 
+/*! Redefined to reset internal flags valid for study instance */
+void SalomeApp_Module::studyClosed( SUIT_Study* theStudy )
+{
+  LightApp_Module::studyClosed( theStudy );
+  
+  myIsFirstActivate = true;
+  
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>(application());
+  if (!app)
+    return;
+  
+  SUIT_DataBrowser* ob = app->objectBrowser();
+  if (ob && ob->model())
+    disconnect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+                this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ) );
+}
+
+
+/*!
+ * \brief Virtual public slot
+ *
+ * This method is called after the object inserted into data view to update their visibility state
+ * This is default implementation
+ */
+void SalomeApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
+{
+  if (!isActiveModule())
+    return;
+  // change visibility of object
+  if (!theObject || theColumn != SUIT_DataObject::VisibilityId )
+    return;
+
+  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if( !study )
+    return;
+
+  LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>(theObject);
+  if(!lo)
+    return;
+  
+  // detect action index (from LightApp level)
+  int id = -1;
+  
+  if ( study->visibilityState(lo->entry()) == Qtx::ShownState )
+    id = myErase;
+  else if ( study->visibilityState(lo->entry()) == Qtx::HiddenState )
+    id = myDisplay;
+  
+  if ( id != -1 )
+    startOperation( id );
+}
+
+
+/*!
+  Called then study closed
+*/
+void SalomeApp_Application::onStudyClosed( SUIT_Study* theStudy){
+  LightApp_Application::onStudyClosed(theStudy);
+
+  disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+             this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+}
+
+
+void SalomeApp_Module::updateModuleVisibilityState() {
+
+  // update visibility state of objects
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
+  if (!app)
+    return;
+  
+  SUIT_DataBrowser* ob = app->objectBrowser();
+  if (!ob || !ob->model())
+    return;
+
+  // connect to click on item
+  connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+           this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
+
+  SUIT_DataObject* rootObj = ob->root();
+  if( !rootObj )
+    return;
+  
+  DataObjectList listObj = rootObj->children( true );
+  
+  SUIT_ViewModel* vmod = 0;
+  if ( SUIT_ViewManager* vman = app->activeViewManager() )
+    vmod = vman->getViewModel();
+  app->updateVisibilityState( listObj, vmod );
+}
index 3e4af4e13243302686c992354b1c5877e68ae093..83b4323843630bf203b22cf6b3e2be21bd3182d8 100644 (file)
@@ -1,28 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// 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
-//
+
 #ifndef SALOMEAPP_MODULE_H
 #define SALOMEAPP_MODULE_H
 
@@ -35,11 +36,12 @@ class SalomeApp_Application;
 class LightApp_Selection;
 class SALOME_ListIO;
 class QString;
+class SUIT_DataObject;
 
 /*!
  * \brief Base class for all salome modules
-*/
-class SALOMEAPP_EXPORT SalomeApp_Module : public LightApp_Module
+ */
+class SALOMEAPP_EXPORT SalomeApp_Module : virtual public LightApp_Module
 {
   Q_OBJECT
 
@@ -61,10 +63,21 @@ public:
   virtual void                        storeVisualParameters(int savePoint);
   virtual void                        restoreVisualParameters(int savePoint);
   virtual LightApp_Selection*         createSelection() const;
+  
+  public slots:
+  virtual bool                        activateModule( SUIT_Study* );
+  virtual void                        studyClosed( SUIT_Study* );
+  virtual void                        onObjectClicked( SUIT_DataObject*, int );
+
+  virtual void                        updateModuleVisibilityState();
 
 protected:
   virtual CAM_DataModel*              createDataModel();
   virtual void                        extractContainers( const SALOME_ListIO&, SALOME_ListIO& ) const;
+
+
+ protected:
+  bool myIsFirstActivate;
 };
 
 #endif
index 6005d889acdf28d65d248eaed48ebab4b0adf486..4a60705de17129f7e14a8c1052aa686e3218a00a 100644 (file)
@@ -1,11 +1,11 @@
-// Copyright (C) 2008  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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
+// 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.
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:    SalomeApp_NoteBookDlg.cxx
 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
 // Module : GUI
+//
+#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
 
 #include "SalomeApp_NoteBookDlg.h"
 #include "SalomeApp_Application.h"
@@ -34,8 +38,6 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 
-#include <PyConsole_Console.h>
-
 #include <SALOMEDS_Tool.hxx>
 
 #include <QWidget>
@@ -53,8 +55,6 @@
 #include <string>
 #include <vector>
 
-using namespace std;
-
 #define DEFAULT_MARGIN  11
 #define DEFAULT_SPACING 6
 #define SPACER_SIZE     120
@@ -72,8 +72,9 @@ using namespace std;
  *  Purpose  : Constructor
  */
 //============================================================================
-NoteBook_TableRow::NoteBook_TableRow(int index, QWidget* parent):
+NoteBook_TableRow::NoteBook_TableRow(int index, NoteBook_Table* parentTable, QWidget* parent):
   QWidget(parent),
+  myParentTable(parentTable),
   myIndex(index),
   myRowHeader(new QTableWidgetItem()),
   myVariableName(new QTableWidgetItem()),
@@ -171,10 +172,11 @@ bool NoteBook_TableRow::CheckValue()
 {
   bool aResult = false;
   QString aValue = GetValue();
-  if( (!aValue.isEmpty()) && 
-      (IsRealValue(aValue)) ||
-      IsIntegerValue(aValue)||
-      IsBooleanValue(aValue)) 
+  if(!aValue.isEmpty() && 
+     (IsRealValue(aValue) ||
+      IsIntegerValue(aValue) ||
+      IsBooleanValue(aValue) ||
+      IsValidStringValue(aValue)))
     aResult = true;
   
   return aResult;
@@ -220,7 +222,7 @@ bool NoteBook_TableRow::IsRealValue(const QString theValue, double* theResult)
 {
   bool aResult = false;
   double aDResult = theValue.toDouble(&aResult);
-  if(theResult)
+  if(aResult && theResult)
     *theResult = aDResult;
   
   return aResult;
@@ -243,7 +245,7 @@ bool NoteBook_TableRow::IsBooleanValue(const QString theValue, bool* theResult){
     aBResult = false;
     aResult = true;
   }
-  if(theResult)
+  if(aResult && theResult)
     *theResult = aBResult;
   
   return aResult;
@@ -261,12 +263,50 @@ bool NoteBook_TableRow::IsIntegerValue(const QString theValue, int* theResult)
   int anIResult;
   anIResult = theValue.toInt(&aResult);
 
-  if(theResult)
+  if(aResult && theResult)
     *theResult = anIResult;  
   
   return aResult;
 }
 
+//============================================================================
+/*! Function : IsValidStringValue
+ *  Purpose  : Return true if theValue string is valid, otherwise return 
+ *             false
+ *             The string are always valid for the moment
+ *             The whole notebook is verified on apply
+ */
+//============================================================================
+bool NoteBook_TableRow::IsValidStringValue(const QString theValue)
+{
+  int aNumRows = myParentTable->myRows.count();
+  if( aNumRows == 0 )
+    return true;
+
+  bool aLastRowIsEmpty = myParentTable->myRows[ aNumRows - 1 ]->GetName().isEmpty() &&
+                         myParentTable->myRows[ aNumRows - 1 ]->GetValue().isEmpty();
+
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  PyConsole_Console* pyConsole = app->pythonConsole();
+  PyConsole_Interp* pyInterp = pyConsole->getInterp();
+  PyLockWrapper aLock = pyInterp->GetLockWrapper();
+  std::string command = "import salome_notebook ; ";
+  command += "salome_notebook.checkThisNoteBook(";
+  for( int i = 0, n = aLastRowIsEmpty ? aNumRows - 1 : aNumRows; i < n; i++ ) {
+    command += myParentTable->myRows[i]->GetName().toStdString();
+    command += "=\"";
+    command += myParentTable->myRows[i]->GetValue().toStdString();
+    command += "\", ";
+  }
+  command += ") ";
+
+  //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+  bool oldSuppressValue = pyConsole->isSuppressOutput();
+  pyConsole->setIsSuppressOutput(true);        
+  bool aResult = pyInterp->run(command.c_str());
+  pyConsole->setIsSuppressOutput(oldSuppressValue);    
+  return !aResult;
+}
 
 ///////////////////////////////////////////////////////////////////////////
 //                      NoteBook_Table class                             //
@@ -354,8 +394,8 @@ void NoteBook_Table::Init(_PTR(Study) theStudy)
       NoteBook_TableRow* aRow = myRows[ i ];
       if( aRow )
       {
-       delete aRow;
-       aRow = 0;
+        delete aRow;
+        aRow = 0;
       }
     }
     myRows.clear();
@@ -367,10 +407,10 @@ void NoteBook_Table::Init(_PTR(Study) theStudy)
   myVariableMap.clear();
 
   //Add all variables into the table
-  vector<string> aVariables = theStudy->GetVariableNames();
+  std::vector<std::string> aVariables = theStudy->GetVariableNames();
   for(int iVar = 0; iVar < aVariables.size(); iVar++ ) {
     AddRow(QString(aVariables[iVar].c_str()),
-          Variable2String(aVariables[iVar],theStudy));
+           Variable2String(aVariables[iVar],theStudy));
   }
 
   //Add empty row
@@ -387,7 +427,7 @@ void NoteBook_Table::Init(_PTR(Study) theStudy)
  *  Purpose  : Convert variable values to QString
  */
 //============================================================================
-QString NoteBook_Table::Variable2String(const string& theVarName,
+QString NoteBook_Table::Variable2String(const std::string& theVarName,
                                         _PTR(Study) theStudy)
 {
   QString aResult;
@@ -397,6 +437,8 @@ QString NoteBook_Table::Variable2String(const string& theVarName,
     aResult = QString::number(theStudy->GetInteger(theVarName));
   else if( theStudy->IsBoolean(theVarName) )
     aResult = theStudy->GetBoolean(theVarName) ? QString("True") : QString("False");
+  else if( theStudy->IsString(theVarName) )
+    aResult = theStudy->GetString(theVarName).c_str();
   
   return aResult;
 }
@@ -419,7 +461,28 @@ bool NoteBook_Table::IsValid() const
     if( !myRows[i]->CheckName() || !IsUniqueName( myRows[i] ) || !myRows[i]->CheckValue() )
       return false;
 
-  return true;
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  PyConsole_Console* pyConsole = app->pythonConsole();
+  PyConsole_Interp* pyInterp = pyConsole->getInterp();
+  PyLockWrapper aLock = pyInterp->GetLockWrapper();
+  std::string command = "import salome_notebook ; ";
+  command += "salome_notebook.checkThisNoteBook(";
+  for( int i = 0, n = aLastRowIsEmpty ? aNumRows - 1 : aNumRows; i < n; i++ )
+    {
+      command += myRows[i]->GetName().toStdString();
+      command += "=\"";
+      command += myRows[i]->GetValue().toStdString();
+      command += "\",";
+    }
+  command += ")";
+
+  //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+  bool oldSuppressValue = pyConsole->isSuppressOutput();
+  pyConsole->setIsSuppressOutput(true);        
+  bool aResult = pyInterp->run(command.c_str());
+  pyConsole->setIsSuppressOutput(oldSuppressValue);    
+
+  return !aResult;
 }
 
 //============================================================================
@@ -427,7 +490,7 @@ bool NoteBook_Table::IsValid() const
  *  Purpose  : renumber row items
  */
 //============================================================================
-void NoteBook_Table::RenamberRowItems(){
+void NoteBook_Table::RenamberRowItems() {
   for(int i=0; i<myRows.size();i++){
     myRows[i]->GetHeaderItem()->setText(QString::number(i+1));
   }
@@ -441,7 +504,7 @@ void NoteBook_Table::RenamberRowItems(){
 void NoteBook_Table::AddRow(const QString& theName, const QString& theValue)
 {
   int anIndex = getUniqueIndex();
-  NoteBook_TableRow* aRow = new NoteBook_TableRow(anIndex, this);
+  NoteBook_TableRow* aRow = new NoteBook_TableRow(anIndex, this, this);
   aRow->SetName(theName);
   aRow->SetValue(theValue);
   aRow->AddToTable(this);
@@ -503,51 +566,51 @@ void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem)
       QString aMsg;
 
       if(aCurrentColumn == NAME_COLUMN) {
-       int anIndex = aRow->GetIndex();
-       if( myVariableMap.contains( anIndex ) )
-       {
-         const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
-         if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( string( aVariable.Name.toLatin1().constData() ) ) )
-         {
-           if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
-                                     tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
-                                     QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
-           {
-             bool isBlocked = blockSignals( true );
-             aRow->SetName( aVariable.Name );
-             blockSignals( isBlocked );
-             return;
-           }
-         }
-       }
+        int anIndex = aRow->GetIndex();
+        if( myVariableMap.contains( anIndex ) )
+        {
+          const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+          if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( std::string( aVariable.Name.toLatin1().constData() ) ) )
+          {
+            if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+                                      tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
+                                      QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+            {
+              bool isBlocked = blockSignals( true );
+              aRow->SetName( aVariable.Name );
+              blockSignals( isBlocked );
+              return;
+            }
+          }
+        }
       }
 
       //Case then varible name changed. 
       if(aCurrentColumn == NAME_COLUMN) {
         if(!aRow->CheckName()) {
-         IsCorrect = false;
-         aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName());
-       }
+          IsCorrect = false;
+          aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName());
+        }
         else if(!IsUniqueName(aRow)) {
-         IsCorrect = false;
+          IsCorrect = false;
           aMsg = tr( "VARNAME_EXISTS" ).arg(aRow->GetName());
-       }
-       else
-         IsVariableComplited = aRow->CheckValue();
+        }
+        else
+          IsVariableComplited = aRow->CheckValue();
       }
       
       //Case then varible value changed. 
       else if(aCurrentColumn == VALUE_COLUMN){
         if(!aRow->CheckValue()) {
-         IsCorrect = false;
-         aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName());
-       }
-       else
-         IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow);
+          IsCorrect = false;
+          aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName());
+        }
+        else
+          IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow);
       }
 
       if(!IsCorrect && !aMsg.isEmpty())
-       SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg );
+        SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg );
 
       bool isBlocked = blockSignals( true );
       theItem->setForeground( QBrush( IsCorrect ? Qt::black : Qt::red ) );
@@ -556,19 +619,19 @@ void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem)
       int anIndex = aRow->GetIndex();
       if( myVariableMap.contains( anIndex ) )
       {
-       NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
-       if( aVariable.Name.compare( aRow->GetName() ) != 0 ||
-           aVariable.Value.compare( aRow->GetValue() ) != 0 )
-       {
-         aVariable.Name = aRow->GetName();
-         aVariable.Value = aRow->GetValue();
-       }
-       else
-         isModified = false;
+        NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+        if( aVariable.Name.compare( aRow->GetName() ) != 0 ||
+            aVariable.Value.compare( aRow->GetValue() ) != 0 )
+        {
+          aVariable.Name = aRow->GetName();
+          aVariable.Value = aRow->GetValue();
+        }
+        else
+          isModified = false;
       }
 
       if(IsCorrect && IsVariableComplited && IsLastRow(aRow))
-       AddEmptyRow();
+        AddEmptyRow();
     }
 
     if( !myIsModified )
@@ -616,22 +679,22 @@ void NoteBook_Table::RemoveSelected()
       else {
         int nRow = row(aSelectedItems[i]);
 
-       if( myStudy->IsVariableUsed( string( aRow->GetName().toLatin1().constData() ) ) )
-       {
-         if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
-                                   tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
-                                   QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
-         {
-           isProcessItemChangedSignal = true;
-           return;
-         }
-       }
-
-       int index = aRow->GetIndex();
+        if( myStudy->IsVariableUsed( std::string( aRow->GetName().toLatin1().constData() ) ) )
+        {
+          if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+                                    tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
+                                    QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+          {
+            isProcessItemChangedSignal = true;
+            return;
+          }
+        }
+
+        int index = aRow->GetIndex();
         QString aVarName = aRow->GetName();
-       myRemovedRows.append( index );
-       if( myVariableMap.contains( index ) )
-         myVariableMap.remove( index );
+        myRemovedRows.append( index );
+        if( myVariableMap.contains( index ) )
+          myVariableMap.remove( index );
         removeRow(nRow);
         myRows.removeAt(nRow);
         if(myStudy->IsVariable(aVarName.toLatin1().constData()))
@@ -851,7 +914,7 @@ void SalomeApp_NoteBookDlg::onApply()
     if( aVariableMapRef.contains( anIndex ) )
     {
       QString aRemovedVariable = aVariableMapRef[ anIndex ].Name;
-      myStudy->RemoveVariable( string( aRemovedVariable.toLatin1().constData() ) );
+      myStudy->RemoveVariable( std::string( aRemovedVariable.toLatin1().constData() ) );
     }
   }
 
@@ -867,25 +930,28 @@ void SalomeApp_NoteBookDlg::onApply()
     {
       if( aVariableMapRef.contains( anIndex ) )
       {
-       const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ];
-       QString aNameRef = aVariableRef.Name;
-       QString aValueRef = aVariableRef.Value;
-
-       if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
-       {
-         myStudy->RenameVariable( string( aNameRef.toLatin1().constData() ),
-                                  string( aName.toLatin1().constData() ) );
-       }
+        const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ];
+        QString aNameRef = aVariableRef.Name;
+        QString aValueRef = aVariableRef.Value;
+
+        if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
+        {
+          myStudy->RenameVariable( std::string( aNameRef.toLatin1().constData() ),
+                                   std::string( aName.toLatin1().constData() ) );
+        }
       }
 
       if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) )
-       myStudy->SetInteger(string(aName.toLatin1().constData()),anIVal);
+        myStudy->SetInteger(std::string(aName.toLatin1().constData()),anIVal);
 
       else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) )
-       myStudy->SetReal(string(aName.toLatin1().constData()),aDVal);
+        myStudy->SetReal(std::string(aName.toLatin1().constData()),aDVal);
     
       else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) )
-       myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal);
+        myStudy->SetBoolean(std::string(aName.toLatin1().constData()),aBVal);
+    
+      else
+        myStudy->SetString(std::string(aName.toLatin1().constData()),aValue.toStdString());
     }
   }
   myTable->ResetMaps();
@@ -906,13 +972,13 @@ void SalomeApp_NoteBookDlg::onCancel()
   if( myTable->IsModified() )
   {
     int answer = QMessageBox::question( this, tr( "CLOSE_CAPTION" ), tr( "CLOSE_DESCRIPTION" ),
-                                       QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel );
+                                        QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel );
     switch( answer )
     {
       case QMessageBox::Yes    : onOK(); return;
       case QMessageBox::No     : break;
       case QMessageBox::Cancel : return;
-      default :        break;
+      default : break;
     }
   }
   reject();
@@ -978,6 +1044,7 @@ bool SalomeApp_NoteBookDlg::updateStudy()
   // dump study to the temporary directory
   QString aFileName( "notebook" );
   bool toPublish = true;
+  bool isMultiFile = false;
   bool toSaveGUI = true;
 
   int savePoint;
@@ -988,7 +1055,7 @@ bool SalomeApp_NoteBookDlg::updateStudy()
     ip->setDumpPython(studyDS);
     savePoint = SalomeApp_VisualState( app ).storeState(); //SRN: create a temporary save point
   }
-  bool ok = studyDS->DumpStudy( aTmpDir.toStdString(), aFileName.toStdString(), toPublish );
+  bool ok = studyDS->DumpStudy( aTmpDir.toStdString(), aFileName.toStdString(), toPublish, isMultiFile );
   if ( toSaveGUI )
     study->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
 
@@ -1002,7 +1069,7 @@ bool SalomeApp_NoteBookDlg::updateStudy()
   app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
 
   // load study from the temporary directory
-  QString command = QString( "execfile(\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
+  QString command = QString( "execfile(r\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
 
   PyConsole_Console* pyConsole = app->pythonConsole();
   if ( pyConsole )
@@ -1051,7 +1118,7 @@ void SalomeApp_NoteBookDlg::clearStudy()
   int aY = y();
 
   // Disconnect dialog from application desktop in case if:
-  // 1) Application is not the first application in the session        
+  // 1) Application is not the first application in the session 
   // 2) Application is the first application in session but not the only.
   bool changeDesktop = ((anIndex > 0) || (anIndex == 0 && aList.count() > 1));
 
index 431b50ced7d01ea82acf5cb60927e53d2959871f..8e8ec08621453900c4bbaade4a59cd89457a2c67 100644 (file)
@@ -1,11 +1,11 @@
-// Copyright (C) 2008  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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
+// 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.
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File:    SalomeApp_NoteBookDlg.h
 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
 // Module : GUI
-
+//
 #ifndef SALOMEAPP_NOTEBOOKDLG_H
 #define SALOMEAPP_NOTEBOOKDLG_H
 
@@ -35,6 +36,7 @@
 class QWidget;
 class QPushButton;
 class QTableWidgetItem;
+class NoteBook_Table;
 
 struct NoteBoox_Variable
 {
@@ -53,7 +55,7 @@ typedef QMap< int, NoteBoox_Variable > VariableMap;
 class SALOMEAPP_EXPORT NoteBook_TableRow : public QWidget
 {
  public:
-  NoteBook_TableRow(int, QWidget* parent=0);
+  NoteBook_TableRow(int, NoteBook_Table* parentTable, QWidget* parent=0 );
   virtual ~NoteBook_TableRow();
 
   int  GetIndex() const { return myIndex; }
@@ -76,9 +78,11 @@ class SALOMEAPP_EXPORT NoteBook_TableRow : public QWidget
   static bool IsRealValue(const QString theValue, double* theResult = 0);
   static bool IsIntegerValue(const QString theValue, int* theResult = 0);
   static bool IsBooleanValue(const QString theValue, bool* theResult = 0);
+  bool IsValidStringValue(const QString theName);
   
  private:
   int               myIndex;
+  NoteBook_Table*   myParentTable;
   QTableWidgetItem* myRowHeader;
   QTableWidgetItem* myVariableName;
   QTableWidgetItem* myVariableValue;
@@ -93,7 +97,7 @@ class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget
 
   void Init(_PTR(Study) theStudy);
   static QString Variable2String(const std::string& theVarName,
-                                _PTR(Study) theStudy);
+                                 _PTR(Study) theStudy);
 
   bool IsValid() const;
 
@@ -118,6 +122,8 @@ class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget
 
   void ResetMaps();
 
+  QList<NoteBook_TableRow*>          myRows;
+
   public slots:
     void onItemChanged(QTableWidgetItem* theItem);
 
@@ -126,7 +132,6 @@ class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget
     
  private:
   bool isProcessItemChangedSignal;
-  QList<NoteBook_TableRow*>          myRows;
 
   bool        myIsModified;
   QList<int>  myRemovedRows;
index b60117d08be838c219bbb532c971a7543766a19d..13b5a43639630992e9ea015aa2ba2f07854e44b7 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SalomeApp_PyInterp.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #include "SalomeApp_PyInterp.h"
 
 #include <utilities.h>
@@ -32,8 +31,6 @@
 
 #include "PyInterp.h" // this include must be first (see PyInterp_base.h)!
 
-using namespace std;
-
 /*!
  * constructor : multi Python interpreter, one per SALOME study.
  * calls initialize method defined in base class, which calls virtual methods
@@ -92,7 +89,7 @@ bool SalomeApp_PyInterp::initContext()
 
   // Call init_shared_modules to initialize the shared import mechanism for modules 
   //that must not be imported twice
-  PyObjWrapper m2( PyObject_CallMethod( m1, "init_shared_modules", "O", KERNEL_PYTHON::salome_shared_modules_module ) );
+  PyObjWrapper m2( PyObject_CallMethod( m1, (char*)"init_shared_modules", (char*)"O", KERNEL_PYTHON::salome_shared_modules_module ) );
   if ( !m2 )
   {
     MESSAGE( "initContext: problem with init_shared_modules call" );
@@ -110,7 +107,7 @@ bool SalomeApp_PyInterp::initContext()
  */
 void SalomeApp_PyInterp::initPython()
 {
-  MESSAGE("PyInterp_base::initPython");
+  MESSAGE("SalomeApp_PyInterp::initPython");
   ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main
   SCRUTE(KERNEL_PYTHON::_gtstate);
   _gtstate=KERNEL_PYTHON::_gtstate;
index baef2fffda2f81159c3ea61747139d2a3a7f8fc2..88ae02efab2acd7ce13e19eb82af938bdd2a9055 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : SalomeApp_PyInterp.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef _SalomeApp_PYINTERP_H_
 #define _SalomeApp_PYINTERP_H_
 
index 1c040af7df600b53178b3e251aa82c75a704c05b..1a38c88e12a179a31704ddca75a4d17a7ffa0905 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_Study.h"
 
 #include "SalomeApp_Module.h"
 // temporary commented
 //#include <OB_Browser.h>
 
+#include <QCoreApplication>
+#include <QEvent>
+#include <QFileInfo>
+#include "SALOME_Event.h"
+#include "Basics_Utils.hxx"
+
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_TreeModel.h>
+#include <SUIT_DataBrowser.h>
+
+#include <LightApp_Displayer.h>
 
 #include "utilities.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOME_Exception)
 
-using namespace std;
+//#define NOTIFY_BY_EVENT
+
+class ObserverEvent : public QEvent
+{
+public:
+  ObserverEvent(const char* theID, CORBA::Long event):QEvent(QEvent::User)
+  {
+    _anID=theID;
+    _event=event;
+  }
+
+  std::string _anID;
+  CORBA::Long _event;
+};
+
+class SalomeApp_Study::Observer_i : public virtual POA_SALOMEDS::Observer, QObject
+{
+  typedef std::map<std::string, SalomeApp_DataObject*>           EntryMap;
+  typedef std::map<std::string, SalomeApp_DataObject*>::iterator EntryMapIter;
+
+public:
+
+  Observer_i(_PTR(Study) aStudyDS, SalomeApp_Study* aStudy)
+  {
+    myStudyDS=aStudyDS;
+    myStudy=aStudy;
+    fillEntryMap();
+  }
+
+  SUIT_DataObject* findObject( const char* theID ) const
+  {
+    EntryMap::const_iterator it = entry2SuitObject.find( theID );
+    return it != entry2SuitObject.end() ? it->second : 0;
+  }
+
+  virtual void notifyObserverID(const char* theID, CORBA::Long event)
+  {
+#ifdef NOTIFY_BY_EVENT
+    QCoreApplication::postEvent(this,new ObserverEvent(theID,event));
+#else
+    notifyObserverID_real(theID,event);
+#endif
+  }
+
+  virtual bool event(QEvent *event)
+  {
+    if (event->type() == QEvent::User )
+    {
+      //START_TIMING(notify);
+      notifyObserverID_real(static_cast<ObserverEvent *>(event)->_anID.c_str(),static_cast<ObserverEvent *>(event)->_event);
+      //END_TIMING(notify,100);
+    }
+    return true;
+  }
+
+  void notifyObserverID_real(const std::string& theID, long event)
+  {
+    SalomeApp_DataObject* suit_obj = 0;
+
+    switch(event) {
+    case 1:
+      { //Add sobject
+        _PTR(SObject) aSObj = myStudyDS->FindObjectID(theID);
+        _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
+
+        if (!aSComp || aSComp->IsNull()) {
+          MESSAGE("Entry " << theID << " has not father component. Problem ??");
+          return;
+        }
+
+        // Mantis issue 0020136: Drag&Drop in OB
+        _PTR(UseCaseBuilder) aUseCaseBuilder = myStudyDS->GetUseCaseBuilder();
+        if (aUseCaseBuilder->IsUseCaseNode(aSComp)) { // BEGIN: work with tree nodes structure
+          if (!aUseCaseBuilder->IsUseCaseNode(aSObj)) {
+            // tree node is not yet set, it is a normal situation
+            return;
+          }
+
+          _PTR(SObject) aFatherSO = aUseCaseBuilder->GetFather(aSObj);
+          if (!aFatherSO || aFatherSO->IsNull()) {
+            MESSAGE("Father SObject is not found. Problem ??");
+            return;
+          }
+
+          std::string parent_id = aFatherSO->GetID();
+          EntryMapIter it = entry2SuitObject.find(parent_id.c_str());
+
+          if (it == entry2SuitObject.end()) {
+            MESSAGE("Father data object is not found. Problem ??");
+            return;
+          }
+
+          SalomeApp_DataObject* aFatherDO = it->second;
+
+          it = entry2SuitObject.find(theID);
+          if (it != entry2SuitObject.end()) { // this SOobject is already added somethere
+            suit_obj = it->second;
+            SUIT_DataObject* oldFather = suit_obj->parent();
+            if (oldFather) {
+              oldFather->removeChild(suit_obj, false);
+             SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( myStudy->application() );
+             SUIT_AbstractModel* model = dynamic_cast<SUIT_AbstractModel*>(app->objectBrowser()->model());
+             model->forgetObject( suit_obj );
+               
+              if (SalomeApp_DataObject* oldFatherSA = dynamic_cast<SalomeApp_DataObject*>(oldFather)) {
+                oldFatherSA->updateItem();
+              }
+            }
+          }
+          else {
+            suit_obj = new SalomeApp_DataObject(aSObj);
+            entry2SuitObject[theID] = suit_obj;
+          }
+
+         suit_obj->updateItem();
+          // define position in the data tree (in aFatherDO) to insert the aSObj
+          int pos = -1;
+          //int childDataObjCount = aFatherDO->childCount();
+          _PTR(UseCaseIterator) aUseCaseIter = aUseCaseBuilder->GetUseCaseIterator(aFatherSO);
+          for (int cur = 0; aUseCaseIter->More() && pos < 0; cur++, aUseCaseIter->Next()) {
+            if (aUseCaseIter->Value()->GetID() == theID) {
+              pos = cur;
+              break;
+            }
+          }
+
+          aFatherDO->insertChildAtPos(suit_obj, pos);
+          //aFatherDO->insertChild(suit_obj, pos);
+          aFatherDO->updateItem();
+
+        } // END: work with tree nodes structure
+        else { // BEGIN: work with study structure
+          EntryMapIter it = entry2SuitObject.find( theID );
+          if ( it != entry2SuitObject.end() ) {
+            MESSAGE("Entry " << theID << " is already added. Problem ??");
+            return;
+          }
+
+          int last2Pnt_pos = theID.rfind( ":" );
+          std::string parent_id = theID.substr( 0, last2Pnt_pos );
+          int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() );
+
+          if ( parent_id.length() == 3 ) // "0:1" - root item?
+          {
+            // It's probably a SComponent
+            if ( theID == aSComp->GetID() )
+              suit_obj = new SalomeApp_ModuleObject( aSComp );
+            else
+              suit_obj = new SalomeApp_DataObject( aSObj );
+          }
+          else
+          {
+            suit_obj = new SalomeApp_DataObject( aSObj );
+          }
+
+          it = entry2SuitObject.find( parent_id );
+          if ( it != entry2SuitObject.end() ) {
+            SalomeApp_DataObject* father = it->second;
+            father->insertChildAtTag( suit_obj, tag );
+          }
+          else {
+            if ( parent_id.length() == 3 ) // "0:1" - root item?
+            {
+              // This should be for a module
+              SUIT_DataObject* father=myStudy->root();
+              father->appendChild(suit_obj);
+            }
+            else
+            {
+              MESSAGE("SHOULD NEVER GET HERE!!!");
+
+              //Try to find the SalomeApp_DataObject object parent
+              std::string root_id = parent_id.substr( 0, 4 );
+              std::string obj_id = parent_id.substr( 4 );
+
+              std::string anID;
+              std::string::size_type debut = 0;
+              std::string::size_type fin;
+              SalomeApp_DataObject* anObj = dynamic_cast<SalomeApp_DataObject*>( myStudy->root() );
+              while ( 1 ) {
+                fin = obj_id.find_first_of( ':', debut );
+                if ( fin == std::string::npos ) {
+                  //last id
+                  anObj = dynamic_cast<SalomeApp_DataObject*>(anObj->childObject(atoi(obj_id.substr(debut).c_str())-1));
+                  entry2SuitObject[parent_id] = anObj;
+                  break;
+                }
+                anID = root_id + obj_id.substr( 0, fin );
+                EntryMapIter it2 = entry2SuitObject.find( anID );
+                if ( it2 == entry2SuitObject.end() ) {
+                  //the ID is not known in entry2SuitObject
+                  anObj = dynamic_cast<SalomeApp_DataObject*>(anObj->childObject(atoi(obj_id.substr(debut, fin-debut).c_str())-1));
+                  entry2SuitObject[anID] = anObj;
+                }
+                else
+                  anObj = it2->second;
+                debut = fin+1;
+              }
+              anObj->insertChildAtTag( suit_obj, tag );
+            }
+          }
+          entry2SuitObject[theID] = suit_obj;
+        } // END: work with study structure
+        break;
+      }
+    case 2:
+      { // Remove sobject
+        EntryMapIter it = entry2SuitObject.find( theID );
+        if ( it != entry2SuitObject.end() )
+        {
+          suit_obj = it->second;
+          // VSR: object is not removed, since SALOMEDS::SObject is not actually removed,
+          //      only its attributes are cleared;
+          //      thus, the object can be later reused
+          suit_obj->updateItem();
+          //SUIT_DataObject* father=suit_obj->parent();
+          //if(father)
+          //  father->removeChild(suit_obj);
+          //entry2SuitObject.erase(it);
+        }
+        else
+        {
+          MESSAGE("Want to remove an unknown object" << theID);
+        }
+        break;
+      }
+    case 0:
+      { //modify sobject
+        //MESSAGE("Want to modify an object "  << theID);
+        EntryMapIter it = entry2SuitObject.find( theID );
+        if ( it != entry2SuitObject.end() )
+        {
+          suit_obj = it->second;
+          suit_obj->updateItem();
+        }
+        else
+        {
+          MESSAGE("Want to modify an unknown object"  << theID);
+        }
+        break;
+      }
+    case 5: //IOR of the object modified
+      {
+        EntryMapIter it = entry2SuitObject.find( theID );
+        if ( it != entry2SuitObject.end() )
+          suit_obj = it->second;
+
+        /* Define visibility state */
+        bool isComponent = dynamic_cast<SalomeApp_ModuleObject*>( suit_obj ) != 0;
+        if ( suit_obj && !isComponent ) {
+          QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType());
+          if (!moduleTitle.isEmpty()) {
+            LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false);
+            if (aDisplayer) {
+              if(aDisplayer->canBeDisplayed(theID.c_str())) {
+                myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState );
+                //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
+              }
+              else
+                MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
+            }
+          }
+        }
+        break;
+      }
+    default:MESSAGE("Unknown event: "  << event);break;
+    } //switch
+  } //notifyObserverID_real
+
+private:
+  void fillEntryMap()
+  {
+    entry2SuitObject.clear();
+    SUIT_DataObject* o = myStudy->root();
+    while (o) {
+      SalomeApp_DataObject* so = dynamic_cast<SalomeApp_DataObject*>( o );
+      if ( so ) {
+        std::string entry = so->entry().toLatin1().constData();
+        if ( entry.size() )
+          entry2SuitObject[entry] = so;
+      }
+      if ( o->childCount() > 0 ) {
+        // parse the children
+        o = o->firstChild();
+      }
+      else if ( o->nextBrother() > 0 ) {
+        o = o->nextBrother();
+      }
+      else {
+        // step to the next appropriate parent
+        o = o->parent();
+        while ( o ) {
+          if ( o->nextBrother() ) {
+            o = o->nextBrother();
+            break;
+          }
+          o = o->parent();
+        }
+      }
+    }
+  }
+
+private:
+  _PTR(Study)      myStudyDS;
+  SalomeApp_Study* myStudy;
+  EntryMap         entry2SuitObject;
+};
+
 
 /*!
   Constructor.
 */
 SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
-: LightApp_Study( app )
+: LightApp_Study( app ), myObserver( 0 )
 {
-}  
+}
 
 /*!
   Destructor.
@@ -65,11 +383,30 @@ SalomeApp_Study::~SalomeApp_Study()
 int SalomeApp_Study::id() const
 {
   int id = -1;
-  if ( myStudyDS )
+  if ( studyDS() )
     id = studyDS()->StudyId();
   return id;
 }
 
+/*!
+  Get study name.
+*/
+QString SalomeApp_Study::studyName() const
+{
+  // redefined from SUIT_Study to update study name properly since
+  // it can be changed outside of GUI
+  // TEMPORARILY SOLUTION: better to be implemented with help of SALOMEDS observers
+  if ( studyDS() ) {
+    QString newName = studyDS()->Name().c_str();
+    if ( LightApp_Study::studyName() != newName ) {
+      SalomeApp_Study* that = const_cast<SalomeApp_Study*>( this );
+      that->setStudyName( newName );
+      ((SalomeApp_Application*)application())->updateDesktopTitle();
+    }
+  }
+  return LightApp_Study::studyName();
+}
+
 /*!
   Gets studyDS pointer.
 */
@@ -83,11 +420,11 @@ _PTR(Study) SalomeApp_Study::studyDS() const
 */
 bool SalomeApp_Study::createDocument( const QString& theStr )
 {
-  MESSAGE( "openDocument" );
+  MESSAGE( "createDocument" );
 
   // initialize myStudyDS, read HDF file
   QString aName = newStudyName();
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toStdString() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) );
   if ( !study )
     return false;
 
@@ -95,9 +432,20 @@ bool SalomeApp_Study::createDocument( const QString& theStr )
   setStudyName( aName );
 
   // create myRoot
-  setRoot( new SalomeApp_RootObject( this ) );
+  SalomeApp_RootObject* aRoot=new SalomeApp_RootObject( this );
+#ifdef WITH_SALOMEDS_OBSERVER
+  aRoot->setToSynchronize(false);
+#endif
+  setRoot( aRoot );
 
   bool aRet = CAM_Study::createDocument( theStr );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+  myObserver = new Observer_i(myStudyDS,this);
+  //attach an observer to the study with notification of modifications
+  myStudyDS->attach(myObserver->_this(),true);
+#endif
+
   emit created( this );
 
   return aRet;
@@ -112,7 +460,7 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
   MESSAGE( "openDocument" );
 
   // initialize myStudyDS, read HDF file
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( (char*) theFileName.toStdString().c_str() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) );
   if ( !study )
     return false;
 
@@ -124,16 +472,23 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
   ModelList dm_s;
   dataModels( dm_s );
   QListIterator<CAM_DataModel*> it( dm_s );
-  while ( it.hasNext() ) 
+  while ( it.hasNext() )
     openDataModel( studyName(), it.next() );
-  
+
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
-  // but tree that corresponds to not-loaded data models will be updated any way. 
-  ((SalomeApp_Application*)application())->updateObjectBrowser( false ); 
+  // but tree that corresponds to not-loaded data models will be updated any way.
+  ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+  dynamic_cast<SalomeApp_RootObject*>( root() )->setToSynchronize(false);
+  myObserver = new Observer_i(myStudyDS,this);
+  //attach an observer to the study with notification of modifications
+  myStudyDS->attach(myObserver->_this(),true);
+#endif
 
   bool res = CAM_Study::openDocument( theFileName );
-  
+
   emit opened( this );
   study->IsSaved(true);
 
@@ -144,7 +499,7 @@ bool SalomeApp_Study::openDocument( const QString& theFileName )
       SalomeApp_VisualState( (SalomeApp_Application*)application() ).restoreState( savePoints[savePoints.size()-1] );
   }
 
-  ((SalomeApp_Application*)application())->updateObjectBrowser( true ); 
+  ((SalomeApp_Application*)application())->updateObjectBrowser( true );
   return res;
 }
 
@@ -157,7 +512,7 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName )
   MESSAGE( "loadDocument" );
 
   // obtain myStudyDS from StudyManager
-  _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( (char*) theStudyName.toStdString().c_str() ) );
+  _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( theStudyName.toUtf8().data() ) );
   if ( !study )
     return false;
 
@@ -177,8 +532,15 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName )
 
   // this will build a SUIT_DataObject-s tree under myRoot member field
   // passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
-  // but tree that corresponds to not-loaded data models will be updated any way. 
-  ((SalomeApp_Application*)application())->updateObjectBrowser( false ); 
+  // but tree that corresponds to not-loaded data models will be updated any way.
+  ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+  dynamic_cast<SalomeApp_RootObject*>( root() )->setToSynchronize(false);
+  myObserver = new Observer_i(myStudyDS,this);
+  //attach an observer to the study with notification of modifications
+  myStudyDS->attach(myObserver->_this(),true);
+#endif
 
   bool res = CAM_Study::openDocument( theStudyName );
   emit opened( this );
@@ -203,17 +565,20 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName )
   bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", false );
   if ( store )
     SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
-  
+
   ModelList list; dataModels( list );
 
   QListIterator<CAM_DataModel*> it( list );
   QStringList listOfFiles;
   while ( it.hasNext() ) {
-    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+    // Cast to LightApp class in order to give a chance
+    // to light modules to save their data
+    if ( LightApp_DataModel* aModel = 
+        dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
       listOfFiles.clear();
       aModel->saveAs( theFileName, this, listOfFiles );
       if ( !listOfFiles.isEmpty() )
-       saveModuleData(aModel->module()->name(), listOfFiles);
+        saveModuleData(aModel->module()->name(), listOfFiles);
     }
   }
 
@@ -224,11 +589,11 @@ bool SalomeApp_Study::saveDocumentAs( const QString& 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.toStdString(), studyDS(), isMultiFile ) :
-    SalomeApp_Application::studyMgr()->SaveAs     ( theFileName.toStdString(), studyDS(), isMultiFile ))
+  bool res = (isAscii ?
+    SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.toUtf8().data(), studyDS(), isMultiFile ) :
+    SalomeApp_Application::studyMgr()->SaveAs     ( theFileName.toUtf8().data(), studyDS(), isMultiFile ))
     && CAM_Study::saveDocumentAs( theFileName );
-  
+
   res = res && saveStudyData(theFileName);
 
   if ( res )
@@ -251,11 +616,14 @@ bool SalomeApp_Study::saveDocument()
   QListIterator<CAM_DataModel*> it( list );
   QStringList listOfFiles;
   while ( it.hasNext() ) {
-    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+    // Cast to LightApp class in order to give a chance
+    // to light modules to save their data
+    if ( LightApp_DataModel* aModel = 
+        dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
       listOfFiles.clear();
       aModel->save(listOfFiles);
-      if ( !listOfFiles.isEmpty() ) 
-       saveModuleData(aModel->module()->name(), listOfFiles);
+      if ( !listOfFiles.isEmpty() )
+        saveModuleData(aModel->module()->name(), listOfFiles);
     }
   }
 
@@ -266,13 +634,13 @@ bool SalomeApp_Study::saveDocument()
 
   bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
   bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false );
-  bool res = (isAscii ? 
+  bool res = (isAscii ?
     SalomeApp_Application::studyMgr()->SaveASCII( studyDS(), isMultiFile ) :
     SalomeApp_Application::studyMgr()->Save     ( studyDS(), isMultiFile )) && CAM_Study::saveDocument();
 
   res = res && saveStudyData(studyName());
   if ( res )
-    emit saved( this );  
+    emit saved( this );
 
   return res;
 }
@@ -296,6 +664,80 @@ void SalomeApp_Study::closeDocument(bool permanently)
   }
 }
 
+/*!
+  Dump study operation. Writes a Python dump file using
+  SALOMEDS services. Additionally, gives a chance to light modules
+  to participate in dump study operation.
+
+  \param theFileName - full path to the output Python file
+  \param toPublish - if true, all objects are published in a study 
+  by the output script, including those not orignally present 
+  in the current study.
+  \param isMultiFile - if true, each module's dump is written into 
+  a separate Python file, otherwise a single output file is written
+  \param toSaveGUI - if true, the GUI state is written
+
+  \return - true if the operation succeeds, and false otherwise.
+*/
+bool SalomeApp_Study::dump( const QString& theFileName, 
+                           bool toPublish, 
+                           bool isMultiFile,
+                           bool toSaveGUI )
+{
+  int savePoint;
+  _PTR(AttributeParameter) ap;
+  _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+  _PTR(Study) aStudy = studyDS();
+
+  if( ip->isDumpPython( aStudy ) ) 
+    ip->setDumpPython( aStudy ); //Unset DumpPython flag.
+
+  if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
+    ip->setDumpPython( aStudy );
+    //SRN: create a temporary save point
+    savePoint = SalomeApp_VisualState( 
+      dynamic_cast<SalomeApp_Application*>( application() ) ).storeState(); 
+  }
+
+  // Issue 21377 - Each data model is asked to dump its data not present in SALOMEDS study.
+  // This is an optional but important step, it gives a chance to light modules
+  // to dump their data as a part of common dump study operation
+  ModelList list; 
+  dataModels( list );
+
+  QListIterator<CAM_DataModel*> it( list );
+  QStringList listOfFiles;
+  while ( it.hasNext() ) {
+    if ( LightApp_DataModel* aModel = 
+        dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
+      listOfFiles.clear();
+      if ( aModel->dumpPython( theFileName, this, isMultiFile, listOfFiles ) && 
+          !listOfFiles.isEmpty() )
+       // This call simply passes the data model's dump output to SalomeApp_Engine servant.
+       // This code is shared with persistence mechanism.
+       // NOTE: this should be revised if behavior of saveModuleData() changes!
+        saveModuleData(aModel->module()->name(), listOfFiles);
+    }
+  }
+
+  // Now dump SALOMEDS part that also involves SalomeApp_Engine in case if 
+  // any light module is present in the current configuration
+  QFileInfo aFileInfo( theFileName );
+  bool res = aStudy->DumpStudy( aFileInfo.absolutePath().toUtf8().data(),
+                               aFileInfo.baseName().toUtf8().data(),
+                               toPublish,
+                               isMultiFile);
+  if ( toSaveGUI )
+    removeSavePoint( savePoint ); //SRN: remove the created temporary save point.
+
+  // Issue 21377 - Clean up light module data in SalomeApp_Engine servant
+  // This code is shared with persistence mechanism.
+  // NOTE: this should be revised if behavior of saveStudyData() changes!
+  saveStudyData( theFileName );
+
+  return res;
+}
+
 /*!
   \return true, if study is modified in comparison with last open/save
 */
@@ -305,7 +747,7 @@ bool SalomeApp_Study::isModified() const
   if (!isAnyChanged)
     isAnyChanged = LightApp_Study::isModified();
 
-  return isAnyChanged; 
+  return isAnyChanged;
 }
 
 /*!
@@ -327,7 +769,7 @@ bool SalomeApp_Study::isSaved() const
   if (!isAllSaved)
     isAllSaved = LightApp_Study::isSaved();
 
-  return isAllSaved; 
+  return isAllSaved;
 }
 
 /*!
@@ -346,7 +788,7 @@ void SalomeApp_Study::saveModuleData( QString theModuleName, QStringList theList
   for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
     if ( (*it).isEmpty() )
       continue;
-    aListOfFiles[anIndex] = (*it).toStdString();
+    aListOfFiles[anIndex] = (*it).toUtf8().data();
     anIndex++;
   }
   SetListOfFiles(theModuleName.toStdString().c_str(), aListOfFiles);
@@ -373,16 +815,22 @@ void SalomeApp_Study::openModuleData( QString theModuleName, QStringList& theLis
 }
 
 /*!
-  Saves data from study
+  Re-implemented from LightApp_Study, actually does not save anything but
+  simply cleans up light modules' data
 */
 bool SalomeApp_Study::saveStudyData( const QString& theFileName )
 {
   ModelList list; dataModels( list );
   QListIterator<CAM_DataModel*> it( list );
   std::vector<std::string> listOfFiles(0);
-  while ( it.hasNext() )
-    if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() )
-      SetListOfFiles(aModel->module()->name().toStdString().c_str(), listOfFiles);
+  while ( it.hasNext() ){
+    LightApp_DataModel* aLModel = 
+      dynamic_cast<LightApp_DataModel*>( it.next() );
+    // It is safe to call SetListOfFiles() for any kind of module
+    // because SetListOfFiles() does nothing for full modules :)
+    if ( aLModel )
+      SetListOfFiles(aLModel->module()->name().toStdString().c_str(), listOfFiles);
+  }
   return true;
 }
 
@@ -402,6 +850,54 @@ void SalomeApp_Study::setStudyDS( const _PTR(Study)& s )
   myStudyDS = s;
 }
 
+/*!
+  Virtual method re-implemented from LightApp_Study in order to create
+  the module object connected to SALOMEDS - SalomeApp_ModuleObject.
+
+  \param theDataModel - data model instance to create a module object for
+  \param theParent - the module object's parent (normally it's the study root)
+  \return the module object instance
+  \sa LightApp_Study class, LightApp_DataModel class
+*/
+CAM_ModuleObject* SalomeApp_Study::createModuleObject( LightApp_DataModel* theDataModel, 
+                                                      SUIT_DataObject* theParent ) const
+{
+  SalomeApp_Study* that = const_cast<SalomeApp_Study*>( this );
+  
+  // Ensure that SComponent instance is published in the study for the given module
+  // This line causes automatic creation of SalomeApp_ModuleObject in case if
+  // WITH_SALOMEDS_OBSERVER is defined
+  that->addComponent( theDataModel );
+  
+  // SalomeApp_ModuleObject might have been created by SALOMEDS observer
+  // or by someone else so check if it exists first of all
+  CAM_ModuleObject* res = 0;
+
+  DataObjectList children = root()->children();
+  DataObjectList::const_iterator anIt = children.begin(), aLast = children.end();
+  for( ; !res && anIt!=aLast; anIt++ )
+  {
+    SalomeApp_ModuleObject* obj = dynamic_cast<SalomeApp_ModuleObject*>( *anIt );
+    if ( obj && obj->componentDataType() == theDataModel->module()->name() )
+      res = obj;
+  }
+
+  if ( !res ){
+    _PTR(Study) aStudy = studyDS();
+    if ( !aStudy )
+      return res;
+
+    _PTR(SComponent) aComp = aStudy->FindComponent( 
+      theDataModel->module()->name().toStdString() );
+    if ( !aComp )
+      return res;
+
+    res = new SalomeApp_ModuleObject( theDataModel, aComp, theParent );
+  }
+
+  return res;
+}
+
 /*!
   Insert data model.
 */
@@ -424,13 +920,16 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm)
   if (!aModule) {
     // Check SComponent existance
     _PTR(Study) aStudy = studyDS();
-    if (!aStudy) 
+    if (!aStudy)
       return;
-    _PTR(SComponent) aComp = aStudy->FindComponent(dm->module()->name().toStdString());
+
+    std::string aCompDataType = dm->module()->name().toStdString();
+
+    _PTR(SComponent) aComp = aStudy->FindComponent(aCompDataType);
     if (!aComp) {
       // Create SComponent
       _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-      aComp = aBuilder->NewComponent(dm->module()->name().toStdString());
+      aComp = aBuilder->NewComponent(aCompDataType);
       aBuilder->SetName(aComp, dm->module()->moduleName().toStdString());
       QString anIconName = dm->module()->iconName();
       if (!anIconName.isEmpty()) {
@@ -438,11 +937,26 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm)
         if (anAttr)
           anAttr->SetPixMap(anIconName.toStdString());
       }
+
       // Set default engine IOR
-      aBuilder->DefineComponentInstance(aComp, SalomeApp_Application::defaultEngineIOR().toStdString());
+      // Issue 21377 - using separate engine for each type of light module
+      std::string anEngineIOR = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(),
+                                                                          true );
+      aBuilder->DefineComponentInstance(aComp, anEngineIOR);
       //SalomeApp_DataModel::BuildTree( aComp, root(), this, /*skipExisitng=*/true );
       SalomeApp_DataModel::synchronize( aComp, this );
     }
+    else {
+      _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+      aBuilder->SetName(aComp, dm->module()->moduleName().toStdString());
+      QString anIconName = dm->module()->iconName();
+      if (!anIconName.isEmpty()) {
+        _PTR(AttributePixMap) anAttr = aBuilder->FindOrCreateAttribute(aComp, "AttributePixMap");
+        if (anAttr)
+          anAttr->SetPixMap(anIconName.toStdString());
+      }
+      // Set default engine IOR
+    }
   }
 }
 
@@ -461,8 +975,10 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
   QString anEngine;
   // 1. aModule == 0 means that this is a light module (no CORBA enigine)
   if (!aModule) {
-    anEngine = SalomeApp_Application::defaultEngineIOR();
-    aSComp = aStudy->FindComponent(dm->module()->name().toStdString());
+    // Issue 21377 - using separate engine for each type of light module
+    std::string aCompDataType = dm->module()->name().toStdString();
+    anEngine = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(), true ).c_str();
+    aSComp = aStudy->FindComponent( aCompDataType );
   }
   else {
     SalomeApp_DataModel* aDM = dynamic_cast<SalomeApp_DataModel*>( dm );
@@ -523,7 +1039,7 @@ QString SalomeApp_Study::newStudyName() const
     curName = prefix.arg( i );
     for ( j = 0 ; j < n; j++ ){
       if ( !strcmp( studies[j].c_str(), curName.toLatin1() ) )
-       break;
+        break;
     }
     if ( j == n )
       newName = curName;
@@ -534,30 +1050,38 @@ QString SalomeApp_Study::newStudyName() const
 }
 
 /*!
+  Note that this method does not create or activate SalomeApp_Engine_i instance,
+  therefore it can be called safely for any kind of module, but for full
+  modules it returns an empty list.
   \return list of files used by module: to be used by CORBAless modules
   \param theModuleName - name of module
 */
 std::vector<std::string> SalomeApp_Study::GetListOfFiles( const char* theModuleName  ) const
 {
-  SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+  // Issue 21377 - using separate engine for each type of light module
+  SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false );
   if (aDefaultEngine)
-    return aDefaultEngine->GetListOfFiles(id(), theModuleName);
+    return aDefaultEngine->GetListOfFiles(id());
 
   std::vector<std::string> aListOfFiles;
   return aListOfFiles;
 }
 
 /*!
-  Sets list of files used by module: to be used by CORBAless modules
+  Sets list of files used by module: to be used by CORBAless modules.
+  Note that this method does not create or activate SalomeApp_Engine_i instance,
+  therefore it can be called safely for any kind of module, but for full
+  modules it simply does nothing.
   \param theModuleName - name of module
   \param theListOfFiles - list of files
 */
 void SalomeApp_Study::SetListOfFiles ( const char* theModuleName,
                                        const std::vector<std::string> theListOfFiles )
 {
-  SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+  // Issue 21377 - using separate engine for each type of light module
+  SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false );
   if (aDefaultEngine)
-    aDefaultEngine->SetListOfFiles(theListOfFiles, id(), theModuleName);
+    aDefaultEngine->SetListOfFiles(theListOfFiles, id());
 }
 
 /*!
@@ -602,6 +1126,12 @@ void SalomeApp_Study::markAsSavedIn(QString theFileName)
   setIsSaved(true);
 }
 
+LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry )
+{
+  LightApp_DataObject* o = dynamic_cast<LightApp_DataObject*>( myObserver ? myObserver->findObject( theEntry.toLatin1().constData() ) : 0 );
+  return o;
+}
+
 /*!
   Deletes all references to object
   \param obj - object
@@ -677,13 +1207,30 @@ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries
 */
 void SalomeApp_Study::components( QStringList& comps ) const
 {
-  for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() ) 
+  for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() )
+  {
+    _PTR(SComponent) aComponent ( it->Value() );
+    // skip the magic "Interface Applicative" component
+    if ( aComponent && aComponent->ComponentDataType() != getVisualComponentName().toLatin1().constData() )
+      comps.append( aComponent->ComponentDataType().c_str() );
+  }
+}
+
+/*!
+  Get the entry for the given module
+  \param comp - list to be filled
+  \return module root's entry
+*/
+QString SalomeApp_Study::centry( const QString& comp ) const
+{
+  QString e;
+  for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More() && e.isEmpty(); it->Next() )
   {
     _PTR(SComponent) aComponent ( it->Value() );
-    if( aComponent && aComponent->ComponentDataType() == "Interface Applicative" )
-      continue; // skip the magic "Interface Applicative" component
-    comps.append( aComponent->ComponentDataType().c_str() );
+    if ( aComponent && comp == aComponent->ComponentDataType().c_str() )
+      e = aComponent->GetID().c_str();
   }
+  return e;
 }
 
 /*!
@@ -693,7 +1240,7 @@ std::vector<int> SalomeApp_Study::getSavePoints()
 {
   std::vector<int> v;
 
-  _PTR(SObject) so = studyDS()->FindComponent("Interface Applicative");
+  _PTR(SObject) so = studyDS()->FindComponent( getVisualComponentName().toLatin1().constData() );
   if(!so) return v;
 
   _PTR(StudyBuilder) builder = studyDS()->NewBuilder();
@@ -714,7 +1261,7 @@ std::vector<int> SalomeApp_Study::getSavePoints()
 void SalomeApp_Study::removeSavePoint(int savePoint)
 {
   if(savePoint <= 0) return;
- _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+ _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(SObject) so = AP->GetSObject();
   _PTR(StudyBuilder) builder = studyDS()->NewBuilder();
   builder->RemoveObjectWithChildren(so);
@@ -725,7 +1272,7 @@ void SalomeApp_Study::removeSavePoint(int savePoint)
 */
 QString SalomeApp_Study::getNameOfSavePoint(int savePoint)
 {
-  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(AP);
   return ip->getProperty("AP_SAVEPOINT_NAME").c_str();
 }
@@ -735,19 +1282,11 @@ QString SalomeApp_Study::getNameOfSavePoint(int savePoint)
 */
 void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint)
 {
-  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(AP);
   ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString());
 }
 
-/*!
-  \return a name of the component where visual parameters are stored
-*/
-std::string SalomeApp_Study::getVisualComponentName()
-{
-  return "Interface Applicative";
-}
-
 /*!
  * \brief Restores the study state
  */
index 217423d1a173ce62d835677b21dbd761fa3460ff..5344264867e75245014e985900eee54471cd57d3 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_STUDY_H
 #define SALOMEAPP_STUDY_H
 
@@ -36,11 +37,14 @@ class SALOMEAPP_EXPORT SalomeApp_Study : public LightApp_Study
 {
   Q_OBJECT
 
+  class Observer_i;
+
 public:
   SalomeApp_Study( SUIT_Application* );
   virtual ~SalomeApp_Study();
 
   virtual int         id() const;
+  virtual QString     studyName() const;
 
   virtual bool        createDocument( const QString& );
   virtual bool        openDocument( const QString& );
@@ -51,6 +55,8 @@ public:
 
   virtual void        closeDocument(bool permanently = true);
 
+  virtual bool        dump( const QString&, bool, bool, bool );
+
   virtual bool        isSaved()  const;
   virtual bool        isModified() const;
   virtual void        Modified();
@@ -69,16 +75,18 @@ public:
   virtual bool        isComponent( const QString& ) const;
   virtual void        children( const QString&, QStringList& ) const;
   virtual void        components( QStringList& ) const;
+  virtual QString     centry( const QString& ) const;
 
   std::vector<int>    getSavePoints();
   void                removeSavePoint(int savePoint);
   QString             getNameOfSavePoint(int savePoint);
   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
-  virtual std::string getVisualComponentName();
 
   virtual void        restoreState(int savePoint);
   void                markAsSavedIn(QString theFileName);
 
+  virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
+
 protected:
   virtual void        saveModuleData ( QString theModuleName, QStringList theListOfFiles );
   virtual void        openModuleData ( QString theModuleName, QStringList& theListOfFiles );
@@ -94,7 +102,8 @@ protected:
   virtual void        dataModelInserted( const CAM_DataModel* );
   virtual bool        openDataModel( const QString&, CAM_DataModel* );
   void                setStudyDS(const _PTR(Study)& s );
-
+  virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel, 
+                                               SUIT_DataObject* theParent ) const;
 protected slots:
   virtual void        updateModelRoot( const CAM_DataModel* );
 
@@ -103,6 +112,7 @@ private:
 
 private:
   _PTR(Study)         myStudyDS;
+  Observer_i*         myObserver;
 };
 
 #ifdef WIN32
index ee81e8ee159e8088995c5ab94eafd337ba46f72c..2fd7dcb8af63f47517d6ec1143c9eaad2b4b180b 100644 (file)
@@ -1,32 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME SalomeApp
 //  File   : SalomeApp_StudyPropertiesDlg.cxx
-//  Author : Sergey ANIKIN
-//  Module : SALOME
-//  $Header$
-//
+//  Author : Roman NIKOLAEV
+
 #include "SalomeApp_StudyPropertiesDlg.h"
-#include "SalomeApp_ListView.h"
 #include "SalomeApp_Study.h"
 
 #include "SUIT_Session.h"
 // QT Includes
 #include <QPushButton>
 #include <QGridLayout>
+#include <QHBoxLayout>
+#include <QFrame>
+#include <QLineEdit>
+#include <QLabel>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QTextEdit>
+#include <QTreeWidget>
+#include <QPushButton>
 
-using namespace std;
-
+#include <iostream>
 #define  DEFAULT_MARGIN 11
-#define DEFAULT_SPACING 6
+#define  DEFAULT_SPACING 6
 #define     SPACER_SIZE 5
 #define MIN_LIST_WIDTH  300
 #define MIN_LIST_HEIGHT 150
 
-class SalomeApp_PropItem : public SalomeApp_ListViewItem
-{
-public:
-  /*! constructor  */
-  SalomeApp_PropItem(SalomeApp_ListView* parent,
-                    const QString       theName,
-                    const bool          theEditable,
-                    const int           theUserType) :
-  SalomeApp_ListViewItem( parent, QStringList(theName), theEditable )
-  {
-    setUserType(theUserType);
-  }
-  /*! constructor */
-  SalomeApp_PropItem(SalomeApp_ListView*     parent,
-                    SalomeApp_ListViewItem* after,
-                    const QString     theName,
-                    const bool        theEditable,
-                    const int         theUserType) :
-  SalomeApp_ListViewItem( parent, after, theName, theEditable )
-  {
-    setUserType(theUserType);
-  }
-  /*! fills widget with initial values (list or single value)*/
-  void fillWidgetWithValues( SalomeApp_EntityEdit* theWidget )
-  {
-    QStringList list;
-    switch(getUserType()) {
-    //case SalomeApp_StudyPropertiesDlg::prpModeId:
-    //  {
-    //    list << SalomeApp_StudyPropertiesDlg::tr("PRP_MODE_FROM_SCRATCH") <<
-    //        SalomeApp_StudyPropertiesDlg::tr("PRP_MODE_FROM_COPYFROM");
-    //    theWidget->insertList(list);
-    //    break;
-    //  }
-    case SalomeApp_StudyPropertiesDlg::prpLockedId:
-      {
-       list << SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) << SalomeApp_StudyPropertiesDlg::tr( "PRP_YES" );
-       theWidget->insertList(list, getValue() == SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) ? 0 : 1 );
-       break;
-      }
-    case SalomeApp_StudyPropertiesDlg::prpModificationsId:
-      {
-       SalomeApp_Study* study =
-          dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-       if (study) {
-         _PTR(Study) studyDoc = study->studyDS();
-         _PTR(AttributeStudyProperties) propAttr;
-         if ( studyDoc ) {
-           propAttr = studyDoc->GetProperties();
-           if ( propAttr ) {
-             std::vector<std::string> aUsers;
-             std::vector<int>  aMins, aHours, aDays, aMonths, aYears;
-             propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false);
-             int aCnt = aUsers.size();
-             for ( int i = 0; i < aCnt; i++ ) {
-               QString val;
-               val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
-                           aDays  [i],
-                           aMonths[i],
-                           aYears [i],
-                           aHours [i],
-                           aMins  [i]);
-               val = val + " : " + QString( aUsers[i].c_str() );
-               list.prepend(val);
-             }
-             theWidget->setDuplicatesEnabled(true);
-             theWidget->insertList(list);
-           }
-         }
-       }
-       break;
-      }
-    default:
-      {
-       SalomeApp_ListViewItem::fillWidgetWithValues(theWidget);
-       break;
-      }
-    }
-  }
-  /*! finishes editing of entity */
-  virtual UpdateType finishEditing( SalomeApp_EntityEdit* theWidget ) {
-    if ( getUserType() == SalomeApp_StudyPropertiesDlg::prpModificationsId )
-      return utCancel;
-    else
-      return SalomeApp_ListViewItem::finishEditing(theWidget);
-  }
-};
 
 /*!Constructor. Initialize study properties dialog.*/
 SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent)
-     : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
-       myChanged( false )
+  : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+    myIsChanged(false)
 {
-  setObjectName( "" );
   setModal( TRUE );
 
   setWindowTitle(tr("TLT_STUDY_PROPERTIES"));
   setSizeGripEnabled( true );
 
-  setWindowFlags( windowFlags() ^ QFlags<Qt::WindowType>(!Qt::WindowContextHelpButtonHint) );
-
-  QGridLayout* mainLayout = new QGridLayout(this);
-  mainLayout->setMargin(DEFAULT_MARGIN);
-  mainLayout->setSpacing(DEFAULT_SPACING);
-
-  myPropList = new SalomeApp_ListView(this);
-  myPropList->setColumnCount(2);
-  QStringList aLabels;
-  aLabels << "" << "";
-  myPropList->setHeaderLabels( aLabels );
-  myPropList->enableEditing(TRUE);
-  myPropList->setMinimumSize(MIN_LIST_WIDTH, MIN_LIST_HEIGHT);
-  mainLayout->addWidget(myPropList, 0, 0, 1, 3);
-
-  myOKBtn = new QPushButton(tr("BUT_OK"), this);
-  mainLayout->addWidget(myOKBtn, 1, 0);
-
-  myCancelBtn = new QPushButton(tr("BUT_CANCEL"), this);
-  mainLayout->addWidget(myCancelBtn, 1, 2);
-
-  QSpacerItem* spacer1 =
-    new QSpacerItem(SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum);
-  mainLayout->addItem(spacer1, 1, 1);
+  setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );
 
   // Display study properties
   SalomeApp_Study* study =
@@ -179,10 +75,77 @@ SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent)
   if (study)
     myStudyDoc = study->studyDS();
 
-  initData();
+  //Author
+  QLabel* authorLbl = new QLabel(tr("PRP_AUTHOR"),this);
+  myAuthor = new QLineEdit(this);
+
+  //Creation date
+  QLabel* dateLbl = new QLabel(tr("PRP_DATE"),this);
+  myDate = new QLabel(this);
+
+  //Locked flag
+  myLocked = new QCheckBox(tr("PRP_LOCKED"), this);
+
+  //Modification flag
+  myModification = new QLabel(this);
+
+  //Units
+  QLabel* unitsLbl = new QLabel(tr("PRP_UNITS"),this);
+  myUnits = new QComboBox(this);
+
+  //Comment
+  QLabel* commentLabel = new QLabel(tr("PRP_COMMENT"),this);
+  myComment = new QTextEdit(this);
+  myComment->setMaximumHeight(80);
 
-  connect(myOKBtn,     SIGNAL(clicked()), this, SLOT(onOK()));
-  connect(myCancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
+  //Modifications
+  QLabel* modificationsLabel = new QLabel(tr("PRP_MODIFICATIONS"),this);  
+  myModifications = new QTreeWidget(this);
+  myModifications->setRootIsDecorated(false);
+  myModifications->setUniformRowHeights(true);
+  myModifications->setAllColumnsShowFocus(true);
+  myModifications->setColumnCount(2);
+  myModifications->setMaximumHeight(80);
+  QStringList columnNames;
+  columnNames.append(tr("PRP_AUTHOR"));
+  columnNames.append(tr("PRP_DATE_MODIF"));
+
+  QTreeWidgetItem * headerItem = new QTreeWidgetItem(columnNames);
+  myModifications->setHeaderItem ( headerItem );
+
+  QFrame* buttonFrame = new QFrame(this);
+
+  QHBoxLayout* horizontalLayout = new QHBoxLayout(buttonFrame);
+  
+  myOkButton = new QPushButton(tr("BUT_OK"), buttonFrame);
+  myCancelButton = new QPushButton(tr("BUT_CANCEL"), buttonFrame);
+
+  horizontalLayout->addWidget(myOkButton);
+  horizontalLayout->addItem( new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum) );
+  horizontalLayout->addWidget(myCancelButton);
+  
+  QGridLayout* gridLayout = new QGridLayout(this);
+  gridLayout->setMargin(DEFAULT_MARGIN);
+  gridLayout->setSpacing(DEFAULT_SPACING);
+  gridLayout->addWidget(authorLbl, 0, 0, 1, 1);
+  gridLayout->addWidget(myAuthor, 0, 1, 1, 1);
+  gridLayout->addWidget(dateLbl, 1, 0, 1, 1);
+  gridLayout->addWidget(myDate, 1, 1, 1, 1);
+  gridLayout->addWidget(myLocked, 2, 0, 1, 1);
+  gridLayout->addWidget(myModification, 2, 1, 1, 1);
+  gridLayout->addWidget(unitsLbl, 3, 0, 1, 1);
+  gridLayout->addWidget(myUnits, 3, 1, 1, 1);
+  gridLayout->addItem(new QSpacerItem(/*72*/0, 0/*20*/, QSizePolicy::Expanding, QSizePolicy::Minimum), 3, 2, 1, 1);
+  gridLayout->addWidget(commentLabel, 4, 0, 1, 1);
+  gridLayout->addWidget(myComment, 4, 1, 1, 2);
+  gridLayout->addWidget(modificationsLabel, 5, 0, 1, 1);
+  gridLayout->addWidget(myModifications, 5, 1, 1, 2);
+  gridLayout->addWidget(buttonFrame, 6, 0, 1, 3);
+
+  connect(myOkButton,     SIGNAL(clicked()), this, SLOT(clickOnOk()));
+  connect(myCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
+  
+  initData();
 }
 
 /*!
@@ -202,172 +165,133 @@ void SalomeApp_StudyPropertiesDlg::initData()
   if (hasData)
     propAttr = myStudyDoc->GetProperties();
   hasData = hasData && propAttr;
-
-  // Study author's name
-  SalomeApp_PropItem* item = new SalomeApp_PropItem(myPropList, tr("PRP_AUTHOR")+":", true, prpAuthorId);
-  if (hasData)
-    item->setValue(propAttr->GetUserName().c_str());
-
-  // Date of creation
-  item = new SalomeApp_PropItem(myPropList, item, tr("PRP_DATE")+":", false, prpDateId);
+  
   if (hasData) {
+    //Creator and creation date
+    myAuthor->setText(propAttr->GetUserName().c_str());
     int minutes, hours, day, month, year;
     if (propAttr->GetCreationDate(minutes, hours, day, month, year)) {
       QString strDate;
       strDate.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", day, month, year, hours, minutes);
-      item->setValue(strDate);
+      myDate->setText(strDate);
+    }
+    
+    //Is Locked?
+    myLocked->setChecked(propAttr->IsLocked());
+
+    //Is Modified?
+    bool isModified = false;
+    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>
+      (SUIT_Session::session()->activeApplication()->activeStudy());
+    if (study) {
+      isModified = study->isModified();
+      if (hasData) {
+        if (propAttr->IsModified() != isModified) {
+          propAttr->SetModified((int)isModified);
+        }
+      }
     }
-  }
 
-  // Creation mode
-//  item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODE")+":", true, prpModeId);
-//  item->setEditingType( SalomeApp_EntityEdit::etComboBox);
-//  if (hasData) item->setValue(propAttr->GetCreationMode());
+    QString modif = propAttr->IsModified() ? tr( "PRP_MODIFIED" ) : tr( "PRP_NOT_MODIFIED" );
+    myModification->setText(modif);
+    
+    //Units
+    QStringList theList;
+    theList <<""<<"mm"<<"cm"<<"m"<<"km"<<"inch";
+    myUnits->insertItems(0,theList); 
 
-  // Locked or not
-  item = new SalomeApp_PropItem(myPropList, item, tr("PRP_LOCKED")+":", true, prpLockedId);
-  item->setEditingType( SalomeApp_EntityEdit::etComboBox);
-  if ( hasData )
-    item->setValue( tr( propAttr->IsLocked() ? "PRP_YES" : "PRP_NO" ) );
+    QString anUnit = propAttr->GetUnits().c_str();
 
-  // Saved or not
-  item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODIFIED")+":", false, prpSavedId);
-  bool isModified = false;
-  SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>
-    (SUIT_Session::session()->activeApplication()->activeStudy());
-  if (study) {
-    isModified = study->isModified();
-    if (hasData) {
-      if (propAttr->IsModified() != isModified) {
-        propAttr->SetModified((int)isModified);
+    int aFound = -1;
+    for (int i = 0; i < myUnits->count(); i++) {
+      if ( myUnits->itemText(i) == anUnit ) {
+        aFound = i;
+        break;
       }
     }
-  }
-  if (hasData) {
-    if (propAttr->IsModified())
-      item->setValue( tr( "PRP_YES" ) );
-    else
-      item->setValue( tr( "PRP_NO" ) );
-  }
-
-  // Modifications list
-  item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODIFICATIONS")+":", true, prpModificationsId);
-  item->setEditingType( SalomeApp_EntityEdit::etComboBox);
-  if (hasData) {
+    
+    if (aFound >= 0) {
+      myUnits->setCurrentIndex(aFound);
+    }
+    
+    //Comments
+    myComment->setPlainText(propAttr->GetComment().c_str());
+    
+    //Modifications
     std::vector<std::string> aUsers;
-    std::vector<int> aMins, aHours, aDays, aMonths, aYears;
+    std::vector<int>  aMins, aHours, aDays, aMonths, aYears;
     propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false);
-    int aLast = aUsers.size()-1;
-    if (aLast >= 0) {
-      QString val;
-      val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
-                 aDays  [aLast],
-                 aMonths[aLast],
-                 aYears [aLast],
-                 aHours [aLast],
-                 aMins  [aLast]);
-      val = val + " : " + QString(aUsers[aUsers.size()-1].c_str());
-      item->setValue(val);
-    }
+    int aCnt = aUsers.size();
+    for ( int i = 0; i < aCnt; i++ ) {
+      QString date;
+      date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
+                  aDays  [i],
+                  aMonths[i],
+                  aYears [i],
+                  aHours [i],
+                  aMins  [i]);
+      QStringList aList;
+      aList.append(aUsers[i].c_str());
+      aList.append(date);
+      QTreeWidgetItem* item = new  QTreeWidgetItem(aList);
+      myModifications->addTopLevelItem(item);
+    }        
   }
-
-  myOKBtn->setEnabled(hasData);
-}
-
-/*!
-  accept data. Return true.
-*/
-bool SalomeApp_StudyPropertiesDlg::acceptData()
-{
-  return TRUE;
+  adjustSize();
 }
 
 /*!
   Fill properties attributes.
 */
-void SalomeApp_StudyPropertiesDlg::onOK()
+void SalomeApp_StudyPropertiesDlg::clickOnOk()
 {
-  myPropList->accept();
-
-  if (acceptData()) {
-    _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
-    //myChanged = propChanged();
-    if ( propAttr /*&& myChanged*/ ) {
-      QTreeWidgetItemIterator it( myPropList );
-      // iterate through all items of the listview
-      while (*it) {
-       SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
-       switch (item->getUserType()) {
-       case prpAuthorId:
-          if (QString(propAttr->GetUserName().c_str()) != item->getValue().trimmed()) {
-            if (!propAttr->IsLocked()) {
-              propAttr->SetUserName(item->getValue().trimmed().toStdString());
-              myChanged = true;
-            } else {
-              SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
-                                      QObject::tr("WRN_WARNING"),
-                                      QObject::tr("WRN_STUDY_LOCKED") );
-            }
-          }
-         break;
-        //case prpModeId:
-       //  propAttr->SetCreationMode(item->getValue().trimmed().latin1());
-       //  break;
-       case prpLockedId:
-          {
-            bool bLocked = item->getValue().compare(tr("PRP_YES")) == 0;
-            if (propAttr->IsLocked() != bLocked) {
-              propAttr->SetLocked(bLocked);
-              myChanged = true;
-            }
-          }
-         break;
-       default:
-         break;
-       }
-       ++it;
+  _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
+  //Firstly, store locked flag
+  if(propAttr) {
+    bool bLocked = myLocked->isChecked();
+    if (propAttr->IsLocked() != bLocked) {
+      propAttr->SetLocked(bLocked);
+      myIsChanged = true;
+    }
+    
+    bool needWarning = false;
+    
+    //Author
+    if (QString(propAttr->GetUserName().c_str()) != myAuthor->text().trimmed()) {
+      if(!propAttr->IsLocked()) {
+        propAttr->SetUserName(myAuthor->text().trimmed().toStdString());
+        myIsChanged = true;
+      } else {
+        needWarning = true;
       }
     }
-    accept();
-  }
-}
-
-/*!
-  Check is properties changed?
-*/
-bool SalomeApp_StudyPropertiesDlg::propChanged()
-{
-  _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
-  if (propAttr) {
-    QTreeWidgetItemIterator it (myPropList);
 
-    // iterate through all items of the listview
-    while (*it) {
-      SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
-      switch (item->getUserType()) {
-      case prpAuthorId:
-       if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().trimmed() ) {
-         return true;
-       }
-       break;
-      //case prpModeId:
-      //  if ( QString( propAttr->GetCreationMode().c_str() ) != item->getValue().trimmed() ) {
-      //    return true;
-      //  }
-      //  break;
-      case prpLockedId:
-       {
-         bool bLocked = item->getValue().compare( tr( "PRP_YES" ) ) == 0;
-         if ( propAttr->IsLocked() != bLocked ) {
-           return true;
-         }
-         break;
-       }
-      default:
-       break;
+    //Unit
+    if (QString(propAttr->GetUnits().c_str()) != myUnits->currentText()) {
+      if(!propAttr->IsLocked()) {
+        propAttr->SetUnits(myUnits->currentText().toStdString());
+        myIsChanged = true;
+      } else {
+        needWarning = true;
       }
-      ++it;
     }
+      
+    //Comment      
+    if (QString(propAttr->GetComment().c_str()) != myComment->toPlainText()) {
+      if(!propAttr->IsLocked()) {
+        propAttr->SetComment(myComment->toPlainText().toStdString());
+        myIsChanged = true;
+      } else {
+        needWarning = true;
+      }
+    }
+    
+    if(needWarning) {
+      SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
+                               QObject::tr("WRN_WARNING"),
+                               QObject::tr("WRN_STUDY_LOCKED") );
+    }
+    
+    accept();
   }
-  return false;
 }
index ce56f996e97eee3c2a73579355233976316a950b..8ff0500d9d12fd0ee04e04cc5d4a10e1b9e98f8b 100644 (file)
@@ -1,26 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SalomeApp_StudyPropertiesDlg.h
-//  Author : Sergey ANIKIN
+//  Author : Roman NIKOLAEV
 //  Module : SALOME
 //
 #ifndef SALOMEAPP_STUDY_PROPERTIES_DLG_H
 
 #include <SALOMEDSClient_Study.hxx>
 
-class SalomeApp_ListView;
+class QLineEdit;
+class QLabel;
+class QCheckBox;
+class QComboBox;
+class QTextEdit;
+class QTreeWidget;
 class QPushButton;
 
 class SALOMEAPP_EXPORT SalomeApp_StudyPropertiesDlg : public QDialog
 { 
   Q_OBJECT
-
-public:
-  enum {
-    prpAuthorId,
-    prpModeId,
-    prpDateId,
-    prpSavedId,
-    prpLockedId,
-    prpModificationsId,
-    prpLastId
-  };
-
 public:
   SalomeApp_StudyPropertiesDlg( QWidget* parent = 0 );
   ~SalomeApp_StudyPropertiesDlg();
 
-  bool isChanged() { return myChanged; } 
-
+  bool isChanged() { return myIsChanged; }
+  
 public slots:
-  void onOK();
-
+  void clickOnOk();
 private:
-  void initData(); 
-  bool acceptData(); 
-  bool propChanged(); 
+ void initData();
   
 private:
-  SalomeApp_ListView* myPropList;
-  QPushButton*        myOKBtn;
-  QPushButton*        myCancelBtn;
-  bool                myChanged;  
-
-  _PTR(Study)         myStudyDoc;
+ _PTR(Study)          myStudyDoc;
+ bool                 myIsChanged;
+ QLineEdit*           myAuthor;
+ QLabel*              myDate;
+ QCheckBox*           myLocked;
+ QLabel*              myModification;
+ QComboBox*           myUnits;
+ QTextEdit*           myComment;
+ QTreeWidget*         myModifications;
+ QPushButton*         myOkButton;
+ QPushButton*         myCancelButton;
 };
  
 #endif // SALOMEAPP_STUDY_PROPERTIES_DLG_H
index eeb12e91ff4f7fa1d04d871af3ccbffb61388ef9..299dff91063053e2fdeb22915233402c00308388 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_Tools.h"
 
 #include <SUIT_Session.h>
 */
 Quantity_Color SalomeApp_Tools::color( const QColor& c )
 {
-       Quantity_Color aColor;
-       if ( c.isValid() )
-               aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
-       return aColor;
+        Quantity_Color aColor;
+        if ( c.isValid() )
+                aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
+        return aColor;
 }
 
 /*!
@@ -48,7 +49,7 @@ Quantity_Color SalomeApp_Tools::color( const QColor& c )
 */
 QColor SalomeApp_Tools::color( const Quantity_Color& c )
 {
-       return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) );
+        return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) );
 }
 
 /*!
@@ -63,32 +64,32 @@ QString SalomeApp_Tools::ExceptionToString( const SALOME::SALOME_Exception& S_ex
   case SALOME::COMM:
   case SALOME::INTERNAL_ERROR:
     {
-           message = QString( S_ex.details.text );
-           QString source( S_ex.details.sourceFile );
-           QString line;
-           line.setNum( S_ex.details.lineNumber );
-           message = message + " \n" + source + " : " + line;
+            message = QString( S_ex.details.text );
+            QString source( S_ex.details.sourceFile );
+            QString line;
+            line.setNum( S_ex.details.lineNumber );
+            message = message + " \n" + source + " : " + line;
       break;
     }
   case SALOME::BAD_PARAM:
     {
-           message = QString( S_ex.details.text );
+            message = QString( S_ex.details.text );
 #ifdef _DEBUG_
-           QString source( S_ex.details.sourceFile );
-           QString line;
-           line.setNum( S_ex.details.lineNumber );
-           message = message + " \n" + source + " : " + line;
+            QString source( S_ex.details.sourceFile );
+            QString line;
+            line.setNum( S_ex.details.lineNumber );
+            message = message + " \n" + source + " : " + line;
 #endif
-           break;
+            break;
     }
   default:
     {
-           message = QString( "SALOME CORBA Exception Type invalid" );
-           QString source( S_ex.details.sourceFile );
-           QString line;
-           line.setNum( S_ex.details.lineNumber );
-           message = message + " \n" + source + " : " + line;
-           break;
+            message = QString( "SALOME CORBA Exception Type invalid" );
+            QString source( S_ex.details.sourceFile );
+            QString line;
+            line.setNum( S_ex.details.lineNumber );
+            message = message + " \n" + source + " : " + line;
+            break;
     }
   }
   return message;
@@ -112,7 +113,7 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e
   case SALOME::BAD_PARAM:
     error = false;
     title = QObject::tr( "Engine Warning" );
-         break;
+          break;
   default:
     title = QObject::tr( "Internal SALOME Error" );
     break;
@@ -120,9 +121,9 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e
 
   if ( error )
     SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
-                              title, message );
+                               title, message );
   else
     SUIT_MessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(),
-                             title, message );
+                              title, message );
 
 }
index f341a2824f3fc512d23182e7212ac92acbf48529..73e9584c6162c06d88e5c5237b4f6b64b652cd58 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_TOOLS_H
 #define SALOMEAPP_TOOLS_H
 
index 9e603dcadbdf62365bd5750abc53db1871398dd2..489925eae6242434901661c0f0073b7a2164654f 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_TypeFilter.h"
 
 #include "LightApp_DataOwner.h"
@@ -55,11 +56,11 @@ bool SalomeApp_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const
       
       _PTR(SObject) aSObj( aStudy->FindObjectID( entry.toStdString() ) );
       if (aSObj)
-       {
-         _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
-         if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) )
-           return true;
-       }
+        {
+          _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
+          if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) )
+            return true;
+        }
     }
 
   return false;
index 403e77ae2c2f3e991d12b0bbb2b3565c764849a3..85bda84934a4f5c433dd17f84e2b09740d67afc5 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_TYPEFILTER_H
 #define SALOMEAPP_TYPEFILTER_H
 
index 0244b0ac4a57185a6a923e255bd875cce9cfeeb2..a28e5422820291fd37a553023eb473fae55d6cfd 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SalomeApp_VisualState.h"
 
 #include "SalomeApp_Module.h"
@@ -41,6 +42,7 @@
 
 #include <vector>//?
 #include <string>//?
+#include <cstdio>
 
 /*!
   Constructor.
@@ -49,7 +51,7 @@ SalomeApp_VisualState::SalomeApp_VisualState( SalomeApp_Application* app )
   : QObject(),
     myApp( app )
 {
-}  
+}
 
 /*!
   Destructor.
@@ -62,7 +64,7 @@ SalomeApp_VisualState::~SalomeApp_VisualState()
   Sets names of all view windows in given list.  This is used
   in order to apply the same naming algorithm when saving and restoring
   view windows.  Names of view windows must be the same before saving
-  workstack (splitters) information, and before its restoring! 
+  workstack (splitters) information, and before its restoring!
   Naming rule: ViewerType_IndexOfViewerOfThisType_IndexOfViewInThisViewer
                VTKViewer_0_0
                OCCViewer_0_0  OCCViewer_0_1  OCCViewer_0_2
@@ -70,33 +72,31 @@ SalomeApp_VisualState::~SalomeApp_VisualState()
 */
 void nameViewWindows( const ViewManagerList& lst )
 {
-  QMultiHash<QString,int> viewersCounter; // map viewerType - to - index_of_this_viewer_type
-  QListIterator<SUIT_ViewManager*> it(lst);
-  SUIT_ViewManager* aVM = 0;
-  while ( it.hasNext() ) {
-    aVM = it.next();
-    if ( !aVM ) continue;
+  QMap<QString, int> viewersCounter;
+  for ( QList<SUIT_ViewManager*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+  {
+    SUIT_ViewManager* aVM = *it;
+    if ( !aVM )
+      continue;
 
     int view_count = aVM->getViewsCount();
     QString vType = aVM->getType();
     if ( !view_count )
       continue; //No views is opened in the viewer
-    
-    int viewerID = viewersCounter.value( vType );
-    if ( !viewerID ) {
-      viewerID = 0;
-      viewersCounter.insert( vType, viewerID );
-    }
-    else
-      ++viewerID;
+
+    if ( !viewersCounter.contains( vType ) )
+      viewersCounter.insert( vType, 0 );
+
+    int& viewerID = viewersCounter[vType];
 
     QVector<SUIT_ViewWindow*> views = aVM->getViews();
-    for ( int i = 0; i < view_count; i++ )  {
+    for ( int i = 0; i < view_count; i++ )
+    {
       QString vName = QString( "%1_%2_%3" ).arg( vType ).arg( viewerID ).arg( i );
       views[i]->setObjectName( vName );
     }
+    viewerID++;
   }
-  viewersCounter.clear();
 }
 
 /*!
@@ -108,25 +108,30 @@ int SalomeApp_VisualState::storeState()
   if ( !study )
     return -1;
 
+  // unlock study if it is locked
+  bool aLocked = study->studyDS()->GetProperties()->IsLocked();
+  if (aLocked) study->studyDS()->GetProperties()->SetLocked(false);
+
   int savePoint = 1;
   std::vector<int> savePoints = study->getSavePoints();
   //Calculate a new savePoint number = the last save point number + 1
-  if ( savePoints.size() > 0) 
+  if ( savePoints.size() > 0)
     savePoint = savePoints[savePoints.size()-1] + 1;
 
-  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), 
+                                                                      savePoint );
   _PTR(IParameters) ip = ClientFactory::getIParameters( ap );
 
   ViewManagerList lst;
   myApp->viewManagers( lst );
 
-  // setting unique names for view windows in order to save this view inside 
+  // setting unique names for view windows in order to save this view inside
   // workstack's structure (see below).  On restore the views with the same names will
   // be placed to the same place inside the workstack's splitters.
   nameViewWindows( lst );
 
   // store active window's name
-  SUIT_ViewWindow* win = myApp->desktop()->activeWindow();  
+  SUIT_ViewWindow* win = myApp->desktop()->activeWindow();
   if ( win )
     ip->setProperty("AP_ACTIVE_VIEW", win->objectName().toStdString() );
 
@@ -138,12 +143,12 @@ int SalomeApp_VisualState::storeState()
     if ( !vm ) continue;
 
     int view_count = vm->getViewsCount();
-    if ( !view_count ) 
+    if ( !view_count )
       continue; //No views is opened in the viewer
-      
+
     std::string viewerEntry = QString( "%1_%2" ).arg( vm->getType() ).arg( ++viewerID ).toStdString();
     ip->append("AP_VIEWERS_LIST", viewerEntry);
-    
+
     QVector<SUIT_ViewWindow*> views = vm->getViews();
     for(int i = 0; i<view_count; i++) {
       ip->append( viewerEntry, views[i]->windowTitle().toStdString() );
@@ -152,19 +157,20 @@ int SalomeApp_VisualState::storeState()
   }
 
   //Save information about split areas
-  if ( myApp->desktop()->inherits( "STD_TabDesktop" ) ) {
-    QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
+  if ( myApp->desktop()->inherits( "STD_TabDesktop" ) )
+  {
     QString workstackInfo;
-    (*workstack) >> workstackInfo;
-    ip->setProperty( "AP_WORKSTACK_INFO", workstackInfo.toStdString() );
+    QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
+    QByteArray geomState = workstack->saveState( 0 );
+    ip->setProperty( "AP_WORKSTACK_INFO", QString( geomState.toHex() ).toStdString() );
   }
-  
+
   //Save a name of the active module
-  if ( CAM_Module* activeModule = myApp->activeModule() ) 
+  if ( CAM_Module* activeModule = myApp->activeModule() )
     ip->setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().toStdString() );
 
   //Store visual parameters of the modules
-  QList<CAM_Module*> mlist; 
+  QList<CAM_Module*> mlist;
   myApp->modules( mlist );
   QListIterator<CAM_Module*> itM( mlist );
   CAM_Module* module = 0;
@@ -180,7 +186,9 @@ int SalomeApp_VisualState::storeState()
 
   // set default name of new savePoint
   study->setNameOfSavePoint( savePoint, QObject::tr( "SAVE_POINT_DEF_NAME" ) + QString::number( savePoint ) );
-  
+
+  if (aLocked) study->studyDS()->GetProperties()->SetLocked(true);
+
   return savePoint;
 }
 
@@ -193,71 +201,73 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   if ( !study )
     return;
 
-  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(),
+                                                                      savePoint );
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
   qApp->installEventFilter( this );
 
   //Remove all already existent veiwers and their views
-  ViewManagerList lst;
-  myApp->viewManagers( lst );
-  QListIterator<SUIT_ViewManager*> it(lst);
-  while ( it.hasNext() ) {
-    myApp->removeViewManager( it.next() );
-    qApp->processEvents();
-  }
+  //myApp->clearViewManagers();
+  myApp->clearKnownViewManagers();
+
   //Restore the viewers and view windows
   int nbViewers = ip->nbValues( "AP_VIEWERS_LIST" );
   SUIT_ViewWindow* viewWin = 0;
 
   // parameters of view windows are stored in a map for restoring after restoring of the workstack
   QMap<SUIT_ViewWindow*, QString> viewersParameters;
-  
-  for ( int i = 0; i < nbViewers; i++ ) {
+
+  for ( int i = 0; i < nbViewers; i++ )
+  {
     std::string viewerEntry = ip->getValue( "AP_VIEWERS_LIST", i );
     std::vector<std::string> veiewerParams = ip->parseValue(viewerEntry,'_');
     std::string type = veiewerParams[0];
     std::string viewerID = veiewerParams[1];
     SUIT_ViewManager* vm = myApp->newViewManager( type.c_str() );
-    if ( !vm ) 
+    if ( !vm )
       continue; //Unknown viewer
-    
+
     int nbViews = (ip->nbValues(viewerEntry))/2;
-    
+
     //Create nbViews-1 view (-1 because 1 view is created by createViewManager)
-    for ( int i = 1; i< nbViews; i++ ) { 
+    for ( int i = 1; i< nbViews; i++ )
+    {
       SUIT_ViewWindow* aView = vm->createViewWindow();
       aView->show();
     }
 
     int viewCount = vm->getViewsCount();
-    if (viewCount != nbViews) {
+    if ( viewCount != nbViews )
+    {
       printf( "\nRestore visual state: Unknow error, Can't create a view!\n" );
       continue;
     }
 
     //Resize the views, set their captions and apply visual parameters.
-    QVector<SUIT_ViewWindow*> views = vm->getViews();  
-    for (int i = 0, j = 0; i<viewCount; i++, j+=2) {
+    QVector<SUIT_ViewWindow*> views = vm->getViews();
+    for ( int i = 0, j = 0; i<viewCount; i++, j+=2 )
+    {
       viewWin = views[i];
-      if ( !viewWin ) 
-       continue;
+      if ( !viewWin )
+        continue;
 
       // wait untill the window is really shown.  This step fixes MANY bugs..
-      while ( !vm->isVisible() )
-       qApp->processEvents();
-      
-      viewWin->setWindowTitle(ip->getValue(viewerEntry, j).c_str());
-      
+      //      while ( !vm->isVisible() )
+      //        qApp->processEvents();
+
+      viewWin->setWindowTitle( ip->getValue( viewerEntry, j ).c_str() );
+
       //      printf ( "VP for viewWin \"%s\": %s\n", viewerEntry.c_str(), ip->getValue(viewerEntry, j+1).c_str() );
-      viewersParameters[ viewWin ] = ip->getValue(viewerEntry, j+1).c_str();
+      viewersParameters[ viewWin ] = ip->getValue( viewerEntry, j + 1 ).c_str();
       //viewWin->setVisualParameters(ip->getValue(viewerEntry, j+1).c_str());
     }
   }
 
   // restore modules' visual parameters
-  std::vector<std::string> v = ip->getValues("AP_MODULES_LIST");
-  for ( int i = 0; i < v.size(); i++ ) {
+  std::vector<std::string> v = ip->getValues( "AP_MODULES_LIST" );
+  for ( int i = 0; i < v.size(); i++ )
+  {
     myApp->activateModule( v[i].c_str() );
     if ( SalomeApp_Module* module = dynamic_cast<SalomeApp_Module*>( myApp->activeModule() ) )
       module->restoreVisualParameters( savePoint );
@@ -265,39 +275,44 @@ void SalomeApp_VisualState::restoreState(int savePoint)
 
   // new view windows may have been created in  module->restoreVisualParameters() [GAUSS]
   // so here we store their visual parameters for later restoring..
-  lst.clear();
-  myApp->viewManagers(lst);
-  QListIterator<SUIT_ViewManager*> itVM( lst );
-  SUIT_ViewManager* aVM = 0;
-  while ( itVM.hasNext() ) {
-    aVM = itVM.next();
-    if ( !aVM ) continue;
+  QList<SUIT_ViewManager*> lst;
+  myApp->viewManagers( lst );
+  for ( QList<SUIT_ViewManager*>::iterator itVM = lst.begin(); itVM != lst.end(); ++itVM )
+  {
+    SUIT_ViewManager* aVM = *itVM;
+    if ( !aVM )
+      continue;
 
     int view_count = aVM->getViewsCount();
     QVector<SUIT_ViewWindow*> views = aVM->getViews();
-    for ( int i = 0; i < view_count; i++ ) {
-      if ( !viewersParameters.contains( views[i] ) ) {
-       viewersParameters[ views[i] ] = views[i]->getVisualParameters();
-       //      printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() );
+    for ( int i = 0; i < view_count; i++ )
+    {
+      if ( !viewersParameters.contains( views[i] ) )
+      {
+        viewersParameters[ views[i] ] = views[i]->getVisualParameters();
+        //      printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() );
       }
     }
-  }  
+  }
 
   // activate module that was active on save
   QString activeModuleName( ip->getProperty("AP_ACTIVE_MODULE" ).c_str() );
-  if ( !activeModuleName.isEmpty() ) 
+  if ( !activeModuleName.isEmpty() )
     myApp->activateModule( activeModuleName );
 
-  // setting unique names for view windows in order to restore positions of view windows inside 
-  // workstack's structure (see below).  During save the same naming algorithm was used, 
+  // setting unique names for view windows in order to restore positions of view windows inside
+  // workstack's structure (see below).  During save the same naming algorithm was used,
   // so the same views will get the same names.
   nameViewWindows( lst );
 
+  qApp->processEvents();
+
   // restore workstack parameters.  should be done after module's restoreVisualParameters(), because
   // some modules can create their own viewers (like VISU creates GaussViewers)
-  if ( myApp->desktop()->inherits( "STD_TabDesktop" ) ) {
+  if ( myApp->desktop()->inherits( "STD_TabDesktop" ) )
+  {
     QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
-    (*workstack) << ip->getProperty( "AP_WORKSTACK_INFO" ).c_str();
+    workstack->restoreState( QByteArray::fromHex( QByteArray( ip->getProperty( "AP_WORKSTACK_INFO" ).c_str() ) ), 0 );
   }
 
   // restore visual parameters of view windows.  it must be done AFTER restoring workstack.
@@ -311,7 +326,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   }
 
   qApp->removeEventFilter( this );
-  
+
   //  for ( it.toFirst(); it.current(); ++it ) {
   //    int view_count = it.current()->getViewsCount();
   //    QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
@@ -326,7 +341,7 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   //    QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
   //    for ( int i = 0; i < view_count; i++ )  {
   //      if ( activeViewName == views[i]->name() )
-  //   views[i]->setFocus();
+  //    views[i]->setFocus();
   //    }
   //  }
 }
@@ -345,6 +360,6 @@ bool SalomeApp_VisualState::eventFilter( QObject* o, QEvent* e )
        aType == QEvent::KeyPress ||
        aType == QEvent::KeyRelease )
     return true;
-  
+
   return QObject::eventFilter( o, e );
 }
index 0720f31afb7b32e5e64df111e9304b37d77cce0f..44e01eda73f6b872e2a3052019c21647f6072f01 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef SALOMEAPP_VISUALSTATE_H
 #define SALOMEAPP_VISUALSTATE_H
 
index 9ed60c64a72a70809baf7510a8ace8dc99a9a01c..3a40050ad21ebc54ac9b4f3f56802b2bd7858de2 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOMELocalTrace : log on local machine
 #  File   : Makefile.in
 #  Author : Sergey RUIN
index b49a59dd84fd3b411c618217b843782667222955..9d3968dd9667424f63cfb17465fca8432ab6e9cf 100644 (file)
@@ -1,27 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-#include "SalomeAppTest.hxx"
 
-using namespace std;
+#include "SalomeAppTest.hxx"
 
 // ============================================================================
 /*!
index c2cab3bf10f51660647bc2664e5b8290545643f0..95377484757fa2545826d340301d7f4f5db7025b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _SalomeAppTEST_HXX_
 #define _SalomeAppTEST_HXX_
 
index bc917025cbb01f7496167d72e531795c06cb599a..43b62b410d23d2af482dbe38e33fd37978d5a132 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // --- include all SalomeApp Test from basics until the present directory
 //
 #include "SalomeAppTest.hxx"
index a7bcb4cd96d38b6cb2eb001bccfdd3abb537dcc0..a390f686b86213a727268a7259be8bfc16acbab4 100644 (file)
@@ -1,24 +1,26 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 import sys, os,signal,string,commands
 import runSalome
 import orbmodule
index d89841c1433af01e35c67907e916676d6effa886..001a2473b81a3abbf626e3a2426eb7480c24ed19 100644 (file)
@@ -1,3 +1,25 @@
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 [language]
 language = en
 
index b95d46a34a59e47eb71c52c76f34776cdbb310db..5124442cade1de9655a876ea28a98b6b4e515230 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 -->
 <document>
+  <!-- import LightApp.xml file -->
+  <import name="LightApp"/>
   <section name="launch">
     <!-- SALOME launching parameters -->
-    <parameter name="gui"        value="yes"/>
-    <parameter name="splash"     value="yes"/>
-    <parameter name="file"       value="no"/>
-    <parameter name="key"        value="no"/>
-    <parameter name="interp"     value="no"/>
     <parameter name="logger"     value="no"/>
     <parameter name="xterm"      value="no"/>
     <parameter name="portkill"   value="no"/>
     <parameter name="killall"    value="no"/>
     <parameter name="pinter"     value="no"/>
     <parameter name="noexcepthandler"  value="no"/>
-    <parameter name="modules"    value="GEOM,SMESH,VISU,MED,YACS"/>
+    <parameter name="modules"    value="GEOM,SMESH,VISU,MED,YACS,PARAVIS"/>
     <parameter name="pyModules"  value=""/>
     <parameter name="embedded"   value="SalomeAppEngine,study,cppContainer,registry,moduleCatalog"/>
     <parameter name="standalone" value="pyContainer,supervContainer"/>
   </section>
   <section name="language">
     <!-- Language settings (resource manager)-->
-    <parameter name="language"    value="en"/>
     <parameter name="translators" value="%P_msg_%L.qm|%PM_msg_%L.qm|%P_icons.qm|%P_images.qm|%PM_images.qm"/>
   </section>
-  <section name="splash" >
-    <!-- Splash screen settings -->
-    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
-    <parameter name="constant_info"     value="%A [ %V ]" />
-    <parameter name="text_colors"       value="#eeeeff|#555555" />
-    <parameter name="hide_on_click"     value="no" />
-    <parameter name="show_progress"     value="yes" />
-    <parameter name="show_message"      value="yes" />
-    <parameter name="show_percents"     value="yes" />
-    <parameter name="margin"            value="40" />
-    <parameter name="progress_width"    value="20" />
-    <parameter name="progress_flags"    value="bottom,left_to_right" />
-    <parameter name="opacity"           value="0.70" />
-    <parameter name="font"              value="Tahoma,12,normal" />
-    <parameter name="alignment"         value="top,left" />
-    <parameter name="progress_colors"   value="#3b3e5d|#d14949|v" />
-  </section>
-  <section name="resources">
-    <!-- Resource directories (resource manager)-->
-    <parameter name="SUIT"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="STD"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="Plot2d"       value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="SPlot2d"      value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="GLViewer"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="OCCViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="VTKViewer"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="SVTK"         value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="PyConsole"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="LightApp"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="SalomeApp"    value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="OB"           value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="CAM"          value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="SUPERVGraph"  value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="QxGraph"      value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <parameter name="ToolsGUI"     value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
-    <!-- NETGENPlugin and GHS3DPlugin -->
-    <!-- Here the environment variables are used in upper case, -->
-    <!-- In SMESH/resources/SalomeApp.xml case-sensitive notation is used. -->
-    <!-- As a result, both variants are acceptable. -->
-    <parameter name="NETGENPlugin"   value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
-    <parameter name="GHS3DPlugin"    value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
-    <parameter name="BLSURFPlugin"   value="${BLSURFPLUGIN_ROOT_DIR}/share/salome/resources/blsurfplugin"/>
-    <parameter name="HexoticPLUGIN"  value="${HexoticPLUGIN_ROOT_DIR}/share/salome/resources/hexoticplugin"/>
-    <parameter name="GHS3DPRLPlugin" value="${GHS3DPRLPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dprlplugin"/>
-  </section>
-  <section name="SMESH">
-    <!-- Default SMESH module plugins -->
-    <parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,GHS3DPRLPlugin,HexoticPLUGIN,BLSURFPlugin"/>
-  </section>
-  <section name="desktop" >
-    <!-- Default GUI desktop state, position, size -->
-    <parameter name="geometry"  value="80%%x80%%+10%%+10%%"/>
-  </section>
-  <section name="Style">
-    <!-- Style and theme preferences -->
-    <parameter name="use_salome_style" value="true" />
-  </section>
   <section name="ObjectBrowser" >
     <!-- Object Browser preferences -->
-    <parameter name="auto_hide_search_tool" value="true" />
-    <parameter name="auto_size"             value="false" />
-    <parameter name="auto_size_first"       value="true"  />
-    <parameter name="resize_on_expand_item" value="false"  />
-    <parameter name="visibility_column_id_1" value="true"  />
-    <parameter name="visibility_column_id_2" value="true" />
-    <parameter name="visibility_column_id_3" value="true" />
-    <parameter name="visibility_column_id_4" value="true" />
-  </section>
-  <section name="PyConsole">
-    <!-- Python console preferences -->
-    <parameter name="font"                value="Helvetic,12" />
-    <parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
+    <parameter name="visibility_column_id_1" value="false" />
+    <parameter name="visibility_column_id_2" value="false" />
+    <parameter name="visibility_column_id_3" value="false" />
+    <parameter name="visibility_column_id_4" value="false" />
   </section>
-  <section name="OCCViewer" >
-    <!-- OCC viewer preferences -->
-    <parameter name="background"     value="35, 136, 145" />
-    <parameter name="iso_number_u"   value="1" />
-    <parameter name="iso_number_v"   value="1" />
-    <parameter name="trihedron_size" value="100" />
- </section>
- <section name="VTKViewer" >
-    <!-- VTK viewer preferences -->
-    <parameter name="background"     value="0, 0, 0" />
-    <parameter name="trihedron_size" value="105" />
-    <parameter name="relative_size"  value="true" />
-    <parameter name="use_advanced_selection_algorithm" value="true" />
-    <parameter name="recorder_mode"        value="1"    />
-    <parameter name="recorder_fps"         value="17.3" />
-    <parameter name="recorder_quality"     value="100"  />
-    <parameter name="recorder_progressive" value="true" />
- </section>
- <section name="Plot2d" >
-    <!-- Plot2d viewer preferences -->
-    <parameter name="Background"   value="255, 255, 255"/>
-    <parameter name="CurveType"    value="1" />
-    <parameter name="HorScaleMode" value="0" />
-    <parameter name="LegendPos"    value="1" />
-    <parameter name="MarkerSize"   value="9" />
-    <parameter name="ShowLegend"   value="true" />
-    <parameter name="VerScaleMode" value="0"  />
-  </section>
-  <section name="SUPERVGraph" >
-    <!-- Supervision viewer preferences -->
-    <parameter name="Background" value="144, 208, 211" />
-    <parameter name="Title"      value="63, 213, 255"  />
-    <parameter name="NodeBody"   value="255, 249, 147" />
-  </section>
-  <section name="MRU" >
-    <!-- Show "Most recently used" studies-->
-    <parameter name="show_mru" value="true"/>
-    <!-- Max number of stored "Most recently used" studies-->
-    <parameter name="max_count" value="50"/>
-    <!-- Max visible number of "Most recently used" studies-->
-    <parameter name="visible_count" value="7"/>
-    <!-- Insert mode-->
-    <parameter name="insert_mode" value="0"/>
-    <!-- Link type-->
-    <parameter name="link_type" value="0"/>
-    <!-- Show "Clear" item-->
-    <parameter name="show_clear" value="true"/>
-  </section> 
-  <section name="QxGraph" >
-    <!-- QxGraph viewer preferences -->
-    <parameter name="Background" value="144, 208, 211" />
-    <parameter name="Title"      value="63, 213, 255"  />
-    <parameter name="NodeBody"   value="255, 249, 147" />
-  </section>
-  <section name="QxSceneViewer" >
-    <!-- QxGraph viewer preferences -->
-    <parameter name="Background" value="144, 208, 211" />
-    <parameter name="Title"      value="63, 213, 255"  />
-    <parameter name="NodeBody"   value="255, 249, 147" />
-  </section>
-  <section name="FileDlg" >
+  <section name="FileDlg">
     <!-- "Open/Save File" dialog box preferences-->
     <parameter name="QuickDirList" value="${DATA_DIR}" />
   </section>
     <!-- General study settings -->
     <parameter name="store_positions"     value="false" />
     <parameter name="store_visual_state"  value="false" />
-  </section>
-  <section name="ExternalBrowser" >
-    <!-- External HELP browser settings -->
-    <parameter value="D:\Program Files\Internet Explorer\iexplore.exe" name="winapplication" />
-    <parameter value="/usr/bin/mozilla" name="application" />
+    <parameter name="pydump_publish"      value="true" />
+    <parameter name="multi_file_dump"     value="false" />
+    <parameter name="pydump_save_gui"     value="true" />
   </section>
 </document>
diff --git a/src/SalomeApp/resources/SalomeApp_images.po b/src/SalomeApp/resources/SalomeApp_images.po
deleted file mode 100644 (file)
index 73b029b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
index f6152fb3d65f11b6426d94afb4efabd985e2200b..305ed4131767bf8eecf7e9502b42a027cc6122ac 100644 (file)
@@ -1,25 +1,4 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 </TS>
diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po
deleted file mode 100644 (file)
index 0ca26a4..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2004-02-17 11:17+0300\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-//=======================================================================================
-
-msgid "BUT_NEW"
-msgstr "&New"
-
-msgid "BUT_OPEN"
-msgstr "&Open"
-
-msgid "BUT_LOAD"
-msgstr "&Load"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PYTHON_CONSOLE"
-msgstr "Python Console"
-
-msgid "SalomeApp_Application::TOT_DESK_FILE_DUMP_STUDY"
-msgstr "Dump study"
-
-msgid "SalomeApp_Application::MEN_DESK_FILE_DUMP_STUDY"
-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"
-
-msgid "SalomeApp_Application::MEN_DESK_FILE_LOAD_SCRIPT"
-msgstr "Load Scrip&t..."
-
-msgid "SalomeApp_Application::PRP_DESK_FILE_LOAD_SCRIPT"
-msgstr "Loads python script from file"
-
-msgid "SalomeApp_Application::TOT_FILE_DESK_PREFERENCES"
-msgstr "Preferences"
-
-msgid "SalomeApp_Application::MEN_DESK_TOOLS"
-msgstr "&Tools"
-
-msgid "SalomeApp_Application::TOT_DESK_CATALOG_GENERATOR"
-msgstr "Catalog generator"
-
-msgid "SalomeApp_Application::MEN_DESK_CATALOG_GENERATOR"
-msgstr "Catalog &Generator"
-
-msgid "SalomeApp_Application::PRP_DESK_CATALOG_GENERATOR"
-msgstr "Generates XML catalog of a component's interface"
-
-msgid "SalomeApp_Application::TOT_DESK_REGISTRY_DISPLAY"
-msgstr "Registry display"
-
-msgid "SalomeApp_Application::MEN_DESK_REGISTRY_DISPLAY"
-msgstr "Registry &Display"
-
-msgid "SalomeApp_Application::PRP_DESK_REGISTRY_DISPLAY"
-msgstr "Displays content of the Registry CORBA server"
-
-msgid "SalomeApp_Application::TOT_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "SalomeApp_Application::MEN_DESK_MRU"
-msgstr "Most Recently Used"
-
-msgid "SalomeApp_Application::TOT_DESK_PROPERTIES"
-msgstr "Study properties"
-
-msgid "SalomeApp_Application::MEN_DESK_PROPERTIES"
-msgstr "Pro&perties..."
-
-msgid "SalomeApp_Application::PRP_DESK_PROPERTIES"
-msgstr "Edits study properties"
-
-msgid "SalomeApp_Application::PREF_CATEGORY_SALOME"
-msgstr "SALOME"
-
-msgid "SalomeApp_Application::PREF_TAB_OBJBROWSER"
-msgstr "Object browser"
-
-msgid "SalomeApp_Application::MEN_OPENWITH"
-msgstr "Activate %1 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"
-msgstr "New Window"
-
-msgid "SalomeApp_Application::MEN_VIEW_WNDS"
-msgstr "Windows"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PREF_GROUP_DEF_COLUMNS"
-msgstr "Default columns"
-
-msgid "SalomeApp_Application::PREF_OBJ_BROWSER_SETTINGS"
-msgstr "Settings"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::OBJ_BROWSER_NAME"
-msgstr "Object"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_0"
-msgstr "Entry"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_1"
-msgstr "Value"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_2"
-msgstr "IOR"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_3"
-msgstr "Reference entry"
-
-msgid "SalomeApp_Application::ALL_FILES_FILTER"
-msgstr "All files (*.*)"
-
-msgid "SalomeApp_Application::PYTHON_FILES_FILTER"
-msgstr "PYTHON Files (*.py)"
-
-msgid "SalomeApp_Application::STUDY_LOCKED"
-msgstr "LOCKED"
-
-msgid "SalomeApp_Application::QUE_DOC_ALREADYEXIST"
-msgstr "The document %1 already exists in study manager.\nDo you want to reload it ?"
-
-//=======================================================================================
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE_FROM_SCRATCH"
-msgstr "from scratch"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE_FROM_COPYFROM"
-msgstr "copy from"
-
-msgid "SalomeApp_StudyPropertiesDlg::TLT_STUDY_PROPERTIES"
-msgstr "Study Properties"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_AUTHOR"
-msgstr "Author"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_DATE"
-msgstr "Created"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE"
-msgstr "Mode"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_LOCKED"
-msgstr "Locked"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODIFIED"
-msgstr "Modified"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODIFICATIONS"
-msgstr "Modifications"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_YES"
-msgstr "Yes"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_NO"
-msgstr "No"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PUBLISH_IN_STUDY"
-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 "CLOSE_LOCKED_STUDY"
-msgstr "Close locked study?"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::MEN_RESTORE_VS"
-msgstr "Restore"
-
-msgid "SalomeApp_Application::MEN_RENAME_VS"
-msgstr "Rename"
-
-msgid "SalomeApp_Application::MEN_DELETE_VS"
-msgstr "Delete"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::APPCLOSE_SAVE"
-msgstr "&Save&&Close"
-
-msgid "SalomeApp_Application::APPCLOSE_CLOSE"
-msgstr "&Close w/o saving"
-
-msgid "SalomeApp_Application::APPCLOSE_UNLOAD"
-msgstr "&Unload"
-
-msgid "SalomeApp_Application::APPCLOSE_CANCEL"
-msgstr "&Cancel"
-
-msgid "SalomeApp_Application::APPCLOSE_CAPTION"
-msgstr "Close active study"
-
-msgid "SalomeApp_Application::APPCLOSE_DESCRIPTION"
-msgstr "Do you want to close or only unload the study"
-
index 2252e9a2a5add2d5b0ddfb8b3e8c17ae38c6c523..c248a811da9e4b9d36451dee820673816b94a83c 100644 (file)
@@ -1,32 +1,16 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
         <source>WRN_FILE_NAME_BAD</source>
-        <translation>Please enter correct file name. Special characters are not allowed.</translation>
+        <translation>Please enter correct file name.
+Python file must include only letters, digits and underscores and start from letter or underscore.</translation>
+    </message>
+    <message>
+        <source>WRN_FILE_NOT_EXIST</source>
+        <translation>The file %1 does not exist.</translation>
     </message>
     <message>
         <source>CLOSE_LOCKED_STUDY</source>
         <source>PUBLISH_IN_STUDY</source>
         <translation>Publish in study</translation>
     </message>
+    <message>
+        <source>MULTI_FILE_DUMP</source>
+        <translation>Multi file dump</translation>
+    </message>
     <message>
         <source>BUT_NEW</source>
         <translation>&amp;New</translation>
     </message>
     <message>
         <source>ERR_INCOMPATIBLE_TYPE</source>
-        <translation>Variable with name "%1" has incompatible numeric type</translation>
+        <translation>Variable with name &quot;%1&quot; has incompatible numeric type</translation>
     </message>
     <message>
         <source>ERR_INVALID_VALUE</source>
-        <translation>Value hasn't been validated</translation>
+        <translation>Value hasn&apos;t been validated</translation>
     </message>
     <message>
         <source>ERR_NO_VARIABLE</source>
-        <translation>Variable with name "%1" doesn't exist</translation>
+        <translation>Variable with name &quot;%1&quot; doesn&apos;t exist</translation>
     </message>
 </context>
 <context>
         <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
         <translation>Load python script</translation>
     </message>
+    <message>
+        <source>PREF_PYDUMP_PUBLISH</source>
+        <translation>Publish in study in python dump</translation>
+    </message>
+    <message>
+        <source>PREF_PYDUMP_MULTI_FILE</source>
+        <translation>Multi file python dump</translation>
+    </message>
+    <message>
+        <source>PREF_PYDUMP_SAVE_GUI</source>
+        <translation>Save GUI state in python dump</translation>
+    </message>
     <message>
         <source>PREF_STORE_VISUAL_STATE</source>
         <translation>Store/restore last GUI state</translation>
@@ -180,6 +180,10 @@ Do you want to reload it ?</translation>
         <source>TOT_DESK_CATALOG_GENERATOR</source>
         <translation>Catalog generator</translation>
     </message>
+    <message>
+        <source>TOT_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Add vars to notebook</translation>
+    </message>
     <message>
         <source>PUBLISH_IN_STUDY</source>
         <translation>Publish in study</translation>
@@ -256,6 +260,14 @@ Do you want to reload it ?</translation>
         <source>MEN_DESK_TOOLS</source>
         <translation>&amp;Tools</translation>
     </message>
+    <message>
+        <source>MEN_DESK_PLUGINS_TOOLS</source>
+        <translation>Tools</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PLUGINS</source>
+        <translation>Plugins</translation>
+    </message>
     <message>
         <source>TOT_DESK_FILE_DUMP_STUDY</source>
         <translation>Dump study</translation>
@@ -272,6 +284,10 @@ Do you want to reload it ?</translation>
         <source>PRP_DESK_CATALOG_GENERATOR</source>
         <translation>Generates XML catalog of a component&apos;s interface</translation>
     </message>
+    <message>
+        <source>PRP_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Add variables of the study to the notebook</translation>
+    </message>
     <message>
         <source>PRP_DESK_FILE_DUMP_STUDY</source>
         <translation>Dumps study to the python script</translation>
@@ -304,6 +320,10 @@ Do you want to reload it ?</translation>
         <source>MEN_DESK_CATALOG_GENERATOR</source>
         <translation>Catalog &amp;Generator</translation>
     </message>
+    <message>
+        <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Add vars to NoteBook</translation>
+    </message>
     <message>
         <source>APPCLOSE_CAPTION</source>
         <translation>Close active study</translation>
@@ -320,6 +340,10 @@ Do you want to reload it ?</translation>
         <source>ACTIVATE_MODULE_OP_LOAD</source>
         <translation>&amp;Load...</translation>
     </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_SCRIPT</source>
+        <translation>Load &amp;Script...</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_StudyPropertiesDlg</name>
@@ -339,6 +363,18 @@ Do you want to reload it ?</translation>
         <source>PRP_MODIFICATIONS</source>
         <translation>Modifications</translation>
     </message>
+    <message>
+        <source>PRP_DATE_MODIF</source>
+        <translation>Date</translation>
+    </message>        
+    <message>
+        <source>PRP_UNITS</source>
+        <translation>Length units</translation>
+   </message>                      
+    <message>
+        <source>PRP_COMMENT</source>
+        <translation>Comment</translation>
+   </message>                         
     <message>
         <source>PRP_NO</source>
         <translation>No</translation>
@@ -351,9 +387,13 @@ Do you want to reload it ?</translation>
         <source>PRP_MODIFIED</source>
         <translation>Modified</translation>
     </message>
+    <message>
+            <source>PRP_NOT_MODIFIED</source>
+           <translation>Not modified</translation>
+    </message>                     
     <message>
         <source>PRP_DATE</source>
-        <translation>Created</translation>
+        <translation>Creation date</translation>
     </message>
     <message>
         <source>PRP_MODE</source>
@@ -372,80 +412,106 @@ Do you want to reload it ?</translation>
     <name>SalomeApp_ExitDlg</name>
     <message>
         <source>SHUTDOWN_SERVERS</source>
-        <translation>Shutdown standalone servers</translation>
+        <translation>Shutdown servers</translation>
     </message>
 </context>
 <context>
     <name>NoteBook_Table</name>
-        <message>
-           <source>REMOVE_VARIABLE_IS_USED</source>
-           <translation>Variable with name "%1" is used in the study.
+    <message>
+        <source>REMOVE_VARIABLE_IS_USED</source>
+        <translation>Variable with name &quot;%1&quot; is used in the study.
 Do you really want to remove it?</translation>
-       </message>
-        <message>
-           <source>RENAME_VARIABLE_IS_USED</source>
-           <translation>Variable with name "%1" is used in the study.
+    </message>
+    <message>
+        <source>RENAME_VARIABLE_IS_USED</source>
+        <translation>Variable with name &quot;%1&quot; is used in the study.
 Do you really want to rename it?</translation>
-       </message>
-        <message>
-           <source>VARNAME_COLUMN</source>
-           <translation>Variable Name</translation>
-        </message>
-        <message>      
-           <source>VARVALUE_COLUMN</source>
-           <translation>Variable Value</translation>
-       </message>
-        <message>      
-           <source>VARVALUE_INCORRECT</source>
-           <translation>Variable Value Incorrect: %1</translation>
-       </message>
-        <message>      
-           <source>VARNAME_INCORRECT</source>
-           <translation>Valiable Name Incorrect :%1</translation>
-       </message>
-        <message>      
-           <source>VARNAME_EXISTS</source>
-           <translation>Valiable with name "%1" exists</translation>
-       </message>
+    </message>
+    <message>
+        <source>VARNAME_COLUMN</source>
+        <translation>Variable Name</translation>
+    </message>
+    <message>
+        <source>VARVALUE_COLUMN</source>
+        <translation>Variable Value</translation>
+    </message>
+    <message>
+        <source>VARVALUE_INCORRECT</source>
+        <translation>Variable Value Incorrect: %1</translation>
+    </message>
+    <message>
+        <source>VARNAME_INCORRECT</source>
+        <translation>Variable Name Incorrect :%1</translation>
+    </message>
+    <message>
+        <source>VARNAME_EXISTS</source>
+        <translation>Variable with name &quot;%1&quot; exists</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_NoteBookDlg</name>
-        <message>
-           <source>NOTEBOOK_TITLE</source>
-           <translation>Salome NoteBook</translation>
-        </message>
-        <message>
-           <source>BUT_UPDATE_STUDY</source>
-           <translation>&amp;Update Study</translation>
-       </message>
-        <message>
-           <source>BUT_REMOVE</source>
-           <translation>&amp;Remove</translation>
-       </message>
-        <message>
-           <source>BUT_APPLY_AND_CLOSE</source>
-           <translation>A&amp;pply and Close</translation>
-       </message>
-        <message>
-           <source>BUT_HELP</source>
-           <translation>&amp;Help</translation>
-       </message>
-        <message>
-            <source>CLOSE_CAPTION</source>
-            <translation>Close NoteBook</translation>
-        </message>
-        <message>
-            <source>CLOSE_DESCRIPTION</source>
-            <translation>Do you want to save changes you made to NoteBook?</translation>
-        </message>
-        <message>
-           <source>INCORRECT_DATA</source>
-           <translation>At least one variable has been defined incorrectly.
+    <message>
+        <source>NOTEBOOK_TITLE</source>
+        <translation>Salome NoteBook</translation>
+    </message>
+    <message>
+        <source>BUT_UPDATE_STUDY</source>
+        <translation>&amp;Update Study</translation>
+    </message>
+    <message>
+        <source>BUT_REMOVE</source>
+        <translation>&amp;Remove</translation>
+    </message>
+    <message>
+        <source>BUT_APPLY_AND_CLOSE</source>
+        <translation>A&amp;pply and Close</translation>
+    </message>
+    <message>
+        <source>BUT_HELP</source>
+        <translation>&amp;Help</translation>
+    </message>
+    <message>
+        <source>CLOSE_CAPTION</source>
+        <translation>Close NoteBook</translation>
+    </message>
+    <message>
+        <source>CLOSE_DESCRIPTION</source>
+        <translation>Do you want to save changes you made to NoteBook?</translation>
+    </message>
+    <message>
+        <source>INCORRECT_DATA</source>
+        <translation>At least one variable has been defined incorrectly.
 Please edit its parameters or remove it from table.</translation>
-       </message>
-        <message>
-           <source>ERR_UPDATE_STUDY_FAILED</source>
-           <translation>Failed to update study!</translation>
-       </message>
+    </message>
+    <message>
+        <source>ERR_UPDATE_STUDY_FAILED</source>
+        <translation>Failed to update study!</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_DoubleSpinBox</name>
+    <message>
+        <source>VALID_RANGE_VAR_MSG</source>
+        <translation>Specify either a variable name or
+a floating-point value in range ( %1; %2 )
+with %3-digit precision</translation>
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Specify a floating-point value in range ( %1; %2 )
+with %3-digit precision</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_IntSpinBox</name>
+    <message>
+        <source>VALID_RANGE_VAR_MSG</source>
+        <translation>Specify either a variable name or
+an integer value in range ( %1; %2 )</translation>
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Specify an integer value in range ( %1; %2 )</translation>
+    </message>
 </context>
 </TS>
index ae858a3f40ecd0bbdb5c9043fc5e4287d910a766..eaf315c845831accb8a9b99e6593b2dbe93f78ff 100755 (executable)
@@ -1,30 +1,31 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOME Session : implementation of Session.idl
 #  File   : Makefile.in
 #  Author : Paul RASCLE, EDF
 #  Module : SALOME
 #  $Header$
-#
+
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libSalomeSession.la
@@ -49,21 +50,21 @@ dist_libSalomeSession_la_SOURCES =  \
 libSalomeSession_la_CPPFLAGS = $(QT_MT_INCLUDES) $(PYTHON_INCLUDES)            \
        $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ $(CAS_CPPFLAGS)    \
        @CORBA_CXXFLAGS@ @CORBA_INCLUDES@                                       \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl                 \
+       -I$(top_builddir)/idl                                                   \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Event             \
-       -I$(srcdir)/../Style @LIBXML_INCLUDES@
+       -I$(srcdir)/../Style -I$(srcdir)/../CASCatch @LIBXML_INCLUDES@
 
 if ENABLE_TESTRECORDER
   libSalomeSession_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
 endif
 
-libSalomeSession_la_LDFLAGS = $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS       \
+libSalomeSession_la_LDFLAGS = $(KERNEL_LDFLAGS) -lSalomeNS                     \
        -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog      \
        -lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector              \
        -lSalomeIDLKernel -lSalomeContainer -lTOOLSDS -lSalomeLauncher          \
        -lRegistry -lSALOMEBasics                                               \
        ../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la    \
-       ../Style/libSalomeStyle.la
+       ../Style/libSalomeStyle.la $(QT_MT_LIBS) 
 
 if ENABLE_TESTRECORDER
   libSalomeSession_la_LDFLAGS+= $(TESTRECORDER_LIBS)
@@ -76,12 +77,11 @@ dist_SALOME_Session_Server_SOURCES = SALOME_Session_Server.cxx
 
 SALOME_Session_Server_CPPFLAGS = $(libSalomeSession_la_CPPFLAGS)
 SALOME_Session_Server_LDADD    = $(libSalomeSession_la_LDFLAGS)                \
-       $(PYTHON_LIBS) $(OMNIORB_LIBS)                                          \
-       $(HDF5_LIBS) -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS       \
+       -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS                    \
        -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry         \
        -lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la   \
-       $(top_builddir)/idl/libSalomeIDLGUI.la                                  \
-       libSalomeSession.la
+       $(top_builddir)/idl/libSalomeIDLGUI.la libSalomeSession.la              \
+       $(HDF5_LIBS) $(PYTHON_LIBS) $(OMNIORB_LIBS)
 
 if ENABLE_TESTRECORDER
   SALOME_Session_Server_LDADD+= $(TESTRECORDER_LIBS)
index 0a0d4fe8374d2fbd2b2bc6b084e01757765e6853..0a752c8fb61bd19570be734402f30522e50e6f20 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOME_Session.hxx
 //  Author : Alexander A. BORODIN
 //  Module : GUI
@@ -27,7 +28,7 @@
 #define _SALOME_Session_HXX_
 
 #if defined WIN32
-#  if defined SESSION_EXPORTS
+#  if defined SESSION_EXPORTS || defined SalomeSession_EXPORTS
 #    define SESSION_EXPORT __declspec( dllexport )
 #  else
 #    define SESSION_EXPORT __declspec( dllimport )
index 6bb4668f292d901991548228b155ee9b0cb3b327..3dfee002dfe8f73efd19c00ebafc819970c21f3d 100755 (executable)
@@ -1,65 +1,62 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Session : implementation of Session.idl
 //  File : SALOME_Session_Server.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
-//
-#include <Container_init_python.hxx>
-#include <Utils_ORB_INIT.hxx>
-#include <Utils_SINGLETON.hxx>
+
 #include <SALOME_NamingService.hxx>
 #include <SALOME_ModuleCatalog_impl.hxx>
-#include <OpUtil.hxx>
-#include <RegistryService.hxx>
-#include <ConnectionManager_i.hxx>
 #include <SALOME_LifeCycleCORBA.hxx>
+#include <SALOME_Event.h>
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <Container_init_python.hxx>
+#include <ConnectionManager_i.hxx>
+#include <RegistryService.hxx>
 
 #ifdef ENABLE_TESTRECORDER
   #include <TestApplication.h>
 #endif
 
-#include <QDir>
-#include <QFile>
-#include <QApplication>
-#include <QMutex>
-#include <QWaitCondition>
-#include <QRegExp>
-#include <QTextStream>
-
+#include <OpUtil.hxx>
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
 #include <Utils_SALOME_Exception.hxx>
 #include <Utils_CorbaException.hxx>
-#include <SALOME_Event.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_Session)
-#include CORBA_SERVER_HEADER(SALOMEDS)
 
 #include <utilities.h>
 #include "Session_ServerLauncher.hxx"
 #include "Session_ServerCheck.hxx"
+#include "Session_Session_i.hxx"
 
+#include <Qtx.h>
 #include <QtxSplash.h>
+
 #include <Style_Salome.h>
+
+#include "GUI_version.h"
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
 #include <SUIT_Application.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_ExceptionHandler.h>
 
-#include <Standard_Version.hxx>
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOME_Session)
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include <QDir>
+#include <QFile>
+#include <QApplication>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QRegExp>
+#include <QTextStream>
 
 /*! - read arguments, define list of server to launch with their arguments.
  * - wait for naming service
@@ -94,7 +101,7 @@ void MessageOutput( QtMsgType type, const char* msg )
   switch ( type )
   {
   case QtDebugMsg:
-    MESSAGE( "Debug: " << msg );
+    //MESSAGE( "Debug: " << msg );
     break;
   case QtWarningMsg:
     MESSAGE( "Warning: " << msg );
@@ -130,31 +137,7 @@ static const char* pixmap_not_found_xpm[] = {
 
 QString salomeVersion()
 {
-  QString path( ::getenv( "GUI_ROOT_DIR" ) );
-  if ( !path.isEmpty() )
-    path += QDir::separator();
-  path += QString( "bin/salome/VERSION" );
-
-  QFile vf( path );
-  if ( !vf.open( QIODevice::ReadOnly ) )
-    return QString();
-
-  QString line( vf.readLine( 1024 ) );
-
-  vf.close();
-
-  if ( line.isEmpty() )
-    return QString();
-
-  while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
-    line.remove( line.length() - 1, 1 );
-
-  QString ver;
-  int idx = line.lastIndexOf( ":" );
-  if ( idx != -1 )
-    ver = line.mid( idx + 1 ).trimmed();
-
-  return ver;
+  return GUI_VERSION_STR;
 }
 
 class SALOME_ResourceMgr : public SUIT_ResourceMgr
@@ -180,7 +163,7 @@ public:
       if ( myExtAppVersion == "APP_VERSION" ) {
         if ( myExtAppName != "SalomeApp" )
           myExtAppVersion = "";
-       else myExtAppVersion = salomeVersion();
+        else myExtAppVersion = salomeVersion();
       }
     }
   }
@@ -193,35 +176,41 @@ protected:
     return SUIT_ResourceMgr::userFileName( myExtAppName, for_load );
   }
 
-  virtual int userFileId( const QString& _fname ) const
+  virtual long userFileId( const QString& _fname ) const
   {
+    long id = -1;
     if ( !myExtAppName.isEmpty() ) {
+#ifdef WIN32
+      QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ).arg( currentFormat() ) );
+#else
       QRegExp exp( QString( "\\.%1rc\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ) );
+#endif
       QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" );
       
       QString fname = QFileInfo( _fname ).fileName();
       if( exp.exactMatch( fname ) ) {
-       QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
-       int major=0, minor=0;
-       major = vers[0].toInt();
-       minor = vers[1].toInt();
-       if( vers_exp.indexIn( vers[2] )==-1 )
-         return -1;
-       int release = 0, dev1 = 0, dev2 = 0;
-       release = vers_exp.cap( 1 ).toInt();
-       dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
-       dev2 = vers_exp.cap( 3 ).toInt();
-       
-       int dev = dev1*100+dev2, id = major;
-       id*=100; id+=minor;
-       id*=100; id+=release;
-       id*=10000;
-       if ( dev > 0 ) id+=dev-10000;
-       return id;
+        QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
+        int major=0, minor=0;
+        int release = 0, dev1 = 0, dev2 = 0;
+       if ( vers.count() > 0 ) major = vers[0].toInt();
+       if ( vers.count() > 1 ) minor = vers[1].toInt();
+       if ( vers.count() > 2 ) {
+         if( vers_exp.indexIn( vers[2] ) != -1 ) {
+           release = vers_exp.cap( 1 ).toInt();
+           dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
+           dev2 = vers_exp.cap( 3 ).toInt();
+         }
+       }
+        
+        int dev = dev1*100+dev2;
+       id = major;
+        id*=100; id+=minor;
+        id*=100; id+=release;
+        id*=10000;
+        if ( dev > 0 ) id+=dev-10000;
       }
     }
-
-    return -1;
+    return id;
   }
 
 public:
@@ -257,12 +246,20 @@ public:
 #ifdef ENABLE_TESTRECORDER
   SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
 #else
-  SALOME_QApplication( int& argc, char** argv ) : QApplication( argc, argv ), myHandler ( 0 ) {}
+  SALOME_QApplication( int& argc, char** argv )
+#ifndef WIN32
+  // san: Opening an X display and choosing a visual most suitable for 3D visualization
+  // in order to make SALOME viewers work with non-native X servers
+  : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+#else
+  : QApplication( argc, argv ), 
+#endif
+    myHandler ( 0 ) {}
 #endif
 
   virtual bool notify( QObject* receiver, QEvent* e )
   {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+#if OCC_VERSION_LARGE < 0x06010100
     // Disable GUI user actions while python command is executed
     if (SUIT_Session::IsPythonExecuted()) {
       // Disable mouse and keyboard events
@@ -280,8 +277,24 @@ public:
     return myHandler ? myHandler->handle( receiver, e ) :
       TestApplication::notify( receiver, e );
 #else
-    return myHandler ? myHandler->handle( receiver, e ) :
-      QApplication::notify( receiver, e );
+    try {
+      return myHandler ? myHandler->handle( receiver, e ) : QApplication::notify( receiver, e );
+    }
+    catch (std::exception& e) {
+      std::cerr << e.what()  << std::endl;
+    }
+    catch (CORBA::Exception& e) {
+      std::cerr << "Caught CORBA::Exception"  << std::endl;
+      CORBA::Any tmp;
+      tmp<<= e;
+      CORBA::TypeCode_var tc = tmp.type();
+      const char *p = tc->name();
+      std::cerr << "notify(): CORBA exception of the kind : " << p << " is caught" << std::endl;
+    }
+    catch (...) {
+      std::cerr << "Unknown exception caught in Qt handler: it's probably a bug in SALOME platform" << std::endl;
+    }
+    return false;  // return false when exception is caught
 #endif
   }
   SUIT_ExceptionHandler* handler() const { return myHandler; }
@@ -339,9 +352,17 @@ int main( int argc, char **argv )
   // Install Qt debug messages handler
   qInstallMsgHandler( MessageOutput );
   
+  // add $QTDIR/plugins to the pluins search path for image plugins
+  QString qtdir( ::getenv( "QTDIR" ) );
+  if ( !qtdir.isEmpty() )
+    QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
+
   // Create Qt application instance;
   // this should be done the very first!
   SALOME_QApplication _qappl( argc, argv );
+  _qappl.setOrganizationName( "salome" );
+  _qappl.setApplicationName( "salome" );
+  _qappl.setApplicationVersion( salomeVersion() );
 
   // Add application library path (to search style plugin etc...)
   QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
@@ -358,7 +379,7 @@ int main( int argc, char **argv )
     SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
     resMgr.setCurrentFormat( "xml" );
     resMgr.setWorkingMode( QtxResourceMgr::IgnoreUserValues );
-    resMgr.loadLanguage( "LightApp", "en" );
+    resMgr.loadLanguage( "LightApp" );
     //
     splash = QtxSplash::splash( QPixmap() );
     splash->readSettings( &resMgr );
@@ -393,7 +414,7 @@ int main( int argc, char **argv )
   try {
     // ...initialize Python (only once)
     int   _argc   = 1;
-    char* _argv[] = {""};
+    char* _argv[] = {(char*)""};
     KERNEL_PYTHON::init_python( _argc,_argv );
     PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
     if ( !KERNEL_PYTHON::salome_shared_modules_module ) // import only once
@@ -435,7 +456,7 @@ int main( int argc, char **argv )
     const char *p = tc->name();
     INFOS ( "run(): CORBA exception of the kind : "<<p<< " is caught" );
   }
-  catch ( exception& e ) {
+  catch ( std::exception& e ) {
     INFOS( "run(): An exception has been caught: " <<e.what() );
   }
   catch (...) {
@@ -468,22 +489,22 @@ int main( int argc, char **argv )
       splash->setProgress( 0, sc.totalSteps() );
       // start check loop 
       while ( true ) {
-       int step    = sc.currentStep();
-       int total   = sc.totalSteps();
-       QString msg = sc.currentMessage();
-       QString err = sc.error();
-       if ( !err.isEmpty() ) {
-         QtxSplash::setError( err );
-         QApplication::instance()->processEvents();
-         result = -1;
-         break;
-       }
-       QtxSplash::setStatus( msg, step );
-       QApplication::instance()->processEvents();
-       if ( step >= total )
-         break;
-       // ...block this thread until servers checking is finished
-       _SplashStarted.wait( &_SplashMutex );
+        int step    = sc.currentStep();
+        int total   = sc.totalSteps();
+        QString msg = sc.currentMessage();
+        QString err = sc.error();
+        if ( !err.isEmpty() ) {
+          QtxSplash::setError( err );
+          QApplication::instance()->processEvents();
+          result = -1;
+          break;
+        }
+        QtxSplash::setStatus( msg, step );
+        QApplication::instance()->processEvents();
+        if ( step >= total )
+          break;
+        // ...block this thread until servers checking is finished
+        _SplashStarted.wait( &_SplashMutex );
       }
       // ...unlock mutex 'cause it is no more needed
       _SplashMutex.unlock();
@@ -496,16 +517,17 @@ int main( int argc, char **argv )
     _GUIMutex.unlock();
   }
 
-  bool shutdown = false;
+  // Obtain Session interface reference
+  CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" );
+  SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
+
+  bool shutdownAll = false;
+  bool shutdownSession = false;
   if ( !result ) {
     // Launch GUI activator
     if ( isGUI ) {
       if ( splash )
-       splash->setStatus( QApplication::translate( "", "Activating desktop..." ) );
-      // ...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 ) );
+        splash->setStatus( QApplication::translate( "", "Activating desktop..." ) );
       // ...create GUI launcher
       MESSAGE( "Session activated, Launch IAPP..." );
       guiThread = new GetInterfaceThread( session );
@@ -522,6 +544,14 @@ int main( int argc, char **argv )
 
       _SessionMutex.unlock();
 
+      // Session might be shutdowning here, check status
+      SALOME::StatSession stat = session->GetStatSession();
+      shutdownSession = stat.state == SALOME::shutdown;
+      if ( shutdownSession ) {
+       _SessionMutex.lock(); // lock mutex before leaving loop - it will be unlocked later
+       break;
+      }
+
       // SUIT_Session creation
       aGUISession = new SALOME_Session();
 
@@ -530,32 +560,45 @@ int main( int argc, char **argv )
       SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
       if ( aGUIApp )
       {
-       Style_Salome::initialize( aGUIApp->resourceMgr() );
-       if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
-         Style_Salome::apply();
-
-       if ( !isFound( "noexcepthandler", argc, argv ) )
-         _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
-                                                      // aGUISession contains SalomeApp_ExceptionHandler
-       // Run GUI loop
-       MESSAGE( "run(): starting the main event loop" );
-
-       if ( splash )
-         splash->finish( aGUIApp->desktop() );
-         
-       result = _qappl.exec();
+        Style_Salome::initialize( aGUIApp->resourceMgr() );
+        if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
+          Style_Salome::apply();
+
+        if ( !isFound( "noexcepthandler", argc, argv ) )
+          _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
+                                                       // aGUISession contains SalomeApp_ExceptionHandler
+        // Run GUI loop
+        MESSAGE( "run(): starting the main event loop" );
+
+        if ( splash )
+          splash->finish( aGUIApp->desktop() );
        
-       splash = 0;
-
-       if ( result == SUIT_Session::NORMAL ) { // desktop is closed by user from GUI
-         shutdown = aGUISession->exitFlags();
+        result = _qappl.exec();
+        
+        splash = 0;
+       
+        if ( result == SUIT_Session::NORMAL ) {
+         // desktop is explicitly closed by user from GUI
+         // exit flags says if it's necessary to shutdown all servers
+         // all session server only
+          shutdownAll = aGUISession->exitFlags();
+       }
+       else {
+         // desktop might be closed from:
+         // - StopSesion() /temporarily/ or
+         // - Shutdown() /permanently/
+         stat = session->GetStatSession();
+         shutdownSession = stat.state == SALOME::shutdown;
+       }
+       if ( shutdownAll || shutdownSession ) {
+         _SessionMutex.lock(); // lock mutex before leaving loop - it will be unlocked later
          break;
        }
       }
 
       delete aGUISession;
       aGUISession = 0;
-
+      
       // Prepare _GUIMutex for a new GUI activation
       _SessionMutex.lock();
     }
@@ -564,20 +607,22 @@ int main( int argc, char **argv )
   // unlock Session mutex
   _SessionMutex.unlock();
   
-  if ( shutdown )
+  if ( shutdownAll )
     shutdownServers( _NS );
 
   if ( myServerLauncher )
     myServerLauncher->KillAll(); // kill embedded servers
 
+  // Unregister session server
+  SALOME_Session_i* sessionServant = dynamic_cast<SALOME_Session_i*>( poa->reference_to_servant( session.in() ) );
+  if ( sessionServant )
+    sessionServant->NSunregister();
+
   delete aGUISession;
   delete guiThread;
   delete myServerLauncher;
   delete _NS;
 
-  PyGILState_STATE gstate = PyGILState_Ensure();
-  Py_Finalize();
-
   try  {
     orb->shutdown(0);
   }
@@ -588,11 +633,22 @@ int main( int argc, char **argv )
     // exception is raised when orb->destroy() is called and
     // cpp continer is launched in the embedded mode
     //////////////////////////////////////////////////////////////
-    // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
+    // std::cerr << "Caught unexpected exception on shutdown : ignored !!" << std::endl;
+    if ( shutdownAll )
+      killOmniNames();
+    abort(); //abort program to avoid deadlock in destructors or atexit when shutdown has been interrupted
   }
 
-  if ( shutdown )
+  PyGILState_Ensure();
+  //Destroy orb from python (for chasing memory leaks)
+  //PyRun_SimpleString("from omniORB import CORBA");
+  //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
+  //PyRun_SimpleString("orb.destroy()");
+  Py_Finalize();
+
+  if ( shutdownAll )
     killOmniNames();
 
+  MESSAGE( "Salome_Session_Server:endofserver" );
   return result;
 }
index e861236f795ef804218052c4a5e54963eb1d2958..15bb917c14db1e83dfaf492f60d9fd5b7dfd313b 100644 (file)
@@ -1,46 +1,52 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
 //  File   : SalomeApp_Engine_i.cxx
 //  Author : Alexander SLADKOV
-//  Module : SALOME
-//  $Header$
-//
-#include "SalomeApp_Engine_i.hxx"
 
-#include "SALOMEDS_Tool.hxx"
+#include "SalomeApp_Engine_i.hxx"
 
-#include <iostream>
+#include <SALOME_NamingService.hxx>
+#include <SALOMEDS_Tool.hxx>
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <Utils_SALOME_Exception.hxx>
+#include <utilities.h>
 
-using namespace std;
+#include <QApplication>
+#include <QDir>
+#include <QFile>
 
-SalomeApp_Engine_i* SalomeApp_Engine_i::myInstance = NULL;
+#include <iostream>
 
 /*!
   Constructor
 */
-SalomeApp_Engine_i::SalomeApp_Engine_i()
+SalomeApp_Engine_i::SalomeApp_Engine_i( const char* theComponentName )
 {
-  myInstance = this;
+  myComponentName = theComponentName;
+  MESSAGE("SalomeApp_Engine_i::SalomeApp_Engine_i(): myComponentName = " <<
+         myComponentName << ", this = " << this);
 }
 
 /*!
@@ -48,6 +54,8 @@ SalomeApp_Engine_i::SalomeApp_Engine_i()
 */
 SalomeApp_Engine_i::~SalomeApp_Engine_i()
 {
+  MESSAGE("SalomeApp_Engine_i::~SalomeApp_Engine_i(): myComponentName = " << 
+         myComponentName << ", this = " << this);
 }
 
 SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theComponent,
@@ -56,22 +64,23 @@ SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theCompone
 {
   SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
 
-  cout << "SalomeApp_Engine_i::Save() isMultiFile = " << isMultiFile << endl;
   if (CORBA::is_nil(theComponent) || CORBA::is_nil(theComponent->GetStudy()))
     return aStreamFile._retn();
 
   const int studyId = theComponent->GetStudy()->StudyId();
-  cout << "SalomeApp_Engine_i::Save() - studyId = " << studyId << endl;
 
   // Get a temporary directory to store a file
   //std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
 
   if (myMap.count(studyId)) {
-    cout << "SalomeApp_Engine_i::Save() - myMap.count(studyId)" << endl;
-    MapOfListOfFiles mapOfListOfFiles = myMap[studyId];
     std::string componentName (theComponent->ComponentDataType());
-    cout << "SalomeApp_Engine_i::Save() - componentName = " << componentName << endl;
-    ListOfFiles listOfFiles = mapOfListOfFiles[componentName];
+
+    // Error somewhere outside - Save() called with
+    // wrong SComponent instance
+    if ( myComponentName != componentName )
+      return aStreamFile._retn();
+
+    const ListOfFiles& listOfFiles = myMap[studyId];
 
     // listOfFiles must contain temporary directory name in its first item
     // and names of files (relatively the temporary directory) in the others
@@ -79,7 +88,6 @@ SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theCompone
 
     if (n > 0) { // there are some files, containing persistent data of the component
       std::string aTmpDir = listOfFiles[0];
-      cout << "SalomeApp_Engine_i::Save() - aTmpDir = " << aTmpDir << endl;
 
       // Create a list to store names of created files
       SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
@@ -103,10 +111,16 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent,
                                          const char* theURL,
                                          bool isMultiFile)
 {
-  cout << "SalomeApp_Engine_i::Load() isMultiFile = " << isMultiFile << endl;
+  std::cout << "SalomeApp_Engine_i::Load() isMultiFile = " << isMultiFile << std::endl;
   if (CORBA::is_nil(theComponent) || CORBA::is_nil(theComponent->GetStudy()))
     return false;
 
+  // Error somewhere outside - Load() called with
+  // wrong SComponent instance
+  std::string componentName (theComponent->ComponentDataType());
+  if ( myComponentName != componentName )
+    return false;
+
   const int studyId = theComponent->GetStudy()->StudyId();
 
   // Create a temporary directory for the component's data files
@@ -124,52 +138,259 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent,
   for (int i = 1; i < n; i++)
     listOfFiles[i] = std::string(aSeq[i - 1]);
 
-  //MapOfListOfFiles mapOfListOfFiles;
-  //if (myMap.count(studyId))
-  //  mapOfListOfFiles = myMap[studyId];
-  //std::string componentName (theComponent->ComponentDataType());
-  //mapOfListOfFiles[componentName] = listOfFiles;
-  //myMap[studyId] = mapOfListOfFiles;
-
-  SetListOfFiles(listOfFiles, studyId, theComponent->ComponentDataType());
+  SetListOfFiles(listOfFiles, studyId);
 
   return true;
 }
 
-SalomeApp_Engine_i::ListOfFiles SalomeApp_Engine_i::GetListOfFiles (const int theStudyId,
-                                                                    const char* theComponentName)
+SalomeApp_Engine_i::ListOfFiles SalomeApp_Engine_i::GetListOfFiles (const int theStudyId)
 {
   ListOfFiles aListOfFiles;
 
-  if (myMap.count(theStudyId))
+  if (myMap.find(theStudyId) != myMap.end())
   {
-    MapOfListOfFiles mapOfListOfFiles = myMap[theStudyId];
-    std::string componentName (theComponentName);
-    if (mapOfListOfFiles.count(componentName))
-      aListOfFiles = mapOfListOfFiles[componentName];
+    aListOfFiles = myMap[theStudyId];
   }
 
   return aListOfFiles;
 }
 
-void SalomeApp_Engine_i::SetListOfFiles (const ListOfFiles theListOfFiles,
-                                         const int   theStudyId,
-                                         const char* theComponentName)
+void SalomeApp_Engine_i::SetListOfFiles (const ListOfFiles& theListOfFiles,
+                                         const int          theStudyId)
 {
-  //if (!myMap.count(theStudyId)) {
-  //  MapOfListOfFiles mapOfListOfFiles;
-  //  myMap[theStudyId] = mapOfListOfFiles;
-  //}
-
-  MapOfListOfFiles& mapOfListOfFiles = myMap[theStudyId];
-  std::string componentName (theComponentName);
-  mapOfListOfFiles[componentName] = theListOfFiles;
+  myMap[theStudyId] = theListOfFiles;
+}
+
+/*! 
+ *  DumpPython implementation for light modules
+ */
+Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Object_ptr theStudy, 
+                                                CORBA::Boolean isPublished, 
+                                                CORBA::Boolean isMultiFile, 
+                                                CORBA::Boolean& isValidScript)
+{
+  MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<<
+         myComponentName << ", this = " << this);
+  
+  // Temporary solution: returning a non-empty sequence
+  // even if there's nothing to dump, to avoid crashes in SALOMEDS
+  // TODO: Improve SALOMEDSImpl_Study::DumpStudy() by skipping the components 
+  // with isValidScript == false, and initialize isValidScript by false below.
+  Engines::TMPFile_var aStreamFile = new Engines::TMPFile(1);
+  aStreamFile->length( 1 );
+  aStreamFile[0] = '\0';
+  isValidScript = true;
+
+  if (CORBA::is_nil(theStudy))
+    return aStreamFile._retn();
+
+  SALOMEDS::Study_var studyDS = SALOMEDS::Study::_narrow( theStudy );
+  const int studyId = studyDS->StudyId();
+
+  if (!myMap.count(studyId))
+    return aStreamFile._retn();
+
+  ListOfFiles listOfFiles = myMap[studyId];
+
+  // listOfFiles must contain temporary directory name in its first item
+  // and names of files (relatively the temporary directory) in the others
+  if ( listOfFiles.size() < 2 ) 
+    return aStreamFile._retn();
+
+  // there are some files, containing persistent data of the component
+  QString aTmpPath( listOfFiles.front().c_str() );
+  QDir aTmpDir( aTmpPath );
+  if ( !aTmpDir.exists() )
+    return aStreamFile._retn();    
+
+  // Calculate file sizes
+  QStringList aFilePaths;
+  QList<qint64> aFileSizes;
+  qint64 aBuffSize = 0;
+  ListOfFiles::const_iterator aFIt  = listOfFiles.begin();
+  ListOfFiles::const_iterator aFEnd = listOfFiles.end();
+  aFIt++;
+  for (; aFIt != aFEnd; aFIt++){
+    QString aFileName( (*aFIt).c_str() );
+    if ( !aTmpDir.exists( aFileName ) ){
+      continue;
+    }
+
+    QFile aFile( aTmpDir.filePath( aFileName ) );
+    if ( !aFile.open( QIODevice::ReadOnly ) ){
+      continue;
+    }
+
+    aFilePaths.push_back( aTmpDir.filePath( aFileName ) );
+    aFileSizes.push_back( aFile.size() );
+    aBuffSize += aFileSizes.back();
+
+    aFile.close();
+  }
+
+  if ( !aFilePaths.size() || !aBuffSize )
+    return aStreamFile._retn(); 
+    
+  char* aBuffer = new char[aBuffSize + 1];
+  if ( !aBuffer )
+    return aStreamFile._retn();
+
+  // Convert the file(s) to the byte stream, multiple files are simply
+  // concatenated
+  // TODO: imporve multi-script support if necessary...
+  qint64 aCurrPos = 0;
+  QStringList::const_iterator aFileIt  = aFilePaths.begin();
+  QStringList::const_iterator aFileEnd = aFilePaths.end();
+  QList<qint64>::const_iterator   aSIt = aFileSizes.begin();
+  for ( ; aFileIt != aFileEnd; aFileIt++, aSIt++ ){
+    QFile aFile( aTmpDir.filePath( *aFileIt ) );
+    if ( !aFile.open( QIODevice::ReadOnly ) ){
+      continue;
+    }
+
+    // Incorrect size of file
+    // Do not remove the bad file to have some diagnostic means
+    if ( aFile.read( aBuffer + aCurrPos, *aSIt ) != *aSIt ){
+      aFile.close();      
+      return aStreamFile._retn();
+    }
+
+    aCurrPos += (*aSIt); 
+    aFile.remove();   
+  }
+
+  // Here we should end up with empty aTmpDir
+  // TODO: Handle QDir::rmdir() error status somehow...
+  aTmpDir.rmdir( aTmpPath );
+
+  aBuffer[aBuffSize] = '\0';
+  CORBA::Octet* anOctetBuf =  (CORBA::Octet*)aBuffer;
+  aStreamFile = new Engines::TMPFile(aBuffSize + 1, aBuffSize + 1, anOctetBuf, 1); 
+
+  return aStreamFile._retn();
 }
 
 /*!
-  \return shared instance of engine
+  \return Component data type string for this instance of the engine
 */
-SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance()
+char* SalomeApp_Engine_i::ComponentDataType()
 {
-  return myInstance;
+  return const_cast<char*>( myComponentName.c_str() );
 }
+
+/*!
+  \return 
+*/
+CORBA::ORB_var SalomeApp_Engine_i::orb()
+{
+  ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+  // TODO: using QApplication here looks ugly, think how to
+  // obtain the ORB reference in a nicer way...
+  static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+  return _orb;
+}
+
+/*!
+  \return 
+*/
+PortableServer::POA_var SalomeApp_Engine_i::poa()
+{
+  static PortableServer::POA_var _poa;
+  if ( CORBA::is_nil( _poa ) ){
+    CORBA::Object_var obj = orb()->resolve_initial_references( "RootPOA" );
+    _poa = PortableServer::POA::_narrow( obj );
+  }
+  return _poa;
+}
+
+/*!
+  \return 
+*/
+SALOME_NamingService* SalomeApp_Engine_i::namingService()
+{
+  static SALOME_NamingService _ns(orb());
+  return &_ns;
+}
+
+/*!
+  Internal method, creates a CORBA engine for a light SALOME module
+  with the given "component data type" string,
+  activates it and registers in SALOME naming service with
+  /SalomeAppEngine/comp_data_type path. If the engine is already in the 
+  naming service, simply returns and object reference to it.
+  \param theComponentName - synthetic "component data type" used to identify a given light module
+  \return Object reference to the CORBA engine
+*/
+CORBA::Object_ptr SalomeApp_Engine_i::engineForComponent( const char* theComponentName,
+                                                         bool toCreate )
+{
+  CORBA::Object_var anEngine;
+  if ( !theComponentName || !strlen( theComponentName ) )
+    return anEngine._retn();
+
+  std::string aPath( "/SalomeAppEngine/" );
+  aPath += theComponentName;
+  anEngine = namingService()->Resolve( aPath.c_str() );
+
+  // Activating a new instance of the servant
+  if ( toCreate && CORBA::is_nil( anEngine ) ){
+    try {
+      SalomeApp_Engine_i* aServant    = new SalomeApp_Engine_i( theComponentName );
+      PortableServer::ObjectId_var id = poa()->activate_object( aServant );
+      anEngine = aServant->_this();
+      aServant->_remove_ref();
+      namingService()->Register( anEngine.in(), aPath.c_str() );
+    }
+    catch (CORBA::SystemException&) {
+      INFOS("Caught CORBA::SystemException.");
+    }
+    catch (CORBA::Exception&) {
+      INFOS("Caught CORBA::Exception.");
+    }
+    catch (...) {
+      INFOS("Caught unknown exception.");
+    }
+  }
+
+  return anEngine._retn();
+}
+
+/*!
+  \param theComponentName - synthetic "component data type" used to identify a given light module
+  \return IOR string for the CORBA engine for a light SALOME module
+  with the given "component data type" string
+  \sa GetInstance( const char* theComponentName )
+*/
+std::string SalomeApp_Engine_i::EngineIORForComponent( const char* theComponentName,
+                                                      bool toCreate )
+{
+  std::string anIOR( "" );
+  CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+  if ( !CORBA::is_nil( anEngine ) )
+  {
+    CORBA::String_var objStr = orb()->object_to_string( anEngine.in() );
+    anIOR = std::string( objStr.in() );
+  }
+  return anIOR;
+}
+
+/*!
+  \param theComponentName - synthetic "component data type" used to identify a given light module
+  \return A pointer to corresponding C++ engine instance, null means some internal problems.
+  \sa EngineIORForComponent( const char* theComponentName )
+*/
+SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance( const char* theComponentName,
+                                                    bool toCreate )
+{
+  SalomeApp_Engine_i* aServant = 0;
+  CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+  if ( !CORBA::is_nil( anEngine ) )
+  {
+    PortableServer::Servant aServantBase = poa()->reference_to_servant( anEngine.in() );
+    aServant = dynamic_cast<SalomeApp_Engine_i*>( aServantBase );
+  } 
+  MESSAGE("SalomeApp_Engine_i::GetInstance(): theComponentName = " <<
+         theComponentName << ", aServant = " << aServant);
+  return aServant;
+}
+
index b338785d27b8826761a9b3cbfa5992c53d3cf5ec..0e728da621f5b67c305dcffa22f122609993855b 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
 //  File   : SalomeApp_Engine_i.hxx
 //  Author : Alexander SLADKOV
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef _SALOMEAPP_ENGINE_I_HXX_
 #define _SALOMEAPP_ENGINE_I_HXX_
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SalomeApp_Engine)
 
+class SALOME_NamingService;
+
 class SESSION_EXPORT SalomeApp_Engine_i: public POA_SalomeApp::Engine,
-                          public Engines_Component_i
+                                        public Engines_Component_i
 {
 public:
-  SalomeApp_Engine_i();
+  SalomeApp_Engine_i( const char* theComponentName );
   ~SalomeApp_Engine_i();
 
   SALOMEDS::TMPFile*      Save( SALOMEDS::SComponent_ptr theComponent, 
@@ -54,17 +55,22 @@ public:
                                const char* theURL, 
                                bool isMultiFile );
 
+  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
+                                       CORBA::Boolean isPublished,
+                                       CORBA::Boolean isMultiFile,
+                                       CORBA::Boolean& isValidScript);
+
 public:
   typedef std::vector<std::string> ListOfFiles;
 
-  ListOfFiles             GetListOfFiles (const int         theStudyId, 
-                                          const char*       theComponentName);
-
-  void                    SetListOfFiles (const ListOfFiles theListOfFiles,
-                                          const int         theStudyId, 
-                                          const char*       theComponentName);
+  ListOfFiles             GetListOfFiles (const int          theStudyId);
+  void                    SetListOfFiles (const ListOfFiles& theListOfFiles,
+                                          const int          theStudyId);
 
-  static SalomeApp_Engine_i* GetInstance();
+  static std::string         EngineIORForComponent( const char* theComponentName,
+                                                   bool toCreate );
+  static SalomeApp_Engine_i* GetInstance          ( const char* theComponentName,
+                                                   bool toCreate ); 
 
 public:
   // methods from SALOMEDS::Driver without implementation.  Must be redefined because 
@@ -72,7 +78,7 @@ public:
   SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr, const char*, bool )                                                                        {return 0;}
   CORBA::Boolean LoadASCII( SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile&, const char*, bool )                                                  {return 0;}
   void Close( SALOMEDS::SComponent_ptr )                                                                                                             {}
-  char* ComponentDataType()                                                                                                                          {return 0;}
+  char* ComponentDataType();
   char* IORToLocalPersistentID( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean,  CORBA::Boolean )                                                {return 0;}
   char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean,  CORBA::Boolean )                                                {return 0;}
   bool CanPublishInStudy( CORBA::Object_ptr )                                                                                                        {return 0;}
@@ -83,11 +89,17 @@ public:
   SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile&, CORBA::Long, SALOMEDS::SObject_ptr )                                                    {return 0;}
 
 private:
-  typedef std::map<std::string, ListOfFiles> MapOfListOfFiles;
-  typedef std::map<int, MapOfListOfFiles>    MapOfMapOfListOfFiles;
-  MapOfMapOfListOfFiles                      myMap;
+  static CORBA::ORB_var              orb();
+  static PortableServer::POA_var     poa();
+  static SALOME_NamingService*       namingService();
+  static CORBA::Object_ptr           engineForComponent( const char* theComponentName,
+                                                        bool toCreate  );
+
+private:
+  typedef std::map<int, ListOfFiles> MapOfListOfFiles;
+  MapOfListOfFiles                   myMap;
 
-  static SalomeApp_Engine_i* myInstance;
+  std::string                        myComponentName;
 };
 
 #endif
diff --git a/src/Session/Session.pro b/src/Session/Session.pro
deleted file mode 100644 (file)
index 1fb30bb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#TEMPLATE = lib
-#TARGET = SalomeSession
-#DESTDIR = ../../lib
-#MOC_DIR = ../../moc
-#OBJECTS_DIR = ../../obj/$$TARGET
-
-# ================>
-
-TEMPLATE = 
-TARGET = SALOME_Session_Server
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-# <================
-
-
-QT_MT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-OMNIORBDIR = $$(OMNIORBDIR)
-CORBA_INCLUDES = $${OMNIORBDIR}/include $${OMNIORBDIR}/include/omniORB4 $${OMNIORBDIR}/include/COS
-
-INCLUDEPATH += $${QT_MT_INCLUDES} $${PYTHON_INCLUDES} $${HDF5_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CAS_CPPFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix $$(GUI_ROOT_DIR)/idl ../Qtx ../SUIT ../Event
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-LIBS += $${QT_MT_LIBS}  $${KERNEL_LDFLAGS} -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog -lSalomeDSClient $${CAS_KERNEL} -L../../lib -lwith_loggerTraceCollector -lsuit -lEvent -L$$(GUI_ROOT_DIR)/idl -lSalomeIDLGUI
-
-# ================>
-
-OMNIORB_LIBS = -L$${OMNIORBDIR}/lib -lomniORB4 -lomniDynamic4 -lCOS4 -lCOSDynamic4 -lomnithread
-
-HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
-
-INCLUDEPATH = $${INCLUDEPATH}
-LIBS = $${LIBS} $${OMNIORB_LIBS} $${HDF5_LIBS} -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics -L$$(GUI_ROOT_DIR)/lib -lqtx -lSalomeSession
-
-# <================
-
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += SESSION_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
-
-HEADERS  = Session_Session_i.hxx
-HEADERS += Session_ServerLauncher.hxx
-HEADERS += Session_ServerThread.hxx
-HEADERS += Session_ServerCheck.hxx
-HEADERS += SalomeApp_Engine_i.hxx
-
-SOURCES  = Session_Session_i.cxx
-SOURCES += Session_ServerThread.cxx
-SOURCES += Session_ServerLauncher.cxx
-SOURCES += Session_ServerCheck.cxx
-SOURCES += SalomeApp_Engine_i.cxx
-
-# ================>
-
-SOURCES += SALOME_Session_Server.cxx
-
-# <================
-
-#includes.files = $$HEADERS
-#includes.path = ../../include
-
-#INSTALLS += includes
-
-
index 4003b22accdad1f9a87c28eefb0861062c7f8635..3888313d9e653f1d3604df71a2f3478d63907ffb 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Session_ServerCheck.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
@@ -265,8 +266,8 @@ void Session_ServerCheck::run()
       CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
       CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
       if ( !CORBA::is_nil( _root_context ) ) {
-       setStep( ++current * myAttempts );
-       break;
+        setStep( ++current * myAttempts );
+        break;
       }
     }
     catch( CORBA::COMM_FAILURE& ) {
@@ -296,11 +297,11 @@ void Session_ServerCheck::run()
       CORBA::Object_var obj = NS.Resolve( "/Registry" );
       Registry::Components_var registry = Registry::Components::_narrow( obj );
       if ( !CORBA::is_nil( registry ) ) {
-       MESSAGE( "/Registry is found" );
-       registry->ping();
-       MESSAGE( "Registry was activated" );
-       setStep( ++current * myAttempts );
-       break;
+        MESSAGE( "/Registry is found" );
+        registry->ping();
+        MESSAGE( "Registry was activated" );
+        setStep( ++current * myAttempts );
+        break;
       }
     }
     catch ( ServiceUnreachable& ) {
@@ -344,11 +345,11 @@ void Session_ServerCheck::run()
       CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
       SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow( obj );
       if ( !CORBA::is_nil( studyManager ) ) {
-       MESSAGE( "/myStudyManager is found" );
-       studyManager->ping();
-       MESSAGE( "StudyManager was activated" );
-       setStep( ++current * myAttempts );
-       break;
+        MESSAGE( "/myStudyManager is found" );
+        studyManager->ping();
+        MESSAGE( "StudyManager was activated" );
+        setStep( ++current * myAttempts );
+        break;
       }
     }
     catch ( ServiceUnreachable& ) {
@@ -392,11 +393,11 @@ void Session_ServerCheck::run()
       CORBA::Object_var obj = NS.Resolve( "/Kernel/ModulCatalog" );
       SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow( obj );
       if ( !CORBA::is_nil( catalog ) ){
-       MESSAGE( "/Kernel/ModulCatalog is found" );
-       catalog->ping();
-       MESSAGE( "ModuleCatalog was activated" );
-       setStep( ++current * myAttempts );
-       break;
+        MESSAGE( "/Kernel/ModulCatalog is found" );
+        catalog->ping();
+        MESSAGE( "ModuleCatalog was activated" );
+        setStep( ++current * myAttempts );
+        break;
       }
     }
     catch ( ServiceUnreachable& ) {
@@ -440,11 +441,11 @@ void Session_ServerCheck::run()
       CORBA::Object_var obj = NS.Resolve( "/Kernel/Session" );
       SALOME::Session_var session = SALOME::Session::_narrow( obj );
       if ( !CORBA::is_nil( session ) ) {
-       MESSAGE( "/Kernel/Session is found" );
-       session->ping();
-       MESSAGE( "SALOME_Session was activated" );
-       setStep( ++current * myAttempts );
-       break;
+        MESSAGE( "/Kernel/Session is found" );
+        session->ping();
+        MESSAGE( "SALOME_Session was activated" );
+        setStep( ++current * myAttempts );
+        break;
       }
     }
     catch ( ServiceUnreachable& ) {
@@ -482,45 +483,45 @@ void Session_ServerCheck::run()
       setStep( current * myAttempts + i );
 
       try {
-       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
-       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
-       ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
-       NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
-       Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
-       if ( !CORBA::is_nil( FScontainer ) ) {
-         MESSAGE( containerName.toLatin1().constData() << " is found" );
-         FScontainer->ping();
-         MESSAGE( "FactoryServer container was activated" );
-         setStep( ++current * myAttempts );
-         break;
-       }
+        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+        NS.init_orb( orb );
+        QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() );
+        CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+        Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
+        if ( !CORBA::is_nil( FScontainer ) ) {
+          MESSAGE( containerName.toLatin1().constData() << " is found" );
+          FScontainer->ping();
+          MESSAGE( "FactoryServer container was activated" );
+          setStep( ++current * myAttempts );
+          break;
+        }
       }
       catch ( ServiceUnreachable& ) {
-       MESSAGE( "Caught exception: Naming Service unreachable." );
-       error = "Naming service unreachable";
+        MESSAGE( "Caught exception: Naming Service unreachable." );
+        error = "Naming service unreachable";
       }
       catch ( CORBA::COMM_FAILURE& ) {
-       MESSAGE( "Caught CORBA::SystemException CommFailure." );
-       error = "Caught CORBA::SystemException CommFailure.";
+        MESSAGE( "Caught CORBA::SystemException CommFailure." );
+        error = "Caught CORBA::SystemException CommFailure.";
       }
       catch ( CORBA::SystemException& ) {
-       MESSAGE( "Caught CORBA::SystemException." );
-       error = "Caught CORBA::SystemException.";
+        MESSAGE( "Caught CORBA::SystemException." );
+        error = "Caught CORBA::SystemException.";
       }
       catch ( CORBA::Exception& ) {
-       MESSAGE( "Caught CORBA::Exception." );
-       error = "Caught CORBA::Exception.";
+        MESSAGE( "Caught CORBA::Exception." );
+        error = "Caught CORBA::Exception.";
       }
       catch (...) {
-       MESSAGE( "Caught unknown exception." );
-       error = "Caught unknown exception.";
+        MESSAGE( "Caught unknown exception." );
+        error = "Caught unknown exception.";
       }
       
       if ( i == myAttempts-1 ) {
-       setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
-       return;
+        setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
+        return;
       }
     }
   }
@@ -533,45 +534,45 @@ void Session_ServerCheck::run()
       setStep( current * myAttempts + i );
 
       try {
-       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
-       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
-       ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
-       NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
-       Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
-       if ( !CORBA::is_nil( FSPcontainer ) ) {
-         MESSAGE( containerName.toLatin1().constData() << " is found" );
-         FSPcontainer->ping();
-         MESSAGE("FactoryServerPy container was activated");
-         setStep( ++current * myAttempts );
-         break;
-       }
+        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+        NS.init_orb( orb );
+        QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() );
+        CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+        Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
+        if ( !CORBA::is_nil( FSPcontainer ) ) {
+          MESSAGE( containerName.toLatin1().constData() << " is found" );
+          FSPcontainer->ping();
+          MESSAGE("FactoryServerPy container was activated");
+          setStep( ++current * myAttempts );
+          break;
+        }
       }
       catch ( ServiceUnreachable& ) {
-       MESSAGE( "Caught exception: Naming Service unreachable." );
-       error = "Naming service unreachable";
+        MESSAGE( "Caught exception: Naming Service unreachable." );
+        error = "Naming service unreachable";
       }
       catch ( CORBA::COMM_FAILURE& ) {
-       MESSAGE( "Caught CORBA::SystemException CommFailure." );
-       error = "Caught CORBA::SystemException CommFailure.";
+        MESSAGE( "Caught CORBA::SystemException CommFailure." );
+        error = "Caught CORBA::SystemException CommFailure.";
       }
       catch ( CORBA::SystemException& ) {
-       MESSAGE( "Caught CORBA::SystemException." );
-       error = "Caught CORBA::SystemException.";
+        MESSAGE( "Caught CORBA::SystemException." );
+        error = "Caught CORBA::SystemException.";
       }
       catch ( CORBA::Exception& ) {
-       MESSAGE( "Caught CORBA::Exception." );
-       error = "Caught CORBA::Exception.";
+        MESSAGE( "Caught CORBA::Exception." );
+        error = "Caught CORBA::Exception.";
       }
       catch (...) {
-       MESSAGE( "Caught unknown exception." );
-       error = "Caught unknown exception.";
+        MESSAGE( "Caught unknown exception." );
+        error = "Caught unknown exception.";
       }
 
       if ( i == myAttempts-1 ) {
-       setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
-       return;
+        setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
+        return;
       }
     }
   }
@@ -584,45 +585,45 @@ void Session_ServerCheck::run()
       setStep( current * myAttempts + i );
 
       try {
-       CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
-       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
-       ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
-       NS.init_orb( orb );
-       QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() );
-       CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
-       Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
-       if ( !CORBA::is_nil( SVcontainer ) ) {
-         MESSAGE( containerName.toLatin1().constData() << " is found" );
-         SVcontainer->ping();
-         MESSAGE("SuperVisionContainer container was activated");
-         setStep( ++current * myAttempts );
-         break;
-       }
+        CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+        SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+        ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+        NS.init_orb( orb );
+        QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() );
+        CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+        Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
+        if ( !CORBA::is_nil( SVcontainer ) ) {
+          MESSAGE( containerName.toLatin1().constData() << " is found" );
+          SVcontainer->ping();
+          MESSAGE("SuperVisionContainer container was activated");
+          setStep( ++current * myAttempts );
+          break;
+        }
       }
       catch ( ServiceUnreachable& ) {
-       MESSAGE( "Caught exception: Naming Service unreachable." );
-       error = "Naming service unreachable";
+        MESSAGE( "Caught exception: Naming Service unreachable." );
+        error = "Naming service unreachable";
       }
       catch ( CORBA::COMM_FAILURE& ) {
-       MESSAGE( "Caught CORBA::SystemException CommFailure." );
-       error = "Caught CORBA::SystemException CommFailure.";
+        MESSAGE( "Caught CORBA::SystemException CommFailure." );
+        error = "Caught CORBA::SystemException CommFailure.";
       }
       catch ( CORBA::SystemException& ) {
-       MESSAGE( "Caught CORBA::SystemException." );
-       error = "Caught CORBA::SystemException.";
+        MESSAGE( "Caught CORBA::SystemException." );
+        error = "Caught CORBA::SystemException.";
       }
       catch ( CORBA::Exception& ) {
-       MESSAGE( "Caught CORBA::Exception." );
-       error = "Caught CORBA::Exception.";
+        MESSAGE( "Caught CORBA::Exception." );
+        error = "Caught CORBA::Exception.";
       }
       catch (...) {
-       MESSAGE( "Caught unknown exception." );
-       error = "Caught unknown exception.";
+        MESSAGE( "Caught unknown exception." );
+        error = "Caught unknown exception.";
       }
     
       if ( i == myAttempts-1 ) {
-       setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
-       return;
+        setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
+        return;
       }
     }
   }
index e23568ed2f0d9402bfc63c1040a70629879c3fe9..1bbb6590d2d77d696ad719c7c923dea613b212e4 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Session_ServerCheck.hxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
index bf7fe089037f4a522702249621cd710ca9ba43b4..39c9c5ef6752a1f3c553ef45e048cbf4fc6f8396 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Session : implementation of Session_ServerLauncher.cxx
 //  File   : Session_ServerLauncher.xx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-//
+
 #include "Session_ServerLauncher.hxx"
 #include "Session_ServerThread.hxx"
 
@@ -34,7 +33,6 @@
 #include <QMutex>
 #include <QWaitCondition>
 
-using namespace std;
 /*! 
    default constructor not for use
  */
@@ -47,13 +45,13 @@ Session_ServerLauncher::Session_ServerLauncher()
   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)
+                                               char ** argv, 
+                                               CORBA::ORB_ptr orb, 
+                                               PortableServer::POA_ptr poa,
+                                               QMutex *GUIMutex,
+                                               QWaitCondition *ServerLaunch,
+                                               QMutex *SessionMutex,
+                                               QWaitCondition *SessionStarted)
 {
   _argc = argc;
   _argv = argv;
@@ -117,60 +115,71 @@ void Session_ServerLauncher::CheckArgs()
       SCRUTE(_argv[iarg]);
       _argCopy.push_back(_argv[iarg]);
       switch (argState)
-       {
-       case 0: // looking for "--with"
-         {
-           if (strcmp(_argv[iarg],"--with")==0)
-             argState = 1;
-           break;
-         }
-       case 1: // looking for server type
-         {
-           for (int i=0; i<Session_ServerThread::NB_SRV_TYP; i++)
-               if (strcmp(_argv[iarg],Session_ServerThread::_serverTypes[i])==0)
-                 {
-                   aServArg._servType = i;
-                   argState = 2;
-                   break;
-                 }
-           break;
-         }
-       case 2: // looking for "("
-         {
-           if (strcmp(_argv[iarg],"(")!=0)
-             {
-               INFOS("parenthesis '(' is required here...");
-               for (int i=0; i<iarg; i++)
-                 cerr << _argv[i] << " ";
-               cerr << endl;
-               throw SALOME_Exception(LOCALIZED("Error in command arguments, missing prenthesis"));
-             } 
-           else
-             {
-               aServArg._firstArg=iarg+1;    // arg after '('
-               argState = 3;
-             }
-           break;
-         }
-       case 3: // looking for arguments
-         {
-           if (strcmp(_argv[iarg],")")==0)   // end of arguments = ')'
-             {
-               aServArg._lastArg=iarg-1;     // arg before ')'
-               MESSAGE("server : "<< Session_ServerThread::_serverTypes[aServArg._servType]);
-               for (int i=aServArg._firstArg; i<=aServArg._lastArg; i++)
-                 MESSAGE("  arg : " << _argCopy[i]);
-               _argServToLaunch.push_back(aServArg);
-               argState = 0;
-             } 
-           break;
-         }
-       default:
-         {
-           ASSERT(0);
-           break;
-         }
-       }
+        {
+        case 0: // looking for "--with"
+          {
+            if (strcmp(_argv[iarg],"--with")==0)
+              argState = 1;
+            break;
+          }
+        case 1: // looking for server type
+          {
+           // Temporary solution
+           // Issue 21337 - no more SalomeApp_Engine_i activation here
+           // TODO: To be removed as soon as any trace of SalomeAppEngine
+           // has been eliminated from KERNEL scripts
+           if (strcmp(_argv[iarg], "SalomeAppEngine")==0){
+             argState = 0;
+             iarg += 2; // skipping "()" 
+             break;
+           }
+           // Temporary solution
+
+            for (int i=0; i<Session_ServerThread::NB_SRV_TYP; i++)
+                if (strcmp(_argv[iarg],Session_ServerThread::_serverTypes[i])==0)
+                  {
+                    aServArg._servType = i;
+                    argState = 2;
+                    break;
+                  }
+            break;
+          }
+        case 2: // looking for "("
+          {
+            if (strcmp(_argv[iarg],"(")!=0)
+              {
+                INFOS("parenthesis '(' is required here...");
+                for (int i=0; i<iarg; i++)
+                  std::cerr << _argv[i] << " ";
+                std::cerr << std::endl;
+                throw SALOME_Exception(LOCALIZED("Error in command arguments, missing prenthesis"));
+              } 
+            else
+              {
+                aServArg._firstArg=iarg+1;    // arg after '('
+                argState = 3;
+              }
+            break;
+          }
+        case 3: // looking for arguments
+          {
+            if (strcmp(_argv[iarg],")")==0)   // end of arguments = ')'
+              {
+                aServArg._lastArg=iarg-1;     // arg before ')'
+                MESSAGE("server : "<< Session_ServerThread::_serverTypes[aServArg._servType]);
+                for (int i=aServArg._firstArg; i<=aServArg._lastArg; i++)
+                  MESSAGE("  arg : " << _argCopy[i]);
+                _argServToLaunch.push_back(aServArg);
+                argState = 0;
+              } 
+            break;
+          }
+        default:
+          {
+            ASSERT(0);
+            break;
+          }
+        }
     }
   if (argState == 1)
     throw SALOME_Exception(LOCALIZED("Error in command arguments, missing server type"));
@@ -182,7 +191,7 @@ void Session_ServerLauncher::CheckArgs()
 
 void Session_ServerLauncher::ActivateAll()
 {
-  list<ServArg>::iterator itServ;
+  std::list<ServArg>::iterator itServ;
   for (itServ = _argServToLaunch.begin(); itServ !=_argServToLaunch.end(); itServ++)
   {
     int argc = 2 + (*itServ)._lastArg - (*itServ)._firstArg;
@@ -193,8 +202,8 @@ void Session_ServerLauncher::ActivateAll()
     if (argc>1)
     {
       for (int i=0; i<argc-1; i++)
-       //argv[i+1] = _argCopy[(*itServ)._firstArg + i].c_str();
-             argv[i+1] = _argv[(*itServ)._firstArg + i];
+        //argv[i+1] = _argCopy[(*itServ)._firstArg + i].c_str();
+              argv[i+1] = _argv[(*itServ)._firstArg + i];
     }
 
     MESSAGE("*** activating [" << argc << "] : " << argv[0]);
@@ -213,7 +222,7 @@ void Session_ServerLauncher::ActivateAll()
 
   int argc=1;
   char** argv = new char*[argc];
-  argv[0] = "Session";
+  argv[0] = (char*)"Session";
   Session_SessionThread* aServerThread
     = new Session_SessionThread(argc, argv, _orb,_root_poa,_SessionMutex,_SessionStarted);
   _serverThreads.push_front(aServerThread);
@@ -227,7 +236,7 @@ void Session_ServerLauncher::ActivateAll()
 void Session_ServerLauncher::KillAll()
 {
   MESSAGE("Session_ServerLauncher::KillAll()");
-  list<Session_ServerThread*>::reverse_iterator itServ;
+  std::list<Session_ServerThread*>::reverse_iterator itServ;
   for (itServ = _serverThreads.rbegin(); itServ !=_serverThreads.rend(); itServ++)
   {
     delete (*itServ);
index dac62c609c80db54d482145bb3432a03a2cd1684..39b9eaa834a3a6253f6187eba0cc9c2ce1ea5811 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Session : implementation of Session_ServerLauncher.hxx
 //  File   : Session_ServerLauncher.hxx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef _SESSION_SERVERLAUNCHER_HXX_
 #define _SESSION_SERVERLAUNCHER_HXX_
 
@@ -36,8 +35,6 @@
 #include <string>
 #include <QThread>
 
-using namespace std;
-
 class SESSION_EXPORT ServArg
   {
   public:
@@ -61,13 +58,13 @@ class SESSION_EXPORT Session_ServerLauncher: public QThread
 public:
   Session_ServerLauncher();
   Session_ServerLauncher(int argc,
-                        char ** argv, 
-                        CORBA::ORB_ptr orb, 
-                        PortableServer::POA_ptr poa,
-                        QMutex *GUIMutex,
-                        QWaitCondition *ServerLaunch,
-                        QMutex *SessionMutex,
-                        QWaitCondition *SessionStarted);
+                         char ** argv, 
+                         CORBA::ORB_ptr orb, 
+                         PortableServer::POA_ptr poa,
+                         QMutex *GUIMutex,
+                         QWaitCondition *ServerLaunch,
+                         QMutex *SessionMutex,
+                         QWaitCondition *SessionStarted);
   virtual ~Session_ServerLauncher();
   void run();
   void KillAll();
@@ -77,17 +74,17 @@ protected:
   void ActivateAll();
 
 private:
-  int _argc;
-  char ** _argv;
-  CORBA::ORB_var              _orb;
-  PortableServer::POA_var     _root_poa;
-  QMutex*                     _GUIMutex;
-  QWaitCondition*             _ServerLaunch;
-  QMutex*                     _SessionMutex;
-  QWaitCondition*             _SessionStarted;
-  list<ServArg>               _argServToLaunch;
-  vector<string>              _argCopy;
-  list<Session_ServerThread*> _serverThreads;
+  int                              _argc;
+  char**                           _argv;
+  CORBA::ORB_var                    _orb;
+  PortableServer::POA_var          _root_poa;
+  QMutex*                          _GUIMutex;
+  QWaitCondition*                  _ServerLaunch;
+  QMutex*                          _SessionMutex;
+  QWaitCondition*                  _SessionStarted;
+  std::list<ServArg>               _argServToLaunch;
+  std::vector<std::string>         _argCopy;
+  std::list<Session_ServerThread*> _serverThreads;
 };
 
 #endif
index 3a66b102ec440dd0e38973ca9edbcec90038554b..07e1e6726991ae1569e77eb800ec2b6341532399 100755 (executable)
@@ -1,33 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Session : implementation of Session_ServerThread.cxx
 //  File   : Session_ServerThread.cxx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-// #include <SALOMEconfig.h>
-// #include CORBA_SERVER_HEADER(SALOME_Session)
-// #include CORBA_SERVER_HEADER(SALOMEDS)
-//
+
 #include "Session_ServerThread.hxx"
 
 #include <SALOME_NamingService.hxx>
@@ -38,7 +34,6 @@
 #include <RegistryService.hxx>
 
 #include "Session_Session_i.hxx"
-#include "SalomeApp_Engine_i.hxx"
 
 #include <Utils_ORB_INIT.hxx>
 #include <Utils_SINGLETON.hxx>
 #include <QMutex>
 #include <QWaitCondition>
 
-using namespace std;
-
-const int Session_ServerThread::NB_SRV_TYP = 7;
+const int Session_ServerThread::NB_SRV_TYP = 6;
 const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container",
-                                                             "ModuleCatalog",
-                                                             "Registry",
-                                                             "SALOMEDS",
-                                                             "Session",
-                                                             "SalomeAppEngine",
+                                                              "ModuleCatalog",
+                                                              "Registry",
+                                                              "SALOMEDS",
+                                                              "Session",
                                                               "ContainerManager"};
 
 /*! 
@@ -76,9 +68,9 @@ Session_ServerThread::Session_ServerThread()
   constructor
 */
 Session_ServerThread::Session_ServerThread(int argc,
-                                          char ** argv, 
-                                          CORBA::ORB_ptr orb, 
-                                          PortableServer::POA_ptr poa)
+                                           char ** argv, 
+                                           CORBA::ORB_ptr orb, 
+                                           PortableServer::POA_ptr poa)
 {
   //MESSAGE("Session_ServerThread Constructor " << argv[0]);
   _argc = argc;
@@ -123,64 +115,58 @@ void Session_ServerThread::Init()
       MESSAGE("Server Thread type : "<<_serverTypes[i]);
       switch (_servType) {
       case 0:  // Container
-       {
-         NamingService_WaitForServerReadiness(_NS,"/Registry");
-         NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
-         ActivateContainer(_argc, _argv);
-         break;
-       }
+        {
+          NamingService_WaitForServerReadiness(_NS,"/Registry");
+          NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
+          ActivateContainer(_argc, _argv);
+          break;
+        }
       case 1:  // ModuleCatalog
-       {
-         NamingService_WaitForServerReadiness(_NS,"/Registry");
-         ActivateModuleCatalog(_argc, _argv);
-         break;
-       }
+        {
+          NamingService_WaitForServerReadiness(_NS,"/Registry");
+          ActivateModuleCatalog(_argc, _argv);
+          break;
+        }
       case 2:  // Registry
-       {
-         NamingService_WaitForServerReadiness(_NS,"");
-         ActivateRegistry(_argc, _argv);
-         break;
-       }
+        {
+          NamingService_WaitForServerReadiness(_NS,"");
+          ActivateRegistry(_argc, _argv);
+          break;
+        }
       case 3:  // SALOMEDS
-       {
-         NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
-         ActivateSALOMEDS(_argc, _argv);
-         break;
-       }
+        {
+          NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
+          ActivateSALOMEDS(_argc, _argv);
+          break;
+        }
       case 4:  // Session
-       {
-         NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
-         string containerName = "/Containers/";
-         containerName = containerName + Kernel_Utils::GetHostname();
-         containerName = containerName + "/FactoryServer";
-         NamingService_WaitForServerReadiness(_NS,containerName);
-         ActivateSession(_argc, _argv);
-         break;
-       }
-      case 5: // SalomeApp_Engine
-       {
-         NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
-         ActivateEngine(_argc, _argv);
-         break;
-       }
-      case 6: // Container Manager
-       {
-         NamingService_WaitForServerReadiness(_NS,"");
-         ActivateContainerManager(_argc, _argv);
-         break;
-       }
+        {
+          NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
+          std::string containerName = "/Containers/";
+          containerName = containerName + Kernel_Utils::GetHostname();
+          containerName = containerName + "/FactoryServer";
+          NamingService_WaitForServerReadiness(_NS,containerName);
+          ActivateSession(_argc, _argv);
+          break;
+        }
+      case 5: // Container Manager
+        {
+          NamingService_WaitForServerReadiness(_NS,"");
+          ActivateContainerManager(_argc, _argv);
+          break;
+        }
       default:
-       {
-         ASSERT(0);
-         break;
-       }
+        {
+          ASSERT(0);
+          break;
+        }
       }
     }
   }
 }
 
 void Session_ServerThread::ActivateModuleCatalog(int argc,
-                                                char ** argv)
+                                                 char ** argv)
 {
   try {
     MESSAGE("ModuleCatalog thread started");
@@ -215,7 +201,7 @@ void Session_ServerThread::ActivateModuleCatalog(int argc,
 }
 
 void Session_ServerThread::ActivateSALOMEDS(int argc,
-                                           char ** argv)
+                                            char ** argv)
 {
   try {
     MESSAGE("SALOMEDS thread started");
@@ -243,7 +229,7 @@ void Session_ServerThread::ActivateSALOMEDS(int argc,
 }
 
 void Session_ServerThread::ActivateRegistry(int argc,
-                                           char ** argv)
+                                            char ** argv)
 {
   MESSAGE("Registry thread started");
   SCRUTE(argc); 
@@ -265,10 +251,11 @@ void Session_ServerThread::ActivateRegistry(int argc,
   const char *registryName = "Registry";
   Registry::Components_var varComponents;
   try {
-    RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance();
+    RegistryService *ptrRegistry = new RegistryService;
     ptrRegistry->SessionName( ptrSessionName );
     ptrRegistry->SetOrb(_orb);
     varComponents = ptrRegistry->_this();
+    ptrRegistry->_remove_ref(); //let poa manage registry service deletion
     // The RegistryService must not already exist.
     
     try {
@@ -281,9 +268,8 @@ void Session_ServerThread::ActivateRegistry(int argc,
     }
     catch( const CORBA::Exception &/*exx*/ ) {
     }
-    string absoluteName = string("/") + registryName;
+    std::string absoluteName = std::string("/") + registryName;
     _NS->Register( varComponents , absoluteName.c_str() );
-    MESSAGE("On attend les requetes des clients");
   }
   catch( const SALOME_Exception &ex ) {
     INFOS( "Communication Error : " << ex.what() );
@@ -292,12 +278,12 @@ void Session_ServerThread::ActivateRegistry(int argc,
 }
 
 void Session_ServerThread::ActivateContainerManager(int argc,
-                                            char ** argv)
+                                             char ** argv)
 {
   try {
     PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
-    cout << "Activate SalomeLauncher ......!!!! " << endl;
-    SALOME_Launcher * myContainer = new SALOME_Launcher(_orb,root_poa);
+    std::cout << "Activate SalomeLauncher ......!!!! " << std::endl;
+    new SALOME_Launcher(_orb,root_poa);
   }
   catch(CORBA::SystemException&) {
     INFOS("Caught CORBA::SystemException.");
@@ -317,7 +303,7 @@ void Session_ServerThread::ActivateContainerManager(int argc,
 }
 
 void Session_ServerThread::ActivateContainer(int argc,
-                                            char ** argv)
+                                             char ** argv)
 {
   try {
     MESSAGE("Container thread started");
@@ -333,25 +319,25 @@ void Session_ServerThread::ActivateContainer(int argc,
       MESSAGE("factory_poa does not exists, create...");
       // define policy objects     
       PortableServer::ImplicitActivationPolicy_var implicitActivation =
-       _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION);
+        _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION);
       // default = NO_IMPLICIT_ACTIVATION
       PortableServer::ThreadPolicy_var threadPolicy =
-       _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
+        _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
       // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
       
       // create policy list
       CORBA::PolicyList policyList;
       policyList.length(2);
       policyList[0] = PortableServer::ImplicitActivationPolicy::
-       _duplicate(implicitActivation);
+        _duplicate(implicitActivation);
       policyList[1] = PortableServer::ThreadPolicy::
-       _duplicate(threadPolicy);
+        _duplicate(threadPolicy);
       
       PortableServer::POAManager_var nil_mgr
-       = PortableServer::POAManager::_nil();
+        = PortableServer::POAManager::_nil();
       factory_poa = _root_poa->create_POA("factory_poa",
-                                         nil_mgr,
-                                         policyList);
+                                          nil_mgr,
+                                          policyList);
       //with nil_mgr instead of pman,
       //a new POA manager is created with the new POA
       
@@ -365,13 +351,12 @@ void Session_ServerThread::ActivateContainer(int argc,
       MESSAGE("pmanfac->activate()");
     }
     
-    char *containerName = "";
+    char *containerName = (char*)"";
     if (argc >1) {
       containerName = argv[1];
     }
     
-    Engines_Container_i * myContainer 
-      = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+    new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
   }
   catch(CORBA::SystemException&) {
     INFOS("Caught CORBA::SystemException.");
@@ -390,31 +375,8 @@ void Session_ServerThread::ActivateContainer(int argc,
   }
 }
 
-void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/)
-{
-  try {
-    MESSAGE("SalomeApp_Engine thread started");
-    SalomeApp_Engine_i* anEngine = new SalomeApp_Engine_i();
-    PortableServer::ObjectId_var id =_root_poa->activate_object( anEngine );
-    MESSAGE("poa->activate_object( SalomeApp_Engine )");
-
-    CORBA::Object_var obj = anEngine->_this();
-    anEngine->_remove_ref();
-    _NS->Register( obj ,"/SalomeAppEngine");
-  }
-  catch (CORBA::SystemException&) {
-    INFOS("Caught CORBA::SystemException.");
-  }
-  catch (CORBA::Exception&) {
-    INFOS("Caught CORBA::Exception.");
-  }
-  catch (...) {
-    INFOS("Caught unknown exception.");
-  }
-}
-
 void Session_ServerThread::ActivateSession(int argc,
-                                          char ** argv)
+                                           char ** argv)
 {
   MESSAGE("Session_ServerThread::ActivateSession() not implemented!");
 }
@@ -423,11 +385,11 @@ void Session_ServerThread::ActivateSession(int argc,
   constructor 
 */
 Session_SessionThread::Session_SessionThread(int argc,
-                                            char** argv, 
-                                            CORBA::ORB_ptr orb, 
-                                            PortableServer::POA_ptr poa,
-                                            QMutex* GUIMutex,
-                                            QWaitCondition* GUILauncher)
+                                             char** argv, 
+                                             CORBA::ORB_ptr orb, 
+                                             PortableServer::POA_ptr poa,
+                                             QMutex* GUIMutex,
+                                             QWaitCondition* GUILauncher)
 : Session_ServerThread(argc, argv, orb, poa),
   _GUIMutex( GUIMutex ),
   _GUILauncher( GUILauncher )
@@ -442,7 +404,7 @@ Session_SessionThread::~Session_SessionThread()
 }
 
 void Session_SessionThread::ActivateSession(int argc,
-                                           char ** argv)
+                                            char ** argv)
 {
   try {
     MESSAGE("Session thread started");
index 549dd3021bbdf94cf759dc28499ae167160e1991..e6a970008c5ebc1adbd659380217afe36db1d534 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Session : implementation of Session_ServerThread.hxx
 //  File   : Session_ServerThread.hxx
 //  Author : Paul RASCLE, EDF
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef _SESSION_SERVERTHREAD_HXX_
 #define _SESSION_SERVERTHREAD_HXX_
 
@@ -33,9 +32,7 @@
 #include <CORBA.h> 
 #include <string>
 
-using namespace std;
-
-void WaitForServerReadiness(string serverName);
+void WaitForServerReadiness(std::string serverName);
 
 class SALOME_NamingService;
 
@@ -47,9 +44,9 @@ public:
 
   Session_ServerThread();
   Session_ServerThread(int argc,
-                      char ** argv, 
-                      CORBA::ORB_ptr orb, 
-                      PortableServer::POA_ptr poa);
+                       char ** argv, 
+                       CORBA::ORB_ptr orb, 
+                       PortableServer::POA_ptr poa);
   virtual ~Session_ServerThread();
   void         Init();
 protected:
@@ -77,11 +74,11 @@ class SESSION_EXPORT Session_SessionThread : public Session_ServerThread
 public:
   Session_SessionThread() {}
   Session_SessionThread(int argc,
-                      char** argv, 
-                      CORBA::ORB_ptr orb, 
-                      PortableServer::POA_ptr poa,
-                      QMutex* GUIMutex,
-                       QWaitCondition* GUILauncher);
+                       char** argv, 
+                       CORBA::ORB_ptr orb, 
+                       PortableServer::POA_ptr poa,
+                       QMutex* GUIMutex,
+                       QWaitCondition* GUILauncher);
   virtual ~Session_SessionThread();  
 
 protected:
index 59ea32ac2cdb4f018d30e93b613031125f2676a2..a075efc134e5b70387b5f1878a12233d0ef1598d 100755 (executable)
@@ -1,30 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  SALOME Session : implementation of Session.idl
 //  File   : SALOME_Session_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
-//  $Header$
-//
+
 #include "utilities.h"
 
 #include "Session_Session_i.hxx"
@@ -36,6 +34,8 @@
 #include "SUIT_Desktop.h"
 #include "SUIT_Study.h"
 
+#include "Basics_Utils.hxx"
+
 #include <QMutex>
 #include <QWaitCondition>
 
 
 #ifdef WNT
 # include <process.h>
+#else
+#include <unistd.h>
 #endif
 
-
-using namespace std;
-
 /*!
   constructor
 */
 SALOME_Session_i::SALOME_Session_i(int argc,
-                                  char ** argv,
-                                  CORBA::ORB_ptr orb,
-                                  PortableServer::POA_ptr poa,
-                                  QMutex* GUIMutex,
-                                  QWaitCondition* GUILauncher)
+                                   char ** argv,
+                                   CORBA::ORB_ptr orb,
+                                   PortableServer::POA_ptr poa,
+                                   QMutex* GUIMutex,
+                                   QWaitCondition* GUILauncher)
 {
   _argc = argc ;
   _argv = argv ;
@@ -69,22 +68,23 @@ SALOME_Session_i::SALOME_Session_i(int argc,
   _GUIMutex = GUIMutex;
   _GUILauncher = GUILauncher;
   _NS = new SALOME_NamingService(_orb);
+  _isShuttingDown = false;
   //MESSAGE("constructor end");
 }
 
 /*!
   returns Visu component
 */
-Engines::Component_ptr SALOME_Session_i::GetComponent(const char* theLibraryName)
+Engines::EngineComponent_ptr SALOME_Session_i::GetComponent(const char* theLibraryName)
 {
-  typedef Engines::Component_ptr TGetImpl(CORBA::ORB_ptr,
-                                         PortableServer::POA_ptr,
-                                         SALOME_NamingService*,QMutex*);
+  typedef Engines::EngineComponent_ptr TGetImpl(CORBA::ORB_ptr,
+                                                PortableServer::POA_ptr,
+                                                SALOME_NamingService*,QMutex*);
   OSD_SharedLibrary  aSharedLibrary(const_cast<char*>(theLibraryName));
   if(aSharedLibrary.DlOpen(OSD_RTLD_LAZY))
     if(OSD_Function anOSDFun = aSharedLibrary.DlSymb("GetImpl"))
       return ((TGetImpl (*)) anOSDFun)(_orb,_poa,_NS,_GUIMutex);
-  return Engines::Component::_nil();
+  return Engines::EngineComponent::_nil();
 }
 
 /*!
@@ -120,6 +120,25 @@ void SALOME_Session_i::NSregister()
   //MESSAGE("Session registered in Naming Service");
 }
 
+/*!
+  Unregister session server from CORBA Naming Service
+*/
+void SALOME_Session_i::NSunregister()
+{
+  try
+    {
+      _NS->Destroy_Name("/Kernel/Session");
+    }
+  catch (ServiceUnreachable&)
+    {
+      INFOS("Caught exception: Naming Service Unreachable");
+    }
+  catch (...)
+    {
+      INFOS("Caught unknown exception from Naming Service");
+    }
+}
+
 /*!
   Launches the GUI if there is none.
   The Corba method is oneway (corba client does'nt wait for GUI completion)
@@ -131,8 +150,8 @@ void SALOME_Session_i::GetInterface()
   if ( !SUIT_Session::session() )
   {
     _GUILauncher->wakeAll();
-    MESSAGE("SALOME_Session_i::GetInterface() called, starting GUI...")
-      }
+    MESSAGE("SALOME_Session_i::GetInterface() called, starting GUI...");
+  }
 }
 
 /*!
@@ -142,19 +161,38 @@ class CloseEvent : public SALOME_Event
 {
 public:
   virtual void Execute() {
-    SUIT_Session* session = SUIT_Session::session();
-    session->closeSession( SUIT_Session::DONT_SAVE );
-    //if ( SUIT_Application::getDesktop() )
-    //  QAD_Application::getDesktop()->closeDesktop( true );
+    if ( SUIT_Session::session() )
+      SUIT_Session::session()->closeSession( SUIT_Session::DONT_SAVE );
   }
 };
 
 /*!
-  Processes event to close session
+  Stop session (close all GUI windows)
 */
 void SALOME_Session_i::StopSession()
 {
-  ProcessVoidEvent( new CloseEvent() );
+  _GUIMutex->lock();
+  _GUIMutex->unlock();
+  if ( SUIT_Session::session() ) {
+    ProcessVoidEvent( new CloseEvent() );
+  }
+}
+
+//! Shutdown session
+void SALOME_Session_i::Shutdown()
+{
+  _GUIMutex->lock();
+  bool isBeingShuttingDown = _isShuttingDown;
+  _isShuttingDown = true;
+  _GUIMutex->unlock();
+  if ( !isBeingShuttingDown ) {
+    if ( SUIT_Session::session() ) {
+      ProcessVoidEvent( new CloseEvent() );
+    }
+    else {
+      _GUILauncher->wakeAll();
+    }
+  }
 }
 
 /*!
@@ -182,16 +220,19 @@ SALOME::StatSession SALOME_Session_i::GetStatSession()
       _runningStudies = SUIT_Session::session()->activeApplication()->getNbStudies();
   }
 
-  _GUIMutex->unlock();
-
   // getting stat info
   SALOME::StatSession_var myStats = new SALOME::StatSession ;
   if (_runningStudies)
     myStats->state = SALOME::running ;
+  else if (_isShuttingDown)
+    myStats->state = SALOME::shutdown ;
   else
     myStats->state = SALOME::asleep ;
   myStats->runningStudies = _runningStudies ;
   myStats->activeGUI = _isGUI ;
+
+  _GUIMutex->unlock();
+
   return myStats._retn() ;
 }
 
@@ -214,6 +255,12 @@ CORBA::Long SALOME_Session_i::getPID() {
 #endif
 }
 
+char* SALOME_Session_i::getHostname()
+{
+  std::string aHostName = Kernel_Utils::GetHostname();
+  return CORBA::string_dup( aHostName.data() );
+}
+
 bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
 {
   class TEvent: public SALOME_Event {
@@ -223,7 +270,7 @@ bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
     virtual void Execute() {
       SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy();
       if ( study ) {
-       study->restoreState(_savePoint);
+        study->restoreState(_savePoint);
       }
     }
   };
@@ -254,7 +301,7 @@ void SALOME_Session_i::emitMessage(const char* theMessage)
   if ( SUIT_Session::session() ) {
     if ( SUIT_Session::session()->activeApplication() ) {
       if ( SUIT_Session::session()->activeApplication()->desktop() ) {
-       ProcessVoidEvent( new TEvent(theMessage) );
+        ProcessVoidEvent( new TEvent(theMessage) );
       }
     }
   }
index c691a2ba28ad59d6c9ba922eeb54fde735f9ac9b..b03803d5bd32c3509f24b01b3d993bcbf7d8661a 100755 (executable)
@@ -1,30 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  SALOME Session : implementation of Session.idl
 //  File   : Session_Session_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SALOME
-//  $Header$
-//
+
 #ifndef _SESSION_SESSION_I_HXX_
 #define _SESSION_SESSION_I_HXX_
 
@@ -39,7 +37,7 @@ class QMutex;
 class QWaitCondition;
 
 class SESSION_EXPORT SALOME_Session_i:  public virtual POA_SALOME::Session,
-                        public virtual PortableServer::ServantBase
+                         public virtual PortableServer::ServantBase
 {
 public:
   SALOME_Session_i(int argc, 
@@ -54,7 +52,7 @@ public:
   void GetInterface();
 
   //! Return VISU component
-  Engines::Component_ptr GetComponent(const char* theLibraryName);
+  Engines::EngineComponent_ptr GetComponent(const char* theLibraryName);
 
   //! Stop the Session (must be idle): kill servant & server
   void StopSession();
@@ -62,13 +60,19 @@ public:
   //! Get session state
   SALOME::StatSession GetStatSession();
 
+  //! Shutdown session
+  void Shutdown();
+
   //! Register the servant to Naming Service
   void NSregister();
+  //! Unregister the servant from Naming Service
+  void NSunregister();
 
   CORBA::Long GetActiveStudyId();
 
   void ping(){};
   CORBA::Long getPID();
+  char* getHostname();
 
   //! Restors a visual state of the study at theSavePoint
   bool restoreVisualState(CORBA::Long theSavePoint);
@@ -90,7 +94,7 @@ protected:
   int _runningStudies ;
   CORBA::ORB_var _orb;
   PortableServer::POA_var _poa;
+  bool _isShuttingDown;
 };
 
 #endif
-
index 18cef3c1907727562e92954ce33faf249279f5c4..153a8b7f054b9619ef46ee3734a8e361f380d75a 100644 (file)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : SalomeApp
@@ -64,3 +65,5 @@ libSalomeStyle_la_LDFLAGS  = $(QT_MT_LIBS)    \
        ../Qtx/libqtx.la
 
 dist_salomeres_DATA = resources/SalomeStyle.xml
+
+nodist_salomeres_DATA = Style_msg_fr.qm
index 9d79eb1747ca1a4d724fa7204e796a32e9d99a0d..aa932cbf58139c24011703adcc0c8a08591b8474 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style.h
 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
 //
@@ -26,7 +24,7 @@
 #define STYLE_H
 
 #if defined WIN32
-#  if defined STYLE_SALOME_EXPORTS || defined STYLE_EXPORTS
+#  if defined STYLE_SALOME_EXPORTS || defined STYLE_EXPORTS || defined SalomeStyle_EXPORTS
 #    define STYLE_SALOME_EXPORT _declspec( dllexport )
 #  else
 #    define STYLE_SALOME_EXPORT _declspec( dllimport )
index 7c529c5412f6955b17648883e0dc34fbc685609a..db45cce23be647b14804e019c53f3fcf1e2617a3 100644 (file)
@@ -6,3 +6,4 @@
      <file>images/warning.png</file>
  </qresource>
  </RCC>
\ No newline at end of file
index 43bb896c06c7d72a3117b03ba53dc466c14eab67..88a266fad3a72aa4985a0960f449679455bd73e4 100644 (file)
@@ -1,28 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Model.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
 #include "Style_Model.h"
+#include "Style_Salome.h"
 
 #include <QtxResourceMgr.h>
 
@@ -41,9 +40,9 @@
 static QColor mixColors( const QColor& c1, const QColor& c2 )
 {
   return QColor( (c1.red()   + c2.red() )   / 2,
-                (c1.green() + c2.green() ) / 2,
-                (c1.blue()  + c2.blue() )  / 2,
-                (c1.alpha() + c2.alpha() ) / 2 );
+                 (c1.green() + c2.green() ) / 2,
+                 (c1.blue()  + c2.blue() )  / 2,
+                 (c1.alpha() + c2.alpha() ) / 2 );
 }
 
 /*!
@@ -106,10 +105,11 @@ void Style_Model::fromApplication( bool reset )
   if ( !QApplication::instance() )  // application object is not created yet
     return;
 
-  if ( !myAppData )  {
-    // if not yes initialized from the application,
-    // store current application's style, palette, etc
+  if ( !myAppData ) // if not yes initialized from the application init myAppData
     myAppData = new AppData;
+
+  // store original application's style, palette, etc
+  if ( !Style_Salome::isActive() ) {
     myAppData->myStyle   = QApplication::style();
     myAppData->myPalette = QApplication::palette();
     myAppData->myFont    = QApplication::font();
@@ -125,7 +125,7 @@ void Style_Model::fromApplication( bool reset )
   for ( int i = (int)QPalette::Active; i <= (int)QPalette::Inactive; i++ ) {
     for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
       myColors[ (QPalette::ColorGroup)i ][ (Style_Model::ColorRole)j ] =
-       myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j );
+        myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j );
     }
   }
 
@@ -281,7 +281,7 @@ void Style_Model::fromResources( QtxResourceMgr* resMgr, const QString& resSecti
       setWidgetEffect( (WidgetEffect)effect );
   }
   else if ( resourceMgr()->hasValue( section, "is-highlight-widget" ) ||
-           resourceMgr()->hasValue( section, "is-raising-widget" ) ) {
+            resourceMgr()->hasValue( section, "is-raising-widget" ) ) {
     bool highlight = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
     bool autoraise = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
     if ( highlight )
@@ -504,7 +504,7 @@ QColor Style_Model::color( ColorRole role, QPalette::ColorGroup cg ) const
   \sa color()
 */
 void Style_Model::setColor( Style_Model::ColorRole role, const QColor& active,
-                           const QColor& inactive, const QColor& disabled )
+                            const QColor& inactive, const QColor& disabled )
 {
   QColor ac = active, ic = inactive, dc = disabled;
 
@@ -515,6 +515,7 @@ void Style_Model::setColor( Style_Model::ColorRole role, const QColor& active,
     switch ( role ) {
     case WindowText:
     case Text:
+    case ButtonText:
       dc = color( Button ).darker();
       break;
     case Base:
@@ -854,7 +855,7 @@ void Style_Model::readColorValue( ColorRole role, const QString& prefix )
   \sa readColorValue()
 */
 void Style_Model::writeColorValue( ColorRole role, const QString& prefix,
-                                  QtxResourceMgr* resMgr, const QString& resSection ) const
+                                   QtxResourceMgr* resMgr, const QString& resSection ) const
 {
   QString active   = QString( "%1-color" ).arg( prefix );
   QString inactive = QString( "%1-color-inactive" ).arg( prefix );
index 7d94ba7c16762c0e0248f2bc7a6fca936392d8f2..793892d30aab7c86d249c20da46e7672180953e2 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Model.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
index 10d1e397bc4cf8b2890e4ab54893f365ccc276e6..8d96aadfdc386447ec39e8eb7c2dcbb323e39319 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_PrefDlg.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
@@ -129,7 +127,7 @@ void Style_PrefDlg::PaletteEditor::addColumn( const QString& title )
 
   l->addWidget( myActiveLab   = new QLabel( tr( "Active" ),   myContainer ), myCurrentRow, myCurrentColumn*4+1 );
   l->addWidget( myInactiveLab = new QLabel( tr( "Inactive" ), myContainer ), myCurrentRow, myCurrentColumn*4+2 );
-  l->addWidget( myDisabledLab = new QLabel( tr( "Disable" ),  myContainer ), myCurrentRow, myCurrentColumn*4+3 );
+  l->addWidget( myDisabledLab = new QLabel( tr( "Disabled" ), myContainer ), myCurrentRow, myCurrentColumn*4+3 );
   int w = 0;
   w = qMax( w, myActiveLab->sizeHint().width() );
   w = qMax( w, myInactiveLab->sizeHint().width() );
@@ -211,7 +209,7 @@ void Style_PrefDlg::PaletteEditor::setColor( int id, QPalette::ColorGroup cg, co
   \internal
 */
 void Style_PrefDlg::PaletteEditor::setColor( int id, const QColor& active,
-                                            const QColor& inactive, const QColor& disabled )
+                                             const QColor& inactive, const QColor& disabled )
 {
   setColor( id, QPalette::Active,   active );
   setColor( id, QPalette::Inactive, inactive.isValid() ? inactive : active );
@@ -267,61 +265,61 @@ void Style_PrefDlg::PaletteEditor::fromColor( const QColor& c )
   const QPalette pal = QPalette( c );
   for ( int i = 0; i < (int)Style_Model::NColorRoles; i++ ) {
     setColor( i,
-             pal.color( QPalette::Active,   (QPalette::ColorRole)i ), 
-             pal.color( QPalette::Inactive, (QPalette::ColorRole)i ),
-             pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) );
+              pal.color( QPalette::Active,   (QPalette::ColorRole)i ), 
+              pal.color( QPalette::Inactive, (QPalette::ColorRole)i ),
+              pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) );
   }
 
   // Header
   setColor( Style_Model::Header,
-           pal.color( QPalette::Active,   QPalette::Button ), 
-           pal.color( QPalette::Inactive, QPalette::Button ),
-           pal.color( QPalette::Disabled, QPalette::Button ) );
+            pal.color( QPalette::Active,   QPalette::Button ), 
+            pal.color( QPalette::Inactive, QPalette::Button ),
+            pal.color( QPalette::Disabled, QPalette::Button ) );
   // Checked
   setColor( Style_Model::Checked,
-           pal.color( QPalette::Active,   QPalette::Base ),
-           pal.color( QPalette::Inactive, QPalette::Base ),
-           pal.color( QPalette::Disabled, QPalette::Base ) );
+            pal.color( QPalette::Active,   QPalette::Base ),
+            pal.color( QPalette::Inactive, QPalette::Base ),
+            pal.color( QPalette::Disabled, QPalette::Base ) );
   // Lines
   setColor( Style_Model::Lines,
-           pal.color( QPalette::Active,   QPalette::Mid ),
-           pal.color( QPalette::Inactive, QPalette::Mid ),
-           pal.color( QPalette::Disabled, QPalette::Mid ) );
+            pal.color( QPalette::Active,   QPalette::Mid ),
+            pal.color( QPalette::Inactive, QPalette::Mid ),
+            pal.color( QPalette::Disabled, QPalette::Mid ) );
   // Slider
   setColor( Style_Model::Slider,
-           pal.color( QPalette::Active,   QPalette::Button ),
-           pal.color( QPalette::Inactive, QPalette::Button ),
-           pal.color( QPalette::Disabled, QPalette::Button ) );
+            pal.color( QPalette::Active,   QPalette::Button ),
+            pal.color( QPalette::Inactive, QPalette::Button ),
+            pal.color( QPalette::Disabled, QPalette::Button ) );
   // ProgressBar
   setColor( Style_Model::ProgressBar,
-           pal.color( QPalette::Active,   QPalette::Highlight ),
-           pal.color( QPalette::Inactive, QPalette::Highlight ),
-           pal.color( QPalette::Disabled, QPalette::Highlight ) );
+            pal.color( QPalette::Active,   QPalette::Highlight ),
+            pal.color( QPalette::Inactive, QPalette::Highlight ),
+            pal.color( QPalette::Disabled, QPalette::Highlight ) );
   // FieldLight
   setColor( Style_Model::FieldLight,
-           pal.color( QPalette::Active,   QPalette::Light ),
-           pal.color( QPalette::Inactive, QPalette::Light ),
-           pal.color( QPalette::Disabled, QPalette::Light ) );
+            pal.color( QPalette::Active,   QPalette::Light ),
+            pal.color( QPalette::Inactive, QPalette::Light ),
+            pal.color( QPalette::Disabled, QPalette::Light ) );
   // FieldDark
   setColor( Style_Model::FieldDark,
-           pal.color( QPalette::Active,   QPalette::Mid ).light( 125 ),
-           pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ),
-           pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) );
+            pal.color( QPalette::Active,   QPalette::Mid ).light( 125 ),
+            pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ),
+            pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) );
   // GridLine
   setColor( Style_Model::GridLine,
-           pal.color( QPalette::Active,   QPalette::Mid ),
-           pal.color( QPalette::Inactive, QPalette::Mid ),
-           pal.color( QPalette::Disabled, QPalette::Mid ) );
+            pal.color( QPalette::Active,   QPalette::Mid ),
+            pal.color( QPalette::Inactive, QPalette::Mid ),
+            pal.color( QPalette::Disabled, QPalette::Mid ) );
   // HighlightWidget
   setColor( Style_Model::HighlightWidget,
-           pal.color( QPalette::Active,   QPalette::Button ),
-           pal.color( QPalette::Inactive, QPalette::Button ),
-           pal.color( QPalette::Disabled, QPalette::Button ) );
+            pal.color( QPalette::Active,   QPalette::Button ),
+            pal.color( QPalette::Inactive, QPalette::Button ),
+            pal.color( QPalette::Disabled, QPalette::Button ) );
   // HighlightWidget
   setColor( Style_Model::HighlightBorder,
-           pal.color( QPalette::Active,   QPalette::Button ).dark( 100 ),
-           pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ),
-           pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) );
+            pal.color( QPalette::Active,   QPalette::Button ).dark( 100 ),
+            pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ),
+            pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) );
   // Pointer
   setColor( Style_Model::Pointer, Qt::black, Qt::black, Qt::black );
 
@@ -331,24 +329,24 @@ void Style_PrefDlg::PaletteEditor::fromColor( const QColor& c )
 
   // BorderTop
   setColor( Style_Model::BorderTop,
-           aDarkActive.lighter(),
-           aDarkInactive.lighter(),
-           aDarkDisabled.lighter() );
+            aDarkActive.lighter(),
+            aDarkInactive.lighter(),
+            aDarkDisabled.lighter() );
   // BorderBottom
   setColor( Style_Model::BorderBottom,
-           aDarkActive.darker(),
-           aDarkInactive.darker(),
-           aDarkDisabled.darker() );
+            aDarkActive.darker(),
+            aDarkInactive.darker(),
+            aDarkDisabled.darker() );
   // TabBorderTop
   setColor( Style_Model::TabBorderTop,
-           aDarkActive.light().light().light(),
-           aDarkInactive.light().light().light(), 
-           aDarkDisabled.light().light().light() );
+            aDarkActive.light().light().light(),
+            aDarkInactive.light().light().light(), 
+            aDarkDisabled.light().light().light() );
   // TabBorderBottom
   setColor( Style_Model::TabBorderBottom,
-           aDarkActive.dark().dark().dark(),
-           aDarkInactive.dark().dark().dark(),
-           aDarkDisabled.dark().dark().dark() );
+            aDarkActive.dark().dark().dark(),
+            aDarkInactive.dark().dark().dark(),
+            aDarkDisabled.dark().dark().dark() );
 }
 
 /*!
@@ -378,7 +376,7 @@ QString Style_PrefDlg::PaletteEditor::idToName( int id )
   case Style_Model::BrightText:        //  7
     name = tr( "Bright text" );      break;
   case Style_Model::ButtonText:        //  8
-    name = tr( "Buttont text" );      break;
+    name = tr( "Button text" );      break;
   case Style_Model::Base:              //  9
     name = tr( "Base" );             break;
   case Style_Model::Window:            // 10
@@ -498,7 +496,7 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent )
   main->setMargin( 0 ); main->setSpacing( SPACING );
 
   // create main widgets
-  myStyleCheck = new QCheckBox( tr( "Use SALOME Style" ), this );
+  myStyleCheck = new QCheckBox( tr( "Enable SALOME Style" ), this );
   QFrame* fr = new QFrame( this );
   fr->setFrameStyle( QFrame::Box | QFrame::Sunken );
 
@@ -634,6 +632,7 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent )
   setButtonPosition( Right, Close );
   setDialogFlags( AlignOnce );
   myStylesList->setEditTriggers( QAbstractItemView::EditKeyPressed );
+  myStylesList->installEventFilter( this );
 
   QStringList globalStyles = resourceMgr()->styles( Style_ResourceMgr::Global );
   QStringList userStyles   = resourceMgr()->styles( Style_ResourceMgr::User );
@@ -671,9 +670,9 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent )
   connect( myStyleCheck,        SIGNAL( toggled( bool ) ),        fr,   SLOT( setEnabled( bool ) ) );
   connect( myStylesList,        SIGNAL( itemSelectionChanged() ), this, SLOT( onStyleChanged() ) );
   connect( myStylesList,        SIGNAL( itemChanged( QListWidgetItem* ) ),       
-          this, SLOT( onItemChanged( QListWidgetItem* ) ) );
+           this, SLOT( onItemChanged( QListWidgetItem* ) ) );
   connect( myStylesList,        SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), 
-          this, SLOT( onApply() ) );
+           this, SLOT( onApply() ) );
   connect( myLinesCombo,        SIGNAL( activated( int ) ),       this, SLOT( onLinesType() ) );
   connect( myPaletteEditor,     SIGNAL( changed() ),              this, SIGNAL( styleChanged() ) );
   connect( myFontEdit,          SIGNAL( changed( QFont ) ),       this, SIGNAL( styleChanged() ) );
@@ -688,7 +687,7 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent )
   connect( mySplitterLength,    SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
   connect( mySliderSize,        SIGNAL( valueChanged( int ) ),    this, SIGNAL( styleChanged() ) );
   connect( aGroup,              SIGNAL( buttonClicked( QAbstractButton* ) ),
-          this, SLOT( onEffectChanged( QAbstractButton* ) ) );
+           this, SLOT( onEffectChanged( QAbstractButton* ) ) );
   connect( this,                SIGNAL( styleChanged() ),         this, SLOT( onChanged() ) );
   
   connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
@@ -720,23 +719,30 @@ void Style_PrefDlg::accept()
   \brief Process key press event
   \param e key event
 */
-void Style_PrefDlg::keyPressEvent( QKeyEvent* e )
+bool Style_PrefDlg::eventFilter( QObject* o, QEvent* e )
 {
-  if ( e->key() == Qt::Key_Delete ) {
-    QListWidgetItem* item = myStylesList->currentItem();
-    if ( item && item->data( TypeRole ).toInt() == User ) {
-      if ( QMessageBox::question( this,
-                                 tr( "Delete user theme" ),
-                                 tr( "Remove theme %1?" ).arg( item->text() ),
-                                 QMessageBox::Yes | QMessageBox::No,
-                                 QMessageBox::Yes ) == QMessageBox::Yes ) {
-       resourceMgr()->remove( item->data( NameRole ).toString() );
-       resourceMgr()->save();
-       delete item;
+  if ( o == myStylesList && e->type() == QEvent::KeyPress ) {
+    QKeyEvent* ke = (QKeyEvent*)e;
+    if ( ke->key() == Qt::Key_Delete ) {
+      QListWidgetItem* item = myStylesList->currentItem();
+      if ( item && item->data( TypeRole ).toInt() == User ) {
+       if ( QMessageBox::question( this,
+                                   tr( "Delete user theme" ),
+                                   tr( "Remove theme %1?" ).arg( item->text() ),
+                                   QMessageBox::Yes | QMessageBox::No,
+                                   QMessageBox::Yes ) == QMessageBox::Yes ) {
+         resourceMgr()->remove( item->data( NameRole ).toString() );
+         resourceMgr()->save();
+         delete item;
+       }
       }
     }
+    if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
+//       onApply();
+//       return true;
+    }
   }
-  QtxDialog::keyPressEvent( e );
+  return QtxDialog::eventFilter( o, e );
 }
 
 /*!
@@ -806,24 +812,24 @@ void Style_PrefDlg::toModel( Style_Model* model ) const
   // ... first set Button color 'cause it is used to calculate other ones
   if ( myPaletteEditor->isAuto() )
     model->setColor( Style_Model::Button,
-                    myPaletteEditor->color( Style_Model::Button, QPalette::Active ) );
+                     myPaletteEditor->color( Style_Model::Button, QPalette::Active ) );
   else 
     model->setColor( Style_Model::Button,
-                    myPaletteEditor->color( Style_Model::Button, QPalette::Active ),
-                    myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ),
-                    myPaletteEditor->color( Style_Model::Button, QPalette::Disabled ));
+                     myPaletteEditor->color( Style_Model::Button, QPalette::Active ),
+                     myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ),
+                     myPaletteEditor->color( Style_Model::Button, QPalette::Disabled ));
   // ... then set all other colors
   for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::LastColor; i++ ) {
     if ( i == Style_Model::NoRole ) continue; // not supported
     if ( i == Style_Model::Button ) continue; // already set
     if ( myPaletteEditor->isAuto() )
       model->setColor( (Style_Model::ColorRole)i,
-                      myPaletteEditor->color( i, QPalette::Active ) );
+                       myPaletteEditor->color( i, QPalette::Active ) );
     else 
       model->setColor( (Style_Model::ColorRole)i,
-                      myPaletteEditor->color( i, QPalette::Active ),
-                      myPaletteEditor->color( i, QPalette::Inactive ),
-                      myPaletteEditor->color( i, QPalette::Disabled ));
+                       myPaletteEditor->color( i, QPalette::Active ),
+                       myPaletteEditor->color( i, QPalette::Inactive ),
+                       myPaletteEditor->color( i, QPalette::Disabled ));
   }
   model->setAutoPalette( myPaletteEditor->isAuto() ); // internal
   // font
@@ -1019,7 +1025,7 @@ void Style_PrefDlg::onItemChanged( QListWidgetItem* item )
     myStylesList->blockSignals( false );
   }
   onChanged();
-}                              
+}                               
 
 /*!
   \brief Called when widget effect is changed
index d96a4f0838c0ca74a783c19f98b947fce4d12190..9429577786f631bd742bc37708bc758ad42a12a0 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_PrefDlg.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
@@ -60,9 +58,7 @@ public:
   ~Style_PrefDlg();
 
   void               accept();
-
-protected:
-  void               keyPressEvent( QKeyEvent* );
+  bool               eventFilter( QObject*, QEvent* );
 
 private:
   Style_ResourceMgr* resourceMgr();
index 597e99d21907f5918a4775e88c8bf50de8e8462d..b62ad477b0d2fccef03ba414519bc8f49919f719 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_ResourceMgr.cxx
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
@@ -81,8 +79,8 @@ QStringList Style_ResourceMgr::styles( StyleType type, bool sort )
       setWorkingMode( IgnoreUserValues );
       QMutableListIterator<QString> it( sl );
       while ( it.hasNext() ) {
-       QString s = it.next();
-       if ( hasSection( s ) ) it.remove();
+        QString s = it.next();
+        if ( hasSection( s ) ) it.remove();
       }
     }
     break;
index ab2aaa2fb24879487210503f7b7ec9c798665c91..8c92eeb065f674af03308b58531993b268b8a3c0 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_ResourceMgr.h
 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 //
index eeb12969f2336fcc726ffe799dbec166a6beace3..f48a5505f22b9aeae55839bb280e18554b5362b4 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Salome.cxx
 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
 //
@@ -259,6 +257,7 @@ void Style_Salome::apply()
     // set SALOME style
     QApplication::style()->setParent( 0 );           // avoid deleting original application style
     QApplication::setStyle( new Style_Salome() );    // set style
+    QApplication::setDesktopSettingsAware(false);    // prevent the style changing from another tools
   }
   update();                                          // update style
 }
@@ -275,6 +274,9 @@ void Style_Salome::restore()
   // check if SALOME style is set to the application
   if ( !isActive() )
     return;
+
+  QApplication::setDesktopSettingsAware(true);
+
   // restore previous style
   model()->restore();
 }
@@ -398,7 +400,7 @@ void Style_Salome::unpolish( QWidget* w )
   \param w widget
 */
 void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComplex* opt,
-                                      QPainter* p, const QWidget* w ) const
+                                       QPainter* p, const QWidget* w ) const
 {
   if ( checkDebugLevel(4) ) {
     QWindowsStyle::drawComplexControl( cc, opt, p, w );
@@ -411,18 +413,19 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
       if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
         bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
         QRect optr = opt->rect, arUp =   subControlRect( cc, spin, SC_SpinBoxUp, w );
-        optr.setWidth( arUp.x()-optr.x()+1 );
+        if (spin->buttonSymbols != QAbstractSpinBox::NoButtons)
+          optr.setWidth( arUp.x()-optr.x()+1 );
         double aRad = model()->widgetRounding( Style_Model::EditRadius );
         bool antialized = model()->antialiasing();
         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         if ( hover )
           drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
         else
           Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
                                    model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
                                    model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr,
-                                  aBrdTopCol, aBrdBotCol, antialized, false );
+                                   aBrdTopCol, aBrdBotCol, antialized, false );
         QRect aBtnRect = QRect( QPoint( arUp.x(), optr.y() ), QPoint( arUp.right(), optr.bottom() ) );
         QColor aBtnCol = opt->palette.color( QPalette::Button );
         bool aStateOn = opt->state & ( State_Sunken | State_On );
@@ -432,7 +435,6 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
           Style_Tools::shadowRect( p, aBtnRect, aRad, 0.0, SHADOW, Style_Tools::Right,
                                   aBtnCol.light( BUT_PERCENT_COL ), aBtnCol.dark( BUT_PERCENT_COL ),
                                   aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
-        State flags = State_None;
         QStyleOptionSpinBox copy;
         PrimitiveElement pe;
         if (spin->subControls & SC_SpinBoxUp) {
@@ -482,7 +484,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
           copy.rect = aBtnRect;
           drawPrimitive(pe, &copy, p, w);
         }
-       break;
+        break;
      }
      case CC_ComboBox: {
       if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
@@ -495,14 +497,14 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
         bool antialized = model()->antialiasing();
         double aRad = model()->widgetRounding( Style_Model::EditRadius );
         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         if ( hover )
           drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
         else
           Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
                                    model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
                                    model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr,
-                                  aBrdTopCol, aBrdBotCol, antialized, false );
+                                   aBrdTopCol, aBrdBotCol, antialized, false );
         if (cmb->subControls & SC_ComboBoxArrow) {
           State flags = State_None;
           QColor aBtnCol = opt->palette.color( QPalette::Button );
@@ -533,7 +535,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
             p->setPen(cmb->palette.highlightedText().color());
           }
           else
-           p->setPen(cmb->palette.text().color());
+            p->setPen(cmb->palette.text().color());
         }
         break;
       }
@@ -545,7 +547,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
 
             if( hasHover() && (slider->state & State_Enabled) &&
                          (slider->state & State_MouseOver) ) {
-             QRect moderated = w->rect();
+              QRect moderated = w->rect();
                 drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ),
                               model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false);
             }
@@ -572,8 +574,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
               bool tickAbove = slider->tickPosition == QSlider::TicksAbove;
               bool tickBelow = slider->tickPosition == QSlider::TicksBelow;
               QColor aBtnCol = model()->color( Style_Model::Slider );          // Style_Model::slider_clr
-             QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-             QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+              QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+              QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
               // rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider
               int aDelta = DELTA_SLIDER-1;
               QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta);
@@ -622,8 +624,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
         menuArea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, w);
 
         if (w && ( qobject_cast<QToolBar *>(w->parentWidget() ) || 
-                  toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) )
-           ) {
+                   ( toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) )
+            ) {
           QWindowsStyle::drawComplexControl( cc, opt, p, w );
           return;
         }
@@ -639,8 +641,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
         bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
         bool isHighWdg     = model()->widgetEffect() == Style_Model::HighlightEffect;
         bool hover = hasHover() && (opt->state & State_Enabled) && ( opt->state & State_MouseOver );
-       QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         QRect aRect = button;
         int aType = isMenuBtn ? Style_Tools::Left : Style_Tools::All;
         if ( toolbutton->subControls & SC_ToolButton ) {
@@ -652,7 +654,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
           else
             Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, top, bottom,
                                      aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
-       }
+        }
         if (toolbutton->subControls & SC_ToolButtonMenu) {
           p->save();
           if ( aMinDelta > menuArea.height()/2 )
@@ -694,7 +696,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
           fr.rect.adjust(3, 3, -3, -3);
           if (toolbutton->features & QStyleOptionToolButton::Menu)
             fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, w), 0);
-         Style_Tools::drawFocus( p, fr.rect, aMinDelta-1,  isMenuBtn ? Style_Tools::Left :
+          Style_Tools::drawFocus( p, fr.rect, aMinDelta-1,  isMenuBtn ? Style_Tools::Left :
                                   Style_Tools::All, aBrdBotCol );
         }
         QStyleOptionToolButton label = *toolbutton;
@@ -717,13 +719,13 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp
         QRect checkBoxRect = subControlRect( cc, opt, SC_GroupBoxCheckBox, w);
         if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
           QRect aRect = subControlRect( cc, opt, SC_GroupBoxFrame, w);
-         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+          QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
           Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::FrameRadius ), 0.,
                                    SHADOW, Style_Tools::All,
                                    model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr
                                    model()->color( Style_Model::FieldDark ),  // Style_Model::fld_dark_clr
-                                  aBrdTopCol, aBrdBotCol, false, false, false, false);
+                                   aBrdTopCol, aBrdBotCol, false, false, false, false);
         }
         // Draw title
         if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
@@ -788,13 +790,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
         drawControl(CE_PushButtonLabel, &subopt, p, w);
         if (btn->state & State_HasFocus) {
           QRect aRect = subElementRect( SE_PushButtonFocusRect, btn, w );
-         Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
+          Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
                                   Style_Tools::All, model()->color( Style_Model::BorderBottom ) );
         }
-       break;
+        break;
       }
     case CE_PushButtonBevel:
-      if ( qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
+      if ( const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
         double aRad = model()->widgetRounding( Style_Model::ButtonRadius );
         bool aStateOn = opt->state & ( State_Sunken | State_On );
         bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
@@ -804,9 +806,9 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
 
         QColor aBtnCol = opt->palette.color( QPalette::Button );
         QColor top = aBtnCol.light( BUT_PERCENT_COL ),
-              bottom = aBtnCol.dark( BUT_PERCENT_COL );
+               bottom = aBtnCol.dark( BUT_PERCENT_COL );
         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         QRect r = opt->rect;
         bool antialized = model()->antialiasing();
         if ( isAutoRaising && hover && !aStateOn )
@@ -814,10 +816,16 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
                                    aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
         else if ( isHighWdg && hover && !aStateOn )
           drawHoverRect( p, r, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true );
-       else
+        else
           Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom,
                                    aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
-       break;
+       if (btn->features & QStyleOptionButton::HasMenu) {
+         int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w);
+         QStyleOptionButton newBtn = *btn;
+         newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi);
+         drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w);
+       }
+        break;
       }
       case CE_DockWidgetTitle:
         if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
@@ -894,8 +902,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
                          dwOpt->state & State_Enabled, aTitle,
                          floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
             p->setFont(oldFont);
-         }
-         break;
+          }
+          break;
         }
     case CE_Splitter: {
       QWindowsStyle::drawControl( ce, opt, p, w );
@@ -919,10 +927,10 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
           bool isSelected = opt->state & State_Selected;
           bool isLast = tab->position == QStyleOptionTab::End ||
                         tab->position == QStyleOptionTab::OnlyOneTab;
-         QColor aColor = opt->palette.color( QPalette::Window ),
+          QColor aColor = opt->palette.color( QPalette::Window ),
                  aDarkColor = aColor.dark( BUT_PERCENT_ON );
-         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );     // Style_Model::border_tab_top_clr
-         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom );  // Style_Model::border_tab_bot_clr
+          QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );     // Style_Model::border_tab_top_clr
+          QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom );  // Style_Model::border_tab_bot_clr
 
           bool isHover = hasHover() && (opt->state & State_Enabled) &&
                                        (opt->state & State_MouseOver);
@@ -935,13 +943,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
                                 DELTA_H_TAB, aColor, aDarkColor,
                                 aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover );
           p->restore();
-       } else
+        } else
            QCommonStyle::drawControl(ce, opt, p, w);
         break;
       }
     case CE_TabBarTabLabel:
       if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
-       if ( tab->position == QStyleOptionTab::End ||
+        if ( tab->position == QStyleOptionTab::End ||
              tab->position == QStyleOptionTab::OnlyOneTab ) {
           QRect oldRect = opt->rect;
           int aDelta = 0;
@@ -949,14 +957,14 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
             aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
             oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right()-aDelta, oldRect.bottom() ) );
           }
-         else {
+          else {
             aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
             oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right(), oldRect.bottom()-aDelta ) );
-         }
+          }
           QStyleOptionTab* copyTab = (QStyleOptionTab*)tab;
           copyTab->rect = oldRect;
           QWindowsStyle::drawControl( ce, copyTab, p, w );
-       }
+        }
         else
           QWindowsStyle::drawControl( ce, opt, p, w );
         break;
@@ -978,8 +986,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
             QColor aBtnCol = opt->palette.color( QPalette::Window ),
                    top =    aBtnCol.light( BUT_PERCENT_ON ),
                    bottom = aBtnCol.dark( BUT_PERCENT_ON );
-           QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-           QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+            QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+            QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
             bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
             if ( !aStateOn && aHighWdg && (opt->state & State_Enabled) &&
                  (opt->state & State_Selected) )
@@ -1004,7 +1012,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
       break;
     case CE_ProgressBarGroove: {
       QColor aBgColor = opt->palette.color( QPalette::Window ),
-       top =    aBgColor.light( BUT_PERCENT_ON ),
+        top =    aBgColor.light( BUT_PERCENT_ON ),
         bottom = aBgColor.dark( BUT_PERCENT_ON );
       QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
@@ -1150,9 +1158,9 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
           int myHeight = pbBits.rect.height();
           pbBits.state = State_None;
           QRect aRect;
-         QColor aColor = model()->color( Style_Model::ProgressBar );    // Style_Model::prbar_clr
-         QColor top    = aColor.light( BUT_PERCENT_COL );
-         QColor bottom = aColor.dark( BUT_PERCENT_COL );
+          QColor aColor = model()->color( Style_Model::ProgressBar );    // Style_Model::prbar_clr
+          QColor top    = aColor.light( BUT_PERCENT_COL );
+          QColor bottom = aColor.dark( BUT_PERCENT_COL );
           int aType;
           for (int i = 0; i <= nu; ++i) {
             aType = Style_Tools::None;
@@ -1194,7 +1202,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
             if ( unit_width > 1 ) {
               aTopClr = aColor.light();
               aBotClr = aColor.dark();
-           }
+            }
             Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::EditRadius ), -1, 0,
                                      aType, top, bottom, aTopClr, aBotClr, false, true );
             x += reverse ? -unit_width : unit_width;
@@ -1224,7 +1232,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
         double aMargin = LINE_GR_MARGIN;
         QLinearGradient gr(x,y,menuitem->rect.right(),y);
         gr.setColorAt( 0.0, aBgColor );
-       gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr
+        gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr
         gr.setColorAt( 1.0, model()->color( Style_Model::FieldLight ) );
         QBrush fill;
         if ( act )
@@ -1234,8 +1242,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
         p->fillRect(menuitem->rect, fill);
         if (menuitem->menuItemType == QStyleOptionMenuItem::Separator){
           int yoff = y-1 + h / 2;
-         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+          QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
           p->setPen( aBrdBotCol );
           p->drawLine(x + 2, yoff, x + width - 4, yoff);
           p->setPen( aBrdTopCol );
@@ -1388,7 +1396,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
                                  Qt::AlignLeft | Qt::AlignVCenter,
                                  iconRect.size(), alignRect);
  
-         // Here's absent filling of pixmap on basic color for editable comboBox
+          // Here's absent filling of pixmap on basic color for editable comboBox
           drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);
 
           if (cb->direction == Qt::RightToLeft)
@@ -1410,7 +1418,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
         QColor top =    aBtnCol.light( BUT_PERCENT_COL ),
                bottom = aBtnCol.dark( BUT_PERCENT_COL );
         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
                                  aBrdBotCol, false, true, aStateOn, true );
       PrimitiveElement arrow;
@@ -1438,13 +1446,12 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
         if ( hasHover() && enabled && (opt->state & State_MouseOver) )
          drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, false);
         else {
-       QColor aColor = model()->color( Style_Model::Slider );      // Style_Model::slider_clr
+        QColor aColor = model()->color( Style_Model::Slider );      // Style_Model::slider_clr
           if ( !enabled )
             aColor = opt->palette.button().color();
-         QColor top =    aColor.light( BUT_PERCENT_ON ),
+          QColor top =    aColor.light( BUT_PERCENT_ON ),
                  bottom = aColor.dark( BUT_PERCENT_ON );
-         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-         QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+          QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
           QRect r = opt->rect;
           QPainterPath path = Style_Tools::roundRect( r, aRad,
                                                       Style_Tools::All );
@@ -1501,7 +1508,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt,
   \param w widget (optional)
 */
 void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
-                                 QPainter* p, const QWidget* w ) const
+                                  QPainter* p, const QWidget* w ) const
 {
   if ( checkDebugLevel(6) ) {
     QWindowsStyle::drawPrimitive( pe, opt, p, w );
@@ -1516,8 +1523,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         QColor aBtnCol = opt->palette.color( QPalette::Window ),
                top =    aBtnCol.light( BUT_PERCENT_ON ),
                bottom = aBtnCol.dark( BUT_PERCENT_ON );
-       QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top,
                                  bottom, aBrdTopCol, aBrdBotCol, false, false, false, false );
         break;
@@ -1525,7 +1532,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
     case PE_PanelButtonTool : {
       if ( w && ( opt->state & State_Enabled ) && 
            ( ( qobject_cast<QToolBar*>( w->parentWidget() ) ) ||
-            ( w->inherits("QDockWidgetTitleButton") ) ||
+             ( w->inherits("QDockWidgetTitleButton") ) ||
              ( w->inherits("QtxWorkstackAreaTitleButton") ) ) ) {
         bool aStateOn = opt->state & (State_Sunken | State_On);
         bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
@@ -1534,14 +1541,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
           drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, true);
         else {
           QColor aBtnCol = opt->palette.color( QPalette::Window );
-         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-         QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+          QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+          QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
           QColor top =    aBtnCol.light( BUT_PERCENT_COL ),
                  bottom = aBtnCol.dark( BUT_PERCENT_COL );
           Style_Tools::shadowRect( p, opt->rect, 0.0, 0, SHADOW, Style_Tools::All, top, bottom,
            aBrdTopCol, aBrdBotCol, model()->antialiasing(), true, aStateOn );
-       }
-       break;
+        }
+        break;
       }
       else
         QWindowsStyle::drawPrimitive( pe, opt, p, w );
@@ -1550,8 +1557,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
     case PE_FrameFocusRect: {
       if (w && qobject_cast<QTabBar*>((QWidget*)w)) {
         QTabBar* tabBar = qobject_cast<QTabBar*>((QWidget*)w);
-       QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+        QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
+        QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
         bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
         Style_Tools::tabRect( p, opt->rect, (int)tabBar->shape(),
                               model()->widgetRounding( Style_Model::FrameRadius ), DELTA_H_TAB,
@@ -1560,7 +1567,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
                               aBrdTopCol, aBrdBotCol, false, false, isHover, true );
       }
       else {
-       QWindowsStyle::drawPrimitive( pe, opt, p, w );
+        QWindowsStyle::drawPrimitive( pe, opt, p, w );
       }
       break;
     }
@@ -1575,24 +1582,24 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       QRect rect = opt->rect;
       QColor pen, brush;
       if ( opt->state & State_Enabled ) {
-       pen = model()->color( Style_Model::Pointer );    // Style_Model::pointer_clr
-       brush = opt->palette.color( QPalette::Button );
+        pen = model()->color( Style_Model::Pointer );    // Style_Model::pointer_clr
+        brush = opt->palette.color( QPalette::Button );
         if ( ( opt->state & State_Sunken ) && (opt->state & State_Enabled ) )
           rect.moveTo( rect.x()+1, rect.y()+1 );
       } else {
         pen = opt->palette.mid().color();
-       brush = pen;
+        brush = pen;
       }
       if ( pe == PE_IndicatorSpinPlus || pe == PE_IndicatorSpinMinus )
-       Style_Tools::drawSign( pe, p, rect, pen, brush );
+        Style_Tools::drawSign( pe, p, rect, pen, brush );
       else
-       Style_Tools::drawArrow( pe, p, rect, pen, brush );
+        Style_Tools::drawArrow( pe, p, rect, pen, brush );
       break;
     }
     case PE_IndicatorCheckBox: {
       if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
         drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),
-                     model()->widgetRounding( Style_Model::EditRadius ),
+                      model()->widgetRounding( Style_Model::EditRadius ),
                       Style_Tools::All, false);
       QBrush fill;
       if (opt->state & State_NoChange)
@@ -1642,10 +1649,10 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       }
       const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
       p->setPen(itemViewOpt && itemViewOpt->showDecorationSelected
-               && opt->state & State_Selected ? opt->palette.highlightedText().color()
-               : opt->palette.text().color());
+                && opt->state & State_Selected ? opt->palette.highlightedText().color()
+                : opt->palette.text().color());
       if (opt->state & State_NoChange)
-       p->setBrush( opt->palette.color( QPalette::Button ) );
+        p->setBrush( opt->palette.color( QPalette::Button ) );
       p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11);
       if (!(opt->state & State_Off)) {
         QLineF lines[11];
@@ -1666,7 +1673,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         QColor aColor = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
         if ( !(opt->state & State_Enabled ) )
           aColor = opt->palette.mid().color();
-       if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
+        if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
           aColor = opt->palette.highlightedText().color();
 
         p->setPen( QPen( aColor ) );
@@ -1680,7 +1687,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
     case PE_IndicatorRadioButton: {
       if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
         drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ), 
-                     model()->widgetRounding( Style_Model::ButtonRadius ),
+                      model()->widgetRounding( Style_Model::ButtonRadius ),
                       Style_Tools::All, false);
 #define PTSARRLEN(x) sizeof(x)/(sizeof(QPoint))
       static const QPoint pts_border[] = {              // border line
@@ -1713,7 +1720,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       else {
         QColor fillColor =  opt->palette.color( QPalette::Base );
         if ( enabled && on )
-         fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr
+          fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr
         QLinearGradient gr( 3, 3, 8, 8 );
         gr.setColorAt( 0.0, fillColor.dark( BUT_PERCENT_ON ) );
         gr.setColorAt( 1.0, fillColor );
@@ -1762,14 +1769,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       }
       if ( pe == PE_FrameLineEdit ) {
         QColor aBrdTopCol = model()->color( Style_Model::BorderTop );    // Style_Model::border_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
         bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
         double aRad = model()->widgetRounding( Style_Model::EditRadius );
         if ( hover )
           drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true);
         else {
           Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW,
-                                  Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
+                                   Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
                                    model()->color( Style_Model::FieldDark ), aBrdTopCol, aBrdBotCol,
                                    model()->antialiasing(), false );
         }
@@ -1778,14 +1785,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
           QRect rect = panel->rect.adjusted( panel->lineWidth,  panel->lineWidth,
                                              -panel->lineWidth, -panel->lineWidth);
-         if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
+          if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
             drawPrimitive( PE_FrameLineEdit, panel, p, w );
-         }
+          }
           else {
-           QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
+            QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
             p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base)
-         }
-       }
+          }
+        }
       }
       break;
     }
@@ -1801,7 +1808,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         if ( aTabPos != QTabWidget::East )
           aRoundType = aRoundType | Style_Tools::TopRight;
         QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+        QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
         Style_Tools::shadowRect( p, opt->rect, model()->widgetRounding( Style_Model::FrameRadius ),
                                  0., SHADOW, aRoundType,
                                  model()->color( Style_Model::FieldLight ),
@@ -1819,7 +1826,6 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       gr.setColorAt( 0.0, aBgCol.light( BUT_PERCENT_ON ) );
       gr.setColorAt( 1.0, aBgCol );
       p->fillRect( r, gr );
-      QRect aRect = QRect( r.x(), r.y(), r.width(), r.height() );
       drawHandle( p, r, horiz, false );
       p->restore();
       break;
@@ -1838,7 +1844,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
       if (const QStyleOptionTabBarBase *tbb
           = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
         if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast &&
-           tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
+            tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
           QWindowsStyle::drawPrimitive( pe, opt, p, w );
           break;
         }
@@ -1850,19 +1856,17 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         if ( tabBar )
           isLast = tabBar->currentIndex() == tabBar->count() -1;
         QColor aColor = opt->palette.color( QPalette::Window );
-        QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop );    // Style_Model::border_tab_top_clr
-       QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
         bool isHover = hasHover() && (opt->state & State_Enabled) &&
                                      (opt->state & State_MouseOver);
         QPainterPath aSelPath = Style_Tools::tabRect( p, aSelRect, (int)tbb->shape,
-                                                     model()->widgetRounding( Style_Model::FrameRadius ),
-                                                     DELTA_H_TAB, aColor, aColor,
+                                                      model()->widgetRounding( Style_Model::FrameRadius ),
+                                                      DELTA_H_TAB, aColor, aColor,
                             aColor, aColor, isSelected, isLast, isHover, false, false );
         if ( !aSelPath.isEmpty() )
           aSelRect = aSelPath.controlPointRect().toRect();
         QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb;
         copyOpt->selectedTabRect = aSelRect;
-       QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
+        QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
         break;
       }
     case PE_IndicatorBranch: {
@@ -1932,9 +1936,9 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         QPalette aPal = aWdg->palette();
         double aMarg = LINE_GR_MARGIN;
         QColor base = model()->color( Style_Model::Base ), // Style_Model::pal_base_clr
-         light = base,
-         light_alt = base.dark(110),//AlternateBase color
-         dark  = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr
+          light = base,
+          light_alt = base.dark(110),//AlternateBase color
+          dark  = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr
         //light.setAlpha( 0 ); // VSR commented: IPAL19262
         QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y());
         gr_h.setColorAt( 0.0, dark );
@@ -1947,7 +1951,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
         // draw frame
         p->fillRect( r, base );
         p->fillRect( r, gr_h );
-       p->fillRect( r, gr_v );
+        p->fillRect( r, gr_v );
         aPal.setBrush( QPalette::Base, QBrush( light ) );
 
         QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y());
@@ -1973,7 +1977,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
   \return metric value
 */
 int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt,
-                              const QWidget* w ) const
+                               const QWidget* w ) const
 {
   if ( checkDebugLevel(7) ) {
     return QWindowsStyle::pixelMetric( metric, opt, w );
@@ -2028,11 +2032,11 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt,
           if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) {
             int aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
             sz.setWidth( sz.width() + aDelta );
-         }
+          }
           if ( tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest ) {
             int aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
             sz.setHeight( sz.height() + aDelta );
-         }
+          }
         }
         break;
       }
@@ -2055,7 +2059,7 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt,
             aDelta += aHalfRect; // for right of line edit internal
           sz.setWidth( res.width() + aDelta + aHalfRect );
         }
-       break;
+        break;
       default:
       break;
   }
@@ -2100,8 +2104,8 @@ QPixmap Style_Salome::standardPixmap(StandardPixmap stPixmap, const QStyleOption
   \return standard icon
 */
 QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, 
-                                               const QStyleOption* opt,
-                                               const QWidget* w ) const
+                                                const QStyleOption* opt,
+                                                const QWidget* w ) const
 {
   if ( checkDebugLevel(10) ) {
     return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
@@ -2165,7 +2169,7 @@ int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWid
   \return subcontrol rectangle
 */
 QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex* opt,
-                                   SubControl sc, const QWidget* wid ) const
+                                    SubControl sc, const QWidget* wid ) const
 {
   if ( checkDebugLevel(12) ) {
     return QWindowsStyle::subControlRect( cc, opt, sc, wid );
@@ -2227,8 +2231,8 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex
             else
               res.setTop( res.top() - aRect - 1);
           break;
-         default:
-           break;
+          default:
+            break;
         }
         break;
       }
@@ -2310,7 +2314,7 @@ void Style_Salome::updatePaletteColors()
     for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
       if ( j == QPalette::NoRole ) continue;
       pal.setColor( (QPalette::ColorGroup)i, (QPalette::ColorRole)j,
-                   model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) );
+                    model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) );
     }
   }
   QPixmapCache::clear();
@@ -2331,7 +2335,7 @@ void Style_Salome::updateAllWidgets( QApplication* app )
   for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) {
     w = *it2;
     if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished)
-       && !w->testAttribute(Qt::WA_SetStyle)) {
+        && !w->testAttribute(Qt::WA_SetStyle)) {
       QEvent e(QEvent::StyleChange);
       QApplication::sendEvent(w, &e);
       polish( w );
@@ -2467,7 +2471,7 @@ void Style_Salome::drawBackground( QPainter* p, const QRect& r, const QColor& bg
     {
       const int d = 3;
       for ( int i = 0; i <= h; i += d )
-       lines.append( QLine( x, y+i, w, r.y()+i ) );
+        lines.append( QLine( x, y+i, w, r.y()+i ) );
     }
     break;
   case Style_Model::Inclined:
@@ -2476,9 +2480,9 @@ void Style_Salome::drawBackground( QPainter* p, const QRect& r, const QColor& bg
       w = w/d*d;
       h = h/d*d;
       for ( int i = 0; i <= w; i += d )
-       lines.append( QLine( x+i, y, x, y+i ) );
+        lines.append( QLine( x+i, y, x, y+i ) );
       for ( int i = 0; i < h; i += d )
-       lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) );
+        lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) );
     }
     break;
   default:
index 75659e9ac5901b90eae46a4320cf6fe2f9106cad..45ee1309c314e415675cd2b241bb777ba63e2460 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Salome.h
 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
 //
@@ -60,35 +58,35 @@ public:
   virtual void        polish( QWidget* );
   virtual void        unpolish( QWidget* );
   virtual void        drawComplexControl( ComplexControl, const QStyleOptionComplex*,
-                                         QPainter*, const QWidget* = 0 ) const;
+                                          QPainter*, const QWidget* = 0 ) const;
   
   virtual void        drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
   virtual void        drawPrimitive( PrimitiveElement, const QStyleOption*,
-                                    QPainter*, const QWidget* = 0 ) const;
+                                     QPainter*, const QWidget* = 0 ) const;
   virtual int         pixelMetric( PixelMetric, const QStyleOption* = 0,
-                                  const QWidget* = 0 ) const;
+                                   const QWidget* = 0 ) const;
   virtual QSize       sizeFromContents ( ContentsType, const QStyleOption*,
-                                        const QSize&, const QWidget* = 0 ) const;
+                                         const QSize&, const QWidget* = 0 ) const;
   virtual QPixmap     standardPixmap( StandardPixmap, const QStyleOption*,
-                                     const QWidget* = 0) const;
+                                      const QWidget* = 0) const;
   virtual int         styleHint( StyleHint, const QStyleOption* = 0,
-                                const QWidget* = 0, QStyleHintReturn* = 0 ) const;
+                                 const QWidget* = 0, QStyleHintReturn* = 0 ) const;
   virtual QRect       subControlRect( ComplexControl, const QStyleOptionComplex*,
-                                     SubControl, const QWidget* = 0 ) const;
+                                      SubControl, const QWidget* = 0 ) const;
   virtual QRect       subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
 
 protected slots:
   QIcon               standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
-                                                 const QWidget* = 0 ) const;
+                                                  const QWidget* = 0 ) const;
 private:
   void                updatePaletteColors();
   void                updateAllWidgets( QApplication* );
   bool                hasHover() const;
   void                drawHoverRect( QPainter*, const QRect&, const QColor&, const double,
-                                    const int, const bool ) const;
+                                     const int, const bool ) const;
   void                drawHandle( QPainter*, const QRect&, bool, bool = true ) const;
   void                drawBackground( QPainter*, const QRect&, const QColor&, const bool,
-                                     const bool = false, const bool = true ) const;
+                                      const bool = false, const bool = true ) const;
   void                drawBorder( QPainter*, const QRect&, bool ) const;
 
   QString             titleText( const QString&, const int, const int, QFont& ) const;
index 8ba7c60c687ffe0cff3b3e4c035ae41c3b2eb5a6..9977b3a6408dfea3221ff01ada6ac57a67c9e1ef 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Tools.cxx
 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
 //
@@ -436,7 +434,7 @@ void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const Q
   \param brush background painter brush
 */
 void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QRect& r,
-                           const QColor& pen, const QColor& brush )
+                            const QColor& pen, const QColor& brush )
 {
   p->save();
   QPainterPath sign;
@@ -458,31 +456,31 @@ void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QR
         deltaY = -deltaY;
       }
       if ( correct ) 
-       sign.moveTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+        sign.moveTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
       else {
-       sign.moveTo(  aDelta/3,   -aDelta/2 );
-       sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
-       sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+        sign.moveTo(  aDelta/3,   -aDelta/2 );
+        sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
+        sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
       }
       
       sign.lineTo(    deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
       
       if ( !correct ) {
-       sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
-       sign.lineTo(  aDelta/3,   -aDelta/2-deltaY );
-       sign.lineTo( -aDelta/3,   -aDelta/2-deltaY );
-       sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+        sign.lineTo(  aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+        sign.lineTo(  aDelta/3,   -aDelta/2-deltaY );
+        sign.lineTo( -aDelta/3,   -aDelta/2-deltaY );
+        sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
       }
       
       sign.lineTo(   -deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
       sign.lineTo(   -deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
 
       if ( correct ) 
-       sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
+        sign.lineTo(  deltaY/2,   -aDelta/2-(deltaY/2-aDelta/3) );
       else {
-       sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
-       sign.lineTo( -aDelta/3,   -aDelta/2 );
-       sign.lineTo(  aDelta/3,   -aDelta/2);
+        sign.lineTo( -aDelta/3,   -aDelta/2-(deltaY/2-aDelta/3) );
+        sign.lineTo( -aDelta/3,   -aDelta/2 );
+        sign.lineTo(  aDelta/3,   -aDelta/2);
       }
 
       if ( correct )
index a21893e2e6f736358b8da9d1c2c50f8d1bc1ccee..1a17f993a5049e8383489a0f8e7c1f5fe1965f9a 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  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 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.
 //
-//  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
 //
-//  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // File   : Style_Tools.h
 // Author : Natalia Ermolaeva, Open CASCADE S.A.S.
 //
@@ -90,7 +88,7 @@ public:
   static void         drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
                                  const QColor&, const QColor& );
   static void         drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
-                               const QColor&, const QColor& );
+                                const QColor&, const QColor& );
   static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
                                const double, const QColor&, const QColor&,
                                const QColor&, const QColor&,
index 3603c1de5296a43793ad746cff311a47f6f0727f..a6a61fff13a260d0317ca6bef6a4b2d32bde9f9b 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 
   Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
   CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index f82e8734da914587ee31f5425c7cd38b1530d322..690f731d385a1a94e8c2f940dcfa9bfd240e06fb 100755 (executable)
@@ -1,24 +1,25 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 #  File   : Makefile.in
 #  Author : Marc Tajchman (CEA)
@@ -47,11 +48,11 @@ nodist_libToolsGUI_la_SOURCES = $(MOC_FILES)
 
 # .po files to transform in .qm
 nodist_salomeres_DATA =                \
-       ToolsGUI_msg_en.qm
+       ToolsGUI_msg_en.qm      \
+       ToolsGUI_msg_fr.qm
 
 libToolsGUI_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS)     \
        @KERNEL_CXXFLAGS@ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@                     \
-       -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl                 \
-       -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+       -I$(top_builddir)/idl -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
 libToolsGUI_la_LDFLAGS  = $(QT_MT_LIBS) ../SUIT/libsuit.la $(CAS_KERNEL) $(KERNEL_LDFLAGS) \
        -lSalomeIDLKernel -lSALOMELocalTrace -lSalomeNS -lOpUtil $(top_builddir)/idl/libSalomeIDLGUI.la
diff --git a/src/TOOLSGUI/TOOLSGUI.pro b/src/TOOLSGUI/TOOLSGUI.pro
deleted file mode 100644 (file)
index a52f844..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = ToolsGUI
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-INCLUDEPATH += $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix ../../idl ../Qtx ../SUIT
-LIBS += -L../../lib -lsuit -lSalomeNS -lOpUtil $${CAS_KERNEL} $${KERNEL_LDFLAGS}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = ToolsGUI.h
-HEADERS += ToolsGUI_RegWidget.h
-HEADERS += ToolsGUI_CatalogGeneratorDlg.h
-
-SOURCES  = ToolsGUI_CatalogGeneratorDlg.cxx
-SOURCES += ToolsGUI_RegWidget.cxx
-SOURCES += ToolsGUI.cxx
-
-TRANSLATIONS = resources/ToolsGUI_icons.ts \
-               resources/ToolsGUI_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index 45190056fb73a7f069531bdbeb83bd5b722dca43..43dcc961ce62515440bbb1a5db4c61f9efae10c6 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI.cxx
 //  Author : Nicolas REJNERI
index 853fc4ab8cad9d030a083f0b55765fe30fe5d4ea..911b625780ca8675cf8718ce63903d50e0a86f80 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI.h
 //  Author : Nicolas REJNERI
@@ -27,7 +28,7 @@
 #define TOOLSGUI_H
 
 #ifdef WIN32
-#  ifdef TOOLSGUI_EXPORTS
+#  if defined TOOLSGUI_EXPORTS || defined ToolsGUI_EXPORTS
 #    define TOOLSGUI_EXPORT __declspec(dllexport)
 #  else
 #    define TOOLSGUI_EXPORT __declspec(dllimport)
index 0ae32da23deb3ec29cc79f748bcf6111957fab3f..c626bc0e72b05a1fbe0554fb01eb3ab224bf3529 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI_CatalogGeneratorDlg.cxx
 //  Author : Nicolas REJNERI
@@ -49,8 +50,6 @@
 
 #include "utilities.h"
 
-using namespace std;
-
 #define SPACING_SIZE             6
 #define MARGIN_SIZE             11
 #define MIN_EDIT_SIZE          250
@@ -324,8 +323,8 @@ QString ToolsGUI_CatalogGeneratorDlg::getIdlPath()
     QCString dir;
     if (dir = getenv( modulename + "_ROOT_DIR")) {
       IDLpath = IDLpath + "-I" + SUIT_Tools::addSlash( SUIT_Tools::addSlash(dir) + 
-                                                     SUIT_Tools::addSlash("idl") + 
-                                                     SUIT_Tools::addSlash("salome")) + " ";
+                                                      SUIT_Tools::addSlash("idl") + 
+                                                      SUIT_Tools::addSlash("salome")) + " ";
     }
   }
 
@@ -371,7 +370,7 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked()
 void ToolsGUI_CatalogGeneratorDlg::updateButtonState()
 {
   myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() && 
-                         !myXmlEdit->text().trimmed().isEmpty() );
+                          !myXmlEdit->text().trimmed().isEmpty() );
 }
 
 /*!
@@ -395,25 +394,25 @@ void ToolsGUI_CatalogGeneratorDlg::onApply()
   if ( !XmlFile.isEmpty() && !IdlFile.isEmpty() ) {
     if ( !QFile::exists( IdlFile ) ) {
       SUIT_MessageBox::critical( this, 
-                                tr("TOOLS_ERR_ERROR"), 
-                                tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) );
+                                 tr("TOOLS_ERR_ERROR"), 
+                                 tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) );
     }
     else {
       QString command = "";
       if ( getenv("KERNEL_ROOT_DIR")  )
-       command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile;
+        command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile;
       else {
-       SUIT_MessageBox::critical( this, 
-                                  tr("TOOLS_ERR_ERROR"), 
-                                  tr("KERNEL_ROOT_DIR variable is not defined") );
+        SUIT_MessageBox::critical( this, 
+                                   tr("TOOLS_ERR_ERROR"), 
+                                   tr("KERNEL_ROOT_DIR variable is not defined") );
       }
 
       if (!Author.isEmpty()) command += ",author=" + Author; 
       if (!Version.isEmpty()) command += ",version=" + Version;
       if (!PngFile.isEmpty()) {
-       OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData()); 
-       TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
-       command += QString(",icon=") + QString(aFile.ToCString());
+        OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData()); 
+        TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
+        command += QString(",icon=") + QString(aFile.ToCString());
       }
       if (!CompName.isEmpty()) command += ",name=" + CompName;
       if (!CompUserName.isEmpty()) command += ",username=" + CompUserName;
@@ -424,9 +423,9 @@ void ToolsGUI_CatalogGeneratorDlg::onApply()
       int res;
       res = system( ( char* )( command.toLatin1().constData() ) );
       if ( res == -1 ) {
-       MESSAGE( "work failed (system command result = " << res );
+        MESSAGE( "work failed (system command result = " << res );
       } else if (res == 217) {
-       MESSAGE( "shell exec failed (system command result = " << res );
+        MESSAGE( "shell exec failed (system command result = " << res );
       }
     }
   }
index 646b0c56b8bc82930c6671cf363e1cf571006061..db373f358c2ef815992fdf2502d01e7c37252fc1 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
 //  File   : ToolsGUI_CatalogGeneratorDlg.h
 //  Author : Nicolas REJNERI
index 8c7fca3547cb909a56ee550fcdda2a15978091ee..c1f5b3ea6ff466d4b455f316413f564cd7c96c51 100755 (executable)
@@ -1,66 +1,49 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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 RegistryDisplay : GUI for Registry server implementation
-//  File   : ToolsGUI_RegWidget.cxx
-//  Author : Pascale NOYRET, EDF
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 # include "ToolsGUI_RegWidget.h"
 
-# include <QAction>
-# include <QDialog>
-# include <QSpinBox>
-# include <QPushButton>
-# include <QTreeWidget>
-# include <QTabWidget> 
-# include <QStatusBar>
-# include <QTextEdit>
-# include <QTextStream>
-# include <QTimer>
-# include <QToolBar>
-# include <QEvent>
-# include <QKeyEvent>
-# include <QCloseEvent>
-# include <QFileInfo>
-# include <QGridLayout>
-# include <QLabel>
-# include <QGroupBox>
-
-# include <SALOME_NamingService.hxx>
-# include <ServiceUnreachable.hxx>
-# include <Utils_SINGLETON.hxx>
-# include <Utils_CommException.hxx>
-
-# include <utilities.h>
-# include <OpUtil.hxx>
-
-# include <Qtx.h>
-
-typedef int PIXELS;
+#include <QApplication>
+#include <QInputDialog>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QTabWidget>
+#include <QTextEdit>
+#include <QTimer>
+#include <QToolBar>
+#include <QTreeWidget>
+#include <QVBoxLayout>
+
+#include <Qtx.h>
+
+#include <SALOME_NamingService.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <Utils_CommException.hxx>
 
 #define MARGIN_SIZE      11
 #define SPACING_SIZE      6
 #define MIN_SPIN_WIDTH  100 
 
-#define BOLD( text ) ( QString( "<b>" ) + QString( text ) + QString( "</b>" ) )
+#define BOLD( text ) QString( "<b>%1</b>" ).arg( QString( text ) )
 
 static const char* const time_data[] = { 
 "16 16 6 1",
@@ -137,315 +120,32 @@ static const char* const refresh_data[] = {
 "......aaaaa....."};
 
 /*!
-  \brief Create components list.
+  \brief Get access to the Registry service
   \internal
   \param orb CORBA ORB reference
-  \return list of registered components
+  \return reference to the Registry service
 */
-static Registry::Components_var MakeRegistry( CORBA::ORB_var& orb )
+static Registry::Components_ptr GetRegistry( CORBA::ORB_ptr orb )
 {
-
-  const char *registryName="Registry" ;
+  static const char* registryName = "Registry";
+  Registry::Components_var aRegistry;
   
-  SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
-  naming.init_orb( orb ) ;
+  SALOME_NamingService& naming = *SINGLETON_<SALOME_NamingService>::Instance();
+  naming.init_orb( orb );
   
-  // Recuperation de la reference de l'objet
-  CORBA::Object_var object = 0 ;
+  CORBA::Object_var object = 0;
   try
   {
-    SCRUTE(registryName) ;
-    object = naming.Resolve( registryName ) ;
-    if(CORBA::is_nil(object)) throw CommException( "unable to find the RegistryService" ) ;
-  }
-  catch( const ServiceUnreachable& ex )
-  {
-    MESSAGE( ex.what() )
-    exit( EXIT_FAILURE ) ;
+    object = naming.Resolve( registryName );
+    if ( CORBA::is_nil( object ) ) throw CommException( "Unable to find the Registry service" );
+    aRegistry = Registry::Components::_narrow( object );
   }
-  catch( const CORBA::Exception& )
+  catch( const CORBA::Exception& ex )
   {
-    exit( EXIT_FAILURE ) ;
+    MESSAGE( "Error: can't access Registry server" );
   }
 
-  // Specialisation de l'objet generique
-
-  return Registry::Components::_narrow( object ) ;
-}
-
-/*!
-  \class ToolsGUI_RegWidget::InfoWindow
-  \brief Information window.
-  \internal
-*/
-
-class ToolsGUI_RegWidget::InfoWindow : public QMainWindow
-{
-public:
-  InfoWindow( QWidget* parent );
-
-  void setText( const QString& text );
-
-protected:
-  void keyPressEvent( QKeyEvent * e );
-
-private:
-  QTextEdit* myTextView;
-};
-
-/*!
-  \brief Constructor.
-  \internal
-  \param parent parent widget
-*/
-ToolsGUI_RegWidget::InfoWindow::InfoWindow( QWidget* parent )
-: QMainWindow( parent )
-{
-  setAttribute( Qt::WA_DeleteOnClose );
-
-  myTextView = new QTextEdit( this );
-  myTextView->setReadOnly( true );
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-}
-
-/*!
-  \brief Set text to the information window.
-  \internal
-  \param text ionfo text
-*/
-void ToolsGUI_RegWidget::InfoWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-/*!
-  \brief Key press event handler. Closeswindow on \c Escape key pressing.
-  \internal
-  \param e key press event
-*/
-void ToolsGUI_RegWidget::InfoWindow::keyPressEvent( QKeyEvent * e )
-{
-  QMainWindow::keyPressEvent( e );
-  if ( e->key() == Qt::Key_Escape )
-    close();
-}
-
-/*!
-  \class ToolsGUI_RegWidget::HelpWindow
-  \brief Help window.
-  \internal
-*/
-
-class ToolsGUI_RegWidget::HelpWindow : public QMainWindow
-{
-public:
-  HelpWindow( QWidget* parent );
-  ~HelpWindow();
-
-  void setText( const QString& text );
-
-private:
-  QTextEdit* myTextView;
-};
-
-/*!
-  \brief Constructor.
-  \internal
-  \param parent parent widget
-*/
-ToolsGUI_RegWidget::HelpWindow::HelpWindow( QWidget* parent ) 
-: QMainWindow( parent )
-{
-  setAttribute( Qt::WA_DeleteOnClose );
-  setWindowTitle( tr( "Help" ) );
-
-  myTextView = new QTextEdit( this );
-  myTextView->setReadOnly( true );
-  QPalette pal = myTextView->palette();
-
-  pal.setBrush( QPalette::Active, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
-  pal.setBrush( QPalette::Active, QPalette::HighlightedText, QBrush( Qt::white ) );
-  pal.setBrush( QPalette::Active, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
-  pal.setBrush( QPalette::Active, QPalette::Text,            QBrush( Qt::black ) );
-
-  pal.setBrush( QPalette::Inactive, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
-  pal.setBrush( QPalette::Inactive, QPalette::HighlightedText, QBrush( Qt::white ) );
-  pal.setBrush( QPalette::Inactive, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
-  pal.setBrush( QPalette::Inactive, QPalette::Text,            QBrush( Qt::black ) );
-
-  pal.setBrush( QPalette::Disabled, QPalette::Highlight,       QBrush( QColor( 0, 0, 128 ) ) );
-  pal.setBrush( QPalette::Disabled, QPalette::HighlightedText, QBrush( Qt::white ) );
-  pal.setBrush( QPalette::Disabled, QPalette::Base,            QBrush( QColor( 255,255,220 ) ) );
-  pal.setBrush( QPalette::Disabled, QPalette::Text,            QBrush( Qt::black ) );
-
-  myTextView->setPalette( pal );
-  
-  setCentralWidget( myTextView );
-  setMinimumSize( 450, 250 );
-
-  QFile f ( "tmp.txt" );
-  if ( f.open( QIODevice::ReadOnly ) ) {
-    QTextStream t( &f ); 
-    while ( !t.atEnd() ) {
-      myTextView->append( t.readLine() );
-    }
-  }
-  f.close();
-}
-
-/*!
-  \brief Destructor.
-  \internal
-*/
-ToolsGUI_RegWidget::HelpWindow::~HelpWindow()
-{
-};
-
-/*!
-  \brief Set text to the help window.
-  \internal
-  \param text help text
-*/
-void ToolsGUI_RegWidget::HelpWindow::setText( const QString& text )
-{
-  myTextView->setText( text );
-}
-
-/*!
-  \class ToolsGUI_RegWidget::IntervalWindow
-  \brief Dialog box to enter time delay between registry window updates
-  \internal
-*/
-
-class ToolsGUI_RegWidget::IntervalWindow : public QDialog
-{
-public:
-  IntervalWindow( QWidget* parent );
-  ~IntervalWindow();
-  
-  QPushButton* Ok();
-  QPushButton* Cancel();
-
-  int getValue();
-  void setValue( int );
-
-private:
-  QSpinBox* mySpinBox;
-  QPushButton* myButtonOk;
-  QPushButton* myButtonCancel;
-};
-
-/*!
-  \brief Constructor.
-  \internal
-  \param parent parent widget
-*/
-ToolsGUI_RegWidget::IntervalWindow::IntervalWindow ( QWidget* parent )
-: QDialog( parent )
-{
-  setModal( true );
-  setAttribute( Qt::WA_DeleteOnClose );
-
-  setWindowTitle( tr( "Refresh Interval"  ) );
-  setSizeGripEnabled( true );
-
-  QGridLayout* topLayout = new QGridLayout( this );
-  topLayout->setSpacing( SPACING_SIZE );
-  topLayout->setMargin( MARGIN_SIZE );
-
-  QGroupBox* intervalGrp = new QGroupBox( this );
-  intervalGrp->setObjectName( "intervalGrp" );
-  QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp );
-  intervalGrpLayout->setAlignment( Qt::AlignTop );
-  intervalGrpLayout->setSpacing( SPACING_SIZE );
-  intervalGrpLayout->setMargin( MARGIN_SIZE  );  
-
-  QHBoxLayout* aBtnLayout = new QHBoxLayout;
-  aBtnLayout->setSpacing( SPACING_SIZE );
-  aBtnLayout->setMargin( 0 );
-
-  myButtonOk = new QPushButton( this );
-  myButtonOk->setObjectName( "buttonOk" );
-  myButtonOk->setText( tr( "BUT_OK"  ) );
-  myButtonOk->setAutoDefault( TRUE );
-  myButtonOk->setDefault( TRUE );
-  
-  myButtonCancel = new QPushButton( this );
-  myButtonCancel->setObjectName( "buttonCancel" );
-  myButtonCancel->setText( tr( "BUT_CANCEL"  ) );
-  myButtonCancel->setAutoDefault( TRUE );
-
-  QLabel* TextLabel = new QLabel( intervalGrp );
-  TextLabel->setObjectName( "TextLabel" );
-  TextLabel->setText( tr( "Please, enter a number of seconds:"  ) );
-
-  mySpinBox = new QSpinBox( intervalGrp );
-  mySpinBox->setMinimum( 1 );
-  mySpinBox->setMaximum( 999999999 );
-  mySpinBox->setSingleStep( 1 );
-  mySpinBox->setObjectName( "SpinBox" );
-  mySpinBox->setValue( 100 );
-  mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
-
-  intervalGrpLayout->addWidget(TextLabel, 0, 0);
-  intervalGrpLayout->addWidget(mySpinBox, 0, 1);
-
-  aBtnLayout->addWidget( myButtonOk );
-  aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
-  aBtnLayout->addWidget( myButtonCancel );
-
-  topLayout->addWidget( intervalGrp, 0, 0 );
-  topLayout->addLayout( aBtnLayout, 1, 0 ); 
-}
-
-/*!
-  \brief Destructor
-  \internal
-*/
-ToolsGUI_RegWidget::IntervalWindow::~IntervalWindow()
-{
-}
-
-/*!
-  \brief Set time interval value
-  \internal
-  \param size interval value
-*/
-void ToolsGUI_RegWidget::IntervalWindow::setValue( const int size )
-{
-  mySpinBox->setValue(size);
-}
-
-/*!
-  \brief Get time interval value
-  \internal
-  \return interval value
-*/
-int ToolsGUI_RegWidget::IntervalWindow::getValue()
-{
-  return mySpinBox->value();
-}
-
-/*!
-  \brief Get \c OK button
-  \internal
-  \return a pointer to \c OK button
-*/
-QPushButton* ToolsGUI_RegWidget::IntervalWindow::Ok()
-{
-  return myButtonOk;
-}
-
-/*!
-  \brief Get \c Cancel button
-  \internal
-  \return a pointer to \c Cancel button
-*/
-QPushButton* ToolsGUI_RegWidget::IntervalWindow::Cancel()
-{
-  return myButtonCancel;
+  return aRegistry._retn();
 }
 
 /*!
@@ -461,107 +161,116 @@ ToolsGUI_RegWidget* ToolsGUI_RegWidget::myRegWidgetPtr = 0;
   \param orb CORBA ORB reference
   \param parent parent widget
 */
-ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb,
-                                                     QWidget* parent )
+ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_ptr orb,
+                                                      QWidget* parent )
 {
   if ( !myRegWidgetPtr ) 
     myRegWidgetPtr = new ToolsGUI_RegWidget( orb, parent );
   return myRegWidgetPtr;
 }
 
-/*!
-  \brief This virtual function is reimplenented to disable popup menu on dock areas
-  (instead of QMainWindow::setDockMenuEnabled( false ) method used in Qt3).
-  \return always 0 to disable menu
-*/
-QMenu* ToolsGUI_RegWidget::createPopupMenu()
-{
-  QMenu* aPopup = 0;
-  return aPopup;
-}
-
 /*!
   \brief Constructor
   \param orb CORBA ORB reference
   \param parent parent widget
 */
-ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent ) 
-: QMainWindow( parent, Qt::Window ),
-  _VarComponents( MakeRegistry(orb) ),
-  _clients( 0 ), 
-  _history( 0 ), 
-  _parent( parent ),
-  _tabWidget( 0 ), 
-  _refresh( 0 ), 
-  _interval( 0 ),
-  myInfoWindow( 0 ), 
-  myHelpWindow( 0 ), 
-  myIntervalWindow( 0 )
+ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent ) 
+: QMainWindow( parent )
 {
-  setAttribute( Qt::WA_DeleteOnClose );
+  myOrb = CORBA::ORB::_duplicate( orb );
 
-  if ( parent )
-    setWindowIcon( parent->windowIcon() );
-
-  // pixmap for buttons
-  QPixmap image_refresh ( ( const char** ) refresh_data );
-  QPixmap image_interval( ( const char** ) time_data );
-  QPixmap image_close   ( ( const char** ) close_data );
+  // set window attributes
+  setAttribute( Qt::WA_DeleteOnClose );
+  setWindowTitle( tr( "TLT_REGISTRY" ) );
 
-  // Buttons definition
-  QToolBar* topbar = new QToolBar( tr("Toolbar"), this );
-  topbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
-  addToolBar( Qt::TopToolBarArea, topbar );
+  // show status bar
+  statusBar();
 
-  _refresh = topbar->addAction(image_refresh, tr( "Refresh" ), this, SLOT( slotListeSelect() ));
-  _refresh->setToolTip( "" );
-  _refresh->setStatusTip( tr("Immediately updates list of components") );
+  // get main menu bar
+  QMenuBar* mainMenu = menuBar();
   
-  /* PAL5540 - this button is needless
-  QPushButton* help = new QPushButton( tr( "Help" ), topbar );
-  connect( help, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
-  QToolTip::add( help, "", toolTipGroup(), tr("Opens Help window") );
-  */
+  // add 'Actions' menu
+  QMenu* m = mainMenu->addMenu( tr( "MNU_ACTIONS" ) );
+  // add 'Actions' toolbar
+  QToolBar* tb = addToolBar( tr( "TB_ACTIONS" ) );
+
+  // create actions
+  myActions[Refresh] = new QAction( QPixmap( refresh_data ), tr( "MEN_REFRESH" ), this );
+  myActions[Refresh]->setStatusTip( tr( "STB_REFRESH" ) );
+  connect( myActions[Refresh], SIGNAL( triggered() ), this, SLOT( refresh() ) );
+  m->addAction( myActions[Refresh] );
+  tb->addAction( myActions[Refresh] );
   
-  _interval = topbar->addAction(image_interval, tr( "Interval" ), this, SLOT( slotSelectRefresh() ));
-  _interval->setToolTip( "" );
-  _interval->setStatusTip( tr("Changes refresh interval") );
-  
-  topbar->addSeparator();
-
-  _close = topbar->addAction( image_close, tr("Close"), this, SLOT( close() ));
-  _close->setToolTip( "" );
-  _close->setStatusTip( tr("Closes Registry window") );
+  myActions[Interval] = new QAction( QPixmap( time_data ), tr( "MEN_INTERVAL" ), this );
+  myActions[Interval]->setStatusTip( tr( "STB_INTERVAL" ) );
+  connect( myActions[Interval], SIGNAL( triggered() ), this, SLOT( refreshInterval() ) );
+  m->addAction( myActions[Interval] );
+  tb->addAction( myActions[Interval] );
   
-  // Display area and associated slots definition
-  _tabWidget = new QTabWidget( this );
-  _clients   = new QTreeWidget( _tabWidget );
-  SetListe();
-  _history   = new QTreeWidget( _tabWidget );
-  SetListeHistory();
-  
-  _tabWidget->addTab( _clients, tr( "Running" ) );
-  _tabWidget->addTab( _history, tr( "History" ) );
-  connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) );
-  connect( _clients,   SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),        this, SLOT( slotClientChanged( QTreeWidgetItem* , int ) ) );
-  connect( _history,   SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ),        this, SLOT( slotHistoryChanged( QTreeWidgetItem* , int ) ) );
-  setCentralWidget( _tabWidget );
+  m->addSeparator();
+  tb->addSeparator();
+
+  myActions[Close] = new QAction( QPixmap( close_data ), tr( "MEN_CLOSE" ), this );
+  myActions[Close]->setStatusTip( tr( "STB_CLOSE" ) );
+  connect( myActions[Close], SIGNAL( triggered() ), this, SLOT( close() ) );
+  m->addAction( myActions[Close] );
+  tb->addAction( myActions[Close] );
+
+  // central widget
+  setCentralWidget( new QWidget( this ) );
+
+  // Create tab widget: SALOME serives list (running and history)
+  QTabWidget* tabWidget = new QTabWidget( centralWidget() );
+
+  myViews[Clients]   = new QTreeWidget( tabWidget );
+  myViews[Clients]->setColumnCount( 6 );
+  myViews[Clients]->setAllColumnsShowFocus( true );
+  myViews[Clients]->setRootIsDecorated( false );
+  QStringList runningLabels;
+  runningLabels << tr( "HDR_COMPONENT" ) << tr( "HDR_PID" )     << tr( "HDR_USERNAME" )
+               << tr( "HDR_HOSTNAME" )  << tr( "HDR_STARTED" ) << tr( "HDR_HELLO" );
+  myViews[Clients]->setHeaderLabels( runningLabels );
+  tabWidget->addTab( myViews[Clients], tr( "TAB_RUNNING" ) );
+
+  myViews[History]   = new QTreeWidget( tabWidget );
+  myViews[History]->setColumnCount(6);
+  myViews[History]->setAllColumnsShowFocus( true );
+  myViews[History]->setRootIsDecorated( false );
+  QStringList historyLabels;
+  historyLabels << tr( "HDR_COMPONENT" ) << tr( "HDR_PID" )     << tr( "HDR_USERNAME" )
+               << tr( "HDR_HOSTNAME" )  << tr( "HDR_STARTED" ) << tr( "HDR_FINISHED" );
+  myViews[History]->setHeaderLabels( historyLabels );
+  tabWidget->addTab( myViews[History], tr( "TAB_HISTORY" ) );
+
+  connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( refresh() ) );
+  connect( myViews[Clients], SIGNAL( itemActivated( QTreeWidgetItem*, int ) ), 
+          this,             SLOT( showDetails( QTreeWidgetItem*, int ) ) );
+  connect( myViews[History], SIGNAL( itemActivated( QTreeWidgetItem*, int ) ),
+          this,             SLOT( showDetails( QTreeWidgetItem*, int ) ) );
+
+  // create information window
+  myDetails = new QTextEdit( centralWidget() );
+  myDetails->setReadOnly( true );
+  myDetails->setMinimumHeight( 100 );
+
+  // layout widgets
+  QVBoxLayout* topLayout = new QVBoxLayout( centralWidget() );
+  topLayout->setMargin( 0 );
+  topLayout->setSpacing( SPACING_SIZE );
+  topLayout->addWidget( tabWidget );
+  topLayout->addWidget( myDetails );
   
-  // Timer definition (used to automaticaly refresh the display area)
-  _counter = new QTimer( this );
-  connect( _counter, SIGNAL( timeout() ), this, SLOT( slotListeSelect() ) );
-  myRefreshInterval = 10;
-  _counter->start( myRefreshInterval * 1000 );
+  // install auto-update timer
+  myTimer = new QTimer( this );
+  connect( myTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+  myTimer->start( 10000 ); // 10 seconds by default
   
-  PIXELS xpos    = 160 ;
-  PIXELS ypos    = 100 ;
-  PIXELS largeur = 800 ;
-  PIXELS hauteur = 350 ;
-  setGeometry( xpos, ypos, largeur, hauteur ) ;
-  setWindowTitle( tr( "Registry" ) ) ;
-  statusBar()->showMessage("    ");
-
-  slotListeSelect();
+  // resize window and set its position
+  resize( 800, 400 );
+  Qtx::alignWidget( (QWidget*)this, (QWidget*)QApplication::desktop(), Qtx::AlignCenter );
+
+  // refresh registry information
+  refresh();
 }
 
 /*!
@@ -569,277 +278,115 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent )
 */
 ToolsGUI_RegWidget::~ToolsGUI_RegWidget()
 {
-  _counter->stop();
   myRegWidgetPtr = 0;
 };
 
 /*!
-  \brief Event filter
-  \param object event receiver
-  \param event event being processed
-  \return \c true if event processing should be stopped
-*/
-bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event )
-{
-  if ( object ) {
-    if ( object == myHelpWindow && event->type() == QEvent::Close ) {
-      myHelpWindow = 0;
-    }
-    else if ( object == myInfoWindow && event->type() == QEvent::Close ) {
-      myInfoWindow = 0;
-    }
-    else if ( object == myIntervalWindow && event->type() == QEvent::Close ) {
-      myIntervalWindow = 0;
-    }
-    else if ( object == _clients && event->type() == QEvent::KeyPress ) {
-      QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
-       slotClientChanged( _clients->currentItem(), 0 );
-      }
-    }
-    else if ( object == _history && event->type() == QEvent::KeyPress ) {
-      QKeyEvent* ke = (QKeyEvent*)event;
-      if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
-       slotHistoryChanged( _history->currentItem(), 0 );
-      }
-    }
-  }
-  return QMainWindow::eventFilter( object, event );
-}
-
-/*!
-  \brief Search item in the list.
-  \param name component name
-  \param pid PID
-  \param machine machine name
-  \param listclient list of registry data
-  \return item index or -1 if it is not found.
-*/
-int ToolsGUI_RegWidget::numitem( const QString& name, 
-                                const QString& pid, 
-                                const QString& machine,
-                                const Registry::AllInfos* listclient )
-{
-  for (CORBA::ULong i=0; i<listclient->length(); i++) {       
-    const Registry::Infos & c_info=(*listclient)[i];
-    ASSERT( c_info.name!=NULL);
-    QString b;
-    b.setNum(int(c_info.pid));
-    if ( (name.compare(QString(c_info.name)) == 0) && 
-        (machine.compare(QString(c_info.machine)) == 0) && 
-        (pid.compare(b) == 0) ) {
-      return i;
-    }
-  }
-  return -1;
-}
-
-/*!
-  \brief Get description text, containing information about client.
+  \brief Get description text, containing information about the service.
   \param c_info client info data
   \return formatted client description
 */
-QString ToolsGUI_RegWidget::setlongText( const Registry::Infos& c_info )
+QString ToolsGUI_RegWidget::getDetails( const Registry::Infos& c_info )
 {
-  ASSERT( c_info.name != NULL );
-  QString a = QString( "<hr><h2>" ) + tr( "Code" ) + QString( " : " );
-  a.append( QString( c_info.name ) );
-  a.append( "</h1><hr><br>" );
-  a.append( "<code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be 
-                        // fixed width (looks much better on Windows)
-  a.append( tr( "Process Id" ) + QString( " : " ) );
-  a.append( BOLD( QString::number( int( c_info.pid ) ) ) );
-  a.append( QString( " " ) + tr( "on machine" ) + QString( " " ) );
-  a.append( BOLD( c_info.machine ) ); 
-  a.append( QString( " " ) + tr( "ip address" ) + QString( " : " ) );
-  a.append( BOLD( c_info.adip ) );
-  a.append( "<br>" );
-  
-  a.append( tr( "launched by user" ) + QString( " " ) );
-  a.append( BOLD( c_info.pwname ) );
-  a.append( QString( " ( " ) + tr( "pid" ) + QString( " : " ) );
-  a.append( BOLD( QString::number( int( c_info.uid ) ) ) );
-  a.append( QString( " )<br> " ) + tr( "in directory" ) + QString( " " ));
-  a.append( BOLD( c_info.cdir ) );
-
-  time_t aTime;
-  a.append( QString( "<br>" ) + tr( "begins" ) + QString( " " ) );
-  aTime = time_t(c_info.tc_start);
-  char * t1 = (char * )duplicate(ctime(&aTime));
-  t1 [strlen(t1) -1 ] = ' ';
-  a.append( BOLD( t1 ) ); 
-  delete [] t1;
-  a.append( "<br>" );
-  
-  if (c_info.tc_hello != 0 ) {
-    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 ) ); 
+  QString a;
+  if ( c_info.name != NULL ) {
+    time_t aStarted( c_info.tc_start );
+    time_t aLastPing( c_info.tc_hello );
+    time_t aFinished( c_info.tc_end );
+
+    a.append( BOLD( tr( "INFO_SERVICE" ).arg( QString( c_info.name ) ) ) );
     a.append( "<br>" );
-    delete [] t2;
-  }
-  if ((c_info.tc_end - c_info.difftime) != 0) {
-    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 ) ); 
     a.append( "<br>" );
-    delete [] t3;
-  }
-  else {
-    a.append( tr( "still running" ) + QString( "<br>" ) );
-  }
-  
-  SCRUTE(c_info.difftime);
-  if (c_info.difftime!= 0) {
-    a.append( QString( "(" ) + tr( "Time on" ) + QString( " " ) ); 
-    a.append( BOLD( c_info.machine ) ); 
-    a.append( QString( " " ) + tr( "differs from server's time. The difference is" ) + QString( " " )); 
-    a.append( BOLD( QString::number( int( c_info.difftime ) ) ) );
-    a.append( QString( " " ) + tr( "seconds" ) + QString( ")<br>" ) );
+    a.append( tr( "INFO_PROCESS" ).arg( BOLD( QString::number( c_info.pid ) ),
+                                       BOLD( c_info.machine ),
+                                       BOLD( c_info.adip ),
+                                       BOLD( c_info.pwname ),
+                                       BOLD( QString::number( c_info.uid ) ),
+                                       BOLD( c_info.cdir ) ) );
+    a.append( "<br>" );
+    a.append( "<br>" );
+    a.append( tr( "INFO_STARTED" ).arg( BOLD( QString( ctime( &aStarted ) ).trimmed() ) ) );
+    a.append( "<br>" );
+    if ( c_info.tc_hello != 0 ) {
+      a.append( tr( "INFO_LAST_PING" ).arg( BOLD( QString( ctime( &aLastPing ) ).trimmed() ) ) );
+      a.append( "<br>" );
+    }
+    if ( c_info.tc_end - c_info.difftime != 0 ) {
+      a.append( tr( "INFO_FINISHED" ).arg( BOLD( QString( ctime( &aFinished ) ).trimmed() ) ) );
+      a.append( "<br>" );
+    }
+    else {
+      a.append( tr( "INFO_RUNNING" ) );
+      a.append( "<br>" );
+    }
+    if ( c_info.difftime != 0 ) {
+      a.append( tr( "INFO_TIME_DIFF" ).arg( BOLD( c_info.machine ), BOLD( QString::number( c_info.difftime ) ) ) ); 
+      a.append( "<br>" );
+    }
+    a.append( "</code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be 
+                           // fixed width (looks much better on Windows)
   }
-  a.append( "</code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be 
-                         // fixed width (looks much better on Windows)
   return a;
-  
 }
 
 /*!
-  \brief Close event handler.
-  \param e close event
+  \brief Refresh registry information
 */
-void ToolsGUI_RegWidget::closeEvent( QCloseEvent* e )
+void ToolsGUI_RegWidget::refresh()
 {
-  if ( myInfoWindow )
-    myInfoWindow->close();
-  if ( myHelpWindow )
-    myHelpWindow->close();
-  if (myIntervalWindow)
-    myIntervalWindow->close();
-  e->accept();
-};
-
-/*!
-  \brief Setup clients list.
-*/
-void ToolsGUI_RegWidget::SetListe()
-{
-  _clients->installEventFilter( this );
-  _clients->setColumnCount(6);
-  _clients->setAllColumnsShowFocus( true );
-  QStringList aLabels;
-  aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("hello");
-  _clients->setHeaderLabels( aLabels );
-  //_clients->setColumnAlignment( 1, Qt::AlignRight );
-}
-
-/*!
-  \brief Setup history list.
-*/
-void ToolsGUI_RegWidget::SetListeHistory()
-{
-  _history->installEventFilter( this );
-   _history->setColumnCount(6);
-  _history->setAllColumnsShowFocus( true );
-  QStringList aLabels;
-  aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("ends");
-  _history->setHeaderLabels( aLabels );
-  //_history->setColumnAlignment( 1, Qt::AlignRight );
-}
-
-/*!
-  \brief Update history list
-*/
-void ToolsGUI_RegWidget::InfoHistory()
-{
-
-  _history->clear();
   try {
-    time_t aTime;
-    _serverhistory = _VarComponents->history();
-    for (CORBA::ULong i=0; i<_serverhistory->length(); i++) {       
-      const Registry::Infos & c_info=(*_serverhistory)[i];
-      ASSERT( c_info.name!=NULL);
-      QString a;
-      a.setNum(int(c_info.pid));
-      aTime = time_t(c_info.tc_start);
-      char * t1 = (char * )duplicate(ctime(&aTime));
-      t1 [strlen(t1) -1 ] = ' ';
-      aTime = time_t(c_info.tc_end);
-      char * t2 = (char * )duplicate(ctime(&aTime));
-      t2 [strlen(t2) -1 ] = ' ';
-      QStringList anItem;
-      anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
-      QTreeWidgetItem * item = new QTreeWidgetItem(_history, anItem);
-      item=0 ;
-      delete [] t1;
-      delete [] t2;
-      
+    // get reference to the Registry service
+    Registry::Components_var aRegistry = GetRegistry( myOrb );
+    if ( aRegistry->_is_nil() ) {
+      myActions[Interval]->setDisabled( true );
+      myActions[Refresh]->setDisabled( true );
+      myTimer->stop();
+      MESSAGE( "Sorry, no more Registry Server" );
+      statusBar()->showMessage( tr( "ERR_NO_REGISTRY" ) );
+      return;
     }
-  }
-  catch( ... ) {
-    _interval->setDisabled( TRUE ) ;
-    _refresh->setDisabled( TRUE ) ;
-    _counter->stop();
-    MESSAGE("Sorry, No more Registry Server") ;
-    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
-  }
-}
 
-/*!
-  \brief Update clients list
-*/
-void ToolsGUI_RegWidget::InfoReg()
-{
-  _clients->clear();
-  try {
-    time_t aTime;
-    _serverclients = _VarComponents->getall();
-    for (CORBA::ULong i=0; i<_serverclients->length(); i++) {       
-      const Registry::Infos & c_info=(*_serverclients)[i];
-      ASSERT( c_info.name!=NULL);
-      QString a;
-      a.setNum(int(c_info.pid));
-      aTime = time_t(c_info.tc_start);
-      char * t1 = (char * )duplicate(ctime(&aTime));
-      t1 [strlen(t1) -1 ] = ' ';
-      aTime = time_t(c_info.tc_hello);
-      char * t2 = (char * )duplicate(ctime(&aTime));
-      t2 [strlen(t2) -1 ] = ' ';
-      QStringList anItem;
-      anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
-      QTreeWidgetItem * item = new QTreeWidgetItem(_clients, anItem);
-      item=0 ;
-      delete [] t1;
-      delete [] t2;
-      
+    myData[Clients] = aRegistry->getall();
+    myData[History] = aRegistry->history();
+
+    // update current services list
+    myViews[Clients]->clear();
+    for ( int i = 0; i < myData[Clients]->length(); i++ ) {
+      const Registry::Infos& c_info = (*myData[Clients])[i];
+      time_t aStarted  = time_t( c_info.tc_start );
+      time_t aLastPing = time_t( c_info.tc_hello );
+      QStringList aData;
+      aData << QString( c_info.name )
+           << QString::number( c_info.pid )
+           << QString( c_info.pwname )
+           << QString( c_info.machine )
+           << QString( ctime( &aStarted ) ).trimmed()
+           << QString( ctime( &aLastPing ) ).trimmed();
+      myViews[Clients]->addTopLevelItem( new QTreeWidgetItem( aData ) );
     }
-  }
-  catch( ... ) {
-    _interval->setDisabled( TRUE ) ;
-    _refresh->setDisabled( TRUE ) ;
-    _counter->stop();
-    MESSAGE("Sorry, No more Registry Server") ;
-    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
-  }
-}
 
-/*!
-  \brief Called when \c Refresh button is clicked
-*/
-void ToolsGUI_RegWidget::slotListeSelect()
-{
-  try {
-    ASSERT(_tabWidget->currentWidget() != NULL);
-    if (_tabWidget->currentWidget () == _clients) InfoReg();
-    else if (_tabWidget->currentWidget () == _history) InfoHistory();
+    // update history
+    myViews[History]->clear();
+    for ( int i = 0; i < myData[History]->length(); i++ ) {       
+      const Registry::Infos& c_info = (*myData[History])[i];
+      time_t aStarted  = time_t( c_info.tc_start );
+      time_t aFinished = time_t( c_info.tc_end );
+      QStringList aData;
+      aData << QString( c_info.name )
+           << QString::number( c_info.pid )
+           << QString( c_info.pwname )
+           << QString( c_info.machine )
+           << QString( ctime( &aStarted ) ).trimmed()
+           << QString( ctime( &aFinished ) ).trimmed();
+      myViews[History]->addTopLevelItem( new QTreeWidgetItem( aData ) );
+    }
   }
   catch( ... ) {
-    MESSAGE("Sorry, No more Registry Server") ;
-    statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
+    myActions[Interval]->setDisabled( true );
+    myActions[Refresh]->setDisabled( true );
+    myTimer->stop();
+    MESSAGE( "Sorry, no more Registry Server" );
+    statusBar()->showMessage( tr( "ERR_NO_REGISTRY" ) );
   }
 }
 
@@ -847,105 +394,27 @@ void ToolsGUI_RegWidget::slotListeSelect()
   \brief Called when \c Interval button is clicked (open dialog box to 
   change refresh interval).
 */
-void ToolsGUI_RegWidget::slotSelectRefresh()
+void ToolsGUI_RegWidget::refreshInterval()
 {
-  myIntervalWindow = new ToolsGUI_RegWidget::IntervalWindow(this);
-  myIntervalWindow->installEventFilter( this );
-  myIntervalWindow->setValue(myRefreshInterval);
-  myIntervalWindow->show();
-  connect( myIntervalWindow->Cancel(), SIGNAL( clicked() ), myIntervalWindow, SLOT( close() ) );
-  connect( myIntervalWindow->Ok(), SIGNAL( clicked() ), this, SLOT( slotIntervalOk() ) );
+  bool ok;
+  int sec = QInputDialog::getInt( this, tr( "TLT_REFRESH_INTERVAL" ), tr( "LAB_REFRESH_INTERVAL" ), 
+                                 myTimer->interval() / 1000, 1, 24 * 60 * 60, 1, &ok );
+  if ( ok )
+    myTimer->start( sec * 1000 );
 }
 
 /*!
-  \brief Called when IntervalWindow's \c OK button is clicked
-*/
-void ToolsGUI_RegWidget::slotIntervalOk()
-{
-  myRefreshInterval = myIntervalWindow->getValue();
-  _counter->start( myRefreshInterval * 1000 );
-  SCRUTE(myRefreshInterval);
-  myIntervalWindow->close();
-}
-/*!
-  \brief Called when \c Help button is clicked
+  \brief Show details about the chosen service.
+  \param item item activated by the user
+  \param column column index
 */
-void ToolsGUI_RegWidget::slotHelp()
+void ToolsGUI_RegWidget::showDetails( QTreeWidgetItem* item, int column )
 {
-  if ( !myHelpWindow ) {
-    myHelpWindow  = new ToolsGUI_RegWidget::HelpWindow( this );
-    myHelpWindow->installEventFilter( this );
-  }
-  myHelpWindow->show();
-  myHelpWindow->raise();
-  myHelpWindow->activateWindow();
+  if ( !item || column < 0 ) return;
+  int i = sender() == myViews[Clients] ? Clients : History;
+  int idx  = myViews[i]->indexOfTopLevelItem( item );
+  int size = myData[i]->length();
+  if ( idx < 0 || idx > size-1 ) return;
+  const Registry::Infos& c_info = (*myData[i])[idx];
+  myDetails->setText( getDetails( c_info ) );
 }
-
-/*!
-  \brief Called when user clicks on item in \c Running list
-  \param item item clicked by the user
-*/
-void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item, int col )
-{
-  if ( !item || col < 0 )
-    return;
-
-  blockSignals( true ); // for sure that item will not be deleted when refreshing
-
-  int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverclients);
-  SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1).toLatin1().constData()) ;
-  
-  ASSERT(numeroItem>=0) ;
-  ASSERT((size_t)numeroItem<_serverclients->length()) ;
-  const Registry::Infos & c_info=(*_serverclients)[numeroItem];
-  ASSERT( c_info.name!=NULL);
-  
-  if ( !myInfoWindow ) {
-    myInfoWindow  = new ToolsGUI_RegWidget::InfoWindow( this );
-    myInfoWindow->installEventFilter( this );
-  }
-  QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setWindowTitle(a);
-  myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info) );
-  myInfoWindow->show();
-  myInfoWindow->raise();
-  myInfoWindow->activateWindow();
-
-  blockSignals( false ); // enabling signals again
-}
-
-/*!
-  \brief Called when user clicks on item in \c History list
-  \param item item clicked by the user
-*/
-void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item, int col )
-{
-  if ( !item || col < 0 )
-    return;
-
-  blockSignals( true ); // for sure that item will not be deleted when refreshing
-
-  int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverhistory);
-  
-  SCRUTE(numeroItem) ;
-  SCRUTE(item->text(1).toLatin1().constData()) ;
-  ASSERT(numeroItem>=0) ;
-  ASSERT((size_t)numeroItem<_serverhistory->length()) ;
-  const Registry::Infos & c_info=(*_serverhistory)[numeroItem];
-  ASSERT( c_info.name!=NULL);
-  
-  if ( !myInfoWindow ) {
-    myInfoWindow  = new ToolsGUI_RegWidget::InfoWindow( this );
-    myInfoWindow->installEventFilter( this );
-  }
-  QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
-  myInfoWindow->setWindowTitle(a);
-  myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info ) );
-  myInfoWindow->show();
-  myInfoWindow->raise();
-  myInfoWindow->activateWindow();
-
-  blockSignals( false ); // enabling signals again
-}
-
index 1c9b3d5492055098a73b9bdaff83ed2dc1ad1d35..bc6932ccb30930bccc7c7abdbcfa32f77c6b3096 100755 (executable)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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 RegistryDisplay : GUI for Registry server implementation
-//  File   : ToolsGUI_RegWidget.h
-//  Author : Pascale NOYRET, EDF
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef TOOLSGUI_REGWIDGET_H
 #define TOOLSGUI_REGWIDGET_H
 
 #include "ToolsGUI.h"
 
 #include <QMainWindow>
+#include <QMap>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(SALOME_Registry)
 
-class QTabWidget;
 class QTreeWidget;
 class QTreeWidgetItem;
-class QWidget;
 class QTimer;
-class QCloseEvent;
 class QAction;
+class QTextEdit;
 
 class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
 {
   Q_OBJECT
 
-  class HelpWindow;
-  class IntervalWindow;
-  class InfoWindow;
+  enum { Refresh, Interval, Close };
+  enum { Clients, History };
 
-  ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
+  ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent = 0 );
 
 public:
   ~ToolsGUI_RegWidget();
 
-  void                       SetListe();
-  void                       SetListeHistory();
-  void                       InfoReg();
-  void                       InfoHistory();
-
-  bool                       eventFilter( QObject* object, QEvent* event );
+  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb, 
+                                           QWidget* parent = 0 );
 
-  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb, 
-                                          QWidget* parent = 0 );
+private slots:
+  void                       refresh();
+  void                       showDetails( QTreeWidgetItem*, int );
+  void                       refreshInterval();
 
-  virtual QMenu*             createPopupMenu();
-
-public slots:
-  void                       slotHelp();
-  void                       slotListeSelect();
-  void                       slotClientChanged( QTreeWidgetItem*, int );
-  void                       slotHistoryChanged( QTreeWidgetItem*, int );
-  void                       slotSelectRefresh();
-  void                       slotIntervalOk();
-
-protected:  
-  static QString             setlongText( const Registry::Infos& c_info );
-  int                        numitem( const QString& name, 
-                                     const QString& pid, 
-                                     const QString& machine, 
-                                     const Registry::AllInfos* clistclient );
-  void                       closeEvent( QCloseEvent* e );
+private:  
+  static QString             getDetails( const Registry::Infos& c_info );
    
-protected :
-  QTreeWidget*         _clients;
-  QTreeWidget*         _history;
-  QWidget*             _parent;
-  QTabWidget*          _tabWidget;
-  QAction*             _refresh;
-  QAction*             _interval;
-  QAction*             _close;
-  QTimer*              _counter;
-  Registry::AllInfos*  _serverhistory;
-  Registry::AllInfos*  _serverclients;
-  InfoWindow*          myInfoWindow;
-  HelpWindow*          myHelpWindow;
-  IntervalWindow*      myIntervalWindow;
-  int                  myRefreshInterval;
-
 private:
-  const Registry::Components_var _VarComponents;
-  static ToolsGUI_RegWidget*     myRegWidgetPtr;
+  static ToolsGUI_RegWidget* myRegWidgetPtr;
+
+  CORBA::ORB_var             myOrb;
+  QMap<int, Registry::AllInfos*> myData;
+  QMap<int, QAction*>        myActions;
+  QMap<int, QTreeWidget*>    myViews;
+  QTextEdit*                 myDetails;
+  QTimer*                    myTimer;
 };
 
 #endif // TOOLSGUI_REGWIDGET_H
diff --git a/src/TOOLSGUI/resources/ToolsGUI_icons.po b/src/TOOLSGUI/resources/ToolsGUI_icons.po
deleted file mode 100755 (executable)
index 0501074..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
-#  File   : ToolsGUI_icons.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: SALOME VERSION 0.4\n"
-"POT-Creation-Date: 2002-04-25 10:04:12 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: Nicolas REJNERI\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:50
-msgid "ToolsGUI_CatalogGeneratorDlg::ICON_SELECT"
-msgstr "select1.png"
diff --git a/src/TOOLSGUI/resources/ToolsGUI_msg_en.po b/src/TOOLSGUI/resources/ToolsGUI_msg_en.po
deleted file mode 100755 (executable)
index 8b7c8c8..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME TOOLSGUI : implementation of desktop "Tools" optioins
-#  File   : ToolsGUI_msg_en.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: SALOME VERSION 0.4\n"
-"POT-Creation-Date: 2002-04-25 10:04:12 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: Nicolas REJNERI\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:58
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_FILES"
-msgstr "Files"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:58
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_SUPPLEMENT"
-msgstr "Component supplementary data"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:150
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_EXPORT"
-msgstr "Export"
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT"
-msgstr "Import"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:47
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_CATALOG_GENERATOR"
-msgstr "Catalog generator"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:82
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_IDL_FILE"
-msgstr "IDL : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:88
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_XML_FILE"
-msgstr "XML : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:88
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_PNG_FILE"
-msgstr "Icon : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_AUTHOR"
-msgstr "Author : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_VERSION"
-msgstr "Version : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_NAME"
-msgstr "Name : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_USERNAME"
-msgstr "UserName : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_TYPE"
-msgstr "Type : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_MULTISTD"
-msgstr "Multistudy : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:153
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_EXPORT_XML"
-msgstr "XML Files ( *.xml )"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:154
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT_IDL"
-msgstr "IDL Files ( *.idl )"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:154
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT_PNG"
-msgstr "PNG Files ( *.png )"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:107
-msgid "TOOLS_BUT_CLOSE"
-msgstr "&Close"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:113
-msgid "TOOLS_BUT_OK"
-msgstr "&Ok"
-
-msgid "TOOLS_BUT_BROWSE"
-msgstr "Browse..."
-
-msgid "TOOLS_BUT_APPLY"
-msgstr "&Apply"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:53
-msgid "TOOLS_WRN_WARNING"
-msgstr "Warning"
-
-msgid "TOOLS_ERR_ERROR"
-msgstr "Error"
-
-msgid "TOOLS_ERR_FILE_NOT_EXIST"
-msgstr "%1\nFile doesn't exist"
index 91c40434fbda950fab9614efac584b55fe0da744..5bc21d2f421a3aa47e77f4e605da5244fe48f0e1 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
     <message>
@@ -98,7 +77,7 @@ File doesn&apos;t exist</translation>
     </message>
     <message>
         <source>TOOLS_COMP_USERNAME</source>
-        <translation>UserName : </translation>
+        <translation>User name : </translation>
     </message>
     <message>
         <source>TOOLS_CATALOG_GENERATOR</source>
@@ -125,4 +104,119 @@ File doesn&apos;t exist</translation>
         <translation>IDL : </translation>
     </message>
 </context>
+<context>
+    <name>ToolsGUI_RegWidget</name>
+    <message>
+        <source>TLT_REFRESH_INTERVAL</source>
+        <translation>Refresh Interval</translation>
+    </message>
+    <message>
+        <source>LAB_REFRESH_INTERVAL</source>
+        <translation>New refresh interval (in seconds)</translation>
+    </message>
+    <message>
+        <source>TLT_REGISTRY</source>
+        <translation>Registry</translation>
+    </message>
+    <message>
+        <source>MNU_ACTIONS</source>
+        <translation>Actions</translation>
+    </message>
+    <message>
+        <source>TB_ACTIONS</source>
+        <translation>Actions</translation>
+    </message>
+    <message>
+        <source>MEN_REFRESH</source>
+        <translation>Refresh</translation>
+    </message>
+    <message>
+        <source>STB_REFRESH</source>
+        <translation>Immediately updates list of components</translation>
+    </message>
+    <message>
+        <source>MEN_INTERVAL</source>
+        <translation>Refresh interval...</translation>
+    </message>
+    <message>
+        <source>STB_INTERVAL</source>
+        <translation>Change refresh interval</translation>
+    </message>
+    <message>
+        <source>MEN_CLOSE</source>
+        <translation>Close</translation>
+    </message>
+    <message>
+        <source>STB_CLOSE</source>
+        <translation>Close Registry window</translation>
+    </message>
+    <message>
+        <source>TAB_RUNNING</source>
+        <translation>Running</translation>
+    </message>
+    <message>
+        <source>TAB_HISTORY</source>
+        <translation>History</translation>
+    </message>
+    <message>
+        <source>HDR_COMPONENT</source>
+        <translation>Component</translation>
+    </message>
+    <message>
+        <source>HDR_PID</source>
+        <translation>PID</translation>
+    </message>
+    <message>
+        <source>HDR_USERNAME</source>
+        <translation>User name</translation>
+    </message>
+    <message>
+        <source>HDR_HOSTNAME</source>
+        <translation>Host name</translation>
+    </message>
+    <message>
+        <source>HDR_STARTED</source>
+        <translation>Started</translation>
+    </message>
+    <message>
+        <source>HDR_FINISHED</source>
+        <translation>Finished</translation>
+    </message>
+    <message>
+        <source>HDR_HELLO</source>
+        <translation>Last ping</translation>
+    </message>
+    <message>
+        <source>ERR_NO_REGISTRY</source>
+        <translation>Error: Registry Server is not found</translation>
+    </message>
+    <message>
+        <source>INFO_SERVICE</source>
+        <translation>Service : %1</translation>
+    </message>
+    <message>
+        <source>INFO_PROCESS</source>
+        <translation>Process ( PID : %1 ) on the machine %2 ( ip address : %3 ); launched by the user %4 ( UID : %5 ) in directory %6.</translation>
+    </message>
+    <message>
+        <source>INFO_STARTED</source>
+        <translation>Started : %1</translation>
+    </message>
+    <message>
+        <source>INFO_LAST_PING</source>
+        <translation>Last signal : %1</translation>
+    </message>
+    <message>
+        <source>INFO_FINISHED</source>
+        <translation>Finished : %1</translation>
+    </message>
+    <message>
+        <source>INFO_RUNNING</source>
+        <translation>Still running</translation>
+    </message>
+    <message>
+        <source>INFO_TIME_DIFF</source>
+        <translation>Time on %1 differs from server&apos;s time. The difference is %2 seconds.</translation>
+    </message>
+</context>
 </TS>
index 65a01c533bc7c9f16ff7a561af3fc47b6c71cb71..58fecd67e58f8e80bf3e55f39760d68b9302d4d1 100755 (executable)
@@ -1,36 +1,40 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 #  File   : Makefile.in
 #  Author : Vladimir Klyachin (OCN)
 #  Module : VTKViewer
-
+#
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+EXTRA_DIST += textures
+
 lib_LTLIBRARIES = libVTKViewer.la
 
 salomeinclude_HEADERS =                                \
        VTKViewer.h                             \
        VTKViewer_CellLocationsArray.h          \
        VTKViewer_Actor.h                       \
+       VTKViewer_FramedTextActor.h             \
        VTKViewer_ExtractUnstructuredGrid.h     \
        VTKViewer_ConvexTool.h                  \
        VTKViewer_Filter.h                      \
@@ -48,15 +52,27 @@ salomeinclude_HEADERS =                             \
        VTKViewer_ViewManager.h                 \
        VTKViewer_ViewModel.h                   \
        VTKViewer_ViewWindow.h                  \
-       VTKViewer_Functor.h
+       VTKViewer_Functor.h                     \
+       VTKViewer_ArcBuilder.h                  \
+       VTKViewer_MarkerDef.h                   \
+       VTKViewer_MarkerUtils.h                 \
+       VTKViewer_MarkerWidget.h                \
+       VTKViewer_MarkerDlg.h                   \
+       VTKViewer_PolyDataMapper.h              \
+       VTKViewer_DataSetMapper.h               \
+       VTKViewer_Texture.h                     \
+       VTKViewer_OpenGLRenderer.h              \
+       VTKViewer_CellCenters.h
 
 dist_libVTKViewer_la_SOURCES =                 \
        VTKViewer_CellLocationsArray.cxx        \
        VTKViewer_Actor.cxx                     \
+       VTKViewer_FramedTextActor.cxx           \
        VTKViewer_ExtractUnstructuredGrid.cxx   \
        VTKViewer_Filter.cxx                    \
        VTKViewer_GeometryFilter.cxx            \
        VTKViewer_AppendFilter.cxx              \
+       VTKViewer_Algorithm.cxx                 \
        VTKViewer_InteractorStyle.cxx           \
        VTKViewer_RenderWindow.cxx              \
        VTKViewer_RenderWindowInteractor.cxx    \
@@ -68,17 +84,34 @@ dist_libVTKViewer_la_SOURCES =                      \
        VTKViewer_ViewManager.cxx               \
        VTKViewer_ViewModel.cxx                 \
        VTKViewer_ConvexTool.cxx                \
-       VTKViewer_ViewWindow.cxx                
+       VTKViewer_ViewWindow.cxx                \
+       VTKViewer_ArcBuilder.cxx                \
+       VTKViewer_MarkerUtils.cxx               \
+       VTKViewer_MarkerWidget.cxx              \
+       VTKViewer_MarkerDlg.cxx                 \
+       VTKViewer_PolyDataMapper.cxx            \
+       VTKViewer_DataSetMapper.cxx             \
+       VTKViewer_Texture.cxx                   \
+       VTKViewer_OpenGLRenderer.cxx            \
+       VTKViewer_CellCenters.cxx
 
 MOC_FILES =                                            \
        VTKViewer_RenderWindow_moc.cxx                  \
        VTKViewer_RenderWindowInteractor_moc.cxx        \
        VTKViewer_ViewManager_moc.cxx                   \
        VTKViewer_ViewModel_moc.cxx                     \
-       VTKViewer_ViewWindow_moc.cxx 
-nodist_libVTKViewer_la_SOURCES = $(MOC_FILES)
+       VTKViewer_ViewWindow_moc.cxx                    \
+       VTKViewer_MarkerWidget_moc.cxx                      \
+       VTKViewer_MarkerDlg_moc.cxx
+
+QRC_FILES = \
+       qrc_VTKViewer.cxx
+
+nodist_libVTKViewer_la_SOURCES = $(MOC_FILES) $(QRC_FILES)
 
 dist_salomeres_DATA =                          \
+       resources/vtk_view_anticlockwise.png    \
+       resources/vtk_view_clockwise.png        \
        resources/vtk_view_back.png             \
        resources/vtk_view_bottom.png           \
        resources/vtk_view_camera_dump.png      \
@@ -93,16 +126,28 @@ dist_salomeres_DATA =                              \
        resources/vtk_view_rotate.png           \
        resources/vtk_view_top.png              \
        resources/vtk_view_triedre.png          \
-       resources/vtk_view_zoom.png
+       resources/vtk_view_zoom.png             \
+       resources/marker_1.png                  \
+       resources/marker_2.png                  \
+       resources/marker_3.png                  \
+       resources/marker_4.png                  \
+       resources/marker_5.png                  \
+       resources/marker_6.png                  \
+       resources/marker_7.png                  \
+       resources/marker_8.png                  \
+       resources/marker_9.png
 
 nodist_salomeres_DATA =                \
        VTKViewer_images.qm     \
-       VTKViewer_msg_en.qm
+       VTKViewer_msg_en.qm     \
+       VTKViewer_msg_fr.qm
 
 libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS)      \
        -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libVTKViewer_la_LDFLAGS = $(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS)  \
-       ../Qtx/libqtx.la ../SUIT/libsuit.la
+libVTKViewer_la_LDFLAGS = $(KERNEL_LDFLAGS) $(VTK_LIBS) $(QT_MT_LIBS)           \
+       $(CAS_KERNEL) $(OGL_LIBS) ../Qtx/libqtx.la ../SUIT/libsuit.la
+
+libVTKViewer_la_LIBADD = -lSALOMELocalTrace
 
 # Executable
 
@@ -111,5 +156,6 @@ bin_PROGRAMS = VTKViewer
 dist_VTKViewer_SOURCES = VTKViewer.cxx
 
 VTKViewer_CPPFLAGS = $(libVTKViewer_la_CPPFLAGS)
-VTKViewer_LDADD    = libVTKViewer.la $(libVTKViewer_la_LDFLAGS)
+VTKViewer_LDFLAGS = $(libVTKViewer_la_LDFLAGS)
+VTKViewer_LDADD = libVTKViewer.la $(libVTKViewer_la_LIBADD)
 
index 0c39feb56241ccc06cbf82a9587904912d66a96b..d0b6bfa5198752d015b8090e65859e8ef09470ab 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   :
 //  Author :
-//  Module :
-//  $Header$
-//
+
 #include "VTKViewer_Actor.h"
 #include "VTKViewer_ExtractUnstructuredGrid.h"
 #include "VTKViewer_ConvexTool.h"
index c05da2448d7e48a8d3bf13ff000f07a868acf64d..c7f5efc5f1711897be43ee0689c60c06c1fa8e81 100755 (executable)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_H
 #define VTKVIEWER_H
 
 #ifdef WIN32
-#  ifdef VTKVIEWER_EXPORTS
+#  if defined VTKVIEWER_EXPORTS || defined VTKViewer_EXPORTS
 #    define VTKVIEWER_EXPORT __declspec( dllexport )
 #  else
 #    define VTKVIEWER_EXPORT __declspec( dllimport )
diff --git a/src/VTKViewer/VTKViewer.pro b/src/VTKViewer/VTKViewer.pro
deleted file mode 100644 (file)
index 0d7fb63..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-TEMPLATE = lib
-TARGET = VTKViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-VTKHOME = $$(VTKHOME)
-VTK_INCLUDES = $${VTKHOME}/include/vtk
-
-VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets   -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-INCLUDEPATH += ../../include $${VTK_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${VTK_LIBS} $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32 
-DEFINES += VTKVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS  = VTKViewer.h
-HEADERS += VTKViewer_CellLocationsArray.h
-HEADERS += VTKViewer_Actor.h
-HEADERS += VTKViewer_ExtractUnstructuredGrid.h
-HEADERS += VTKViewer_ConvexTool.h
-HEADERS += VTKViewer_Filter.h
-HEADERS += VTKViewer_GeometryFilter.h
-HEADERS += VTKViewer_AppendFilter.h
-HEADERS += VTKViewer_Algorithm.h
-HEADERS += VTKViewer_InteractorStyle.h
-HEADERS += VTKViewer_RenderWindow.h
-HEADERS += VTKViewer_RenderWindowInteractor.h
-HEADERS += VTKViewer_ShrinkFilter.h
-HEADERS += VTKViewer_TransformFilter.h
-HEADERS += VTKViewer_Transform.h
-HEADERS += VTKViewer_Trihedron.h
-HEADERS += VTKViewer_Utilities.h
-HEADERS += VTKViewer_ViewManager.h
-HEADERS += VTKViewer_ViewModel.h
-HEADERS += VTKViewer_ViewWindow.h
-HEADERS += VTKViewer_Functor.h
-
-SOURCES  = VTKViewer_CellLocationsArray.cxx
-SOURCES += VTKViewer_Actor.cxx
-SOURCES += VTKViewer_ExtractUnstructuredGrid.cxx
-SOURCES += VTKViewer_Filter.cxx
-SOURCES += VTKViewer_GeometryFilter.cxx
-SOURCES += VTKViewer_AppendFilter.cxx
-SOURCES += VTKViewer_InteractorStyle.cxx
-SOURCES += VTKViewer_RenderWindow.cxx
-SOURCES += VTKViewer_RenderWindowInteractor.cxx
-SOURCES += VTKViewer_ShrinkFilter.cxx
-SOURCES += VTKViewer_Transform.cxx
-SOURCES += VTKViewer_TransformFilter.cxx
-SOURCES += VTKViewer_Trihedron.cxx
-SOURCES += VTKViewer_Utilities.cxx
-SOURCES += VTKViewer_ViewManager.cxx
-SOURCES += VTKViewer_ViewModel.cxx
-SOURCES += VTKViewer_ConvexTool.cxx
-SOURCES += VTKViewer_ViewWindow.cxx
-
-TRANSLATIONS = resources/VTKViewer_images.ts \
-               resources/VTKViewer_msg_en.ts
-
-ICONS   = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
index d086127716801013a4ddee98ff470161f2bd670b..624ed1deb6c8b95429868396a59d6dfd0d76059d 100755 (executable)
@@ -1,36 +1,34 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.cxx
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 /*!
   \class SALOME_Actor SALOME_Actor.h
   \brief Abstract class of SALOME Objects in VTK.
 */
 
-
 #include "VTKViewer_Actor.h"
 
 #include "VTKViewer_Transform.h"
 #include <vtkObjectFactory.h>
 #include <vtkDataSetMapper.h>
 #include <vtkPolyDataMapper.h>
-#include <vtkProperty.h>
 #include <vtkRenderer.h>
 #include <vtkPassThroughFilter.h>
 
-using namespace std;
-
 #if defined __GNUC__
   #if __GNUC__ == 2
     #define __GNUC_2__
@@ -66,9 +61,10 @@ vtkStandardNewMacro(VTKViewer_Actor);
 */
 VTKViewer_Actor
 ::VTKViewer_Actor():
+  myOpacity(1.0),
   myIsHighlighted(false),
   myIsPreselected(false),
-  myRepresentation(VTK_SURFACE),
+  myRepresentation(VTKViewer::Representation::Surface),
   myDisplayMode(1),
   myProperty(vtkProperty::New()),
   PreviewProperty(NULL),
@@ -79,7 +75,7 @@ VTKViewer_Actor
   myTransformFilter(VTKViewer_TransformFilter::New())
 {
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                myPolygonOffsetUnits);
+                                                                 myPolygonOffsetUnits);
 
   for(int i = 0; i < 6; i++)
     myPassFilter.push_back(vtkPassThroughFilter::New());
@@ -233,7 +229,7 @@ VTKViewer_Actor
     
     vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                  myPolygonOffsetUnits);
+                                                                   myPolygonOffsetUnits);
     Superclass::Render(ren,m);
     
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
@@ -261,7 +257,7 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units)
+                             vtkFloatingPointType units)
 {
   myPolygonOffsetFactor = factor;
   myPolygonOffsetUnits = units;
@@ -274,7 +270,7 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units)
+                             vtkFloatingPointType& units)
 {
   factor = myPolygonOffsetFactor;
   units = myPolygonOffsetUnits;
@@ -361,9 +357,11 @@ void
 VTKViewer_Actor
 ::SetRepresentation(int theMode) 
 { 
+  using namespace VTKViewer::Representation;
   switch(myRepresentation){
-  case VTK_POINTS : 
-  case VTK_SURFACE : 
+  case Points : 
+  case Surface : 
+  case SurfaceWithEdges :
     myProperty->SetAmbient(GetProperty()->GetAmbient());
     myProperty->SetDiffuse(GetProperty()->GetDiffuse());
     myProperty->SetSpecular(GetProperty()->GetSpecular());
@@ -371,8 +369,9 @@ VTKViewer_Actor
   }    
 
   switch(theMode){
-  case VTK_POINTS : 
-  case VTK_SURFACE : 
+  case Points : 
+  case Surface : 
+  case SurfaceWithEdges :
     GetProperty()->SetAmbient(myProperty->GetAmbient());
     GetProperty()->SetDiffuse(myProperty->GetDiffuse());
     GetProperty()->SetSpecular(myProperty->GetSpecular());
@@ -384,23 +383,24 @@ VTKViewer_Actor
   }
 
   switch(theMode){
-  case 3 : 
+  case Insideframe : 
     myGeomFilter->SetInside(true);
     myGeomFilter->SetWireframeMode(true);
     GetProperty()->SetRepresentation(VTK_WIREFRAME);
     break;
-  case VTK_POINTS : 
+  case Points : 
     GetProperty()->SetPointSize(VTKViewer_POINT_SIZE);  
     GetProperty()->SetRepresentation(theMode);
     myGeomFilter->SetWireframeMode(false);
     myGeomFilter->SetInside(false);
     break;
-  case VTK_WIREFRAME : 
+  case Wireframe : 
     GetProperty()->SetRepresentation(theMode);
     myGeomFilter->SetWireframeMode(true);
     myGeomFilter->SetInside(false);
     break;
-  case VTK_SURFACE : 
+  case Surface : 
+  case SurfaceWithEdges :
     GetProperty()->SetRepresentation(theMode);
     myGeomFilter->SetWireframeMode(false);
     myGeomFilter->SetInside(false);
@@ -578,8 +578,8 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::SetColor(vtkFloatingPointType r,
-          vtkFloatingPointType g,
-          vtkFloatingPointType b)
+           vtkFloatingPointType g,
+           vtkFloatingPointType b)
 {
   GetProperty()->SetColor(r,g,b);
 }
@@ -600,8 +600,8 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::GetColor(vtkFloatingPointType& r,
-          vtkFloatingPointType& g,
-          vtkFloatingPointType& b)
+           vtkFloatingPointType& g,
+           vtkFloatingPointType& b)
 {
   vtkFloatingPointType aColor[3];
   GetProperty()->GetColor(aColor);
@@ -611,6 +611,25 @@ VTKViewer_Actor
 }
 
 
+/*!
+  Change material
+*/
+void
+VTKViewer_Actor
+::SetMaterial(std::vector<vtkProperty*> theProps)
+{
+}
+
+/*!
+  Get current material
+*/
+vtkProperty* 
+VTKViewer_Actor
+::GetMaterial()
+{
+  return NULL;
+}
+
 /*!
   \return display mode
 */
@@ -653,6 +672,16 @@ VTKViewer_Actor
   return myIsHighlighted; 
 }
 
+/*!
+  \return true if the VTKViewer_Actor is already preselected
+*/
+bool
+VTKViewer_Actor
+::isPreselected() 
+{ 
+  return myIsPreselected; 
+}
+
 /*!
   Set preselection mode
 */
@@ -673,4 +702,41 @@ VTKViewer_Actor
   myIsHighlighted = theIsHighlight; 
 }
 
+/*!
+ * On/Off representation 2D quadratic element as arked polygon
+ */
+void VTKViewer_Actor::SetQuadraticArcMode(bool theFlag){
+  myGeomFilter->SetQuadraticArcMode(theFlag);
+}
+
+/*!
+ * Return true if 2D quadratic element displayed as arked polygon
+ */
+bool VTKViewer_Actor::GetQuadraticArcMode() const{
+  return myGeomFilter->GetQuadraticArcMode();
+}
+/*!
+ * Set Max angle for representation 2D quadratic element as arked polygon
+ */
+void VTKViewer_Actor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+  myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
+}
+
+/*!
+ * Return Max angle of the representation 2D quadratic element as arked polygon
+ */
+vtkFloatingPointType VTKViewer_Actor::GetQuadraticArcAngle() const{
+  return myGeomFilter->GetQuadraticArcAngle();
+}
+
+/*!
+ * Return pointer to the dataset, which used to calculation of the bounding box of the actor.
+ * By default it is the input dataset.
+ */
+vtkDataSet* VTKViewer_Actor::GetHighlightedDataSet() {
+  return GetInput();
+}
+
+
+
 vtkCxxSetObjectMacro(VTKViewer_Actor,PreviewProperty,vtkProperty);
index 77e54f2450d71a4559fa1b2f03b4c6b93d6009ec..5a385e56c0b460d6fef2931fbf6457134bd68b0f 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   : SALOME_Actor.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef VTKVIEVER_ACTOR_H
 #define VTKVIEVER_ACTOR_H
 
@@ -34,6 +33,7 @@
 #include <vector>
 
 #include <vtkLODActor.h>
+#include <vtkProperty.h>
 
 class vtkCell;
 class vtkPointPicker;
@@ -51,6 +51,19 @@ class VTKViewer_TransformFilter;
 extern int VTKViewer_POINT_SIZE;
 extern int VTKViewer_LINE_WIDTH;
 
+namespace VTKViewer
+{
+  namespace Representation
+  {
+    typedef int Type;
+    const Type Points = VTK_POINTS;
+    const Type Wireframe = VTK_WIREFRAME;
+    const Type Surface = VTK_SURFACE;
+    const Type Insideframe = Surface + 1;
+    const Type SurfaceWithEdges = Insideframe + 1;
+  }
+}
+
 #ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
@@ -91,21 +104,31 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   virtual
   void
   SetColor(vtkFloatingPointType r,
-          vtkFloatingPointType g,
-          vtkFloatingPointType b);
+           vtkFloatingPointType g,
+           vtkFloatingPointType b);
 
   //! Get current color
   virtual
   void
   GetColor(vtkFloatingPointType& r,
-          vtkFloatingPointType& g,
-          vtkFloatingPointType& b);
+           vtkFloatingPointType& g,
+           vtkFloatingPointType& b);
 
   //! Change color
   virtual
   void
   SetColor(const vtkFloatingPointType theRGB[3]);
 
+  //! Change material
+  virtual
+  void
+  SetMaterial(std::vector<vtkProperty*> theProps);
+
+  //! Get current material
+  virtual
+  vtkProperty* 
+  GetMaterial();
+
   //----------------------------------------------------------------------------
   // For selection mapping purpose
   //! Maps VTK index of a node to corresponding object index
@@ -223,12 +246,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   //! Set ResolveCoincidentTopology parameters
   void
   SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units);
+                             vtkFloatingPointType units);
 
   //! Get current ResolveCoincidentTopology parameters
   void
   GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units);
+                             vtkFloatingPointType& units);
 
   virtual
   void
@@ -287,6 +310,11 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   bool
   isHighlighted();
 
+  //! Ask, if the VTKViewer_Actor is already preselected
+  virtual
+  bool
+  isPreselected();
+
   //! Set preselection mode
   virtual
   void
@@ -301,6 +329,18 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   void
   SetPreviewProperty(vtkProperty* theProperty);
 
+  //----------------------------------------------------------------------------
+  //! Setting for displaying quadratic elements
+  virtual void SetQuadraticArcMode(bool theFlag);
+  virtual bool GetQuadraticArcMode() const;
+
+  virtual void   SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+  virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+
+  //----------------------------------------------------------------------------
+  //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+  virtual vtkDataSet* GetHighlightedDataSet();
+
  protected:
   //----------------------------------------------------------------------------
   bool myIsResolveCoincidentTopology;
index fefcb3a8a3cdf7293ee3467453277b2412647e0e..9b648c0e75115b376267f7d919cb9c8d3deef3e1 100644 (file)
@@ -1,52 +1,79 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_ViewFrame.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef VTKViewer_Algorithm_H
 #define VTKViewer_Algorithm_H
 
+#include "VTKViewer.h"
+
 #include <vtkActorCollection.h>
 
 class vtkActor;
 
 namespace VTK
 {
+  /*!
+   * This object should be used to avoid problems with recurring calls of GetActors() method of the vtkRenderer class.
+   *
+   * Instead of the following instructions:
+   *
+   * vtkRenderer* aRenderer = ...;
+   * vtkActorCollection* anActorCollection = aRenderer->GetActors();
+   * DoSomething( anActorCollection ); // where GetActors() could be called again
+   *
+   * A code like the following should be used:
+   *
+   * vtkRenderer* aRenderer = ...;
+   * vtkActorCollection* anActorCollection = aRenderer->GetActors();
+   * ActorCollectionCopy aCopy( anActorCollection );
+   * DoSomething( aCopy.GetActors() );
+   */
+  struct VTKVIEWER_EXPORT ActorCollectionCopy
+  {
+    vtkActorCollection* myActorCollection;
+
+    ActorCollectionCopy( vtkActorCollection* theActorCollection );
+    ~ActorCollectionCopy();
+
+    vtkActorCollection* GetActors() const;
+  };
+
   /*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor)\n
    * Call method \a theFun(someActor)
    */
     template<typename TActor, typename TFunction>
       TFunction ForEach(vtkActorCollection *theCollection, TFunction theFun)
       {
-       if(theCollection){
-         theCollection->InitTraversal();
-         while(vtkActor *anAct = theCollection->GetNextActor())
-           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
-             theFun(anActor);
-       }
-       return theFun;
+        if(theCollection){
+          theCollection->InitTraversal();
+          while(vtkActor *anAct = theCollection->GetNextActor())
+            if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+              theFun(anActor);
+        }
+        return theFun;
       }
   
     /*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor and \n
@@ -55,17 +82,17 @@ namespace VTK
      */
     template<typename TActor, typename TPredicate, typename TFunction>
       TFunction ForEachIf(vtkActorCollection *theCollection, 
-                         TPredicate thePredicate,
-                         TFunction theFun)
+                          TPredicate thePredicate,
+                          TFunction theFun)
       {
-       if(theCollection){
-         theCollection->InitTraversal();
-         while(vtkActor *anAct = theCollection->GetNextActor())
-           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
-             if(thePredicate(anActor))
-               theFun(anActor);
-       }
-       return theFun;
+        if(theCollection){
+          theCollection->InitTraversal();
+          while(vtkActor *anAct = theCollection->GetNextActor())
+            if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+              if(thePredicate(anActor))
+                theFun(anActor);
+        }
+        return theFun;
       }
   
     /*!Find actor from collection, that can be dynamicaly cast to \a TActor, \n
@@ -75,14 +102,14 @@ namespace VTK
     template<typename TActor, typename TPredicate>
       TActor* Find(vtkActorCollection *theCollection, TPredicate thePredicate)
       {
-       if(theCollection){
-         theCollection->InitTraversal();
-         while(vtkActor *anAct = theCollection->GetNextActor())
-           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
-             if(thePredicate(anActor))
-               return anActor;
-       }
-       return NULL;
+        if(theCollection){
+          theCollection->InitTraversal();
+          while(vtkActor *anAct = theCollection->GetNextActor())
+            if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+              if(thePredicate(anActor))
+                return anActor;
+        }
+        return NULL;
       }
 
 }
index ccde1876d6d497e6e6edd29676e625e945fecd37..cc08f7bad5cde73056b702718d49a6daf9d11e55 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : kernel of SALOME component
 //  File   : VTKViewer_GeometryFilter.cxx
 //  Author : 
-//  Module : SALOME
-//  $Header$
-//
+
 #include "VTKViewer_AppendFilter.h"
 
 #include <vtkCell.h>
@@ -99,9 +98,9 @@ VTKViewer_AppendFilter
 int
 VTKViewer_AppendFilter
 ::RequestData(
-             vtkInformation *request,
-             vtkInformationVector **inputVector,
-             vtkInformationVector *outputVector)
+              vtkInformation *request,
+              vtkInformationVector **inputVector,
+              vtkInformationVector *outputVector)
 {
   int aRet = 0;
   if(GetSharedPointsDataSet())
@@ -146,8 +145,8 @@ namespace
   inline
   vtkIdType
   GetOutputID(vtkIdType theInputID,
-             vtkIdType theInputDataSetID,
-             const VTKViewer_AppendFilter::TVectorIds& theRanges)
+              vtkIdType theInputDataSetID,
+              const VTKViewer_AppendFilter::TVectorIds& theRanges)
   {
     theInputID = theInputDataSetID = -1;
 
@@ -163,7 +162,7 @@ namespace
 vtkIdType
 VTKViewer_AppendFilter
 ::GetPointOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID)
+                   vtkIdType theInputDataSetID)
 {
   if(GetSharedPointsDataSet())
     return theInputID;
@@ -175,7 +174,7 @@ VTKViewer_AppendFilter
 vtkIdType 
 VTKViewer_AppendFilter
 ::GetCellOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID)
+                   vtkIdType theInputDataSetID)
 {
   if(GetSharedPointsDataSet())
     return theInputID;
@@ -188,10 +187,10 @@ namespace
 {
   void
   GetInputID(vtkIdType theOutputID,
-            vtkIdType& theInputID,
-            vtkIdType& theStartID,
-            vtkIdType& theInputDataSetID,
-            const VTKViewer_AppendFilter::TVectorIds& theRanges)
+             vtkIdType& theInputID,
+             vtkIdType& theStartID,
+             vtkIdType& theInputDataSetID,
+             const VTKViewer_AppendFilter::TVectorIds& theRanges)
   {
     theInputID = theStartID = theInputDataSetID = -1;
 
@@ -207,10 +206,10 @@ namespace
     for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){
       vtkIdType aRange = theRanges[aDataSetId];
       if(aRange > theOutputID){
-       theInputID = theOutputID - aStartId;
-       theInputDataSetID = aDataSetId;
-       theStartID = aStartId;
-       break;
+        theInputID = theOutputID - aStartId;
+        theInputDataSetID = aDataSetId;
+        theStartID = aStartId;
+        break;
       }
       aStartId = aRange;
     }
@@ -220,9 +219,9 @@ namespace
 void 
 VTKViewer_AppendFilter
 ::GetPointInputID(vtkIdType theOutputID,
-                 vtkIdType& theInputID,
-                 vtkIdType& theStartID,
-                 vtkIdType& theInputDataSetID)
+                  vtkIdType& theInputID,
+                  vtkIdType& theStartID,
+                  vtkIdType& theInputDataSetID)
 {
   if(GetSharedPointsDataSet()) {
     theStartID = theInputDataSetID = 0;
@@ -231,25 +230,25 @@ VTKViewer_AppendFilter
   }
 
   ::GetInputID(theOutputID,
-              theInputID,
-              theStartID,
-              theInputDataSetID,
-              myNodeRanges);
+               theInputID,
+               theStartID,
+               theInputDataSetID,
+               myNodeRanges);
 }
 
 
 void
 VTKViewer_AppendFilter
 ::GetCellInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID)
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID)
 {
   ::GetInputID(theOutputID,
-              theInputID,
-              theStartID,
-              theInputDataSetID,
-              myCellRanges);
+               theInputID,
+               theStartID,
+               theInputDataSetID,
+               myCellRanges);
 }
 
 
@@ -261,8 +260,8 @@ VTKViewer_AppendFilter
   vtkInformationVector *outputVector)
 {
   int idx;
-  vtkIdType numPts, numCells, newCellId, cellId;
-  vtkCellData *cd;
+  vtkIdType numPts, numCells, cellId;
+  // vtkCellData *cd;
   vtkIdList *ptIds;
   vtkDataSet *ds;
   int numInputs = this->GetNumberOfInputConnections(0);
@@ -320,11 +319,11 @@ VTKViewer_AppendFilter
     if (ds != NULL) {
       
       numCells = ds->GetNumberOfCells(); 
-      cd = ds->GetCellData();
+      // cd = ds->GetCellData();
       // copy cell and cell data
       for (cellId=0; cellId<numCells; cellId++)  {
         ds->GetCellPoints(cellId, ptIds);
-        newCellId = output->InsertNextCell(ds->GetCellType(cellId), ptIds);
+        output->InsertNextCell(ds->GetCellType(cellId), ptIds);
       }
     }
   }
index 9f90c66581f6420fb6b0093469b200672c3f7ff5..3a0e27a4f782afa889983e83edee04a121b9c073 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_APPENDFILTER_H
 #define VTKVIEWER_APPENDFILTER_H
 
@@ -62,23 +63,23 @@ public:
 
   vtkIdType
   GetPointOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID);
+                   vtkIdType theInputDataSetID);
 
   vtkIdType
   GetCellOutputID(vtkIdType theInputID,
-                 vtkIdType theInputDataSetID);
+                  vtkIdType theInputDataSetID);
 
   void 
   GetPointInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID);
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID);
 
   void
   GetCellInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID);
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID);
 
   typedef std::vector<vtkIdType> TVectorIds;
 
index c928d26f1f77b6f3c47791c7d1d11226070cc96d..3780bf26da44e4ac553f53a8729c22233fadfeb0 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
 //  File   :
 //  Author :
-//  Module :
-//  $Header$
-//
+
 #include "VTKViewer_CellLocationsArray.h"
 
 #include <vtkObjectFactory.h>
index 5fad08ef84dec2bf05259a6ecfe5dfeb969812bc..7cfb3e88c72de3d4b987b0b650df81914efb270b 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_CELLLOCATIONS_H
 #define VTKVIEWER_CELLLOCATIONS_H
 
index 96b6bec3384f233676cd7fb4313364525520acd9..3cd96908ab0383d3ae678e06f02e081da56f862b 100644 (file)
@@ -1,25 +1,27 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_ConvexTool.h"
+#include "VTKViewer_GeometryFilter.h"
 
 #include <set>
 #include <map>
@@ -56,8 +58,8 @@ namespace
     vtkFloatingPointType myOrigin[3];
     vtkFloatingPointType myNormal[3];
     TPolygon(const TConnectivities& theConnectivities,
-            vtkFloatingPointType theOrigin[3],
-            vtkFloatingPointType theNormal[3]):
+             vtkFloatingPointType theOrigin[3],
+             vtkFloatingPointType theNormal[3]):
       myConnectivities(theConnectivities)
     {
       myOrigin[0] = theOrigin[0];
@@ -98,7 +100,7 @@ VTKViewer_Triangulator
 vtkPoints*
 VTKViewer_Triangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   myPoints->Reset();
   myPoints->Modified(); // the VTK bug
@@ -151,8 +153,8 @@ VTKViewer_Triangulator
   aCoordDiff[2] = (aBounds[5] - aBounds[4]);
 
   return sqrt(aCoordDiff[0]*aCoordDiff[0] + 
-             aCoordDiff[1]*aCoordDiff[1] + 
-             aCoordDiff[2]*aCoordDiff[2]);
+              aCoordDiff[1]*aCoordDiff[1] + 
+              aCoordDiff[2]*aCoordDiff[2]);
 }
 
 
@@ -160,9 +162,9 @@ VTKViewer_Triangulator
 void 
 VTKViewer_Triangulator
 ::GetCellNeighbors(vtkUnstructuredGrid *theInput,
-                  vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds)
+                   vtkIdType theCellId,
+                   vtkCell* theFace,
+                   vtkIdList* theCellIds)
 {
   myFaceIds->Reset();
   vtkIdList *anIdList = theFace->PointIds;  
@@ -187,16 +189,18 @@ VTKViewer_Triangulator
 bool 
 VTKViewer_Triangulator
 ::Execute(vtkUnstructuredGrid *theInput,
-         vtkCellData* thInputCD,
-         vtkIdType theCellId,
-         int theShowInside,
-         int theAllVisible,
-         const char* theCellsVisibility,
-         vtkPolyData *theOutput,
-         vtkCellData* theOutputCD,
-         int theStoreMapping,
-         std::vector<vtkIdType>& theVTK2ObjIds,
-         bool theIsCheckConvex)
+          vtkCellData* thInputCD,
+          vtkIdType theCellId,
+          int theShowInside,
+          int theAllVisible,
+          int theAppendCoincident3D,
+          const char* theCellsVisibility,
+          vtkPolyData *theOutput,
+          vtkCellData* theOutputCD,
+          int theStoreMapping,
+          std::vector<vtkIdType>& theVTK2ObjIds,
+          std::map< vtkIdType, std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
+          bool theIsCheckConvex)
 {
   vtkPoints *aPoints = InitPoints(theInput, theCellId);
   vtkIdType aNumPts = GetNbOfPoints();
@@ -245,8 +249,9 @@ VTKViewer_Triangulator
     vtkCell* aFace = GetFace(aFaceId);
     
     GetCellNeighbors(theInput, theCellId, aFace, myCellIds);
+    bool process = myCellIds->GetNumberOfIds() <= 0 ? true : theAppendCoincident3D;
     if((!theAllVisible && !theCellsVisibility[myCellIds->GetId(0)]) || 
-       myCellIds->GetNumberOfIds() <= 0 || theShowInside)
+       myCellIds->GetNumberOfIds() <= 0 || theShowInside || process)
     {
       TPointIds aPointIds;
       vtkIdList *anIdList = aFace->PointIds;  
@@ -270,7 +275,7 @@ VTKViewer_Triangulator
 
     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]);
@@ -294,21 +299,21 @@ VTKViewer_Triangulator
       /* To calculate plane normal for face (aFace)
 
 
-       ^ aNormal
-       |     
-       |   ^ aVector01
-       | /
-       /_________> aVector02
+        ^ aNormal
+        |     
+        |   ^ aVector01
+        | /
+        /_________> aVector02
        
       
       */
       vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0],
-                                           aCoord[1][1] - aCoord[0][1],
-                                           aCoord[1][2] - aCoord[0][2] };
+                                            aCoord[1][1] - aCoord[0][1],
+                                            aCoord[1][2] - aCoord[0][2] };
       
       vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0],
-                                           aCoord[2][1] - aCoord[0][1],
-                                           aCoord[2][2] - aCoord[0][2] };
+                                            aCoord[2][1] - aCoord[0][1],
+                                            aCoord[2][2] - aCoord[0][2] };
       
       vtkMath::Normalize(aVector01);
       vtkMath::Normalize(aVector02);
@@ -323,211 +328,211 @@ VTKViewer_Triangulator
       // To calculate bounds of the point set
       vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0};
       {
-       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 aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
-                                                 aPntCoord[1] - aCoord[0][1],
-                                                 aPntCoord[2] - aCoord[0][2] };
-
-         
-         vtkMath::Normalize(aVector0Pnt);
-         
-         vtkFloatingPointType aNormalPnt[3];
-         // calculate aNormalPnt
-         {
-           vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
-           vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
-           if(aCosPnt01<-1)
-             aCosPnt01 = -1;
-           if(aCosPnt01>1)
-             aCosPnt01 = 1;
-           if(aCosPnt02<-1)
-             aCosPnt02 = -1;
-           if(aCosPnt02>1)
-             aCosPnt02 = 1;
-
-           vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
-           vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
-           vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
-
-           /*  check that triangle similar to equilateral triangle
-               AOC or COB ?
-               aVector0Pnt = (OC)
-               aVector01   = (OB)
-               aVector02   = (OA)
-           
-           B
-           ^ aVector01  C     
-           |           ^ aVector0Pnt  
-           |     _____/ 
-           | ___/
-           |/________> aVector02
-           O          A
-           */
-           aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0); 
-           aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
-           
-           // caculate a normal for best triangle
-           if(aDist01 <= aDist02)
-             vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
-           else
-             vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
-
-         }
-         
-         vtkMath::Normalize(aNormalPnt);
-         
-         if(DEBUG_TRIA_EXECUTE)
-           cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
-         
-         vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
-         if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
-         if(fabs(aDist) < aDistEps){
-           aPointIds.insert(aPntId);
-           aCenter[0] += aPntCoord[0];
-           aCenter[1] += aPntCoord[1];
-           aCenter[2] += aPntCoord[2];
-           if(DEBUG_TRIA_EXECUTE) cout  << "; Added = TRUE" << endl;
-         } else {
-           if(DEBUG_TRIA_EXECUTE) cout  << "; Added = FALSE" << endl;
-         }
-       }
-       int aNbPoints = aPointIds.size();
-       aCenter[0] /= aNbPoints;
-       aCenter[1] /= aNbPoints;
-       aCenter[2] /= aNbPoints;
+        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 aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
+                                                  aPntCoord[1] - aCoord[0][1],
+                                                  aPntCoord[2] - aCoord[0][2] };
+
+          
+          vtkMath::Normalize(aVector0Pnt);
+          
+          vtkFloatingPointType aNormalPnt[3];
+          // calculate aNormalPnt
+          {
+            vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
+            vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
+            if(aCosPnt01<-1)
+              aCosPnt01 = -1;
+            if(aCosPnt01>1)
+              aCosPnt01 = 1;
+            if(aCosPnt02<-1)
+              aCosPnt02 = -1;
+            if(aCosPnt02>1)
+              aCosPnt02 = 1;
+
+            vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
+            vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
+            vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
+
+            /*  check that triangle similar to equilateral triangle
+                AOC or COB ?
+                aVector0Pnt = (OC)
+                aVector01   = (OB)
+                aVector02   = (OA)
+            
+            B
+            ^ aVector01  C     
+            |           ^ aVector0Pnt  
+            |     _____/ 
+            | ___/
+            |/________> aVector02
+            O          A
+            */
+            aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0); 
+            aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
+            
+            // caculate a normal for best triangle
+            if(aDist01 <= aDist02)
+              vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
+            else
+              vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
+
+          }
+          
+          vtkMath::Normalize(aNormalPnt);
+          
+          if(DEBUG_TRIA_EXECUTE)
+            cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
+          
+          vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
+          if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
+          if(fabs(aDist) < aDistEps){
+            aPointIds.insert(aPntId);
+            aCenter[0] += aPntCoord[0];
+            aCenter[1] += aPntCoord[1];
+            aCenter[2] += aPntCoord[2];
+            if(DEBUG_TRIA_EXECUTE) cout  << "; Added = TRUE" << endl;
+          } else {
+            if(DEBUG_TRIA_EXECUTE) cout  << "; Added = FALSE" << endl;
+          }
+        }
+        int aNbPoints = aPointIds.size();
+        aCenter[0] /= aNbPoints;
+        aCenter[1] /= aNbPoints;
+        aCenter[2] /= aNbPoints;
       }
       
       //To sinchronize orientation of the cell and its face
       vtkFloatingPointType aVectorC[3] = { aCenter[0] - aCellCenter[0],
-                                          aCenter[1] - aCellCenter[1],
-                                          aCenter[2] - aCellCenter[2] };
+                                           aCenter[1] - aCellCenter[1],
+                                           aCenter[2] - aCellCenter[2] };
       vtkMath::Normalize(aVectorC);
       
       vtkFloatingPointType aDot = vtkMath::Dot(aNormal,aVectorC);
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
-       cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
-       cout<<"\t\taDot = "<<aDot<<"\n";
+        cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+        cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
+        cout<<"\t\taDot = "<<aDot<<"\n";
       }
       if(aDot > 0){
-       aNormal[0] = -aNormal[0];
-       aNormal[1] = -aNormal[1];
-       aNormal[2] = -aNormal[2];
+        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] };
+                                           aCoord[0][1] - aCenter[1],
+                                           aCoord[0][2] - aCenter[2] };
       vtkMath::Normalize(aVector0);
       
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
-       cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
+        cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
+        cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
       }
       
       // To calculate the set of points by face those that belong to the plane
       TFace2PointIds aRemoveFace2PointIds;
       {
-       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()));
-         
-
-         if(DEBUG_TRIA_EXECUTE) {
-           cout << "anIntersection:";
-           TPointIds::iterator aII = anIntersection.begin();
-           for(;aII!=anIntersection.end();aII++)
-             cout << *aII << ",";
-           cout << endl;
-           cout << "anIds         :";
-           TPointIds::const_iterator aIIds = anIds.begin();
-           for(;aIIds!=anIds.end();aIIds++)
-             cout << *aIIds << ",";
-           cout << endl;
-         }
-         if(anIntersection == anIds){
-           aRemoveFace2PointIds.insert(anIds);
-         }
-       }
+        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()));
+          
+
+          if(DEBUG_TRIA_EXECUTE) {
+            cout << "anIntersection:";
+            TPointIds::iterator aII = anIntersection.begin();
+            for(;aII!=anIntersection.end();aII++)
+              cout << *aII << ",";
+            cout << endl;
+            cout << "anIds         :";
+            TPointIds::const_iterator aIIds = anIds.begin();
+            for(;aIIds!=anIds.end();aIIds++)
+              cout << *aIIds << ",";
+            cout << endl;
+          }
+          if(anIntersection == anIds){
+            aRemoveFace2PointIds.insert(anIds);
+          }
+        }
       }
       
       // 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);
-       }
+        TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin();
+        TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end();
+        for(; anIter != anEndIter; anIter++){
+          const TPointIds& anIds = *anIter;
+          aFace2PointIds.erase(anIds);
+        }
       }
       
       // To sort the planar set of the points accrding to the angle
       {
-       typedef std::map<vtkFloatingPointType,vtkIdType> 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);
-         
-         vtkFloatingPointType aCross[3];
-         vtkMath::Cross(aVector,aVector0,aCross);
-         vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
-         bool aGreaterThanPi = aCr < 0;
-         vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
-         vtkFloatingPointType anAngle = 0.0;
-         if(aCosinus >= 1.0){
-           aCosinus = 1.0;
-         } else if (aCosinus <= -1.0){
-           aCosinus = -1.0;
-           anAngle = vtkMath::Pi();
-         } else {
-           anAngle = acos(aCosinus);
-           if(aGreaterThanPi)
-             anAngle = 2*vtkMath::Pi() - anAngle;
-         }
-         
-         if(DEBUG_TRIA_EXECUTE) {
-           cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
-           cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
-           cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
-         }
-         aSortedPointIds[anAngle] = aPntId;
-       }
-
-       if(!aSortedPointIds.empty()){
-         int aNumFacePts = aSortedPointIds.size();
-         ::TConnectivities aConnectivities(aNumFacePts);
-         TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
-         TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
-         if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
-         for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
-           vtkIdType aPntId = anIter->second;
-           aConnectivities[anId] = GetConnectivity(aPntId);
-           if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
-         }
-         if(DEBUG_TRIA_EXECUTE) cout << endl;
-         aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
-       }
+        typedef std::map<vtkFloatingPointType,vtkIdType> 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);
+          
+          vtkFloatingPointType aCross[3];
+          vtkMath::Cross(aVector,aVector0,aCross);
+          vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
+          bool aGreaterThanPi = aCr < 0;
+          vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
+          vtkFloatingPointType anAngle = 0.0;
+          if(aCosinus >= 1.0){
+            aCosinus = 1.0;
+          } else if (aCosinus <= -1.0){
+            aCosinus = -1.0;
+            anAngle = vtkMath::Pi();
+          } else {
+            anAngle = acos(aCosinus);
+            if(aGreaterThanPi)
+              anAngle = 2*vtkMath::Pi() - anAngle;
+          }
+          
+          if(DEBUG_TRIA_EXECUTE) {
+            cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
+            cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
+            cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
+          }
+          aSortedPointIds[anAngle] = aPntId;
+        }
+
+        if(!aSortedPointIds.empty()){
+          int aNumFacePts = aSortedPointIds.size();
+          ::TConnectivities aConnectivities(aNumFacePts);
+          TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
+          TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
+          if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
+          for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
+            vtkIdType aPntId = anIter->second;
+            aConnectivities[anId] = GetConnectivity(aPntId);
+            if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
+          }
+          if(DEBUG_TRIA_EXECUTE) cout << endl;
+          aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
+        }
       }
     }
   }
@@ -542,18 +547,18 @@ VTKViewer_Triangulator
       vtkFloatingPointType* aNormal = aPolygon.myNormal;
       vtkFloatingPointType* anOrigin = aPolygon.myOrigin;
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\taPolygonId = "<<aPolygonId<<"\n";
-       cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
-       cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
+        cout<<"\taPolygonId = "<<aPolygonId<<"\n";
+        cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+        cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
       }
       for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){
-       vtkFloatingPointType aPntCoord[3];
-       vtkIdType anId = GetPointId(aPntId);
-       aPoints->GetPoint(anId,aPntCoord);
-       vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
-       if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
-       if(aDist < -aDistEps)
-         return false;
+        vtkFloatingPointType aPntCoord[3];
+        vtkIdType anId = GetPointId(aPntId);
+        aPoints->GetPoint(anId,aPntCoord);
+        vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
+        if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
+        if(aDist < -aDistEps)
+          return false;
       }
     }
   }
@@ -567,14 +572,14 @@ VTKViewer_Triangulator
       if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<<aPolygonId<<" | ";
       TConnectivities& aConnectivities = aPolygon.myConnectivities;
       if(DEBUG_TRIA_EXECUTE) {
-       for(int i=0;i<aConnectivities.size();i++)
-         cout << aConnectivities[i] << ",";
-       cout << endl;
+        for(int i=0;i<aConnectivities.size();i++)
+          cout << aConnectivities[i] << ",";
+        cout << endl;
       }
       int aNbPoints = aConnectivities.size();
       vtkIdType aNewCellId = theOutput->InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]);
       if(theStoreMapping)
-       theVTK2ObjIds.push_back(theCellId);
+        VTKViewer_GeometryFilter::InsertId( theCellId, VTK_POLYGON, theVTK2ObjIds, theDimension2VTK2ObjIds );
       theOutputCD->CopyData(thInputCD,theCellId,aNewCellId);
     }
   }
@@ -611,7 +616,7 @@ VTKViewer_OrderedTriangulator
 vtkPoints*
 VTKViewer_OrderedTriangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   myBoundaryTris->Reset();
 
@@ -622,14 +627,17 @@ VTKViewer_OrderedTriangulator
 
     vtkFloatingPointType aBounds[6];
     myPoints->GetBounds(aBounds);
-
+    vtkFloatingPointType xSize, ySize, zSize;
+    xSize = aBounds[1] - aBounds[0];
+    ySize = aBounds[3] - aBounds[2];
+    zSize = aBounds[5] - aBounds[4];
     vtkFloatingPointType anAbsoluteCoord[3];
     vtkFloatingPointType aParamentrucCoord[3];
     for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
       myPoints->GetPoint(aPntId, anAbsoluteCoord);
-      aParamentrucCoord[0] = (anAbsoluteCoord[0] - aBounds[0]) / (aBounds[1] - aBounds[0]);
-      aParamentrucCoord[1] = (anAbsoluteCoord[1] - aBounds[2]) / (aBounds[3] - aBounds[2]);
-      aParamentrucCoord[2] = (anAbsoluteCoord[2] - aBounds[4]) / (aBounds[5] - aBounds[4]);
+      aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
+      aParamentrucCoord[1] = ySize==0. ? 0. : ((anAbsoluteCoord[1] - aBounds[2]) / ySize);
+      aParamentrucCoord[2] = zSize==0. ? 0. : ((anAbsoluteCoord[2] - aBounds[4]) / zSize);
       myTriangulator->InsertPoint(aPntId, anAbsoluteCoord, aParamentrucCoord, 0);
     }
 
@@ -709,7 +717,7 @@ VTKViewer_DelaunayTriangulator
 vtkPoints* 
 VTKViewer_DelaunayTriangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId);
 
index 0f4429c2badb3363023fe4f443073305fc0395ec..017a0a70011f97f4793ec8bfc804a4cd1514ed4f 100644 (file)
@@ -1,29 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _VTKViewer_ConvexTool_H
 #define _VTKViewer_ConvexTool_H
 
 #include "VTKViewer.h"
 
+#include <map>
 #include <vector>
 
 #include <vtkSystemIncludes.h>
@@ -52,16 +54,18 @@ class VTKVIEWER_EXPORT 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<vtkIdType>& theVTK2ObjIds,
-         bool theIsCheckConvex);
+          vtkCellData* thInputCD,
+          vtkIdType theCellId,
+          int theShowInside,
+          int theAllVisible,
+          int theAppendCoincident3D,
+          const char* theCellsVisibility,
+          vtkPolyData *theOutput,
+          vtkCellData* theOutputCD,
+          int theStoreMapping,
+          std::vector<vtkIdType>& theVTK2ObjIds,
+          std::map< vtkIdType, std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
+          bool theIsCheckConvex);
 
  private:
   vtkIdList* myCellIds;
@@ -74,7 +78,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator
   virtual
   vtkPoints* 
   InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId);
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -95,9 +99,9 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator
 
   void 
   GetCellNeighbors(vtkUnstructuredGrid *theInput,
-                  vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds);
+                   vtkIdType theCellId,
+                   vtkCell* theFace,
+                   vtkIdList* theCellIds);
 
   vtkIdType 
   GetConnectivity(vtkIdType thePntId);
@@ -121,7 +125,7 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul
   virtual
   vtkPoints* 
   InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId);
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -151,7 +155,7 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   virtual
   vtkPoints* 
   InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId);
+             vtkIdType theCellId);
 
   virtual
   vtkIdType 
index 7cd46041a9c2e26a334a3397709c06dd3394fcb7..25ca840fbd9c749570e77d77842b7c321f72c6b4 100755 (executable)
@@ -1,29 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  VISU CONVERTOR :
-// File:    VISU_ExtractUnstructuredGrid.cxx
+
+// File:    VTKViewer_ExtractUnstructuredGrid.cxx
 // Author:  Alexey PETROV
-// Module : VISU
-//
+
 #include "VTKViewer_ExtractUnstructuredGrid.h"
 #include "VTKViewer_CellLocationsArray.h"
 
 #include <vtkCell.h>
 #include <vtkInformation.h>
 #include <vtkInformationVector.h>
+#include <vtkVersion.h>
 
-using namespace std;
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
+#include "utilities.h"
 
 #if defined __GNUC__
   #if __GNUC__ == 2
@@ -50,6 +44,8 @@ static int MYDEBUG = 0;
   #endif
 #endif
 
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
 vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid);
 
 
@@ -71,6 +67,7 @@ void VTKViewer_ExtractUnstructuredGrid::RegisterCell(vtkIdType theCellId){
 void VTKViewer_ExtractUnstructuredGrid::RegisterCellsWithType(vtkIdType theCellType){
 //  if(0 && MYDEBUG) MESSAGE("RegisterCellsWithType - theCellType = "<<theCellType);
   myCellTypes.insert(theCellType);
+  //MESSAGE("myCellTypes.insert " << theCellType);
   Modified();
 }
 
@@ -85,13 +82,9 @@ vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(int theOutId) const
   if ( myCellIds.empty() && myCellTypes.empty() )
     return theOutId;
 
-  if ( myOut2InId.empty() || theOutId > (int)myOut2InId.size() )
+  if ( theOutId<0 || theOutId >= (int)myOut2InId.size() )
     return -1;
-#if defined __GNUC_2__
   return myOut2InId[theOutId];
-#else
-  return myOut2InId.at(theOutId);
-#endif
 }
 
 vtkIdType VTKViewer_ExtractUnstructuredGrid::GetOutputId(int theInId) const{
@@ -103,14 +96,16 @@ vtkIdType VTKViewer_ExtractUnstructuredGrid::GetOutputId(int theInId) const{
 
 
 inline void InsertCell(vtkUnstructuredGrid *theInput,
-                      vtkCellArray *theConnectivity, 
-                      vtkUnsignedCharArray* theCellTypesArray,
-                      vtkIdType theCellId, 
-                      vtkIdList *theIdList,
-                      bool theStoreMapping,
-                      vtkIdType theOutId, 
-                      VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
-                      VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+                       vtkCellArray *theConnectivity, 
+                       vtkUnsignedCharArray* theCellTypesArray,
+                       vtkIdTypeArray*& theFaces,
+                       vtkIdTypeArray*& theFaceLocations,
+                       vtkIdType theCellId, 
+                       vtkIdList *theIdList,
+                       bool theStoreMapping,
+                       vtkIdType theOutId, 
+                       VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+                       VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
 {
   vtkCell *aCell = theInput->GetCell(theCellId);
   vtkIdList *aPntIds = aCell->GetPointIds();
@@ -119,9 +114,44 @@ inline void InsertCell(vtkUnstructuredGrid *theInput,
   for(vtkIdType i = 0; i < aNbIds; i++){
     theIdList->SetId(i,aPntIds->GetId(i));
   }
-  theConnectivity->InsertNextCell(theIdList);
-
   vtkIdType aCellType = aCell->GetCellType();
+#if VTK_XVERSION > 50700
+  if (aCellType != VTK_POLYHEDRON)
+    {
+#endif
+      theConnectivity->InsertNextCell(theIdList);
+      if (theFaceLocations)
+        theFaceLocations->InsertNextValue(-1);
+#if VTK_XVERSION > 50700
+    }
+  else
+    {
+      //MESSAGE("InsertCell type VTK_POLYHEDRON " << theStoreMapping);
+      if (!theFaces)
+        {
+          theFaces = vtkIdTypeArray::New();
+          theFaces->Allocate(theCellTypesArray->GetSize());
+          theFaceLocations = vtkIdTypeArray::New();
+          theFaceLocations->Allocate(theCellTypesArray->GetSize());
+          // FaceLocations must be padded until the current position
+          for (vtkIdType i = 0; i <= theCellTypesArray->GetMaxId(); i++)
+            {
+              theFaceLocations->InsertNextValue(-1);
+            }
+        }
+      // insert face location
+      theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1);
+
+      // insert cell connectivity and faces stream
+      vtkIdType nfaces;
+      vtkIdType* face;
+      vtkIdType realnpts;
+      theInput->GetFaceStream(theCellId, nfaces, face);
+      vtkUnstructuredGrid::DecomposeAPolyhedronCell(
+          nfaces, face, realnpts, theConnectivity, theFaces);
+    }
+#endif
+
   theCellTypesArray->InsertNextValue(aCellType);
   if(theStoreMapping){
     theOut2InId.push_back(theCellId);
@@ -130,13 +160,13 @@ inline void InsertCell(vtkUnstructuredGrid *theInput,
 }
 
 inline void InsertPointCell(vtkCellArray *theConnectivity, 
-                           vtkUnsignedCharArray* theCellTypesArray,
-                           vtkIdType theCellId, 
-                           vtkIdList *theIdList,
-                           bool theStoreMapping,
-                           vtkIdType theOutId, 
-                           VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
-                           VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+                            vtkUnsignedCharArray* theCellTypesArray,
+                            vtkIdType theCellId,
+                            vtkIdList *theIdList,
+                            bool theStoreMapping,
+                            vtkIdType theOutId, 
+                            VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+                            VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
 {
   theIdList->SetId(0,theCellId);
   theConnectivity->InsertNextCell(theIdList);
@@ -180,16 +210,16 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
     MESSAGE("Execute - myChangeMode = "<<myChangeMode);
   }*/
   if(myExtractionMode == eCells){
-    if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving){
+    if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving)){
       if(vtkIdType aNbElems = anInput->GetNumberOfCells()){
-       if(myStoreMapping) myOut2InId.reserve(aNbElems);
-       anOutput->ShallowCopy(anInput);
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         if(myStoreMapping){
-           myOut2InId.push_back(aCellId);
-           myIn2OutId[aCellId] = anOutId;
-         }
-       }
+        if(myStoreMapping) myOut2InId.reserve(aNbElems);
+        anOutput->ShallowCopy(anInput);
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          if(myStoreMapping){
+            myOut2InId.push_back(aCellId);
+            myIn2OutId[aCellId] = anOutId;
+          }
+        }
       }
     }else{
       vtkIdList *anIdList = vtkIdList::New();
@@ -199,75 +229,83 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
       vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
       aCellTypesArray->SetNumberOfComponents(1);
       aCellTypesArray->Allocate(aNbElems*aCellTypesArray->GetNumberOfComponents());
+
+      vtkIdTypeArray *newFaces = 0;
+      vtkIdTypeArray *newFaceLocations = 0;
+
       if(!myCellIds.empty() && myCellTypes.empty()){
-       if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
-       if(myChangeMode == eAdding){
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           if(myCellIds.find(aCellId) != myCellIds.end()){
-             InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                        myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }else{
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           if(myCellIds.find(aCellId) == myCellIds.end()){
-             InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                        myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }
+        if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
+        if(myChangeMode == eAdding){
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            if(myCellIds.find(aCellId) != myCellIds.end()){
+              InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                         myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }else{
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            if(myCellIds.find(aCellId) == myCellIds.end()){
+              InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                         myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }
       }else if(myCellIds.empty() && !myCellTypes.empty()){
-       if(myChangeMode == eAdding){
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           vtkIdType aType = anInput->GetCellType(aCellId);
-           if(myCellTypes.find(aType) != myCellTypes.end()){
-             InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                        myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }else{
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           vtkIdType aType = anInput->GetCellType(aCellId);
-           if(myCellTypes.find(aType) == myCellTypes.end()){
-             InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                        myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }
+        if(myChangeMode == eAdding){
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            vtkIdType aType = anInput->GetCellType(aCellId);
+            if(myCellTypes.find(aType) != myCellTypes.end()){
+              InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                         myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }else{
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            vtkIdType aType = anInput->GetCellType(aCellId);
+            if(myCellTypes.find(aType) == myCellTypes.end()){
+              InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                         myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }
       }else if(!myCellIds.empty() && !myCellTypes.empty()){
-       if(myChangeMode == eAdding){
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           vtkIdType aType = anInput->GetCellType(aCellId);
-           if(myCellTypes.find(aType) != myCellTypes.end()){
-             if(myCellIds.find(aCellId) != myCellIds.end()){
-               InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                          myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-             }
-           }
-         }
-       }else{
-         for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-           vtkIdType aType = anInput->GetCellType(aCellId);
-           if(myCellTypes.find(aType) == myCellTypes.end()){
-             if(myCellIds.find(aCellId) == myCellIds.end()){
-               InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
-                          myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-             }
-           }
-         }
-       }
+        if(myChangeMode == eAdding){
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            vtkIdType aType = anInput->GetCellType(aCellId);
+            if(myCellTypes.find(aType) != myCellTypes.end()){
+              if(myCellIds.find(aCellId) != myCellIds.end()){
+                InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+              }
+            }
+          }
+        }else{
+          for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+            vtkIdType aType = anInput->GetCellType(aCellId);
+            if(myCellTypes.find(aType) == myCellTypes.end()){
+              if(myCellIds.find(aCellId) == myCellIds.end()){
+                InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+              }
+            }
+          }
+        }
       }
       if((aNbElems = aConnectivity->GetNumberOfCells())){
-       VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
-       aCellLocationsArray->SetNumberOfComponents(1);
-       aCellLocationsArray->SetNumberOfTuples(aNbElems);
-       aConnectivity->InitTraversal();
-       for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
-         aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
-       }
-       anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
-       anOutput->SetPoints(anInput->GetPoints());
-       aCellLocationsArray->Delete();
+        VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+        aCellLocationsArray->SetNumberOfComponents(1);
+        aCellLocationsArray->SetNumberOfTuples(aNbElems);
+        aConnectivity->InitTraversal();
+        for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+          aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
+        }
+#if VTK_XVERSION > 50700
+        anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,newFaceLocations,newFaces);
+#else
+        anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
+        anOutput->SetPoints(anInput->GetPoints());
+        aCellLocationsArray->Delete();
       }
       aCellTypesArray->Delete();
       aConnectivity->Delete();
@@ -282,68 +320,71 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
     vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
     aCellTypesArray->SetNumberOfComponents(1);
     aCellTypesArray->Allocate(aNbElems*aCellTypesArray->GetNumberOfComponents());
-    if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving){
+    // additional condition has been added to treat a case described in IPAL21372
+    // note that it is significant only when myExtractionMode == ePoints
+    if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving) ||
+       !anInput->GetCellTypesArray()){
       if(myStoreMapping) myOut2InId.reserve(aNbElems);
       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-       InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                       myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+        InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                        myStoreMapping,anOutId,myOut2InId,myIn2OutId);
       }
     }else if(!myCellIds.empty() && myCellTypes.empty()){
       if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
       if(myChangeMode == eAdding){
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         if(myCellIds.find(aCellId) != myCellIds.end()){
-           InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          if(myCellIds.find(aCellId) != myCellIds.end()){
+            InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                            myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+          }
+        }
       }else{
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         if(myCellIds.find(aCellId) == myCellIds.end()){
-           InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          if(myCellIds.find(aCellId) == myCellIds.end()){
+            InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                            myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+          }
+        }
       }
     }else if(myCellIds.empty() && !myCellTypes.empty()){
       if(myChangeMode == eAdding){
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         vtkIdType aType = anInput->GetCellType(aCellId);
-         if(myCellTypes.find(aType) != myCellTypes.end()){
-           InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          vtkIdType aType = anInput->GetCellType(aCellId);
+          if(myCellTypes.find(aType) != myCellTypes.end()){
+            InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                            myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+          }
+        }
       }else{
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         vtkIdType aType = anInput->GetCellType(aCellId);
-         if(myCellTypes.find(aType) == myCellTypes.end()){
-           InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                           myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          vtkIdType aType = anInput->GetCellType(aCellId);
+          if(myCellTypes.find(aType) == myCellTypes.end()){
+            InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                            myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+          }
+        }
       }
     }else if(!myCellIds.empty() && !myCellTypes.empty()){
       if(myChangeMode == eAdding){
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         vtkIdType aType = anInput->GetCellType(aCellId);
-         if(myCellTypes.find(aType) != myCellTypes.end()){
-           if(myCellIds.find(aCellId) != myCellIds.end()){
-             InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                             myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          vtkIdType aType = anInput->GetCellType(aCellId);
+          if(myCellTypes.find(aType) != myCellTypes.end()){
+            if(myCellIds.find(aCellId) != myCellIds.end()){
+              InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                              myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }
       }else{
-       for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
-         vtkIdType aType = anInput->GetCellType(aCellId);
-         if(myCellTypes.find(aType) == myCellTypes.end()){
-           if(myCellIds.find(aCellId) == myCellIds.end()){
-             InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
-                             myStoreMapping,anOutId,myOut2InId,myIn2OutId);
-           }
-         }
-       }
+        for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+          vtkIdType aType = anInput->GetCellType(aCellId);
+          if(myCellTypes.find(aType) == myCellTypes.end()){
+            if(myCellIds.find(aCellId) == myCellIds.end()){
+              InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+                              myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+            }
+          }
+        }
       }
     }
     if((aNbElems = aConnectivity->GetNumberOfCells())){
@@ -352,9 +393,13 @@ void VTKViewer_ExtractUnstructuredGrid::Execute()
       aCellLocationsArray->SetNumberOfTuples(aNbElems);
       aConnectivity->InitTraversal();
       for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
-       aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
+        aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
       }
+#if VTK_XVERSION > 50700
+      anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,0, 0);
+#else
       anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
       anOutput->SetPoints(anInput->GetPoints());
       aCellLocationsArray->Delete();
     }
index 8c3b4a7dc5bc3b3545bf0c58274ae654487a6216..4b4330c7670b89988ec9a1746e8b7e05725be79f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
 #define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
 
index ca9907a840137474baebe9e321be0f9837fc8af5..68440897fa5f748e7e33da0898e530e45baf9447 100755 (executable)
@@ -1,31 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VTKViewer_Filter : Filter for VTK viewer
 //  File   : VTKViewer_Filter.cxx
 //  Author : Sergey LITONIN
-//  Module : SALOME
-//
+
 #include "VTKViewer_Filter.h"
-using namespace std;
 
 IMPLEMENT_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared)
 IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, MMgt_TShared)
index 74bcb2041e2639922e8eadc9b4beb1592df695fa..2e23b853336a69cd6a69e0e9de2d3c96e295f6a9 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESHGUI_Filter : Filter for VTK viewer
 //  File   : VTKViewer_Filter.h
 //  Author : Sergey LITONIN
index e1bb57b173b8fe9dc895b51cc8285961e82634b3..3596589e3e9a01ebbc16b38ea58134503b4bebaa 100644 (file)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_ViewFrame.h
 //  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
-//
+
 #ifndef VTKViewer_Functor_H
 #define VTKViewer_Functor_H
 
@@ -43,14 +42,14 @@ namespace VTK
     {}
     void operator()(TActor* theActor)
     {
-           (theActor->*myAction)(myArg);
+            (theActor->*myAction)(myArg);
     }
   };
 
   template<class TActor, class TArg = int> struct TSetVisibility: TSetFunction<TActor,TArg>
   {
     TSetVisibility(TArg theArg): 
-           TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
+            TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
     {}
   };
 }
index c9f40a734dd00ac6d5490479762214f21dc7d7a6..f004c867b576d5e0e545606da561a05e8daf532c 100755 (executable)
@@ -1,42 +1,46 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  SALOME OBJECT : kernel of SALOME component
+
 //  File   : VTKViewer_GeometryFilter.cxx
 //  Author : Michael ZORIN
 //  Module : SALOME
-//  $Header$ 
 //
 #include "VTKViewer_GeometryFilter.h"
 #include "VTKViewer_ConvexTool.h"
+#include "VTKViewer_ArcBuilder.h"
 
 #include <vtkSmartPointer.h>
 #include <vtkCellArray.h>
 #include <vtkCellData.h>
 #include <vtkGenericCell.h>
+#include <vtkHexagonalPrism.h>
 #include <vtkHexahedron.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
 #include <vtkMergePoints.h>
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
 #include <vtkPolyData.h>
+#include <vtkPolygon.h>
 #include <vtkPyramid.h>
 #include <vtkStructuredGrid.h>
 #include <vtkTetra.h>
@@ -44,8 +48,6 @@
 #include <vtkUnstructuredGrid.h>
 #include <vtkVoxel.h>
 #include <vtkWedge.h>
-#include <vtkInformationVector.h>
-#include <vtkInformation.h>
 
 #include <algorithm>
 #include <iterator>
 #include <map>
 #include <set>
 
+#include "utilities.h"
+
 #if defined __GNUC__
   #if __GNUC__ == 2
     #define __GNUC_2__
   #endif
 #endif
 
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
+//#define __MYDEBUG__
 //#define USE_ROBUST_TRIANGULATION
 
 vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$");
 vtkStandardNewMacro(VTKViewer_GeometryFilter);
 
 VTKViewer_GeometryFilter
-::VTKViewer_GeometryFilter(): 
+::VTKViewer_GeometryFilter():
   myShowInside(0),
   myStoreMapping(0),
-  myIsWireframeMode(0)
+  myAppendCoincident3D(0),
+  myIsWireframeMode(0),
+  myIsBuildArc(false),
+  myMaxArcAngle(2)
 {}
 
 
@@ -100,7 +110,7 @@ VTKViewer_GeometryFilter
     {
       return 0;
     }
-  
+
   if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID){
     return this->UnstructuredGridExecute(input, output, outInfo);
   }else
@@ -113,11 +123,11 @@ VTKViewer_GeometryFilter
 int
 VTKViewer_GeometryFilter
 ::UnstructuredGridExecute(
-                         vtkDataSet *dataSetInput,
-                         vtkPolyData *output,
-                         vtkInformation *outInfo)
+                          vtkDataSet *dataSetInput,
+                          vtkPolyData *output,
+                          vtkInformation *outInfo)
 {
-  
+
   vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
   vtkCellArray *Connectivity = input->GetCells();
   // Check input
@@ -137,7 +147,7 @@ VTKViewer_GeometryFilter
   vtkPointData *pd = input->GetPointData();
   vtkCellData *cd = input->GetCellData();
   vtkPointData *outputPD = output->GetPointData();
-  
+
   VTKViewer_OrderedTriangulator anOrderedTriangulator;
   VTKViewer_DelaunayTriangulator aDelaunayTriangulator;
 
@@ -157,13 +167,13 @@ VTKViewer_GeometryFilter
   vtkIdType aNewPts[VTK_CELL_SIZE];
   // ghost cell stuff
   unsigned char  updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
-  unsigned char  *cellGhostLevels = 0;  
-  
+  unsigned char  *cellGhostLevels = 0;
+
   PixelConvert[0] = 0;
   PixelConvert[1] = 1;
   PixelConvert[2] = 3;
   PixelConvert[3] = 2;
-  
+
   vtkDebugMacro(<<"Executing geometry filter for unstructured grid input");
 
   vtkDataArray* temp = 0;
@@ -180,7 +190,7 @@ VTKViewer_GeometryFilter
     {
     cellGhostLevels = ((vtkUnsignedCharArray*)temp)->GetPointer(0);
     }
-  
+
   // Determine nature of what we have to do
   if ( (!this->CellClipping) && (!this->PointClipping) &&
        (!this->ExtentClipping) )
@@ -194,38 +204,43 @@ VTKViewer_GeometryFilter
     cellVis = new char[numCells];
     }
 
-  // Just pass points through, never merge
-  output->SetPoints(input->GetPoints());
+  // Issue 0020115: [CEA 308] Quadratic elements visualization
+  // Fix of remark described in note 0005222 - SIGSEGV
+  vtkPoints* outputPoints = vtkPoints::New();
+  outputPoints->DeepCopy(input->GetPoints());
+  output->SetPoints(outputPoints);
+  outputPoints->Delete();
+
   outputPD->PassData(pd);
 
   outputCD->CopyAllocate(cd,numCells,numCells/2);
 
   output->Allocate(numCells/4+1,numCells);
-  
+
   // Loop over the cells determining what's visible
   if (!allVisible)
     {
-    for (cellId=0, Connectivity->InitTraversal(); 
-         Connectivity->GetNextCell(npts,pts); 
+    for (cellId=0, Connectivity->InitTraversal();
+         Connectivity->GetNextCell(npts,pts);
          cellId++)
       {
       cellVis[cellId] = 1;
-      if ( this->CellClipping && cellId < this->CellMinimum ||
+      if ( ( this->CellClipping && cellId < this->CellMinimum ) ||
            cellId > this->CellMaximum )
         {
         cellVis[cellId] = 0;
         }
       else
         {
-        for (i=0; i < npts; i++) 
+        for (i=0; i < npts; i++)
           {
           x = p->GetPoint(pts[i]);
-          if ( (this->PointClipping && (pts[i] < this->PointMinimum ||
-                                        pts[i] > this->PointMaximum) ) ||
-               (this->ExtentClipping && 
-                (x[0] < this->Extent[0] || x[0] > this->Extent[1] ||
-                 x[1] < this->Extent[2] || x[1] > this->Extent[3] ||
-                 x[2] < this->Extent[4] || x[2] > this->Extent[5] )) )
+          if ( ( ( ( this->PointClipping && (pts[i] < this->PointMinimum ) ) ||
+                                             pts[i] > this->PointMaximum) ) ||
+               ( this->ExtentClipping &&
+                ( x[0] < this->Extent[0] || x[0] > this->Extent[1] ||
+                  x[1] < this->Extent[2] || x[1] > this->Extent[3] ||
+                  x[2] < this->Extent[4] || x[2] > this->Extent[5] )) )
             {
             cellVis[cellId] = 0;
             break;
@@ -234,16 +249,17 @@ VTKViewer_GeometryFilter
         }//if point clipping needs checking
       }//for all cells
     }//if not all visible
-  
+
   // Loop over all cells now that visibility is known
   // (Have to compute visibility first for 3D cell boundarys)
   int progressInterval = numCells/20 + 1;
+  TMapOfVectorId aDimension2VTK2ObjIds;
   if(myStoreMapping){
     myVTK2ObjIds.clear();
     myVTK2ObjIds.reserve(numCells);
   }
-  for (cellId=0, Connectivity->InitTraversal(); 
-       Connectivity->GetNextCell(npts,pts); 
+  for (cellId=0, Connectivity->InitTraversal();
+       Connectivity->GetNextCell(npts,pts);
        cellId++)
     {
     //Progress and abort method support
@@ -258,7 +274,7 @@ VTKViewer_GeometryFilter
       { // Do not create surfaces in outer ghost cells.
       continue;
       }
-    
+
     if (allVisible || cellVis[cellId])  //now if visible extract geometry
       {
       //special code for nonlinear cells - rarely occurs, so right now it
@@ -272,17 +288,17 @@ VTKViewer_GeometryFilter
         case VTK_VERTEX:
         case VTK_POLY_VERTEX:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping){
-           myVTK2ObjIds.push_back(cellId); //apo
-         }
+          if(myStoreMapping){
+            InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+          }
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
-        case VTK_LINE: 
+        case VTK_LINE:
         case VTK_POLY_LINE:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
@@ -290,52 +306,56 @@ VTKViewer_GeometryFilter
         case VTK_QUAD:
         case VTK_POLYGON:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
         case VTK_TRIANGLE_STRIP:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
         case VTK_PIXEL:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
-         outputCD->CopyData(cd,cellId,newCellId);
+          if(myStoreMapping)
+            InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+          outputCD->CopyData(cd,cellId,newCellId);
           break;
-         
-       case VTK_CONVEX_POINT_SET: {
-         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);
-             
-         break;
-       }
+
+        case VTK_CONVEX_POINT_SET: {
+          bool anIsOk = anOrderedTriangulator.Execute(input,
+                                                      cd,
+                                                      cellId,
+                                                      myShowInside,
+                                                      allVisible,
+                                                      myAppendCoincident3D,
+                                                      cellVis,
+                                                      output,
+                                                      outputCD,
+                                                      myStoreMapping,
+                                                      myVTK2ObjIds,
+                                                      aDimension2VTK2ObjIds,
+                                                      true);
+          if(!anIsOk)
+            aDelaunayTriangulator.Execute(input,
+                                          cd,
+                                          cellId,
+                                          myShowInside,
+                                          allVisible,
+                                          myAppendCoincident3D,
+                                          cellVis,
+                                          output,
+                                          outputCD,
+                                          myStoreMapping,
+                                          myVTK2ObjIds,
+                                          aDimension2VTK2ObjIds,
+                                          false);
+
+          break;
+        }
         case VTK_TETRA: {
           for (faceId = 0; faceId < 4; faceId++)
             {
@@ -344,22 +364,23 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
                  (!allVisible && !cellVis[cellIds->GetId(0)]) )
               {
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_VOXEL: {
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -369,22 +390,23 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
             faceIds->InsertNextId(pts[faceVerts[3]]);
-           aCellType = VTK_QUAD;
+            aCellType = VTK_QUAD;
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || 
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
                  (!allVisible && !cellVis[cellIds->GetId(0)]) )
               {
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[PixelConvert[i]]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_HEXAHEDRON: {
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -394,22 +416,23 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
             faceIds->InsertNextId(pts[faceVerts[3]]);
-           aCellType = VTK_QUAD;
+            aCellType = VTK_QUAD;
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
                  (!allVisible && !cellVis[cellIds->GetId(0)]) )
               {
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_WEDGE: {
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -418,28 +441,63 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             if (faceVerts[3] >= 0)
               {
               faceIds->InsertNextId(pts[faceVerts[3]]);
-             aCellType = VTK_QUAD;
+              aCellType = VTK_QUAD;
               numFacePts = 4;
               }
+
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || 
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
                  (!allVisible && !cellVis[cellIds->GetId(0)]) )
               {
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
+        case VTK_HEXAGONAL_PRISM: {
+          for (faceId = 0; faceId < 8; faceId++)
+          {
+            faceVerts = vtkHexagonalPrism::GetFaceArray(faceId);
+            faceIds->Reset();
+            faceIds->InsertNextId(pts[faceVerts[0]]);
+            faceIds->InsertNextId(pts[faceVerts[1]]);
+            faceIds->InsertNextId(pts[faceVerts[2]]);
+            faceIds->InsertNextId(pts[faceVerts[3]]);
+            aCellType = VTK_QUAD;
+            numFacePts = 4;
+            if (faceVerts[5] >= 0)
+            {
+              faceIds->InsertNextId(pts[faceVerts[4]]);
+              faceIds->InsertNextId(pts[faceVerts[5]]);
+              aCellType = VTK_POLYGON;
+              numFacePts = 6;
+            }
+            input->GetCellNeighbors(cellId, faceIds, cellIds);
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
+                 (!allVisible && !cellVis[cellIds->GetId(0)]) )
+            {
+              for ( i=0; i < numFacePts; i++)
+                aNewPts[i] = pts[faceVerts[i]];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+              outputCD->CopyData(cd,cellId,newCellId);
+            }
+            }
+          break;
+        }
         case VTK_PYRAMID: {
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -448,478 +506,570 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             if (faceVerts[3] >= 0)
               {
               faceIds->InsertNextId(pts[faceVerts[3]]);
-             aCellType = VTK_QUAD;
+              aCellType = VTK_QUAD;
               numFacePts = 4;
               }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || 
+            bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+            if ( process || myShowInside ||
                  (!allVisible && !cellVis[cellIds->GetId(0)]) )
               {
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
+
+#if VTK_XVERSION > 50700
+        case VTK_POLYHEDRON:
+          {
+            //MESSAGE("VTK_POLYHEDRON geometry filter");
+            vtkIdType nFaces = 0;
+            vtkIdType* ptIds = 0;
+            int idp = 0;
+            input->GetFaceStream(cellId, nFaces, ptIds);
+            for (faceId = 0; faceId < nFaces; faceId++)
+              {
+                faceIds->Reset();
+                numFacePts = ptIds[idp];
+                //MESSAGE("numFacePts="<< numFacePts);
+                int pt0 = ++idp;
+                for (i = 0; i < numFacePts; i++)
+                  {
+                    //MESSAGE("ptIds[" << idp + i << "]=" << ptIds[idp + i]);
+                    faceIds->InsertNextId(ptIds[idp + i]);
+                  }
+                idp += numFacePts;
+                switch (numFacePts)
+                  {
+                  case 3:
+                    aCellType = VTK_TRIANGLE;
+                    break;
+                  case 4:
+                    aCellType = VTK_QUAD;
+                    break;
+                  default:
+                    aCellType = VTK_POLYGON;
+                    break;
+                  }
+                // TODO understand and fix display of several polyhedrons                
+                input->GetCellNeighbors(cellId, faceIds, cellIds);
+                bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+                if (process || myShowInside
+                    || (!allVisible && !cellVis[cellIds->GetId(0)]))
+                  {
+                    for (i = 0; i < numFacePts; i++)
+                      aNewPts[i] = ptIds[pt0 + i];
+                    newCellId = output->InsertNextCell(aCellType, numFacePts, aNewPts);
+                    if (myStoreMapping)
+                      InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+                    outputCD->CopyData(cd, cellId, newCellId);
+                  }
+              }
+            break;
+          }
+#endif
         //Quadratic cells
         case VTK_QUADRATIC_EDGE:
         case VTK_QUADRATIC_TRIANGLE:
         case VTK_QUADRATIC_QUAD:
+        case VTK_BIQUADRATIC_QUAD:
         case VTK_QUADRATIC_TETRA:
         case VTK_QUADRATIC_HEXAHEDRON:
+        case VTK_TRIQUADRATIC_HEXAHEDRON:
         case VTK_QUADRATIC_WEDGE:
         case VTK_QUADRATIC_PYRAMID:
-         if(!myIsWireframeMode){
-           input->GetCell(cellId,cell);
-           vtkIdList *pts = vtkIdList::New();  
-           vtkPoints *coords = vtkPoints::New();
-           vtkIdList *cellIds = vtkIdList::New();
-           vtkIdType newCellId;
-           
-           if ( cell->GetCellDimension() == 1 ) {
-             aCellType = VTK_LINE;
-             numFacePts = 2;
-             cell->Triangulate(0,pts,coords);
-             for (i=0; i < pts->GetNumberOfIds(); i+=2) {
-               aNewPts[0] = pts->GetId(i);
-               aNewPts[1] = pts->GetId(i+1);
-               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-               if(myStoreMapping)
-                 myVTK2ObjIds.push_back(cellId);
-               outputCD->CopyData(cd,cellId,newCellId);
+          if(!myIsWireframeMode) {
+            input->GetCell(cellId,cell);
+            vtkIdList *lpts = vtkIdList::New();
+            vtkPoints *coords = vtkPoints::New();
+            vtkIdList *cellIds = vtkIdList::New();
+            vtkIdType newCellId;
+
+            if ( cell->GetCellDimension() == 1 ) {
+              vtkIdType arcResult = -1;
+              if(myIsBuildArc) {
+                arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle);
+                newCellId = arcResult;
+              }
+
+              if(!myIsBuildArc || arcResult == -1 ) {
+                aCellType = VTK_LINE;
+                numFacePts = 2;
+                cell->Triangulate(0,lpts,coords);
+                for (i=0; i < lpts->GetNumberOfIds(); i+=2) {
+                  aNewPts[0] = lpts->GetId(i);
+                  aNewPts[1] = lpts->GetId(i+1);
+                  newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                  if(myStoreMapping)
+                    InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+                  outputCD->CopyData(cd,cellId,newCellId);
+                }
+              }
+              else {
+                if(myStoreMapping)
+                  InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+                outputCD->CopyData(cd,cellId,newCellId);
               }
             }
-           else if ( cell->GetCellDimension() == 2 ) {
-             aCellType = VTK_TRIANGLE;
-             numFacePts = 3;
-             cell->Triangulate(0,pts,coords);
-             for (i=0; i < pts->GetNumberOfIds(); i+=3) {
-               aNewPts[0] = pts->GetId(i);
-               aNewPts[1] = pts->GetId(i+1);
-               aNewPts[2] = pts->GetId(i+2);
-               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-               if(myStoreMapping)
-                 myVTK2ObjIds.push_back(cellId);
-               outputCD->CopyData(cd,cellId,newCellId);
+            else if ( cell->GetCellDimension() == 2 ) {
+              if(!myIsBuildArc) {
+                aCellType = VTK_TRIANGLE;
+                numFacePts = 3;
+                cell->Triangulate(0,lpts,coords);
+                for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
+                  aNewPts[0] = lpts->GetId(i);
+                  aNewPts[1] = lpts->GetId(i+1);
+                  aNewPts[2] = lpts->GetId(i+2);
+                  newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                  if(myStoreMapping)
+                    InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+                  outputCD->CopyData(cd,cellId,newCellId);
+                }
               }
-            } 
-           else //3D nonlinear cell
+              else{
+                BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds,true);
+              }
+            }
+            else //3D nonlinear cell
             {
-             aCellType = VTK_TRIANGLE;
-             numFacePts = 3;
-             for (int j=0; j < cell->GetNumberOfFaces(); j++){
-               vtkCell *face = cell->GetFace(j);
-               input->GetCellNeighbors(cellId, face->PointIds, cellIds);
-               if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ) {
-                 face->Triangulate(0,pts,coords);
-                 for (i=0; i < pts->GetNumberOfIds(); i+=3) {
-                   aNewPts[0] = pts->GetId(i);
-                   aNewPts[1] = pts->GetId(i+1);
-                   aNewPts[2] = pts->GetId(i+2);
-                   newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-                   if(myStoreMapping)
-                     myVTK2ObjIds.push_back(cellId);
-                   outputCD->CopyData(cd,cellId,newCellId);
+              aCellType = VTK_TRIANGLE;
+              numFacePts = 3;
+              for (int j=0; j < cell->GetNumberOfFaces(); j++){
+                vtkCell *face = cell->GetFace(j);
+                input->GetCellNeighbors(cellId, face->PointIds, cellIds);
+                bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+                if ( process || myShowInside ) {
+                  face->Triangulate(0,lpts,coords);
+                  for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
+                    aNewPts[0] = lpts->GetId(i);
+                    aNewPts[1] = lpts->GetId(i+1);
+                    aNewPts[2] = lpts->GetId(i+2);
+                    newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                    if(myStoreMapping)
+                      InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+                    outputCD->CopyData(cd,cellId,newCellId);
                   }
                 }
               }
-            } //3d cell
-           cellIds->Delete();
-           coords->Delete();
-           pts->Delete();
-           break;
-          }else{
-           switch(aCellType){
-           case VTK_QUADRATIC_EDGE: {
-             aCellType = VTK_POLY_LINE;
-             numFacePts = 3;
-             
-             aNewPts[0] = pts[0];
-             aNewPts[2] = pts[1];
-             aNewPts[1] = pts[2];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             break;
-           }
-           case VTK_QUADRATIC_TRIANGLE: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 6;
-             
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[3];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[4];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[5];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             break;
-           }
-           case VTK_QUADRATIC_QUAD: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 8;
-             
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[4];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[5];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[6];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[7];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             break;
-           }
-           case VTK_QUADRATIC_TETRA: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 6;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[4];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[5];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[7];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[8];
-             aNewPts[4] = pts[1];
-             aNewPts[5] = pts[4];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[9];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[5];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[7];
-             aNewPts[4] = pts[0];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             break;
-           }
+            } //3d nonlinear cell
+            cellIds->Delete();
+            coords->Delete();
+            lpts->Delete();
+            break;
+          } else { // wireframe
+            switch(aCellType) {
+            case VTK_QUADRATIC_EDGE: {
+              vtkIdType arcResult =-1;
+              if(myIsBuildArc) {
+               arcResult = Build1DArc(cellId, input, output, pts,myMaxArcAngle);
+               newCellId = arcResult;
+              }
+              if(!myIsBuildArc || arcResult == -1) {
+                aCellType = VTK_POLY_LINE;
+                numFacePts = 3;
+
+                aNewPts[0] = pts[0];
+                aNewPts[2] = pts[1];
+                aNewPts[1] = pts[2];
+
+                newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              }
+
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+              break;
+            }
+            case VTK_QUADRATIC_TRIANGLE: {
+              if(!myIsBuildArc) {
+                aCellType = VTK_POLYGON;
+                numFacePts = 6;
+
+                aNewPts[0] = pts[0];
+                aNewPts[1] = pts[3];
+                aNewPts[2] = pts[1];
+                aNewPts[3] = pts[4];
+                aNewPts[4] = pts[2];
+                aNewPts[5] = pts[5];
+
+                newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                if(myStoreMapping)
+                  InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+                outputCD->CopyData(cd,cellId,newCellId);
+              }
+              else
+                BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds);
+              break;
+            }
+            case VTK_BIQUADRATIC_QUAD:
+            case VTK_QUADRATIC_QUAD: {
+              if(!myIsBuildArc) {
+                aCellType = VTK_POLYGON;
+                numFacePts = 8;
+
+                aNewPts[0] = pts[0];
+                aNewPts[1] = pts[4];
+                aNewPts[2] = pts[1];
+                aNewPts[3] = pts[5];
+                aNewPts[4] = pts[2];
+                aNewPts[5] = pts[6];
+                aNewPts[6] = pts[3];
+                aNewPts[7] = pts[7];
+
+                newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                if(myStoreMapping)
+                  InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+                outputCD->CopyData(cd,cellId,newCellId);
+              }
+              else
+                BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds);
+              break;
+            }
+            case VTK_QUADRATIC_TETRA: {
+              aCellType = VTK_POLYGON;
+              numFacePts = 6;
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[4];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[5];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[6];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[7];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[8];
+              aNewPts[4] = pts[1];
+              aNewPts[5] = pts[4];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[9];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[5];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[7];
+              aNewPts[4] = pts[0];
+              aNewPts[5] = pts[6];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              break;
+            }
             case VTK_QUADRATIC_WEDGE: {
               aCellType = VTK_POLYGON;
-             numFacePts = 6;
+              numFacePts = 6;
               //---------------------------------------------------------------
               //Face 1
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[6];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[7];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[8];
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[6];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[7];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[8];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
-              
+
               //---------------------------------------------------------------
               //Face 2
               aNewPts[0] = pts[3];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[10];
-             aNewPts[4] = pts[5];
-             aNewPts[5] = pts[11];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[10];
+              aNewPts[4] = pts[5];
+              aNewPts[5] = pts[11];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
-              
+
               //---------------------------------------------------------------
               //Face 3
               numFacePts = 8;
               aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[2];
-             aNewPts[3] = pts[14];
-             aNewPts[4] = pts[5];
-             aNewPts[5] = pts[11];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[12];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[2];
+              aNewPts[3] = pts[14];
+              aNewPts[4] = pts[5];
+              aNewPts[5] = pts[11];
+              aNewPts[6] = pts[3];
+              aNewPts[7] = pts[12];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
 
               //---------------------------------------------------------------
               //Face 4
               aNewPts[0] = pts[1];
-             aNewPts[1] = pts[13];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[10];
-             aNewPts[4] = pts[5];
-             aNewPts[5] = pts[14];
-             aNewPts[6] = pts[2];
-             aNewPts[7] = pts[7];
+              aNewPts[1] = pts[13];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[10];
+              aNewPts[4] = pts[5];
+              aNewPts[5] = pts[14];
+              aNewPts[6] = pts[2];
+              aNewPts[7] = pts[7];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
 
               //---------------------------------------------------------------
               //Face 5
               aNewPts[0] = pts[0];
-             aNewPts[1] = pts[12];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[9];
-             aNewPts[4] = pts[4];
-             aNewPts[5] = pts[13];
+              aNewPts[1] = pts[12];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[9];
+              aNewPts[4] = pts[4];
+              aNewPts[5] = pts[13];
               aNewPts[6] = pts[1];
               aNewPts[7] = pts[6];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
               outputCD->CopyData(cd,cellId,newCellId);
               break;
             }
-           case VTK_QUADRATIC_HEXAHEDRON: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 8;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[17];
-             aNewPts[4] = pts[5];
-             aNewPts[5] = pts[12];
-             aNewPts[6] = pts[4];
-             aNewPts[7] = pts[16];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[2];
-             aNewPts[3] = pts[18];
-             aNewPts[4] = pts[6];
-             aNewPts[5] = pts[13];
-             aNewPts[6] = pts[5];
-             aNewPts[7] = pts[17];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[10];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[19];
-             aNewPts[4] = pts[7];
-             aNewPts[5] = pts[14];
-             aNewPts[6] = pts[6];
-             aNewPts[7] = pts[18];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[3];
-             aNewPts[1] = pts[11];
-             aNewPts[2] = pts[0];
-             aNewPts[3] = pts[16];
-             aNewPts[4] = pts[4];
-             aNewPts[5] = pts[15];
-             aNewPts[6] = pts[7];
-             aNewPts[7] = pts[19];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[9];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[10];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[11];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[4];
-             aNewPts[1] = pts[12];
-             aNewPts[2] = pts[5];
-             aNewPts[3] = pts[13];
-             aNewPts[4] = pts[6];
-             aNewPts[5] = pts[14];
-             aNewPts[6] = pts[7];
-             aNewPts[7] = pts[15];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             break;
-           }
-           case VTK_QUADRATIC_PYRAMID: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 6;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[12];
-             aNewPts[4] = pts[4];
-             aNewPts[5] = pts[9];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[10];
-             aNewPts[4] = pts[1];
-             aNewPts[5] = pts[5];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[10];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[11];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[11];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[12];
-             aNewPts[4] = pts[3];
-             aNewPts[5] = pts[7];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
+            case VTK_TRIQUADRATIC_HEXAHEDRON:
+            case VTK_QUADRATIC_HEXAHEDRON: {
+              aCellType = VTK_POLYGON;
               numFacePts = 8;
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[5];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[6];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[7];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[8];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             break;
-           }}
-         }
-       } //switch
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[17];
+              aNewPts[4] = pts[5];
+              aNewPts[5] = pts[12];
+              aNewPts[6] = pts[4];
+              aNewPts[7] = pts[16];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[2];
+              aNewPts[3] = pts[18];
+              aNewPts[4] = pts[6];
+              aNewPts[5] = pts[13];
+              aNewPts[6] = pts[5];
+              aNewPts[7] = pts[17];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[10];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[19];
+              aNewPts[4] = pts[7];
+              aNewPts[5] = pts[14];
+              aNewPts[6] = pts[6];
+              aNewPts[7] = pts[18];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[3];
+              aNewPts[1] = pts[11];
+              aNewPts[2] = pts[0];
+              aNewPts[3] = pts[16];
+              aNewPts[4] = pts[4];
+              aNewPts[5] = pts[15];
+              aNewPts[6] = pts[7];
+              aNewPts[7] = pts[19];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[9];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[10];
+              aNewPts[6] = pts[3];
+              aNewPts[7] = pts[11];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[4];
+              aNewPts[1] = pts[12];
+              aNewPts[2] = pts[5];
+              aNewPts[3] = pts[13];
+              aNewPts[4] = pts[6];
+              aNewPts[5] = pts[14];
+              aNewPts[6] = pts[7];
+              aNewPts[7] = pts[15];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              break;
+            }
+            case VTK_QUADRATIC_PYRAMID: {
+              aCellType = VTK_POLYGON;
+              numFacePts = 6;
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[12];
+              aNewPts[4] = pts[4];
+              aNewPts[5] = pts[9];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[10];
+              aNewPts[4] = pts[1];
+              aNewPts[5] = pts[5];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[10];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[11];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[6];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[11];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[12];
+              aNewPts[4] = pts[3];
+              aNewPts[5] = pts[7];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              numFacePts = 8;
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[5];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[6];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[7];
+              aNewPts[6] = pts[3];
+              aNewPts[7] = pts[8];
+
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              break;
+            } // case VTK_QUADRATIC_PYRAMID:
+            } // switch by type
+          } // end WIREFRAME
+          break;
+        } //switch
       } //if visible
     } //for all cells
-  
+
   output->Squeeze();
 
   vtkDebugMacro(<<"Extracted " << input->GetNumberOfPoints() << " points,"
-  << output->GetNumberOfCells() << " cells.");
+                << output->GetNumberOfCells() << " cells.");
 
   cell->Delete();
 
@@ -927,19 +1077,71 @@ VTKViewer_GeometryFilter
   faceIds->Delete();
 
   if ( cellVis )
-    {
+  {
     delete [] cellVis;
+  }
+
+  // to sort myVTK2ObjIds vector by cell dimension (ascending)
+  if( myStoreMapping && !aDimension2VTK2ObjIds.empty() )
+  {
+    myVTK2ObjIds.clear();
+    for( vtkIdType aDimension = 0; aDimension <= 2; aDimension++ )
+    {
+      TMapOfVectorId::const_iterator anIter = aDimension2VTK2ObjIds.find( aDimension );
+      if( anIter != aDimension2VTK2ObjIds.end() )
+      {
+        const TVectorId& aCellIds = anIter->second;
+        TVectorId::const_iterator anIdIter, anIdIterEnd = aCellIds.end();
+        for( anIdIter = aCellIds.begin(); anIdIter != anIdIterEnd; anIdIter++ )
+        {
+          const vtkIdType aCellId = *anIdIter;
+          myVTK2ObjIds.push_back( aCellId );
+        }
+      }
     }
+  }
 
   return 1;
 }
 
+void
+VTKViewer_GeometryFilter
+::InsertId( const vtkIdType theCellId,
+            const vtkIdType theCellType,
+            TVectorId& theVTK2ObjIds,
+            TMapOfVectorId& theDimension2VTK2ObjIds )
+{
+  theVTK2ObjIds.push_back( theCellId );
+
+  int aDimension = 0;
+  switch( theCellType )
+  {
+    case VTK_VERTEX:
+    case VTK_POLY_VERTEX:
+      aDimension = 0;
+      break;
+    case VTK_LINE:
+    case VTK_POLY_LINE:
+      aDimension = 1;
+      break;
+    case VTK_TRIANGLE:
+    case VTK_TRIANGLE_STRIP:
+    case VTK_POLYGON:
+    case VTK_PIXEL:
+    case VTK_QUAD:
+      aDimension = 2;
+      break;
+  }
+
+  TVectorId& aCellIds = theDimension2VTK2ObjIds[ aDimension ];
+  aCellIds.push_back( theCellId );
+}
 
 void
 VTKViewer_GeometryFilter
 ::SetInside(int theShowInside)
 {
-  if(myShowInside == theShowInside) 
+  if(myShowInside == theShowInside)
     return;
 
   myShowInside = theShowInside;
@@ -954,7 +1156,7 @@ VTKViewer_GeometryFilter
 }
 
 
-void 
+void
 VTKViewer_GeometryFilter
 ::SetWireframeMode(int theIsWireframeMode)
 {
@@ -977,7 +1179,7 @@ void
 VTKViewer_GeometryFilter
 ::SetStoreMapping(int theStoreMapping)
 {
-  if(myStoreMapping == theStoreMapping) 
+  if(myStoreMapping == theStoreMapping)
     return;
 
   myStoreMapping = theStoreMapping;
@@ -994,11 +1196,208 @@ VTKViewer_GeometryFilter
 
 vtkIdType VTKViewer_GeometryFilter::GetElemObjId( int theVtkID )
 {
-  if( myVTK2ObjIds.empty() || theVtkID > (int)myVTK2ObjIds.size() )
+  if( theVtkID < 0 || theVtkID >= (int)myVTK2ObjIds.size() )
     return -1;
-#if defined __GNUC_2__
   return myVTK2ObjIds[theVtkID];
-#else
-  return myVTK2ObjIds.at(theVtkID);
+}
+
+
+void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
+                                                 vtkUnstructuredGrid* input,
+                                                 vtkPolyData *output,
+                                                 TMapOfVectorId& theDimension2VTK2ObjIds,
+                                                 bool triangulate){
+  vtkIdType aCellType = VTK_POLYGON;
+  vtkIdType *aNewPoints = NULL;
+  vtkIdType aNbPoints = 0;
+  vtkIdType newCellId;
+
+  //Input and output cell data
+  vtkCellData *cd = input->GetCellData();
+  vtkCellData *outputCD = output->GetCellData();
+
+  //Input and output scalars on point data
+  vtkDataArray* inputScalars = input->GetPointData()->GetScalars();
+  vtkDataArray* outputScalars = output->GetPointData()->GetScalars();
+
+  std::vector<vtkPoints*> aCollection;
+  std::vector< std::vector<double> > aScalarCollection;
+
+  vtkCell* aCell = input->GetCell(cellId);
+  switch(aCell->GetCellType()) {
+    case VTK_QUADRATIC_TRIANGLE:
+    {
+      //Get All points from input cell
+      Pnt P0 = CreatePnt( aCell, inputScalars, 0 );
+      Pnt P1 = CreatePnt( aCell, inputScalars, 1 );
+      Pnt P2 = CreatePnt( aCell, inputScalars, 2 );
+      Pnt P3 = CreatePnt( aCell, inputScalars, 3 );
+      Pnt P4 = CreatePnt( aCell, inputScalars, 4 );
+      Pnt P5 = CreatePnt( aCell, inputScalars, 5 );
+
+      VTKViewer_ArcBuilder aBuilder1(P0,P3,P1,myMaxArcAngle); //Build arc using 0, 3 and 1 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 1 " << ( aBuilder1.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      VTKViewer_ArcBuilder aBuilder2(P1,P4,P2,myMaxArcAngle); //Build arc using 1, 4 and 2 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 2 " << ( aBuilder2.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      VTKViewer_ArcBuilder aBuilder3(P2,P5,P0,myMaxArcAngle); //Build arc using 2, 5 and 0 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 3 " << ( aBuilder3.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      aCollection.push_back(aBuilder1.GetPoints());
+      aCollection.push_back(aBuilder2.GetPoints());
+      aCollection.push_back(aBuilder3.GetPoints());
+
+      aScalarCollection.push_back(aBuilder1.GetScalarValues());
+      aScalarCollection.push_back(aBuilder2.GetScalarValues());
+      aScalarCollection.push_back(aBuilder3.GetScalarValues());
+      break;
+    }
+    case VTK_BIQUADRATIC_QUAD:
+    case VTK_QUADRATIC_QUAD:
+    {
+      //Get All points from input cell
+      Pnt P0 = CreatePnt( aCell, inputScalars, 0 );
+      Pnt P1 = CreatePnt( aCell, inputScalars, 1 );
+      Pnt P2 = CreatePnt( aCell, inputScalars, 2 );
+      Pnt P3 = CreatePnt( aCell, inputScalars, 3 );
+      Pnt P4 = CreatePnt( aCell, inputScalars, 4 );
+      Pnt P5 = CreatePnt( aCell, inputScalars, 5 );
+      Pnt P6 = CreatePnt( aCell, inputScalars, 6 );
+      Pnt P7 = CreatePnt( aCell, inputScalars, 7 );
+
+      VTKViewer_ArcBuilder aBuilder1(P0,P4,P1,myMaxArcAngle); //Build arc using 0, 4 and 1 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 1 " << ( aBuilder1.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
 #endif
+
+      VTKViewer_ArcBuilder aBuilder2(P1,P5,P2,myMaxArcAngle); //Build arc using 1, 5 and 2 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 2 " << ( aBuilder2.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      VTKViewer_ArcBuilder aBuilder3(P2,P6,P3,myMaxArcAngle); //Build arc using 2, 6 and 3 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 3 " << ( aBuilder3.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      VTKViewer_ArcBuilder aBuilder4(P3,P7,P0,myMaxArcAngle); //Build arc using 3, 7 and 0 points
+#ifdef __MYDEBUG__
+      cout << "Quadrangle arc 4 " << ( aBuilder4.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+      aCollection.push_back(aBuilder1.GetPoints());
+      aCollection.push_back(aBuilder2.GetPoints());
+      aCollection.push_back(aBuilder3.GetPoints());
+      aCollection.push_back(aBuilder4.GetPoints());
+
+      aScalarCollection.push_back(aBuilder1.GetScalarValues());
+      aScalarCollection.push_back(aBuilder2.GetScalarValues());
+      aScalarCollection.push_back(aBuilder3.GetScalarValues());
+      aScalarCollection.push_back(aBuilder4.GetScalarValues());
+      break;
+    }
+    default: //Unsupported cell type
+      return;
+  }
+
+  if(triangulate){
+    const vtkIdType numFacePts = 3;
+    vtkIdList *pts = vtkIdList::New();
+    vtkPoints *coords = vtkPoints::New();
+    aCellType = VTK_TRIANGLE;
+    vtkIdType aNewPts[numFacePts];
+    vtkIdType aTriangleId;
+
+    vtkPolygon *aPlg = vtkPolygon::New();
+    std::map<int, double> aPntId2ScalarValue;
+    aNbPoints = MergevtkPoints(aCollection, aScalarCollection, aPlg->GetPoints(), aPntId2ScalarValue, aNewPoints);
+    aPlg->GetPointIds()->SetNumberOfIds(aNbPoints);
+
+    for(vtkIdType i = 0; i < aNbPoints;i++) {
+      aPlg->GetPointIds()->SetId(i, aNewPoints[i]);
+    }
+
+    aPlg->Triangulate(0,pts,coords);
+
+    for (vtkIdType i=0; i < pts->GetNumberOfIds(); i+=3) {
+      aNewPts[0] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i));
+      aNewPts[1] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i+1));
+      aNewPts[2] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i+2));
+
+      if(outputScalars) {
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i)]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+1)]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+2)]);
+      }
+
+      aTriangleId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+
+      if(myStoreMapping)
+        InsertId( cellId, aCellType, myVTK2ObjIds, theDimension2VTK2ObjIds );
+      outputCD->CopyData(cd,cellId,aTriangleId);
+    }
+    pts->Delete();
+    coords->Delete();
+    aPlg->Delete();
+  }
+  else {
+    std::map<int, double> aPntId2ScalarValue;
+    aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
+    if(outputScalars)
+      for(vtkIdType i = 0; i < aNbPoints; i++)
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[aNewPoints[i]]);
+    newCellId = output->InsertNextCell(aCellType,aNbPoints,aNewPoints);
+    outputCD->CopyData(cd,cellId,newCellId);
+
+    if(myStoreMapping)
+      InsertId( cellId, aCellType, myVTK2ObjIds, theDimension2VTK2ObjIds );
+  }
+
+  if (aNewPoints)
+    delete [] aNewPoints;
+}
+
+
+void VTKViewer_GeometryFilter::SetQuadraticArcMode(bool theFlag)
+{
+  if(myIsBuildArc != theFlag) {
+    myIsBuildArc = theFlag;
+    this->Modified();
+  }
+}
+bool VTKViewer_GeometryFilter::GetQuadraticArcMode() const
+{
+  return myIsBuildArc;
+}
+
+void VTKViewer_GeometryFilter::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle)
+{
+  if(myMaxArcAngle != theMaxAngle) {
+    myMaxArcAngle = theMaxAngle;
+    this->Modified();
+  }
+}
+
+vtkFloatingPointType VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const
+{
+  return myMaxArcAngle;
+}
+
+
+int VTKViewer_GeometryFilter::GetAppendCoincident3D() const {
+  return myAppendCoincident3D;
+}
+
+void VTKViewer_GeometryFilter::SetAppendCoincident3D(int theFlag) {
+  if(myAppendCoincident3D != theFlag){
+    myAppendCoincident3D = theFlag;
+    this->Modified();
+  }
 }
index b482eb5af864bb1faa761dc6a376f894a78e5a85..53a36f4e8a9ec5058a24e8a59e8ea5ae2d5fc52c 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_GEOMETRYFILTER_H
 #define VTKVIEWER_GEOMETRYFILTER_H
 
 
 #include <vtkGeometryFilter.h>
 
+#include <map>
 #include <vector>
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
 
+class vtkUnstructuredGrid;
+
 /*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information.
  */
 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter 
@@ -59,6 +63,19 @@ public:
    * \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified().
    * \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable.
    */
+
+  int GetAppendCoincident3D() const;
+  /*! \fn void SetAppendCoincident3D()
+   *  \brief Sets \a myAppendCoincident3D flag. If this flag is true, filter append to the 
+      result data set coincident 3D elements.
+   */
+
+  void SetAppendCoincident3D(int theFlag);
+  /*! \fn int SetAppendCoincident3D()
+   * \brief Return value of \a myAppendCoincident3D
+   * \retval myAppendCoincident3D
+   */
+
   void SetWireframeMode(int theIsWireframeMode);
   /*! \fn int GetWireframeMode()
    * \brief Return value of \a myIsWireframeMode
@@ -86,6 +103,20 @@ public:
    */
   virtual vtkIdType GetElemObjId(int theVtkID);
 
+  virtual void SetQuadraticArcMode(bool theFlag);
+  virtual bool GetQuadraticArcMode() const;
+
+  virtual void   SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+  virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+
+  typedef std::vector<vtkIdType> TVectorId;
+  typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
+
+  static void InsertId( const vtkIdType theCellId,
+                        const vtkIdType theCellType,
+                        TVectorId& theVTK2ObjIds,
+                        TMapOfVectorId& theDimension2VTK2ObjIds );
+
 protected:
   /*! \fn VTKViewer_GeometryFilter();
    * \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0
@@ -104,15 +135,23 @@ protected:
    * \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
    */
   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
-    
-private:
-  typedef std::vector<vtkIdType> TVectorId;
 
+
+  void BuildArcedPolygon(vtkIdType cellId,
+                         vtkUnstructuredGrid* input,
+                         vtkPolyData *output,
+                         TMapOfVectorId& theDimension2VTK2ObjIds,
+                         bool triangulate = false);
+    
 private:
   TVectorId myVTK2ObjIds;
   int       myShowInside;
   int       myStoreMapping;
   int       myIsWireframeMode;
+  int       myAppendCoincident3D;
+
+  vtkFloatingPointType    myMaxArcAngle;   // define max angle for mesh 2D quadratic element in the degrees
+  bool      myIsBuildArc;     // flag for representation 2D quadratic element as arked polygon
 };
 
 #ifdef WIN32
index e69a47edf5092b0bf2fbcbf6685408be5475f217..bc5e342cf86a79946df40e214d8e6442ce34245b 100644 (file)
@@ -1,29 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_InteractorStyle.cxx
 //  Author : Christophe ATTANASIO
-//  Module : SALOME
-//
+
 #include "VTKViewer_InteractorStyle.h"
 
 #include "VTKViewer_Actor.h"
@@ -33,8 +33,6 @@
 #include "VTKViewer_RenderWindow.h"
 #include "VTKViewer_RenderWindowInteractor.h"
 
-//#include "SALOME_Actor.h"
-
 #include <vtkObjectFactory.h>
 #include <vtkMath.h>
 #include <vtkCommand.h>
 
 #include <algorithm>
 
-//#include "utilities.h"
-
-using namespace std;
-
-
 /*
 static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId){
   int anEdgeId = -1;
@@ -68,12 +61,12 @@ static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId)
     float 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];
-       aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
-       if (aDist < aMinDist) {
-         aMinDist = aDist;
-         anEdgeId = i;
-       }
+        int subId;  float pcoords[3], closestPoint[3], weights[3];
+        aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
+        if (aDist < aMinDist) {
+          aMinDist = aDist;
+          anEdgeId = i;
+        }
       }
     }
   }
@@ -120,7 +113,7 @@ VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()
  *\param theWidth - width..
  */
 void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const double& theGreen, 
-                                                         const double& theBlue, const int& theWidth) 
+                                                          const double& theBlue, const int& theWidth) 
 {
   if ( myPreSelectionActor->GetProperty() == 0 )
     return;
@@ -235,9 +228,9 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
     }
 
   double newAngle = atan2((double)(y - this->CurrentRenderer->GetCenter()[1]),
-                         (double)(x - this->CurrentRenderer->GetCenter()[0]));
+                          (double)(x - this->CurrentRenderer->GetCenter()[0]));
   double oldAngle = atan2((double)(oldY -this->CurrentRenderer->GetCenter()[1]),
-                         (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
+                          (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
   
   newAngle *= this->RadianToDegree;
   oldAngle *= this->RadianToDegree;
@@ -258,8 +251,8 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), 
-                                                 int shift,
-                                                 int x, int y) 
+                                                  int shift,
+                                                  int x, int y) 
 {
   myShiftState = shift;
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
@@ -276,7 +269,7 @@ void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
-                                                      int x, int y) 
+                                                       int x, int y) 
 {
   if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
     this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
@@ -312,9 +305,9 @@ void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
-                                                    int shift, 
-                                                    int vtkNotUsed(x),
-                                                    int vtkNotUsed(y))
+                                                     int shift, 
+                                                     int vtkNotUsed(x),
+                                                     int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -332,8 +325,8 @@ void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl,
-                                                        int shift, 
-                                                        int x, int y) 
+                                                         int shift, 
+                                                         int x, int y) 
 {
   if (this->HasObserver(vtkCommand::MiddleButtonPressEvent)) 
     {
@@ -369,9 +362,9 @@ void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
-                                                      int shift, 
-                                                      int vtkNotUsed(x),
-                                                      int vtkNotUsed(y))
+                                                       int shift, 
+                                                       int vtkNotUsed(x),
+                                                       int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -389,8 +382,8 @@ void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl,
-                                                       int shift, 
-                                                       int x, int y) 
+                                                        int shift, 
+                                                        int x, int y) 
 {
   if (this->HasObserver(vtkCommand::RightButtonPressEvent)) 
     {
@@ -425,9 +418,9 @@ void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
-                                                     int shift, 
-                                                     int vtkNotUsed(x),
-                                                     int vtkNotUsed(y))
+                                                      int shift, 
+                                                      int vtkNotUsed(x),
+                                                      int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -863,256 +856,256 @@ void VTKViewer_InteractorStyle::onFinishOperation()
       }
       else {
         if (myPoint == myOtherPoint) {
-         // process point selection
+          // process point selection
           int w, h, x, y;
           m_Interactor->GetSize(w, h);
           x = myPoint.x(); 
           y = h - myPoint.y() - 1;
 
           this->FindPokedRenderer(x, y);
-         m_Interactor->StartPickCallback();
+          m_Interactor->StartPickCallback();
 
-         vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
+          vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
           aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
     
-         SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
+          SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
 
           if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
-           int aVtkId = picker->GetCellId();
-           if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
-             int anObjId = SActor->GetElemObjId(aVtkId);
-             if(anObjId >= 0){
-               Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-               if(aSelectionMode != EdgeOfCellSelection) {
-                 if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
-                   if (IsSelected(IO,aSel)) {
-                     // This IO is already in the selection
-                     aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                   } else {
-                     if (!myShiftState) {
-                       this->HighlightProp( NULL );
-                       aSel->ClearIObjects();
-                     }
-                     aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                     aSel->AddIObject( IO, false );
-                   }
-                 }
-               }else{
-                 if (!myShiftState) {
-                   this->HighlightProp( NULL );
-                   aSel->ClearIObjects();
-                 }
-                 int anEdgeId = GetEdgeId(picker,SActor,anObjId);
-                 if (anEdgeId >= 0) {
-                   aSel->AddOrRemoveIndex( IO, anObjId, true, false);
-                   aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
-                   aSel->AddIObject( IO, false );
-                 } 
-               }
-             }
-           } else {
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           }
+            int aVtkId = picker->GetCellId();
+            if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
+              int anObjId = SActor->GetElemObjId(aVtkId);
+              if(anObjId >= 0){
+                Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                if(aSelectionMode != EdgeOfCellSelection) {
+                  if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
+                    if (IsSelected(IO,aSel)) {
+                      // This IO is already in the selection
+                      aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                    } else {
+                      if (!myShiftState) {
+                        this->HighlightProp( NULL );
+                        aSel->ClearIObjects();
+                      }
+                      aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                      aSel->AddIObject( IO, false );
+                    }
+                  }
+                }else{
+                  if (!myShiftState) {
+                    this->HighlightProp( NULL );
+                    aSel->ClearIObjects();
+                  }
+                  int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+                  if (anEdgeId >= 0) {
+                    aSel->AddOrRemoveIndex( IO, anObjId, true, false);
+                    aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
+                    aSel->AddIObject( IO, false );
+                  
+                }
+              }
+            } else {
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            }
           } else if ( vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker) ) {
-           int aVtkId = picker->GetPointId();
-           if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
-             if ( SActor && SActor->hasIO() ) {
-               int anObjId = SActor->GetNodeObjId(aVtkId);
-               if(anObjId >= 0){
-                 Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-                 if(IsSelected(IO,aSel)) {
-                   // This IO is already in the selection
-                   aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                 } else {
-                   if(!myShiftState) {
-                     this->HighlightProp( NULL );
-                     aSel->ClearIObjects();
-                   }
-                   aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                   aSel->AddIObject( IO, false );
-                 }
-               }
-             }
-           } else {
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           } 
-         } else {
-           if ( SActor && SActor->hasIO() ) {
-             this->PropPicked++;
-             Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-             if(IsSelected(IO,aSel)) {
-               // This IO is already in the selection
-               if(myShiftState) {
-                 aSel->RemoveIObject(IO);
-               }
-             }
-             else {
-               if(!myShiftState) {
-                 this->HighlightProp( NULL );
-                 aSel->ClearIObjects();
-               }
-               aSel->AddIObject( IO, false );
-             }
-           }else{
-             // No selection clear all
-             this->PropPicked = 0;
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           }
-         }
-         m_Interactor->EndPickCallback();
+            int aVtkId = picker->GetPointId();
+            if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
+              if ( SActor && SActor->hasIO() ) {
+                int anObjId = SActor->GetNodeObjId(aVtkId);
+                if(anObjId >= 0){
+                  Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                  if(IsSelected(IO,aSel)) {
+                    // This IO is already in the selection
+                    aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                  } else {
+                    if(!myShiftState) {
+                      this->HighlightProp( NULL );
+                      aSel->ClearIObjects();
+                    }
+                    aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                    aSel->AddIObject( IO, false );
+                  }
+                }
+              }
+            } else {
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            
+          } else {
+            if ( SActor && SActor->hasIO() ) {
+              this->PropPicked++;
+              Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+              if(IsSelected(IO,aSel)) {
+                // This IO is already in the selection
+                if(myShiftState) {
+                  aSel->RemoveIObject(IO);
+                }
+              }
+              else {
+                if(!myShiftState) {
+                  this->HighlightProp( NULL );
+                  aSel->ClearIObjects();
+                }
+                aSel->AddIObject( IO, false );
+              }
+            }else{
+              // No selection clear all
+              this->PropPicked = 0;
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            }
+          }
+          m_Interactor->EndPickCallback();
         } else {
           //processing rectangle selection
-         QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
-         if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
-         m_Interactor->StartPickCallback();
-
-         if (!myShiftState) {
-           this->PropPicked = 0;
-           this->HighlightProp( NULL );
-           aSel->ClearIObjects();
-         }
-
-         // Compute bounds
-         //      vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
-         QRect rect(myPoint, myOtherPoint);
-         rect = rect.normalize();
-         int w, h;
-         m_Interactor->GetSize(w, h);
-         int x1, y1, x2, y2;
-         x1 = rect.left(); 
-         y1 = h - rect.top() - 1;
-         x2 = rect.right(); 
-         y2 = h - rect.bottom() - 1;
-
-         switch (aSelectionMode) {
-         case NodeSelection: {
-           if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
-             vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
-             aListActors->InitTraversal();
-             while (vtkActor* aActor = aListActors->GetNextActor()) {
-               if (!aActor->GetVisibility()) 
-                 continue;
-               if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (SActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-                   if (IO.IsNull()) 
-                     continue;
-                   if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
-                     continue;
-                   if (vtkDataSet* aDataSet = SActor->GetInput()) {
-                     SALOME_Selection::TContainerOfId anIndices;
-                     for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
-                       float aPoint[3];
-                       aDataSet->GetPoint(i,aPoint);
-                       if (IsInRect(aPoint,x1,y1,x2,y2)){
-                         float aDisp[3];
-                         ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
-                         if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
-                           if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
-                             if(anActorCollection->IsItemPresent(SActor)){
-                               float aPickedPoint[3];
-                               aPointPicker->GetMapperPosition(aPickedPoint);
-                               vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
-                               if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
-                                 int anObjId = SActor->GetNodeObjId(aVtkId);
-                                 anIndices.insert(anObjId);
-                               }
-                             }
-                           }
-                         }
-                       }
-                     }
-                     if (!anIndices.empty()) {
-                       aSel->AddOrRemoveIndex(IO, anIndices, true, false);
-                       aSel->AddIObject(IO, false);
-                       anIndices.clear();
-                     }else{
-                       aSel->RemoveIObject(IO, false);
-                     }
-                   }
-                 }
-               }
-             }
-           }
-           break;
-         }
-         case CellSelection:
-         case EdgeOfCellSelection:
-         case EdgeSelection:
-         case FaceSelection:
-         case VolumeSelection: 
-           {
-             vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-             
-             vtkActorCollection* aListActors = picker->GetActors();
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
-                   if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
-                     continue;
-                   VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
-                   if ( !cellList.empty() ) {
-                     SALOME_Selection::TContainerOfId anIndexes;
-                     VTKViewer_CellDataSet::iterator it;
-                     for ( it = cellList.begin(); it != cellList.end(); ++it ) {
-                       int aCellId = (*it).cellId;
-                       
-                       if ( !IsValid( aSActor, aCellId ) )
-                         continue;
-                       
-                       int anObjId = aSActor->GetElemObjId(aCellId);
-                       if (anObjId != -1){
-                         if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
-                           anIndexes.insert(anObjId);
-                         }
-                       }
-                     }
-                     aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
-                     aSel->AddIObject(aIO, false);
-                   }
-                 }
-               }
-             }
-           }
-           break;          
-         case ActorSelection: // objects selection
-           {
-             vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-
-             vtkActorCollection* aListActors = picker->GetActors();
-             SALOME_ListIO aListIO;
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
-                   if (!IsStored(aIO,aListIO))
-                     aListIO.Append(aIO);
-                 }
-               }
-             }
-             if (!aListIO.IsEmpty()) {
-               SALOME_ListIteratorOfListIO It(aListIO);
-               for(;It.More();It.Next()) {
-                 Handle(SALOME_InteractiveObject) IOS = It.Value();
-                 this->PropPicked++;
-                 aSel->AddIObject( IOS, false );
-               }
-             }
-           } // end case 4
-         } //end switch
-         m_Interactor->EndPickCallback();
-       }
-       aActiveStudy->update3dViewers();
+          QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
+          if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
+          m_Interactor->StartPickCallback();
+
+          if (!myShiftState) {
+            this->PropPicked = 0;
+            this->HighlightProp( NULL );
+            aSel->ClearIObjects();
+          }
+
+          // Compute bounds
+          //      vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
+          QRect rect(myPoint, myOtherPoint);
+          rect = rect.normalize();
+          int w, h;
+          m_Interactor->GetSize(w, h);
+          int x1, y1, x2, y2;
+          x1 = rect.left(); 
+          y1 = h - rect.top() - 1;
+          x2 = rect.right(); 
+          y2 = h - rect.bottom() - 1;
+
+          switch (aSelectionMode) {
+          case NodeSelection: {
+            if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
+              vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
+              aListActors->InitTraversal();
+              while (vtkActor* aActor = aListActors->GetNextActor()) {
+                if (!aActor->GetVisibility()) 
+                  continue;
+                if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (SActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                    if (IO.IsNull()) 
+                      continue;
+                    if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
+                      continue;
+                    if (vtkDataSet* aDataSet = SActor->GetInput()) {
+                      SALOME_Selection::TContainerOfId anIndices;
+                      for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
+                        float aPoint[3];
+                        aDataSet->GetPoint(i,aPoint);
+                        if (IsInRect(aPoint,x1,y1,x2,y2)){
+                          float aDisp[3];
+                          ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
+                          if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
+                            if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
+                              if(anActorCollection->IsItemPresent(SActor)){
+                                float aPickedPoint[3];
+                                aPointPicker->GetMapperPosition(aPickedPoint);
+                                vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
+                                if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
+                                  int anObjId = SActor->GetNodeObjId(aVtkId);
+                                  anIndices.insert(anObjId);
+                                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                      if (!anIndices.empty()) {
+                        aSel->AddOrRemoveIndex(IO, anIndices, true, false);
+                        aSel->AddIObject(IO, false);
+                        anIndices.clear();
+                      }else{
+                        aSel->RemoveIObject(IO, false);
+                      }
+                    }
+                  }
+                }
+              }
+            }
+            break;
+          }
+          case CellSelection:
+          case EdgeOfCellSelection:
+          case EdgeSelection:
+          case FaceSelection:
+          case VolumeSelection: 
+            {
+              vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
+              picker->SetTolerance(0.001);
+              picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+              
+              vtkActorCollection* aListActors = picker->GetActors();
+              aListActors->InitTraversal();
+              while(vtkActor* aActor = aListActors->GetNextActor()) {
+                if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (aSActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+                    if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
+                      continue;
+                    VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
+                    if ( !cellList.empty() ) {
+                      SALOME_Selection::TContainerOfId anIndexes;
+                      VTKViewer_CellDataSet::iterator it;
+                      for ( it = cellList.begin(); it != cellList.end(); ++it ) {
+                        int aCellId = (*it).cellId;
+                        
+                        if ( !IsValid( aSActor, aCellId ) )
+                          continue;
+                        
+                        int anObjId = aSActor->GetElemObjId(aCellId);
+                        if (anObjId != -1){
+                          if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
+                            anIndexes.insert(anObjId);
+                          }
+                        }
+                      }
+                      aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
+                      aSel->AddIObject(aIO, false);
+                    }
+                  }
+                }
+              }
+            }
+            break;          
+          case ActorSelection: // objects selection
+            {
+              vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
+              picker->SetTolerance(0.001);
+              picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+
+              vtkActorCollection* aListActors = picker->GetActors();
+              SALOME_ListIO aListIO;
+              aListActors->InitTraversal();
+              while(vtkActor* aActor = aListActors->GetNextActor()) {
+                if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (aSActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+                    if (!IsStored(aIO,aListIO))
+                      aListIO.Append(aIO);
+                  }
+                }
+              }
+              if (!aListIO.IsEmpty()) {
+                SALOME_ListIteratorOfListIO It(aListIO);
+                for(;It.More();It.Next()) {
+                  Handle(SALOME_InteractiveObject) IOS = It.Value();
+                  this->PropPicked++;
+                  aSel->AddIObject( IOS, false );
+                }
+              }
+            } // end case 4
+          } //end switch
+          m_Interactor->EndPickCallback();
+        }
+        aActiveStudy->update3dViewers();
       } 
     } 
     break;
@@ -1230,36 +1223,36 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
     if ( aVtkId >= 0 ) {
       int anObjId = SActor->GetElemObjId(aVtkId);
       if ( SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
-       bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
-       bool aResult = anIsSameObjId;
-       if(!anIsSameObjId) {
-         if(aSelectionMode != EdgeOfCellSelection) {
-           aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
-           if(aResult){
-             mySelectedActor = SActor;
-             myElemId = anObjId;
-             m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
-           }
-         }
-       }
-       if(aSelectionMode == EdgeOfCellSelection){
-         int anEdgeId = GetEdgeId(picker,SActor,anObjId);
-         bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
-         aResult = anIsSameEdgeId;
-         if(!anIsSameEdgeId) {
-           aResult = (anEdgeId >= 0);
-           if (aResult) {
-             mySelectedActor = SActor;
-             myEdgeId = anEdgeId;
-             myElemId = anObjId;
-             m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
-           } 
-         }
-       }
-       if(aResult) {
-         myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
-         myPreSelectionActor->SetVisibility(true);
-       }
+        bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
+        bool aResult = anIsSameObjId;
+        if(!anIsSameObjId) {
+          if(aSelectionMode != EdgeOfCellSelection) {
+            aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
+            if(aResult){
+              mySelectedActor = SActor;
+              myElemId = anObjId;
+              m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
+            }
+          }
+        }
+        if(aSelectionMode == EdgeOfCellSelection){
+          int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+          bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
+          aResult = anIsSameEdgeId;
+          if(!anIsSameEdgeId) {
+            aResult = (anEdgeId >= 0);
+            if (aResult) {
+              mySelectedActor = SActor;
+              myEdgeId = anEdgeId;
+              myElemId = anObjId;
+              m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
+            
+          }
+        }
+        if(aResult) {
+          myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+          myPreSelectionActor->SetVisibility(true);
+        }
       }
     }
   }
@@ -1267,44 +1260,44 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
     int aVtkId = picker->GetPointId();
     if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
       if ( SActor && SActor->hasIO() ) {
-       int anObjId = SActor->GetNodeObjId(aVtkId);
-       bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
-       if(!anIsSameObjId) {
-         mySelectedActor = SActor;
-         myNodeId = anObjId;
-         m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
-       }
-       myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
-       myPreSelectionActor->SetVisibility(true);
+        int anObjId = SActor->GetNodeObjId(aVtkId);
+        bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
+        if(!anIsSameObjId) {
+          mySelectedActor = SActor;
+          myNodeId = anObjId;
+          m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
+        }
+        myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+        myPreSelectionActor->SetVisibility(true);
       }
     }
   }
   else if ( vtkPicker::SafeDownCast(aPicker) ) {
     if ( SActor ) {
       if ( myPreViewActor != SActor ) {
-       if ( myPreViewActor != NULL ) {
-         myPreViewActor->SetPreSelected( false );
-       }
-       myPreViewActor = SActor;
-             
-       if ( SActor->hasIO() ) {
-         Handle( SALOME_InteractiveObject) IO = SActor->getIO();
-         if ( !IsSelected(IO,Sel) ) {
+        if ( myPreViewActor != NULL ) {
+          myPreViewActor->SetPreSelected( false );
+        }
+        myPreViewActor = SActor;
+              
+        if ( SActor->hasIO() ) {
+          Handle( SALOME_InteractiveObject) IO = SActor->getIO();
+          if ( !IsSelected(IO,Sel) ) {
             // Find All actors with same IO
-           vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
-           theActors->InitTraversal();
-           while( vtkActor *ac = theActors->GetNextActor() ) {
-             if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
-               if ( anActor->hasIO() ) {
-                 Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
-                 if(IO->isSame(IOS)) {
-                   anActor->SetPreSelected( true );
-                 }
-               }
-             }
-           }
-         }
-       }
+            vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
+            theActors->InitTraversal();
+            while( vtkActor *ac = theActors->GetNextActor() ) {
+              if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
+                if ( anActor->hasIO() ) {
+                  Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
+                  if(IO->isSame(IOS)) {
+                    anActor->SetPreSelected( true );
+                  }
+                }
+              }
+            }
+          }
+        }
       }
     } else {
       myPreViewActor = NULL;
@@ -1359,13 +1352,13 @@ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int f
   cam->GetFocalPoint(viewFocus);
 
   this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
-                             viewFocus[2], viewFocus);
+                              viewFocus[2], viewFocus);
   focalDepth = viewFocus[2];
 
   this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY),
-                             focalDepth, newPickPoint);
+                              focalDepth, newPickPoint);
   this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY),
-                             focalDepth, oldPickPoint);
+                              focalDepth, oldPickPoint);
   
   // camera motion is reversed
   motionVector[0] = oldPickPoint[0] - newPickPoint[0];
@@ -1375,18 +1368,18 @@ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int f
   cam->GetFocalPoint(viewFocus);
   cam->GetPosition(viewPoint);
   cam->SetFocalPoint(motionVector[0] + viewFocus[0],
-                    motionVector[1] + viewFocus[1],
-                    motionVector[2] + viewFocus[2]);
+                     motionVector[1] + viewFocus[1],
+                     motionVector[2] + viewFocus[2]);
   cam->SetPosition(motionVector[0] + viewPoint[0],
-                  motionVector[1] + viewPoint[1],
-                  motionVector[2] + viewPoint[2]);
+                   motionVector[1] + viewPoint[1],
+                   motionVector[2] + viewPoint[2]);
 }
 
 
 /*! Checks: is the given Actor within display coordinates?*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, 
-                                              const int left, const int top, 
-                                              const int right, const int bottom)
+                                               const int left, const int top, 
+                                               const int right, const int bottom)
 {
   vtkFloatingPointType* aBounds = theActor->GetBounds();
   vtkFloatingPointType aMin[3], aMax[3];
@@ -1409,8 +1402,8 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor,
 
 /*! Checks: is the given Cell within display coordinates?*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, 
-                                              const int left, const int top, 
-                                              const int right, const int bottom)
+                                               const int left, const int top, 
+                                               const int right, const int bottom)
 {
   vtkFloatingPointType* aBounds = theCell->GetBounds();
   vtkFloatingPointType aMin[3], aMax[3];
@@ -1432,8 +1425,8 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell,
 
 /*!Checks: is given point \a thePoint in rectangle*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint, 
-                                        const int left, const int top, 
-                                        const int right, const int bottom)
+                                         const int left, const int top, 
+                                         const int right, const int bottom)
 {
   vtkFloatingPointType aPnt[3];
   ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
index a3e36e0976d54ba93f4a7a240225375dd63bfb0f..35ff5022dbed2cfddb8cbeba38a408771d481344 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_InteractorStyle.h
 //  Author : Christophe ATTANASIO
@@ -31,6 +32,7 @@
 
 class vtkCell;
 class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
 
 #include <QObject>
 #include <QCursor>
@@ -78,7 +80,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 
   void setTriedron(VTKViewer_Trihedron* theTrihedron);
   void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1,
-                          const double& theBlue = 1, const int& theWidth = 5);
+                           const double& theBlue = 1, const int& theWidth = 5);
 
   // Generic event bindings must be overridden in subclasses
   void OnMouseMove  (int ctrl, int shift, int x, int y);
@@ -121,14 +123,14 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   void Place(const int theX, const int theY);
   void TranslateView(int toX, int toY, int fromX, int fromY);
   bool IsInRect(vtkActor* theActor, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
   bool IsInRect(vtkCell* theCell, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
   bool IsInRect(vtkFloatingPointType* thePoint, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
 
   int State;
   vtkFloatingPointType MotionFactor;
@@ -149,6 +151,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   void startRotate();
   void startFitArea();
   void startSpin();
+  void SetTDxStyle(vtkTDxInteractorStyle *tdxStyle) {}
   bool needsRedrawing();
 
  protected:
diff --git a/src/VTKViewer/VTKViewer_PassThroughFilter.cxx b/src/VTKViewer/VTKViewer_PassThroughFilter.cxx
deleted file mode 100755 (executable)
index 3c0e743..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SALOME FILTER : interactive object for VISU entities implementation
-//  File   : SALOME_PassThroughFilter.cxx
-//  Author : Laurent CORNABE with help of Nicolas REJNERI
-//  Module : SALOME
-//
-#include "VTKViewer_PassThroughFilter.h"
-
-#include <vtkCellData.h>
-#include <vtkDataSet.h>
-#include <vtkObjectFactory.h>
-#include <vtkPointData.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-
-vtkCxxRevisionMacro(VTKViewer_PassThroughFilter, "$Revision$");
-vtkStandardNewMacro(VTKViewer_PassThroughFilter);
-
-/*! \class VTKViewer_PassThroughFilter
- * Passive filter take a dataset as input and create a dataset as output.\n
- * The form of the input geometry is not changed in these filters, \n
- * only the point attributes (e.g. scalars, vectors, etc.). 
- */
-
-/*!Execute method.Output calculation.*/
-int VTKViewer_PassThroughFilter::RequestData(
-  vtkInformation *,
-  vtkInformationVector **inputVector,
-  vtkInformationVector *outputVector)
-{
-  // get the info objects
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
-  // get the input and ouptut
-  vtkDataSet *input = vtkDataSet::SafeDownCast(
-    inInfo->Get(vtkDataObject::DATA_OBJECT()));
-  vtkDataSet *output = vtkDataSet::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-  // This has to be here because it initialized all field datas.
-  output->CopyStructure( input );
-  
-  //! Pass all. (data object's field data is passed by the
-  //! superclass after this method)
-  output->GetPointData()->PassData( input->GetPointData() );
-  output->GetCellData()->PassData( input->GetCellData() );
-
-  return 1;
-}
-
-/*!Methods invoked by print to print information about the object including superclasses.\n
- * Typically not called by the user (use Print() instead) but used in the hierarchical \n
- * print process to combine the output of several classes. 
- *\param os - output stream.
- */
-void VTKViewer_PassThroughFilter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-}
diff --git a/src/VTKViewer/VTKViewer_PassThroughFilter.h b/src/VTKViewer/VTKViewer_PassThroughFilter.h
deleted file mode 100755 (executable)
index 92ce5bb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef VTKVIEWER_PASSTHROUGHFILTER_H
-#define VTKVIEWER_PASSTHROUGHFILTER_H
-
-#include "VTKViewer.h"
-
-#include <vtkDataSetToDataSetFilter.h>
-
-class VTKVIEWER_EXPORT VTKViewer_PassThroughFilter : public vtkDataSetToDataSetFilter
-{
-public:
-  vtkTypeRevisionMacro( VTKViewer_PassThroughFilter, vtkDataSetToDataSetFilter );
-  void PrintSelf( ostream& os, vtkIndent indent );
-
-  /*!Create a new VTKViewer_PassThroughFilter.*/
-  static VTKViewer_PassThroughFilter *New();
-
-protected:
-  VTKViewer_PassThroughFilter() {};//!< Null body.
-  virtual ~VTKViewer_PassThroughFilter() {};//!< Null body.
-
-  virtual int RequestData(vtkInformation *, vtkInformationVector **,
-                          vtkInformationVector *); //generate output data
-
-private:
-  VTKViewer_PassThroughFilter( const VTKViewer_PassThroughFilter& );  //!< Not implemented.
-  void operator=( const VTKViewer_PassThroughFilter& );               //!< Not implemented.
-};
-
-#endif
index be3abf8d11393b20b0b10af2a4eccf7d4fa86bdb..ee6c9f2c823e0bcdcd4d505408f2a0667bdedc53 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_RenderWindow.h"
 
 #include <QColorDialog>
@@ -91,6 +92,12 @@ void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* theEvent)
   }
 }
 
+/*! Get paint engine for the scene */
+QPaintEngine* VTKViewer_RenderWindow::paintEngine() const
+{
+  return 0;
+}
+
 /*!Emit mouse move event.*/
 void VTKViewer_RenderWindow::mouseMoveEvent(QMouseEvent* event) 
 {
@@ -144,7 +151,7 @@ void VTKViewer_RenderWindow::onChangeBackgroundColor()
   vtkRenderer * theRenderer = theRenderers->GetNextItem();
   theRenderer->GetBackground(backint);
 
-  QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );    
+  QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );     
   if ( selColor.isValid() ) {
     theRenderer->SetBackground( selColor.red()/255., selColor.green()/255., selColor.blue()/255. ); 
     /* VSR : PAL5420 ---------------------------------------------------
index 13cbb3ea395ce100828cf1b9bccf2c1e5d5f2a4b..b1d400235bc372012ee38f17c90ad5a5f554f872 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_RENDERWINDOW_H
 #define VTKVIEWER_RENDERWINDOW_H
 
@@ -45,6 +46,8 @@ public:
   /*!Get render window pointer.*/
   vtkRenderWindow* getRenderWindow() { return myRW; }
 
+  virtual QPaintEngine* paintEngine() const;
+
  protected:
   virtual void mouseMoveEvent( QMouseEvent* );
   virtual void mousePressEvent( QMouseEvent* );
index 907e85ed19827cca8b70813cb91fdaab648936db..a47647fda9288579119289c380a333425ad07e8d 100755 (executable)
@@ -1,43 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_RenderWindowInteractor.h"
 #include "VTKViewer_RenderWindow.h"
 #include "VTKViewer_InteractorStyle.h"
 #include "SUIT_ViewModel.h"
 #include "VTKViewer_ViewWindow.h"
 
-//#include "SUIT_Application.h"
-//#include "SUIT_Desktop.h"
-
-//#include "SALOME_Selection.h"
 #include "VTKViewer_Actor.h"
 #include "VTKViewer_Algorithm.h"
 #include "VTKViewer_Functor.h"
 
-//#include <stdio.h>
-//#include <stdlib.h>
-//#include <string.h>
-//#include <math.h>
-
 // VTK Includes
 #include <vtkAssemblyNode.h>
 #include <vtkActor.h>
@@ -391,8 +383,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *even
     return ;
   }
   myInteractorStyle->OnLeftButtonDown((event->modifiers() & Qt::ControlModifier), 
-                                     (event->modifiers() & Qt::ShiftModifier), 
-                                     event->x(), event->y());
+                                      (event->modifiers() & Qt::ShiftModifier), 
+                                      event->x(), event->y());
 }
 
 /*!Reaction on left button releases.\n
@@ -404,8 +396,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *eve
     return ;
   }
   myInteractorStyle->OnLeftButtonUp( (event->modifiers() & Qt::ControlModifier), 
-                                    (event->modifiers() & Qt::ShiftModifier), 
-                                    event->x(), event->y() ) ;
+                                     (event->modifiers() & Qt::ShiftModifier), 
+                                     event->x(), event->y() ) ;
 }
 
 /*!Reaction on middle button pressed.\n
@@ -417,8 +409,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *ev
     return ;
   }
   myInteractorStyle->OnMiddleButtonDown((event->modifiers() & Qt::ControlModifier), 
-                                       (event->modifiers() & Qt::ShiftModifier), 
-                                       event->x(), event->y() ) ;
+                                        (event->modifiers() & Qt::ShiftModifier), 
+                                        event->x(), event->y() ) ;
 }
 
 /*!Reaction on middle button released.\n
@@ -430,8 +422,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *e
     return ;
   }
   myInteractorStyle->OnMiddleButtonUp( (event->modifiers() & Qt::ControlModifier), 
-                                      (event->modifiers() & Qt::ShiftModifier), 
-                                      event->x(), event->y() ) ;
+                                       (event->modifiers() & Qt::ShiftModifier), 
+                                       event->x(), event->y() ) ;
 }
 
 /*!Reaction on right button pressed.\n
@@ -443,8 +435,8 @@ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *eve
     return ;
   }
   myInteractorStyle->OnRightButtonDown( (event->modifiers() & Qt::ControlModifier), 
-                                       (event->modifiers() & Qt::ShiftModifier), 
-                                       event->x(), event->y() ) ;
+                                        (event->modifiers() & Qt::ShiftModifier), 
+                                        event->x(), event->y() ) ;
 }
 
 /*!Reaction on right button released.\n
@@ -457,8 +449,8 @@ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *ev
   }
   bool isOperation = myInteractorStyle->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
   myInteractorStyle->OnRightButtonUp( (event->modifiers() & Qt::ControlModifier),
-                                     (event->modifiers() & Qt::ShiftModifier),
-                                     event->x(), event->y() );
+                                      (event->modifiers() & Qt::ShiftModifier),
+                                      event->x(), event->y() );
   if ( !isOperation )
   {
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
@@ -490,21 +482,37 @@ int VTKViewer_RenderWindowInteractor::GetDisplayMode() {
 void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) {
   if(theMode == 0)
     ChangeRepresentationToWireframe();
-  else
+  else if (theMode == 1)
     ChangeRepresentationToSurface();
+  else if (theMode == 2) {
+    ChangeRepresentationToSurfaceWithEdges();
+    theMode++;
+  }
   myDisplayMode = theMode;
 }
 
 /*!Change all actors to wireframe*/
 void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe()
 {
-  ChangeRepresentationToWireframe(GetRenderer()->GetActors());
+  using namespace VTK;
+  ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+  ChangeRepresentationToWireframe(aCopy.GetActors());
 }
 
 /*!Change all actors to surface*/
 void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface()
 {
-  ChangeRepresentationToSurface(GetRenderer()->GetActors());
+  using namespace VTK;
+  ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+  ChangeRepresentationToSurface(aCopy.GetActors());
+}
+
+/*!Change all actors to surface with edges*/
+void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges()
+{
+  using namespace VTK;
+  ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+  ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors());
 }
 
 /*!Change all actors from \a theCollection to wireframe and
@@ -514,8 +522,8 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorC
 {
   using namespace VTK;
   ForEach<VTKViewer_Actor>(theCollection,
-                       TSetFunction<VTKViewer_Actor,int>
-                       (&VTKViewer_Actor::setDisplayMode,0));
+                        TSetFunction<VTKViewer_Actor,int>
+                        (&VTKViewer_Actor::setDisplayMode,0));
   emit RenderWindowModified();
 }
 
@@ -526,8 +534,20 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCol
 {
   using namespace VTK;
   ForEach<VTKViewer_Actor>(theCollection,
-                       TSetFunction<VTKViewer_Actor,int>
-                       (&VTKViewer_Actor::setDisplayMode,1));
+                        TSetFunction<VTKViewer_Actor,int>
+                        (&VTKViewer_Actor::setDisplayMode,1));
+  emit RenderWindowModified();
+}
+
+/*!Change all actors from \a theCollection to surface with edges and
+ * emit render window modified.
+ */
+void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection)
+{
+  using namespace VTK;
+  ForEach<VTKViewer_Actor>(theCollection,
+                        TSetFunction<VTKViewer_Actor,int>
+                        (&VTKViewer_Actor::setDisplayMode,3));
   emit RenderWindowModified();
 }
 
@@ -550,8 +570,8 @@ void VTKViewer_RenderWindowInteractor::EraseAll()
 void VTKViewer_RenderWindowInteractor::DisplayAll()
 {
   using namespace VTK;
-  vtkActorCollection* aCollection = GetRenderer()->GetActors();
-  ForEach<VTKViewer_Actor>(aCollection,TSetVisibility<VTKViewer_Actor>(true));
+  ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+  ForEach<VTKViewer_Actor>(aCopy.GetActors(),TSetVisibility<VTKViewer_Actor>(true));
 
   emit RenderWindowModified() ;
 }
@@ -566,7 +586,7 @@ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool upd
 {
   if ( SActor != 0 )
   {
-    GetRenderer()->RemoveProp( SActor );
+    GetRenderer()->RemoveViewProp( SActor );
     if ( updateViewer )
       emit RenderWindowModified();
   }
@@ -577,8 +597,10 @@ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool upd
  */
 void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer )
 {
+  using namespace VTK;
   vtkRenderer* aRenderer = GetRenderer();
-  vtkActorCollection* anActors = aRenderer->GetActors();
+  ActorCollectionCopy aCopy(aRenderer->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
   if ( anActors )
   {
     anActors->InitTraversal();
@@ -627,7 +649,8 @@ struct TUpdateAction{
 void VTKViewer_RenderWindowInteractor::Update() {
   using namespace VTK;
   vtkRenderer* aRen = GetRenderer();
-  ForEach<vtkActor>(aRen->GetActors(),TUpdateAction());
+  ActorCollectionCopy aCopy(aRen->GetActors());
+  ForEach<vtkActor>(aCopy.GetActors(),TUpdateAction());
 
   aRen->ResetCamera();
 
@@ -657,8 +680,8 @@ bool VTKViewer_RenderWindowInteractor::unHighlightAll(){
  * \li Emit render window modified, if flag \a update - true.
  */
 bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
-                                                VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
-                                                TUpdateActor theFun, bool hilight, bool update)
+                                                 VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+                                                 TUpdateActor theFun, bool hilight, bool update)
 {
   if(theMapIndex.Extent() == 0) return false;
 
@@ -680,9 +703,9 @@ bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteg
 
 /*!Sets actors data.*/
 void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
-                                                   VTKViewer_Actor * theMapActor,
-                                                   VTKViewer_Actor * theActor,
-                                                   TUpdateActor theFun)
+                                                    VTKViewer_Actor * theMapActor,
+                                                    VTKViewer_Actor * theActor,
+                                                    TUpdateActor theFun)
 {
   (*theFun)(theMapIndex,theMapActor,theActor);
   vtkFloatingPointType aPos[3];
index 3edf9c8e32b78713b1800e779ca0faa1cb042c76..1f3556448d7f10f589e7bcb393967f962a3cc25e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_RENDERWINDOWINTERACTOR_H
 #define VTKVIEWER_RENDERWINDOWINTERACTOR_H
 
@@ -104,24 +105,24 @@ public:
   /** @name Selection Management */
   //@{
   bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex,
-                    VTKViewer_Actor* theMapActor,
-                    bool hilight,
-                    bool update = true );
+                     VTKViewer_Actor* theMapActor,
+                     bool hilight,
+                     bool update = true );
   bool highlightEdge(const TColStd_IndexedMapOfInteger& MapIndex,
-                    VTKViewer_Actor* theMapActor,
-                    bool hilight,
-                    bool update = true );
+                     VTKViewer_Actor* theMapActor,
+                     bool hilight,
+                     bool update = true );
   bool highlightPoint(const TColStd_IndexedMapOfInteger& MapIndex,
-                     VTKViewer_Actor* theMapActor,
-                     bool hilight,
-                     bool update = true );
+                      VTKViewer_Actor* theMapActor,
+                      bool hilight,
+                      bool update = true );
 
   void unHighlightSubSelection();
   bool unHighlightAll();
 
   //void SetSelectionMode(Selection_Mode mode);
   void SetSelectionProp(const double& theRed = 1, const double& theGreen = 1,
-                       const double& theBlue = 0, const int& theWidth = 5);
+                        const double& theBlue = 0, const int& theWidth = 5);
   void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001);
   //@}
 
@@ -135,12 +136,14 @@ public:
   //@{
   void ChangeRepresentationToWireframe();
   void ChangeRepresentationToSurface();
+  void ChangeRepresentationToSurfaceWithEdges();
   //@}
 
   /** @name Change to wireframe or surface a list of vtkactor*/
   //@{
   void ChangeRepresentationToWireframe(vtkActorCollection* ListofActors);
   void ChangeRepresentationToSurface(vtkActorCollection* ListofActors);
+  void ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* ListofActors);
   //@}
 
   /** @name Erase Display functions*/
@@ -161,19 +164,19 @@ public:
   void setViewWindow( VTKViewer_ViewWindow* theViewWnd );
 
   void setCellData(const int& theIndex,
-                  VTKViewer_Actor* theMapActor,
-                  VTKViewer_Actor* theActor) {}
+                   VTKViewer_Actor* theMapActor,
+                   VTKViewer_Actor* theActor) {}
   void setEdgeData(const int& theCellIndex,
-                  VTKViewer_Actor* theMapActor,
-                  const int& theEdgeIndex,
-                  VTKViewer_Actor* theActor ) {} //NB
+                   VTKViewer_Actor* theMapActor,
+                   const int& theEdgeIndex,
+                   VTKViewer_Actor* theActor ) {} //NB
   void setPointData(const int& theIndex,
-                   VTKViewer_Actor* theMapActor,
-                   VTKViewer_Actor* theActor) {}
+                    VTKViewer_Actor* theMapActor,
+                    VTKViewer_Actor* theActor) {}
 
   typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex,
-                              VTKViewer_Actor* theMapActor,
-                              VTKViewer_Actor* theActor);
+                               VTKViewer_Actor* theMapActor,
+                               VTKViewer_Actor* theActor);
  protected:
 
   VTKViewer_RenderWindowInteractor();
@@ -182,12 +185,12 @@ public:
   VTKViewer_InteractorStyle* myInteractorStyle;
 
   bool highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
-                VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
-                TUpdateActor theFun, bool hilight, bool update);
+                 VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+                 TUpdateActor theFun, bool hilight, bool update);
   void setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
-                   VTKViewer_Actor* theMapActor,
-                   VTKViewer_Actor *theActor,
-                   TUpdateActor theFun);
+                    VTKViewer_Actor* theMapActor,
+                    VTKViewer_Actor *theActor,
+                    TUpdateActor theFun);
 
   /*! Timer used during various mouse events to figure 
    * out mouse movements.
index 0084d939d5d9a7325426460c963f3875053815b1..7e551972dd91d03c17a77fb166602a8951218834 100755 (executable)
@@ -1,30 +1,29 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME OBJECT : kernel of SALOME component
 //  File   : SALOME_GeometryFilter.cxx
 //  Author : Michael ZORIN
-//  Module : SALOME
-//  $Header$
-//
+
 #include "VTKViewer_ShrinkFilter.h"
 
 #include <vtkCell.h>
@@ -148,7 +147,7 @@ int VTKViewer_ShrinkFilter::RequestData(
       oldId = ptIds->GetId(i);
       newId = newPts->InsertNextPoint(pt);
       if(myStoreMapping)
-       myVTK2ObjIds.push_back(oldId);
+        myVTK2ObjIds.push_back(oldId);
       newPtIds->InsertId(i,newId);
 
       outPD->CopyData(pd, oldId, newId);
index 46f912446e83bf0d2735852e07a5a3aee655a73a..a628778c4a7564310f7abd3e187836ea8e751c85 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_SHRINKFILTER_H
 #define VTKVIEWER_SHRINKFILTER_H
 
index 7b2f92767c6708d488fcd10050e7733c26299911..52d91efc5cd6af2b69566302526a6e7733703430 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME FILTER : interactive object for VISU entities implementation
 //  File   : SALOME_Transform.cxx
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
@@ -61,6 +62,6 @@ int VTKViewer_Transform::IsIdentity(){
   double aScale[3];
   this->GetMatrixScale(aScale);
   return (fabs(aScale[0] - 1.0) < EPS && 
-         fabs(aScale[1] - 1.0) < EPS && 
-         fabs(aScale[2] - 1.0) < EPS);
+          fabs(aScale[1] - 1.0) < EPS && 
+          fabs(aScale[2] - 1.0) < EPS);
 }
index 45277d86d2745fd956e9cd4f4ba5ca8e016e44e7..bc2de9051a7df398c7a54d1731d0b66cecdd04a7 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_TRANSFORM_H
 #define VTKVIEWER_TRANSFORM_H
 
index 2c463f50871d9300941b0b7588bad195ee304df8..522ffa92ec6002cdac1e9b06c853cb598410ffc3 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME FILTER : interactive object for VISU entities implementation
 //  File   : SALOME_TransformFilter.h
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
@@ -55,7 +56,7 @@ int VTKViewer_TransformFilter::RequestData(
 
   vtkPoints *inPts;
   vtkPoints *newPts;
-  int numPts, numCells;
+  int numPts/*, numCells*/;
   vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
   vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
   output->CopyStructure( input );
@@ -66,7 +67,7 @@ int VTKViewer_TransformFilter::RequestData(
     inPts = input->GetPoints();
     if(!anIsIdentity && inPts){
       numPts = inPts->GetNumberOfPoints();
-      numCells = input->GetNumberOfCells();
+      // numCells = input->GetNumberOfCells();
       newPts = vtkPoints::New();
       newPts->Allocate(numPts);
       this->UpdateProgress(.2);
@@ -78,6 +79,7 @@ int VTKViewer_TransformFilter::RequestData(
   }
   outPD->PassData(pd);
   outCD->PassData(cd);
+  InvokeEvent("VTKViewer_TransformFilter::TransformationFinished");
   
   return 1;
 }
index d4937c801e933e6bf678e6319eefe04f6c9d5a71..22be469c08fc4427cc5161ffbf0d087719252963 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_TRANSFORMFILTER_H
 #define VTKVIEWER_TRANSFORMFILTER_H
 
index 067dfecf689f73778e549b101d9227c373940cc2..9f279af6740db2a54d8adb333dd995ee96b8b9a9 100755 (executable)
@@ -1,28 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_Trihedron.h"
 #include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
 
 // VTK Includes
+#include <vtkConfigure.h>
 #include <vtkMath.h>
 #include <vtkMapper.h>
 #include <vtkDataSet.h>
 #include <vtkLineSource.h>
 #include <vtkConeSource.h>
 #include <vtkPolyDataMapper.h>
+#include <vtkPolyDataMapper2D.h>
 #include <vtkVectorText.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
+#include <vtkTextProperty.h>
+
+// QT includes
+#include <QtGlobal>
 
 vtkStandardNewMacro(VTKViewer_UnScaledActor);
 
@@ -74,21 +84,21 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
     theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
     theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][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]));
+                                           (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();
     vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
     vtkDataSet* aDataSet = GetMapper()->GetInput();
     aDataSet->Update();
     vtkFloatingPointType aLength = aDataSet->GetLength();
     vtkFloatingPointType aPrecision = 1.0E-3;
+    vtkFloatingPointType aZeroTol   = 1.0E-12;
     vtkFloatingPointType anOldScale = GetScale()[0];
-    vtkFloatingPointType aScale;
-    if (aSize[1] > aSize[0])
-      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
-    else
-      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[1])/vtkFloatingPointType(aSize[0]));
-    if(aScale != 0.0&& fabs(aScale - anOldScale)/aScale > aPrecision){
+    vtkFloatingPointType aScale = anOldScale;
+    vtkFloatingPointType aMaxSize = (vtkFloatingPointType)qMax(aSize[1],aSize[0]);
+    if (qAbs(aWinDiag) > aZeroTol && qAbs(aLength) > aZeroTol && qAbs(aMaxSize) > aZeroTol)
+      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(qMin(aSize[1],aSize[0]))/aMaxSize);
+    if(qAbs(aScale) > aZeroTol && qAbs(aScale - anOldScale)/aScale > aPrecision){
       SetScale(aScale);
     }
   }
@@ -97,16 +107,22 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
 
 vtkStandardNewMacro(VTKViewer_LineActor);
 
+#ifdef IPAL21440
+vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,vtkTextActor);
+#else
 vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
+#endif
 vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
 
 /*!Adds Label and Arrow actors to \a theRenderer.*/
 void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
 {
+#ifndef IPAL21440
   if(LabelActor && LabelActor->GetVisibility()){
     LabelActor->Modified();
     LabelActor->Render(theRenderer);
   }
+#endif
   if(ArrowActor && ArrowActor->GetVisibility()){
     ArrowActor->Modified();
     ArrowActor->Render(theRenderer);
@@ -148,6 +164,18 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLineActor->SetArrowActor(myArrowActor);
   
   /*! \li Initialize the Label pipe-line representation */
+#ifdef IPAL21440
+  myTextMapper = vtkTextMapper::New();
+  
+  myLabelActor = vtkTextActor::New();
+  myLabelActor->SetMapper(myTextMapper);
+  myLabelActor->ScaledTextOff();
+  myLabelActor->PickableOff();
+  
+  vtkCoordinate* aCoord = vtkCoordinate::New();
+  myLabelActor->GetPositionCoordinate()->SetReferenceCoordinate( aCoord );
+  aCoord->Delete();
+#else
   myVectorText = vtkVectorText::New();
   
   myMapper[2] = vtkPolyDataMapper::New();
@@ -159,6 +187,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLabelActor->SetSize(aLabelActorSize);
   myLabelActor->PickableOff();
   //myLabelActor->DebugOn();
+#endif
   
   myLineActor->SetLabelActor(myLabelActor);
   
@@ -177,8 +206,6 @@ VTKViewer_Axis::~VTKViewer_Axis()
   myMapper[0]->RemoveAllInputs();
   myMapper[0]->Delete();
   
-  myVectorText->Delete();
-  
   /*! \li Destroy of the Arrow pipe-line representation */
   myArrowActor->Delete();
   
@@ -190,8 +217,15 @@ VTKViewer_Axis::~VTKViewer_Axis()
   /*! \li Destroy of the Line pipe-line representation */
   myLineActor->Delete();
   
+#ifdef IPAL21440
+  myTextMapper->RemoveAllInputs();
+  myTextMapper->Delete();
+#else
+  myVectorText->Delete();
+  
   myMapper[2]->RemoveAllInputs();
   myMapper[2]->Delete();
+#endif
   
   myLineSource->Delete();
 }
@@ -240,15 +274,36 @@ void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis)
 /*! Set camera for myLabelActor
  */
 void VTKViewer_Axis::SetCamera(vtkCamera* theCamera){
+#ifndef IPAL21440
   myLabelActor->SetCamera(theCamera);
+#endif
 }
 
-/*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+/*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
  */
-void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
-  myLabelActor->SetProperty(theProperty);
-  myArrowActor->SetProperty(theProperty);
-  myLineActor->SetProperty(theProperty);
+void VTKViewer_Axis::SetColor(double theRed, double theGreen, double theBlue)
+{
+  // Set color property for arrow and line actors
+  vtkProperty* aProperty = vtkProperty::New();
+  aProperty->SetColor(theRed, theGreen, theBlue);
+
+  myArrowActor->SetProperty(aProperty);
+  myLineActor->SetProperty(aProperty);
+#ifndef IPAL21440
+  myLabelActor->SetProperty(aProperty);
+#endif
+
+  aProperty->Delete();
+  
+  // Set color property for label actor
+#ifdef IPAL21440
+  vtkTextProperty* aTextProperty = vtkTextProperty::New();
+  aTextProperty->SetColor(theRed, theGreen, theBlue);
+
+  myLabelActor->SetTextProperty(aTextProperty);
+
+  aTextProperty->Delete();
+#endif
 }
 
 /*! Set size of VTKViewer_Axis
@@ -266,8 +321,13 @@ void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
   myArrowActor->SetOrientation(myRot);
   myArrowActor->SetScale(theSize / 10.);
   
+#ifdef IPAL21440
+  if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
+    aCoord->SetValue( aPosition );
+#else
   myLabelActor->SetPosition(0.0,0.0,0.0);
   myLabelActor->AddPosition(aPosition);
+#endif
 }
 
 /*! Check if actor belongs to the axis object
@@ -278,7 +338,11 @@ bool VTKViewer_Axis::OwnActor(const vtkActor* theActor)
 {
   return theActor == myLineActor  || 
          theActor == myArrowActor ||
+#ifdef IPAL21440
+         false;
+#else
          theActor == myLabelActor;
+#endif
 }
 
 /*! \class VTKViewer_XAxis
@@ -300,11 +364,12 @@ vtkStandardNewMacro(VTKViewer_XAxis);
 VTKViewer_XAxis::VTKViewer_XAxis(){ 
   myDir[0] = 1.0; myDir[1] = 0.0; myDir[2] = 0.0;
   myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 0.0;
+#ifdef IPAL21440
+  myTextMapper->SetInput("X");
+#else
   myVectorText->SetText("X");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(1.0,0.0,0.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(1.0,0.0,0.0);
 }
 
 /*! \class VTKViewer_YAxis
@@ -326,11 +391,12 @@ VTKViewer_YAxis::VTKViewer_YAxis()
 { 
   myDir[0] = 0.0; myDir[1] = 1.0; myDir[2] = 0.0;
   myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 90.;
+#ifdef IPAL21440
+  myTextMapper->SetInput("Y");
+#else
   myVectorText->SetText("Y");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(0.0,1.0,0.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(0.0,1.0,0.0);
 }
 
 /*! \class VTKViewer_ZAxis
@@ -353,11 +419,12 @@ VTKViewer_ZAxis::VTKViewer_ZAxis()
 {
   myDir[0] = 0.0; myDir[1] = 0.0; myDir[2] = 1.0;
   myRot[0] = 0.0; myRot[1] = -90; myRot[2] = 0.0;
+#ifdef IPAL21440
+  myTextMapper->SetInput("Z");
+#else
   myVectorText->SetText("Z");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(0.0,0.0,1.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(0.0,0.0,1.0);
 }
 
 vtkStandardNewMacro(VTKViewer_Trihedron);
@@ -442,20 +509,22 @@ int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer)
 {
   //TVisibility aVis = GetVisibility();
   //SetVisibility(eOff);
-  vtkActorCollection* aCollection = theRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+  vtkActorCollection* aCollection = aCopy.GetActors();
   aCollection->InitTraversal();
   int aCount = 0;
   while(vtkActor* prop = aCollection->GetNextActor()) {
-    if( prop->GetVisibility())
+    if( prop->GetVisibility()) {
       if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(prop)) {
         if(!anActor->IsInfinitive()) 
-         aCount++;
+          aCount++;
       }
       else if ( !OwnActor( anActor ) ) {
-       aCount++;
+        aCount++;
       }
         //int aCount = theRenderer->VisibleActorCount();
         //SetVisibility(aVis);
+    }
   }
   return aCount;
 }
index f1bf77d3e66406c700f3c5844b915416be70a52c..c07aa4df950896efa016ad21ca249b95cfd47225 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_TRIHEDRON_H
 #define VTKVIEWER_TRIHEDRON_H
 
@@ -35,9 +36,22 @@ class vtkPolyDataMapper;
 class vtkLineSource;
 class vtkConeSource;
 class vtkVectorText;
+class vtkTextActor;
+class vtkTextMapper;
 
 class VTKViewer_Axis;
 
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
+// VTKViewer_UnScaledActor is temporarily replaced with simple vtkTextActor
+// This workaround caused by the bug with disappeared labels of the trihedron
+// reproduced after migration from qt-4.4.3 to qt-4.5.2
+#if (VTK_XVERSION < 0x050200)
+#define IPAL21440
+#endif
+
 /*! \class vtkFollower
  * See <a href="http://www.vtk.org/">vtk documentation</a>
  */
@@ -81,10 +95,17 @@ public:
   /*!Create new instance of VTKViewer_LineActor.*/
   static VTKViewer_LineActor *New();
   
-  /*! Sets Lable actor.
+#ifdef IPAL21440
+  /*! Sets Label actor.
+   * \param theLabelActor - vtkTextActor
+   */
+  void SetLabelActor(vtkTextActor* theLabelActor);
+#else
+  /*! Sets Label actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
    */
   void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
+#endif
   
   /*! Sets Arrow actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
@@ -108,7 +129,11 @@ protected:
   }
 
   /*!Label actor pointer*/
+#ifdef IPAL21440
+  vtkTextActor* LabelActor;
+#else
   VTKViewer_UnScaledActor* LabelActor;
+#endif
 
   /*!Arrow actor pointer*/
   vtkFollower* ArrowActor;
@@ -226,9 +251,12 @@ public:
    */
   virtual void SetCamera(vtkCamera* theCamera);
 
-  /*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+  /*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
+   * \param theRed - red component of the color
+   * \param theGreen - green component of the color
+   * \param theBlue - blue component of the color
    */
-  virtual void SetProperty(vtkProperty* theProperty);
+  virtual void SetColor(double theRed, double theGreen, double theBlue);
   
   /*! Set size of VTKViewer_Axis
    */
@@ -237,7 +265,11 @@ public:
   /*! Get label actor.
    * \retval Return myLabelActor.
    */
+#ifdef IPAL21440
+  virtual vtkTextActor* GetLabel() { return myLabelActor; }
+#else
   virtual VTKViewer_UnScaledActor* GetLabel() { return myLabelActor; }
+#endif
   
   /*! Get arrow actor.
    * \retval Return myArrowActor
@@ -273,7 +305,11 @@ protected:
 
   /*! VTKViewer_UnScaledActor actor pointer
    */
+#ifdef IPAL21440
+  vtkTextActor *myLabelActor;
+#else
   VTKViewer_UnScaledActor *myLabelActor;
+#endif
   
   /*! \li myMapper[0] - for the Line pipe-line representation
    *  \li myMapper[1] - for the Arrow pipe-line representation
@@ -289,9 +325,15 @@ protected:
    */
   vtkConeSource *myConeSource;
 
+#ifdef IPAL21440
+  /*! vtkTextMapper pointer (Label)
+   */
+  vtkTextMapper *myTextMapper;
+#else
   /*! VTKViewer_VectorText pointer (Label)
    */
   vtkVectorText* myVectorText;
+#endif
 };
 
 #endif
index 03d085813444b47ae74dbf872b5f352adedbe61f..15cfe20606228b0d40be3280f8accff9a1eed370 100755 (executable)
@@ -1,26 +1,28 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_Utilities.h"
 #include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
 
 #include <algorithm>
 
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 
-using namespace std;
-
 /*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/
 void 
 ResetCamera(vtkRenderer* theRenderer, 
-           int theUsingZeroFocalPoint)
+            int theUsingZeroFocalPoint)
 {  
   if(!theRenderer)
     return;
@@ -51,16 +51,16 @@ ResetCamera(vtkRenderer* theRenderer,
     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);
+    aLength = std::max((aBounds[3]-aBounds[2]),aLength);
+    aLength = std::max((aBounds[5]-aBounds[4]),aLength);
     
     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]));
+           (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+           (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
     
     if(aWidth < MIN_DISTANCE)
       return;
@@ -87,8 +87,8 @@ ResetCamera(vtkRenderer* theRenderer,
     
     // update the camera
     aCamera->SetPosition(aCenter[0]+aDistance*aViewPlaneNormal[0],
-                        aCenter[1]+aDistance*aViewPlaneNormal[1],
-                        aCenter[2]+aDistance*aViewPlaneNormal[2]);
+                         aCenter[1]+aDistance*aViewPlaneNormal[1],
+                         aCenter[2]+aDistance*aViewPlaneNormal[2]);
 
     // find size of the window
     int* aWinSize = theRenderer->GetSize();
@@ -107,7 +107,7 @@ ResetCamera(vtkRenderer* theRenderer,
 /*! Compute the bounds of the visible props*/
 int
 ComputeVisiblePropBounds(vtkRenderer* theRenderer, 
-                        vtkFloatingPointType theBounds[6])
+                         vtkFloatingPointType theBounds[6])
 {
   int aCount = 0;
   
@@ -115,32 +115,33 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer,
   theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT;
   
   // loop through all props
-  vtkActorCollection* aCollection = theRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+  vtkActorCollection* aCollection = aCopy.GetActors();
   aCollection->InitTraversal();
   while (vtkActor* aProp = aCollection->GetNextActor()) {
     // if it's invisible, or has no geometry, we can skip the rest 
-    if(aProp->GetVisibility() && aProp->GetMapper()){
+    if(aProp->GetVisibility() && aProp->GetMapper() && vtkMath::AreBoundsInitialized(aProp->GetBounds())){
       if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp))
         if(anActor->IsInfinitive())
-         continue;
-       
+          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 )
+           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++;
+        aCount++;
 
-       theBounds[0] = min(aBounds[0],theBounds[0]);
-       theBounds[2] = min(aBounds[2],theBounds[2]);
-       theBounds[4] = min(aBounds[4],theBounds[4]);
+        theBounds[0] = std::min(aBounds[0],theBounds[0]);
+        theBounds[2] = std::min(aBounds[2],theBounds[2]);
+        theBounds[4] = std::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]);
+        theBounds[1] = std::max(aBounds[1],theBounds[1]);
+        theBounds[3] = std::max(aBounds[3],theBounds[3]);
+        theBounds[5] = std::max(aBounds[5],theBounds[5]);
 
       }//not bogus
     }
@@ -192,9 +193,9 @@ ResetCameraClippingRange(vtkRenderer* theRenderer)
 /*!Compute trihedron size.*/
 bool
 ComputeTrihedronSize( vtkRenderer* theRenderer,
-                     vtkFloatingPointType& theNewSize,
-                     const vtkFloatingPointType theSize, 
-                     const vtkFloatingPointType theSizeInPercents )
+                      vtkFloatingPointType& theNewSize,
+                      const vtkFloatingPointType theSize, 
+                      const vtkFloatingPointType theSizeInPercents )
 {
   // calculating diagonal of visible props of the renderer
   vtkFloatingPointType bnd[ 6 ];
@@ -206,8 +207,8 @@ ComputeTrihedronSize( vtkRenderer* theRenderer,
   vtkFloatingPointType aLength = 0;
 
   aLength = bnd[ 1 ]-bnd[ 0 ];
-  aLength = max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength );
-  aLength = max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength );
+  aLength = std::max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength );
+  aLength = std::max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength );
 
   static vtkFloatingPointType EPS_SIZE = 5.0E-3;
   theNewSize = aLength * theSizeInPercents / 100.0;
@@ -227,7 +228,8 @@ bool IsBBEmpty(vtkRenderer* theRenderer)
   aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
   
   // iterate through displayed objects and set size if necessary
-  vtkActorCollection* anActors = theRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
   anActors->InitTraversal();
   bool isAny = false;
   while(vtkActor* anAct = anActors->GetNextActor())
@@ -235,11 +237,11 @@ bool IsBBEmpty(vtkRenderer* theRenderer)
     if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(anAct))
       if(anActor->GetVisibility() && !anActor->IsInfinitive())
       {
-       vtkFloatingPointType *aBounds = anActor->GetBounds();
-       if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-          aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-          aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
-         isAny = true;
+        vtkFloatingPointType *aBounds = anActor->GetBounds();
+        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+          isAny = true;
       }
   
   return !isAny;
@@ -257,7 +259,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
   aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
 
   // iterate through displayed objects and set size if necessary
-  vtkActorCollection* anActors = theRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+  vtkActorCollection* anActors = aCopy.GetActors();
   anActors->InitTraversal();
   bool isAny = false;
   while(vtkActor* anAct = anActors->GetNextActor())
@@ -267,19 +270,19 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
     {
       if(anActor->GetVisibility() && !anActor->IsInfinitive())
       {
-       vtkFloatingPointType *aBounds = anActor->GetBounds();
-       if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-          aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-          aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
-       {
-         for(int i = 0; i < 5; i = i + 2){
-           if(aBounds[i] < aNewBndBox[i]) 
-             aNewBndBox[i] = aBounds[i];
-           if(aBounds[i+1] > aNewBndBox[i+1]) 
-             aNewBndBox[i+1] = aBounds[i+1];
-         }
-         isAny = true;
-       }
+        vtkFloatingPointType *aBounds = anActor->GetBounds();
+        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+        {
+          for(int i = 0; i < 5; i = i + 2){
+            if(aBounds[i] < aNewBndBox[i]) 
+              aNewBndBox[i] = aBounds[i];
+            if(aBounds[i+1] > aNewBndBox[i+1]) 
+              aNewBndBox[i+1] = aBounds[i+1];
+          }
+          isAny = true;
+        }
       }
     }
   }
@@ -297,16 +300,16 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
     static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
     
     vtkFloatingPointType aLength = aNewBndBox[1]-aNewBndBox[0];
-    aLength = max((aNewBndBox[3]-aNewBndBox[2]),aLength);
-    aLength = max((aNewBndBox[5]-aNewBndBox[4]),aLength);
+    aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength);
+    aLength = std::max((aNewBndBox[5]-aNewBndBox[4]),aLength);
     
     if(aLength < MIN_DISTANCE)
       return false;
 
     vtkFloatingPointType aWidth = 
       sqrt((aNewBndBox[1]-aNewBndBox[0])*(aNewBndBox[1]-aNewBndBox[0]) +
-          (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
-          (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
+           (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
+           (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
     
     if(aWidth < MIN_DISTANCE)
       return false;
@@ -323,7 +326,7 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
   vtkFloatingPointType aBounds[6];
   int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
   printf("aNewBndBox[0] = %f, aNewBndBox[1] = %f,\naNewBndBox[2] = %f, aNewBndBox[3] = %f,\naNewBndBox[4] = %f, aNewBndBox[5] = %f\n",
-          aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
+           aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
   printf("aCount = %d\n",aCount);
 
   if(aCount){
@@ -338,8 +341,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
 
     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]));
+           (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+           (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
     
     if(aWidth < MIN_DISTANCE)
       return false;
index a9074da59cc17e3badef38d9afdf71d672a06b9a..1ddf940bf5025b119e7f569642b632eaaa989f9f 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_UTILITIES_H
 #define VTKVIEWER_UTILITIES_H
 
@@ -30,13 +31,13 @@ VTKVIEWER_EXPORT
 extern
 void
 ResetCamera(vtkRenderer* theRenderer, 
-           int theUsingZeroFocalPoint = false);
+            int theUsingZeroFocalPoint = false);
 
 VTKVIEWER_EXPORT
 extern
 int
 ComputeVisiblePropBounds(vtkRenderer* theRenderer, 
-                        vtkFloatingPointType theBounds[6]);
+                         vtkFloatingPointType theBounds[6]);
 
 VTKVIEWER_EXPORT
 extern
@@ -46,9 +47,9 @@ VTKVIEWER_EXPORT
 extern
 bool
 ComputeTrihedronSize(vtkRenderer* theRenderer, 
-                    vtkFloatingPointType& theNewSize, 
-                    const vtkFloatingPointType theSize, 
-                    const vtkFloatingPointType theSizeInPercents);
+                     vtkFloatingPointType& theNewSize, 
+                     const vtkFloatingPointType theSize, 
+                     const vtkFloatingPointType theSizeInPercents);
 
 VTKVIEWER_EXPORT
 extern
@@ -56,5 +57,5 @@ bool IsBBEmpty(vtkRenderer* theRenderer);
 VTKVIEWER_EXPORT
 extern
 bool ComputeBBCenter(vtkRenderer* theRenderer, 
-                    vtkFloatingPointType theCenter[3]);
+                     vtkFloatingPointType theCenter[3]);
 #endif
diff --git a/src/VTKViewer/VTKViewer_VectorText.cxx b/src/VTKViewer/VTKViewer_VectorText.cxx
deleted file mode 100755 (executable)
index 8c7f866..0000000
+++ /dev/null
@@ -1,1756 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    $RCSfile$
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
-
-  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
-  All rights reserved.
-  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
-
-     This software is distributed WITHOUT ANY WARRANTY; without even 
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
-     PURPOSE.  See the above copyright notice for more information.*/
-     
-// Modified by Open CASCADE SAS (www.opencascade.com)    
-
-// VTKViewer_VectorText.cxx is a copy of vtkVectorText.cxx file.
-// Purpose of copying:  to remove linking to libHybrid.so VTK library 
-
-#include "VTKViewer_VectorText.h"
-
-#include "vtkCellArray.h"
-#include "vtkObjectFactory.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-using namespace std;
-
-vtkCxxRevisionMacro(VTKViewer_VectorText, "$Revision$");
-vtkStandardNewMacro(VTKViewer_VectorText);
-
-char *VTK_VECTOR_TEXT_33 = (char *) "11 0.438482 "
-"0.28000 -0.07186 0.43164 -0.07143 0.27689 0.07714 0.43472 0.07714 0.32000 0.20134 "
-"0.40000 0.20243 0.31429 0.20550 0.27277 0.76857 0.43848 0.76857 0.27693 1.02571 "
-"0.43429 1.02615 7 2 1 3 2 0 1 7 6 5 6 4 5 8 "
-"7 5 7 8 9 10 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_34 = (char *) "21 0.615625 "
-"0.25714 0.63563 0.32571 0.63563 0.50286 0.63642 0.25143 0.63946 0.33143 0.63840 "
-"0.33462 0.64286 0.49673 0.64286 0.57714 0.63757 0.58093 0.64286 0.21335 0.84286 "
-"0.36680 0.84286 0.46177 0.84286 0.61522 0.84286 0.21295 1.02000 0.46134 1.02000 "
-"0.61563 1.02000 0.36571 1.02307 0.46550 1.02571 0.21714 1.02615 0.36000 1.02723 "
-"0.61143 1.02615 17 3 5 9 7 6 2 4 5 1 6 8 12 0 1 5 6 "
-"12 11 3 0 5 7 8 6 11 12 14 13 9 10 10 9 5 15 14 12 19 "
-"18 10 18 13 10 17 14 20 14 15 20 16 19 10 "
-;
-
-char *VTK_VECTOR_TEXT_35 = (char *) "43 0.974539 "
-"0.22286 -0.09100 0.32571 -0.09236 0.56832 -0.08857 0.67429 -0.09201 0.28193 0.22000 "
-"0.39470 0.22000 0.63009 0.22000 0.15385 0.23143 0.27429 0.22723 0.40571 0.22723 "
-"0.62286 0.22723 0.74857 0.22680 0.97454 0.23143 0.15385 0.33429 0.97454 0.33429 "
-"0.30344 0.34000 0.65201 0.34000 0.77084 0.34000 0.42286 0.34010 0.42034 0.34571 "
-"0.36041 0.60286 0.70748 0.60286 0.82034 0.60286 0.47429 0.60626 0.15385 0.61429 "
-"0.35429 0.61009 0.70286 0.60951 0.82857 0.61009 0.97454 0.61429 0.15385 0.71714 "
-"0.37714 0.72134 0.50286 0.72191 0.72571 0.72134 0.85143 0.72156 0.97143 0.72025 "
-"0.38605 0.72857 0.49823 0.72857 0.73335 0.72857 0.84613 0.72857 0.45143 1.04160 "
-"0.55735 1.04286 0.80000 1.04243 0.90521 1.04286 43 6 2 3 5 0 1 0 5 4 18 "
-"9 10 11 6 3 4 9 8 13 8 15 17 6 11 9 4 5 13 7 8 17 "
-"12 14 8 9 15 15 19 20 16 6 17 12 17 11 18 10 16 10 6 16 21 "
-"16 17 18 19 9 15 9 19 20 30 25 23 20 19 34 33 28 29 24 25 29 "
-"25 30 27 21 22 33 21 27 20 23 30 22 21 17 33 27 28 31 26 32 35 "
-"30 23 32 38 37 31 35 23 21 32 26 26 31 23 32 21 38 41 37 38 36 "
-"35 31 38 21 33 40 39 36 42 41 38 39 35 36 "
-;
-
-char *VTK_VECTOR_TEXT_36 = (char *) "73 0.921518 "
-"0.52571 -0.22882 0.59429 -0.22991 0.52000 -0.09942 0.60571 -0.09385 0.40571 -0.07057 "
-"0.72730 -0.06571 0.33143 -0.03465 0.80571 -0.01813 0.51429 0.01891 0.52152 0.02571 "
-"0.60571 0.02014 0.84571 0.02168 0.25669 0.04286 0.66857 0.03800 0.44571 0.04535 "
-"0.70984 0.06571 0.74535 0.10571 0.74857 0.11079 0.74902 0.11143 0.37057 0.12857 "
-"0.90538 0.12857 0.20823 0.15143 0.35748 0.16286 0.77395 0.16857 0.35429 0.17310 "
-"0.35177 0.18000 0.78134 0.21429 0.92152 0.21429 0.19580 0.22571 0.33480 0.25429 "
-"0.77395 0.29429 0.91177 0.32286 0.76000 0.32921 0.72571 0.36972 0.89355 0.37429 "
-"0.64690 0.40857 0.65143 0.40706 0.64000 0.41109 0.60571 0.41986 0.52109 0.43714 "
-"0.85714 0.43270 0.38857 0.49216 0.79429 0.48902 0.72571 0.52437 0.30454 0.54571 "
-"0.60260 0.56286 0.52043 0.58571 0.26286 0.59570 0.46857 0.59800 0.39429 0.65095 "
-"0.22857 0.67295 0.36823 0.70000 0.75429 0.77624 0.21907 0.78571 0.35891 0.78571 "
-"0.89184 0.79714 0.37714 0.85001 0.72571 0.86144 0.87470 0.86571 0.24571 0.89016 "
-"0.68571 0.90956 0.44000 0.92036 0.60571 0.94469 0.83179 0.94571 0.28000 0.94629 "
-"0.51429 0.94891 0.34286 1.00607 0.75429 1.01579 0.38286 1.02784 0.52043 1.06571 "
-"0.60260 1.06571 0.52260 1.12286 0.60043 1.12286 75 3 8 2 2 8 4 19 12 6 13 11 15 9 8 10 3 2 1 8 "
-"3 10 5 13 10 15 11 16 7 13 5 4 14 6 2 0 1 5 10 3 12 "
-"22 21 14 4 8 13 7 11 11 18 16 20 23 18 18 17 16 20 18 11 19 "
-"6 14 28 21 29 26 23 20 12 19 22 25 22 24 21 22 25 21 25 29 26 "
-"27 30 27 26 20 31 32 30 31 30 27 40 33 32 37 43 38 34 32 31 38 "
-"39 9 40 32 34 38 9 10 43 33 42 37 36 43 39 38 43 42 33 40 35 "
-"36 37 33 43 36 39 45 46 48 41 39 45 39 43 41 48 44 47 51 50 46 "
-"62 65 48 39 46 44 49 47 49 44 48 54 53 50 51 47 49 53 56 59 53 "
-"54 56 66 64 56 55 58 52 58 57 52 54 50 51 59 56 64 67 60 63 60 "
-"57 63 66 61 68 61 66 56 68 65 69 65 62 69 62 46 45 63 57 58 62 "
-"60 67 68 61 65 71 70 72 70 62 67 62 70 69 71 69 70 "
-;
-
-char *VTK_VECTOR_TEXT_37 = (char *) "81 1.409911 "
-"0.46713 -0.11143 0.57143 -0.11215 1.19429 -0.11252 1.10286 -0.10252 1.26444 -0.09429 "
-"1.05143 -0.07759 1.31429 -0.06384 1.14857 -0.01538 1.18857 -0.01807 0.98857 -0.01364 "
-"1.22286 -0.00771 1.36784 -0.00286 1.11302 0.00286 1.26436 0.03143 1.07787 0.04857 "
-"0.95748 0.05429 1.39681 0.06571 1.28680 0.09429 1.05866 0.14000 1.40991 0.14571 "
-"0.94134 0.15143 0.94134 0.21429 1.29295 0.21429 1.06134 0.23714 1.40723 0.23714 "
-"0.95748 0.30000 1.39387 0.30000 1.07787 0.30571 1.27429 0.30371 1.09561 0.33429 "
-"1.23429 0.35465 1.36616 0.36286 1.13143 0.36327 1.16571 0.37277 1.20571 0.36899 "
-"1.00045 0.38571 1.32000 0.41543 1.06857 0.44498 1.24571 0.45681 0.48000 0.46420 "
-"1.15429 0.46723 0.38857 0.47462 0.55016 0.48286 0.60000 0.51330 0.30286 0.52704 "
-"0.43429 0.56177 0.47429 0.55907 0.26857 0.57284 0.50857 0.56943 0.65355 0.57429 "
-"0.39873 0.58000 0.55007 0.60857 0.24530 0.62571 0.36359 0.62571 0.68252 0.64286 "
-"0.56680 0.64857 0.23050 0.69429 0.34437 0.71714 0.57866 0.72286 0.69563 0.72286 "
-"0.22705 0.79143 0.34705 0.81429 0.69295 0.81429 0.56891 0.85429 0.67959 0.87714 "
-"0.24530 0.88286 0.36359 0.88286 0.38132 0.91143 0.54286 0.90975 0.52000 0.93179 "
-"0.65465 0.93429 0.41714 0.94041 0.47429 0.94950 0.29143 0.96914 0.60571 0.99258 "
-"0.32000 0.99868 0.38286 1.03395 0.53714 1.03184 1.06857 1.04249 1.17287 1.04286 "
-"0.48000 1.04395 79 0 1 78 10 4 6 2 8 3 9 14 15 4 "
-"10 8 3 7 5 7 3 8 10 6 13 12 5 7 5 12 9 4 8 2 13 "
-"16 17 17 19 22 14 9 12 15 18 20 11 13 6 13 11 16 17 16 19 18 "
-"15 14 21 20 18 21 23 25 22 26 28 23 21 18 24 22 19 25 27 35 35 "
-"29 37 22 24 26 28 31 30 27 25 23 31 28 26 27 29 35 36 30 31 38 "
-"34 30 38 33 34 37 32 40 32 33 40 38 30 36 32 37 29 40 33 38 42 "
-"46 39 47 53 52 48 43 51 39 46 41 41 50 44 56 57 60 45 41 46 42 "
-"48 46 48 42 43 50 41 45 53 47 44 51 49 55 54 55 49 53 44 50 49 "
-"51 43 55 54 58 59 58 54 57 56 52 57 52 53 60 61 65 58 62 63 57 "
-"61 60 62 64 63 65 66 73 66 65 61 73 66 75 58 59 62 63 64 68 70 "
-"69 68 67 75 66 70 68 64 76 71 72 75 67 76 74 69 70 71 76 67 69 "
-"77 72 72 77 80 77 69 74 76 72 80 79 78 1 "
-;
-
-char *VTK_VECTOR_TEXT_38 = (char *) "76 1.126291 "
-"0.58857 -0.08966 1.03429 -0.09235 0.48000 -0.08395 0.66286 -0.07673 0.40000 -0.05914 "
-"0.72000 -0.05641 0.98286 -0.05473 0.35429 -0.03393 0.78857 -0.01678 1.12629 0.00857 "
-"0.29143 0.02168 0.52571 0.02991 0.57714 0.02764 0.62286 0.03756 0.46857 0.04645 "
-"0.87429 0.05495 0.69714 0.07393 0.42132 0.08286 1.04571 0.07868 0.24486 0.08857 "
-"0.75011 0.11714 0.22327 0.14000 0.37927 0.14571 0.78349 0.16286 0.96893 0.16286 "
-"0.96571 0.16717 0.96457 0.16857 0.95937 0.18000 0.35580 0.22571 0.20991 0.25429 "
-"0.36319 0.28857 0.86286 0.29600 1.02437 0.31143 0.22645 0.32857 0.40418 0.36286 "
-"0.40571 0.36454 0.41330 0.37429 1.05421 0.40857 0.28418 0.42571 0.92000 0.44119 "
-"0.53714 0.46770 0.37143 0.50250 0.66758 0.54000 0.46406 0.55714 0.78704 0.62571 "
-"0.59429 0.63146 0.37714 0.68444 0.69296 0.70000 0.85355 0.71714 0.35681 0.73429 "
-"0.50200 0.75143 0.49756 0.76286 0.49502 0.76857 0.72891 0.76857 0.86966 0.76857 "
-"0.34748 0.82000 0.73295 0.82000 0.48764 0.82571 0.87236 0.83143 0.49714 0.86089 "
-"0.35849 0.87143 0.71429 0.87650 0.52000 0.89555 0.69714 0.89846 0.37964 0.91714 "
-"0.84657 0.91714 0.55429 0.92073 0.65714 0.92498 0.60000 0.93277 0.81868 0.95714 "
-"0.42857 0.97582 0.76571 1.00436 0.51429 1.02723 0.72000 1.02723 0.59429 1.04437 "
-"0.64571 1.04395 78 7 17 10 3 13 0 "
-"2 14 4 6 18 15 17 7 4 9 18 "
-"6 9 6 1 8 16 5 0 12 2 "
-"17 4 14 2 11 14 12 0 13 13 5 "
-"16 15 24 20 16 8 20 13 3 5 "
-"2 12 11 10 17 19 21 28 29 15 20 "
-"8 20 24 23 40 23 31 24 25 26 "
-"19 22 21 31 23 27 22 19 17 18 24 "
-"15 28 21 22 29 30 33 31 32 39 "
-"23 24 26 30 29 28 23 26 27 33 30 "
-"38 32 31 27 38 36 41 38 34 36 "
-"34 38 30 36 34 35 39 32 37 42 40 "
-"31 40 41 36 42 44 47 45 43 40 "
-"40 43 41 50 46 43 50 49 46 45 40 "
-"42 48 53 47 45 42 47 49 52 55 "
-"53 48 56 50 43 45 57 60 55 52 50 "
-"51 49 50 52 48 47 44 54 56 48 "
-"56 65 61 60 59 64 59 60 57 65 56 "
-"58 52 57 55 64 59 70 58 56 54 "
-"59 62 70 68 74 72 65 69 61 70 66 "
-"72 63 71 67 63 61 69 70 62 66 "
-"67 73 68 71 63 69 73 67 71 68 72 "
-"66 74 68 75 75 68 73 "
-;
-
-char *VTK_VECTOR_TEXT_39 = (char *) "10 0.364197 "
-"0.25143 0.63563 0.24571 0.63946 0.32571 0.63757 0.32950 0.64286 0.21034 0.83714 "
-"0.36379 0.83714 0.20991 1.02000 0.36420 1.02000 0.21408 1.02571 0.36000 1.02615 8 1 0 3 "
-"2 3 0 1 3 4 7 6 4 5 4 "
-"3 7 4 5 8 6 9 6 7 9 "
-;
-
-char *VTK_VECTOR_TEXT_40 = (char *) "19 0.595731 "
-"0.50857 -0.39522 0.59429 -0.39447 0.44000 -0.30784 0.51787 -0.24857 0.32530 -0.09429 "
-"0.43748 -0.05429 0.26899 0.06571 0.38134 0.20286 0.23580 0.27714 0.37605 0.38000 "
-"0.23848 0.41429 0.39320 0.53429 0.27177 0.59714 0.43748 0.71143 0.47216 0.80286 "
-"0.36086 0.82000 0.45714 0.97936 0.59573 1.04286 0.50857 1.04395 17 2 3 4 0 3 2 3 "
-"0 1 6 4 5 3 5 4 6 7 8 7 6 5 9 10 8 9 8 7 10 "
-"11 12 10 9 11 12 13 15 12 11 13 14 15 13 16 15 14 17 18 16 17 "
-"16 14 "
-;
-
-char *VTK_VECTOR_TEXT_41 = (char *) "19 0.598482 "
-"0.24000 -0.39447 0.33143 -0.39258 0.40616 -0.28857 0.31641 -0.24857 0.48784 -0.14000 "
-"0.39681 -0.05429 0.55538 0.03143 0.45295 0.20286 0.59580 0.23714 0.59848 0.37429 "
-"0.45823 0.38000 0.44723 0.49429 0.56252 0.59714 0.41714 0.64134 0.47343 0.82000 "
-"0.34857 0.83301 0.37714 0.97936 0.23855 1.04286 0.32571 1.04395 17 0 1 3 2 3 1 3 "
-"4 5 3 2 4 5 6 7 6 5 4 7 8 10 8 9 10 11 10 9 8 "
-"7 6 11 12 13 13 14 15 12 11 9 14 13 12 15 16 17 16 15 14 16 "
-"18 17 "
-;
-
-char *VTK_VECTOR_TEXT_42 = (char *) "34 0.685300 "
-"0.33143 0.58250 0.33714 0.58223 0.53714 0.58250 0.54286 0.58194 0.36213 0.61429 "
-"0.25587 0.63714 0.25266 0.64286 0.62655 0.64286 0.25393 0.64857 0.43429 0.73293 "
-"0.44000 0.73049 0.36715 0.78000 0.50714 0.78000 0.35429 0.78613 0.63429 0.80816 "
-"0.19309 0.82571 0.68389 0.82571 0.19177 0.83143 0.68530 0.83143 0.38857 0.86213 "
-"0.39523 0.86571 0.48000 0.86242 0.47660 0.86571 0.34657 0.88286 0.58857 0.90823 "
-"0.22286 0.92522 0.22857 0.92848 0.64571 0.92816 0.65143 0.92675 0.49295 1.02000 "
-"0.38134 1.03714 0.38550 1.04286 0.49143 1.04021 0.48571 1.04437 32 2 12 10 8 4 11 "
-"8 5 4 8 6 5 4 0 1 2 3 "
-"12 0 4 5 12 9 10 9 11 4 "
-"19 11 21 14 24 12 26 25 17 16 18 "
-"14 13 23 15 19 21 20 11 19 13 "
-"33 31 30 24 21 12 12 21 9 21 11 "
-"9 26 17 23 12 3 7 27 24 18 "
-"13 19 23 23 17 15 20 21 22 18 24 "
-"14 28 27 18 33 30 20 29 20 22 "
-"29 33 20 32 33 29 "
-;
-
-char *VTK_VECTOR_TEXT_43 = (char *) "20 0.952768 "
-"0.52836 0.10571 0.64878 0.10571 0.52420 0.11143 0.65295 0.11143 0.52420 0.39714 "
-"0.65295 0.39714 0.22857 0.40546 0.52000 0.40329 0.66286 0.40437 0.95168 0.40857 "
-"0.22437 0.52286 0.95277 0.52286 0.22857 0.52900 0.52311 0.53429 0.65403 0.53429 "
-"0.94857 0.52900 0.52528 0.82571 0.65186 0.82571 0.53143 0.82991 0.64571 0.82991 18 1 2 0 1 3 2 "
-"4 2 3 5 4 3 12 6 7 14 4 "
-"8 9 15 8 8 4 5 9 11 15 "
-"12 7 13 6 12 10 7 4 13 14 8 "
-"15 17 19 18 14 13 4 17 18 16 "
-"17 16 13 17 13 14 "
-;
-
-char *VTK_VECTOR_TEXT_44 = (char *) "23 0.432768 "
-"0.30286 -0.28607 0.30857 -0.28726 0.33714 -0.27355 0.36571 -0.25275 0.27329 -0.23714 "
-"0.38670 -0.23143 0.30286 -0.21582 0.39914 -0.21429 0.32115 -0.19714 0.41355 -0.18571 "
-"0.33800 -0.16857 0.42327 -0.15714 0.34605 -0.14571 0.43277 -0.10000 0.35580 -0.08286 "
-"0.35472 -0.07714 0.28571 -0.07295 0.34857 -0.07295 0.28000 -0.06878 0.27957 0.07714 "
-"0.43168 0.07714 0.28571 0.08134 0.42857 0.08025 21 0 6 4 0 "
-"1 2 0 2 6 3 6 2 8 5 10 5 7 10 6 5 8 5 6 3 10 "
-"7 12 9 12 7 12 13 14 11 12 9 12 11 13 18 17 19 17 21 19 15 "
-"14 13 15 13 17 21 17 22 17 20 22 18 16 17 20 17 13 "
-;
-
-char *VTK_VECTOR_TEXT_45 = (char *) "8 0.606146 "
-"0.19118 0.26000 0.19429 0.25689 0.60000 0.25580 0.60615 0.26000 0.19118 0.38571 "
-"0.60615 0.38571 0.19429 0.38882 0.60000 0.38991 6 6 1 2 6 0 "
-"1 6 2 7 6 4 0 7 2 3 "
-"5 7 3 "
-;
-
-char *VTK_VECTOR_TEXT_46 = (char *) "13 0.432768 "
-"0.28571 -0.07295 0.42286 -0.07295 0.42857 -0.07186 0.27848 -0.06571 0.28000 -0.06878 "
-"0.43277 -0.06571 0.27848 0.07143 0.43277 0.07143 0.27957 0.07714 0.43168 0.07714 "
-"0.28571 0.08134 0.42286 0.08134 0.42857 0.08025 11 0 "
-"3 4 3 0 1 8 6 10 5 1 2 3 1 5 6 3 5 6 7 11 6 "
-"5 7 10 6 11 9 12 11 9 11 7 "
-;
-
-char *VTK_VECTOR_TEXT_47 = (char *) "5 0.562348 "
-"0.14389 -0.08857 0.14857 -0.09256 0.25004 -0.08857 0.56235 1.04286 0.46286 1.04358 3 2 0 1 4 0 2 3 "
-"4 2 "
-;
-
-char *VTK_VECTOR_TEXT_48 = (char *) "53 0.926804 "
-"0.53714 -0.09009 0.59429 -0.09009 0.66857 -0.07673 0.43429 -0.06723 0.73143 -0.05070 "
-"0.34286 -0.00972 0.80571 0.01025 0.54857 0.02152 0.61714 0.02891 0.30241 0.03714 "
-"0.65714 0.04645 0.46857 0.05007 0.42473 0.08857 0.70286 0.08454 0.26645 0.10000 "
-"0.86943 0.11143 0.39955 0.12286 0.73800 0.13429 0.23748 0.18000 0.37034 0.19714 "
-"0.76252 0.20286 0.91236 0.26000 0.21866 0.26571 0.35621 0.26571 0.77823 0.28857 "
-"0.34437 0.40286 0.92680 0.40286 0.20420 0.40857 0.78705 0.54000 0.20723 0.58000 "
-"0.92420 0.58571 0.35277 0.64286 0.22177 0.69429 0.76571 0.72437 0.89966 0.74000 "
-"0.37756 0.76286 0.74498 0.79143 0.26073 0.82571 0.85927 0.84857 0.42473 0.85429 "
-"0.70439 0.85429 0.46286 0.88902 0.66286 0.89007 0.30241 0.90000 0.51009 0.91143 "
-"0.58286 0.91823 0.80725 0.92857 0.77714 0.95829 0.38350 0.98000 0.71429 0.99927 "
-"0.46286 1.01681 0.65714 1.01959 0.53714 1.02991 53 2 8 1 0 7 3 5 16 9 2 10 8 0 "
-"1 8 7 0 8 12 16 5 11 3 7 3 12 5 15 20 17 11 12 3 13 "
-"6 17 6 13 4 9 16 14 10 4 13 14 19 18 4 10 2 15 17 6 19 "
-"14 16 21 24 20 23 18 19 22 25 27 24 26 28 23 22 18 21 20 15 26 "
-"24 21 22 23 25 29 27 25 29 31 32 28 30 33 31 29 25 30 28 26 32 "
-"35 37 46 40 36 30 34 33 32 31 35 43 39 48 43 37 35 38 36 33 38 "
-"33 34 42 40 49 48 41 50 39 43 35 47 40 46 46 36 38 41 44 50 45 "
-"52 44 42 51 45 41 48 39 49 40 47 50 44 52 52 45 51 42 49 51 "
-;
-
-char *VTK_VECTOR_TEXT_49 = (char *) "11 0.708571 "
-"0.58286 -0.07186 0.70857 -0.07186 0.30857 0.62908 0.31429 0.62657 0.38286 0.65641 "
-"0.30785 0.75143 0.57714 0.77731 0.47429 0.85616 0.56384 0.94000 0.62857 1.02915 "
-"0.70857 1.02882 9 6 0 1 2 4 5 7 5 4 2 3 4 6 "
-"8 7 6 7 4 10 8 6 10 6 1 10 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_50 = (char *) "43 0.914286 "
-"0.18857 -0.06878 0.91429 -0.06878 0.18748 -0.04286 0.19849 0.00857 0.91429 0.05164 "
-"0.38142 0.06000 0.22943 0.07714 0.46286 0.15868 0.30286 0.17832 0.38286 0.25813 "
-"0.58413 0.43143 0.78286 0.44454 0.67543 0.52286 0.85355 0.53429 0.72045 0.58000 "
-"0.89756 0.62571 0.75470 0.64286 0.35168 0.70000 0.91236 0.70000 0.77295 0.71143 "
-"0.21403 0.71714 0.77295 0.74571 0.22605 0.79143 0.37143 0.79804 0.90244 0.80857 "
-"0.75429 0.81228 0.38902 0.83143 0.24359 0.84286 0.73143 0.84689 0.42454 0.87143 "
-"0.86607 0.88857 0.68000 0.89070 0.28000 0.90629 0.49143 0.90823 0.58857 0.91866 "
-"0.82857 0.93555 0.31597 0.94571 0.37714 0.98784 0.76000 0.98657 0.44571 1.01470 "
-"0.69143 1.01470 0.53714 1.02991 0.62857 1.02723 41 3 2 0 3 5 6 1 5 0 5 "
-"3 0 1 4 5 6 5 8 7 8 5 9 8 7 9 7 10 11 10 7 10 "
-"11 12 12 11 14 16 15 18 16 18 19 13 14 11 14 13 16 21 24 25 15 "
-"16 13 21 19 18 23 27 22 17 23 22 24 21 18 27 23 32 17 22 20 31 "
-"42 34 30 28 25 26 32 23 40 31 38 35 28 30 36 32 26 29 36 26 34 "
-"41 33 33 37 29 36 29 37 33 39 37 30 25 24 28 38 31 38 28 35 39 "
-"33 41 31 40 42 41 34 42 "
-;
-
-char *VTK_VECTOR_TEXT_51 = (char *) "68 0.927232 "
-"0.52571 -0.09009 0.63429 -0.08395 0.45143 -0.07756 0.37143 -0.04498 0.74286 -0.04771 "
-"0.30857 0.00132 0.81714 0.00439 0.54286 0.02152 0.60000 0.02420 0.64661 0.03714 "
-"0.27429 0.03952 0.46857 0.04073 0.42857 0.06759 0.70857 0.07561 0.88213 0.08286 "
-"0.23429 0.10772 0.38812 0.11714 0.74535 0.11714 0.91109 0.14571 0.77823 0.19143 "
-"0.20764 0.20857 0.92723 0.22571 0.34286 0.23215 0.78437 0.27143 0.92723 0.27714 "
-"0.75429 0.36430 0.89927 0.38571 0.72571 0.40132 0.86857 0.43270 0.67429 0.43927 "
-"0.48000 0.45284 0.48571 0.44966 0.54857 0.46152 0.60000 0.46109 0.83429 0.46686 "
-"0.72693 0.52286 0.49034 0.55714 0.49714 0.56395 0.78857 0.56473 0.58286 0.57109 "
-"0.82857 0.60921 0.67429 0.61616 0.70400 0.64857 0.85294 0.65429 0.72680 0.70571 "
-"0.87009 0.72286 0.35429 0.72298 0.22175 0.74571 0.72991 0.76286 0.72151 0.80286 "
-"0.86244 0.80857 0.38857 0.82064 0.69143 0.85832 0.84571 0.85587 0.26241 0.87143 "
-"0.43429 0.87829 0.64571 0.89641 0.48571 0.90723 0.29330 0.91714 0.60571 0.91252 "
-"0.53143 0.91823 0.80384 0.92286 0.36000 0.97750 0.73143 0.98213 0.44571 1.01681 "
-"0.65714 1.01470 0.52000 1.02991 0.60000 1.02723 66 3 11 "
-"5 9 8 1 1 8 0 4 9 1 "
-"9 4 13 7 0 8 6 13 4 17 13 "
-"6 2 11 3 2 0 7 5 16 10 "
-"12 5 11 10 16 15 11 2 7 16 5 "
-"12 17 14 19 14 17 6 20 15 22 "
-"19 18 23 22 15 16 14 18 19 21 23 "
-"18 23 26 25 23 21 24 26 28 25 "
-"30 32 36 25 34 27 35 32 33 35 29 "
-"27 25 28 34 29 35 33 26 23 24 "
-"37 36 32 39 32 35 35 27 34 37 32 "
-"39 30 31 32 39 35 41 38 41 35 "
-"38 42 41 40 42 38 42 40 44 40 43 "
-"44 44 43 48 45 48 43 47 46 54 "
-"49 48 50 50 48 45 49 53 52 63 52 "
-"61 53 49 50 46 51 54 58 54 51 "
-"58 55 62 62 55 64 66 57 60 61 52 "
-"53 55 58 51 59 67 60 52 63 56 "
-"56 65 59 55 57 64 64 57 66 65 56 "
-"63 67 66 60 67 59 65 "
-;
-
-char *VTK_VECTOR_TEXT_52 = (char *) "18 0.920000 "
-"0.64571 -0.07295 0.64000 -0.06878 0.77143 -0.06878 0.77403 0.18571 0.16265 0.19143 "
-"0.63429 0.18882 0.92000 0.19408 0.15891 0.31143 0.91735 0.31143 0.29653 0.31714 "
-"0.63740 0.31714 0.77714 0.31403 0.16571 0.32228 0.16616 0.32286 0.63429 0.79380 "
-"0.77186 1.02000 0.66857 1.02282 0.76571 1.02420 18 2 1 0 1 3 5 1 2 "
-"3 3 10 5 9 4 5 4 9 7 "
-"6 11 3 8 11 6 7 9 13 15 16 "
-"14 9 5 10 7 13 12 13 14 16 "
-"11 10 3 14 13 9 14 10 11 15 17 "
-"16 15 14 11 "
-;
-
-char *VTK_VECTOR_TEXT_53 = (char *) "54 0.932946 "
-"0.52571 -0.09009 0.61714 -0.08665 0.44571 -0.07673 0.73143 -0.05179 0.35429 -0.03759 "
-"0.78914 -0.01429 0.30286 0.00241 0.53714 0.02152 0.62857 0.03184 0.84115 0.03714 "
-"0.46857 0.03927 0.66286 0.04645 0.26286 0.04921 0.42286 0.06759 0.71429 0.08439 "
-"0.88045 0.09429 0.23343 0.10000 0.38812 0.10571 0.74535 0.12286 0.35748 0.16857 "
-"0.77294 0.18000 0.91681 0.18000 0.20420 0.20857 0.34286 0.22376 0.78705 0.23714 "
-"0.93295 0.27143 0.79009 0.31714 0.93252 0.33429 0.77714 0.38420 0.91681 0.42000 "
-"0.34857 0.43034 0.75641 0.43143 0.23088 0.44857 0.72000 0.47868 0.40000 0.48400 "
-"0.68000 0.50784 0.86902 0.51714 0.46857 0.52437 0.53143 0.53848 0.57714 0.53848 "
-"0.58857 0.53621 0.60000 0.53580 0.82286 0.56972 0.38494 0.59714 0.77714 0.60535 "
-"0.48571 0.64244 0.69714 0.64327 0.56571 0.65848 0.61714 0.65848 0.43891 0.87714 "
-"0.44571 0.88395 0.88043 0.88857 0.88043 1.00857 0.33714 1.01182 52 7 1 "
-"8 7 0 1 7 2 0 2 10 4 "
-"6 13 12 3 8 1 3 11 8 10 2 "
-"7 4 13 6 11 3 14 19 16 12 "
-"3 5 14 9 14 5 10 13 4 22 19 "
-"23 18 15 20 17 12 13 15 14 9 "
-"14 15 18 19 12 17 25 26 24 20 21 "
-"24 21 20 15 22 16 19 25 24 21 "
-"26 25 27 29 28 26 29 26 27 43 37 "
-"45 36 31 29 34 32 30 31 36 33 "
-"31 28 29 32 34 43 48 47 41 45 38 "
-"47 42 33 36 41 39 40 38 39 47 "
-"37 38 45 47 39 41 44 33 42 43 34 "
-"37 46 33 44 35 46 41 33 46 35 "
-"46 48 41 32 43 53 43 49 53 49 50 "
-"53 53 50 52 50 51 52 "
-;
-
-char *VTK_VECTOR_TEXT_54 = (char *) "70 0.927232 "
-"0.55429 -0.09009 0.66857 -0.08034 0.43429 -0.06213 0.75429 -0.04607 0.34857 -0.00972 "
-"0.81143 -0.00439 0.59429 0.02152 0.51339 0.03143 0.85188 0.04286 0.67429 0.04645 "
-"0.46286 0.05579 0.27384 0.07714 0.41714 0.09597 0.73143 0.09597 0.89355 0.11714 "
-"0.38771 0.14000 0.91177 0.16857 0.77294 0.17429 0.22816 0.18571 0.36530 0.19714 "
-"0.78705 0.24857 0.92680 0.25429 0.35320 0.26000 0.78665 0.30571 0.20420 0.31143 "
-"0.35320 0.31143 0.92723 0.31714 0.36657 0.37429 0.77395 0.37429 0.75429 0.41841 "
-"0.39179 0.42571 0.89756 0.44286 0.72000 0.46418 0.43429 0.47258 0.19891 0.50571 "
-"0.33714 0.50495 0.48000 0.50213 0.66857 0.50086 0.86241 0.50571 0.55429 0.52134 "
-"0.61143 0.51866 0.80403 0.56857 0.42286 0.58821 0.74286 0.60943 0.34134 0.63143 "
-"0.50857 0.62823 0.68000 0.63252 0.57714 0.64134 0.21563 0.66000 0.77714 0.74697 "
-"0.37502 0.75714 0.90966 0.76286 0.25673 0.80286 0.41901 0.83143 0.73143 0.85191 "
-"0.45143 0.86686 0.87343 0.87714 0.30036 0.88286 0.68000 0.89514 0.50286 0.90086 "
-"0.51429 0.90530 0.52000 0.90784 0.60571 0.91866 0.83846 0.92857 0.35429 0.94384 "
-"0.40571 0.98150 0.76000 0.99229 0.49143 1.01748 0.68571 1.02041 0.56571 1.02991 70 "
-"2 10 4 6 1 9 3 5 13 0 7 "
-"2 3 9 1 1 6 0 9 3 13 "
-"7 0 6 10 2 7 20 26 23 4 12 "
-"11 13 8 17 4 10 12 11 19 18 "
-"17 21 20 15 11 12 11 15 19 16 17 "
-"14 18 22 24 8 14 17 8 13 5 "
-"24 35 34 22 18 19 20 21 26 28 23 "
-"26 21 17 16 24 27 35 24 22 25 "
-"28 31 29 31 28 26 24 25 27 32 41 "
-"37 30 35 27 34 44 48 35 33 42 "
-"43 37 41 46 39 40 32 29 38 38 29 "
-"31 33 35 30 33 36 42 42 36 45 "
-"45 39 47 36 39 45 37 46 40 41 32 "
-"38 46 37 43 47 39 46 44 34 35 "
-"48 50 52 48 44 50 49 56 54 57 53 "
-"64 57 52 50 54 66 58 51 56 49 "
-"62 69 61 53 57 50 61 59 60 59 65 "
-"55 65 64 55 58 68 62 55 64 53 "
-"66 54 63 63 54 56 65 59 67 69 62 "
-"68 67 59 61 69 67 61 68 58 66 "
-;
-
-char *VTK_VECTOR_TEXT_55 = (char *) "17 0.923788 "
-"0.37143 -0.07186 0.50286 -0.07186 0.36723 -0.06571 0.37335 0.02000 0.52991 0.11143 "
-"0.40379 0.18571 0.59787 0.35143 0.47387 0.41429 0.66857 0.51873 0.53355 0.55143 "
-"0.63384 0.72857 0.80893 0.76286 0.74359 0.88286 0.21714 0.88546 0.92379 0.91143 "
-"0.21403 1.00857 0.92311 1.00857 15 3 0 1 2 0 3 3 4 5 4 3 1 6 7 5 6 5 4 9 "
-"7 6 10 9 8 8 9 6 10 11 12 11 10 8 15 13 12 12 14 16 15 "
-"12 16 11 14 12 "
-;
-
-char *VTK_VECTOR_TEXT_56 = (char *) "83 0.926804 "
-"0.53143 -0.08966 0.62857 -0.08665 0.45143 -0.07605 0.73714 -0.05641 0.38857 -0.05343 "
-"0.34286 -0.02616 0.79429 -0.02250 0.28571 0.02445 0.58857 0.02152 0.50857 0.02823 "
-"0.85258 0.03143 0.66937 0.04286 0.45143 0.05070 0.71429 0.07296 0.41143 0.07868 "
-"0.24000 0.09016 0.89927 0.10571 0.37669 0.12286 0.76613 0.14000 0.21462 0.15714 "
-"0.35849 0.16286 0.92109 0.17429 0.78705 0.22000 0.34437 0.22571 0.20420 0.27143 "
-"0.92680 0.27143 0.78437 0.28286 0.34748 0.28857 0.77143 0.32947 0.91470 0.33429 "
-"0.21714 0.34118 0.37502 0.36286 0.73296 0.39143 0.89057 0.39143 0.24359 0.40286 "
-"0.41883 0.41429 0.69143 0.42722 0.27275 0.44286 0.85714 0.43841 0.46286 0.44371 "
-"0.50286 0.45748 0.63429 0.45470 0.58286 0.46420 0.80507 0.48286 0.33143 0.49007 "
-"0.40456 0.52286 0.72693 0.52286 0.32000 0.57616 0.54857 0.57580 0.62286 0.58319 "
-"0.82082 0.58571 0.49714 0.58657 0.66286 0.60073 0.28527 0.61429 0.44571 0.61582 "
-"0.70439 0.63714 0.85759 0.63714 0.25756 0.67143 0.72657 0.67143 0.39849 0.68286 "
-"0.87470 0.68286 0.74134 0.72857 0.38705 0.73429 0.88109 0.76857 0.24764 0.77429 "
-"0.73395 0.79714 0.39470 0.80286 0.87177 0.82000 0.71641 0.83714 0.27216 0.86571 "
-"0.44000 0.87296 0.84486 0.88286 0.66286 0.89179 0.48000 0.90086 0.61714 0.91184 "
-"0.54286 0.91823 0.31846 0.93429 0.80571 0.93555 0.38286 0.98616 0.72000 0.99800 "
-"0.43429 1.01008 0.53143 1.02991 0.61714 1.02723 85 0 "
-"9 2 12 4 2 1 8 0 6 11 3 5 14 7 9 0 8 8 1 11 4 "
-"12 5 13 11 6 1 3 11 12 2 9 5 12 14 13 10 18 7 17 15 10 "
-"13 6 15 20 19 7 14 17 18 16 22 16 18 10 20 15 17 19 23 24 16 "
-"21 22 22 25 26 23 19 20 24 27 30 25 22 21 27 24 23 31 34 30 31 "
-"37 34 29 28 26 31 30 27 29 26 25 33 28 29 28 33 32 36 32 43 37 "
-"31 44 40 45 39 44 39 45 43 32 38 35 44 31 42 48 40 44 35 39 41 "
-"46 42 36 46 41 32 33 38 48 42 49 46 36 43 48 45 40 42 46 49 51 "
-"45 48 49 46 52 47 54 53 52 46 55 53 59 57 45 54 47 45 51 54 50 "
-"55 46 59 53 54 50 58 55 58 50 61 57 62 64 61 63 65 56 61 50 57 "
-"59 62 60 61 56 64 66 69 63 67 65 64 62 66 63 61 60 71 68 65 76 "
-"69 66 72 68 77 71 65 67 76 70 78 70 76 66 74 82 75 80 78 70 79 "
-"72 77 74 72 79 80 73 75 80 75 81 68 71 77 73 80 70 82 81 75 82 "
-"74 79 "
-;
-
-char *VTK_VECTOR_TEXT_57 = (char *) "72 0.927232 "
-"0.50286 -0.09009 0.56000 -0.09009 0.42857 -0.07673 0.64571 -0.07395 0.36000 -0.04771 "
-"0.74286 -0.02616 0.28759 0.01429 0.51429 0.02152 0.57143 0.02420 0.80115 0.02571 "
-"0.47429 0.02891 0.42857 0.05007 0.64000 0.04943 0.24930 0.07714 0.39314 0.08286 "
-"0.85229 0.10000 0.70902 0.11143 0.37057 0.12286 0.22177 0.17429 0.34857 0.18947 "
-"0.75109 0.19714 0.89395 0.20286 0.75429 0.20739 0.75681 0.21429 0.90966 0.27143 "
-"0.50286 0.30152 0.42857 0.31605 0.61714 0.31462 0.37714 0.33787 0.70286 0.35759 "
-"0.78705 0.37429 0.32000 0.37846 0.58286 0.42152 0.50286 0.42891 0.63429 0.43184 "
-"0.78286 0.43630 0.92723 0.43714 0.26286 0.44350 0.45143 0.45107 0.68571 0.45750 "
-"0.41587 0.47714 0.23787 0.48857 0.74498 0.52286 0.36359 0.55143 0.21522 0.55714 "
-"0.92680 0.56286 0.76571 0.57009 0.34437 0.63143 0.77823 0.63714 0.20462 0.69429 "
-"0.77866 0.69429 0.91236 0.70000 0.35429 0.74118 0.76571 0.76404 0.21756 0.77429 "
-"0.38286 0.80921 0.87343 0.82571 0.40759 0.84286 0.72571 0.84118 0.24527 0.84857 "
-"0.69143 0.87527 0.84000 0.88221 0.47429 0.89641 0.28571 0.90975 0.63429 0.90784 "
-"0.54857 0.91866 0.33143 0.95527 0.76000 0.96331 0.39629 0.99714 0.68571 1.00437 "
-"0.49714 1.02723 0.57714 1.02991 72 3 8 1 2 11 4 0 7 2 "
-"8 3 12 4 14 6 0 1 8 6 17 "
-"13 10 2 7 7 0 8 5 12 3 "
-"12 5 16 2 10 11 4 11 14 5 9 "
-"16 18 13 19 16 15 20 15 23 20 "
-"6 14 17 13 17 19 21 23 15 22 20 "
-"23 23 24 30 16 9 15 23 21 24 "
-"25 32 26 27 32 25 38 28 26 43 41 "
-"37 34 29 39 33 26 32 29 34 27 "
-"30 36 35 34 32 27 36 30 24 28 38 "
-"31 31 38 37 35 39 29 38 26 33 "
-"39 35 42 42 35 36 40 37 38 44 41 "
-"43 42 36 46 44 47 49 43 37 40 "
-"48 46 45 36 45 46 51 50 48 52 54 "
-"49 47 44 43 50 51 53 51 48 45 "
-"59 54 52 59 55 63 52 49 47 53 61 "
-"58 56 53 51 55 59 52 53 56 61 "
-"66 63 57 55 57 63 62 68 57 58 67 "
-"60 67 58 61 68 66 57 60 69 64 "
-"68 62 70 60 67 69 64 71 65 65 70 "
-"62 70 65 71 64 69 71 "
-;
-
-char *VTK_VECTOR_TEXT_58 = (char *) "14 0.432768 "
-"0.28571 -0.07295 0.42857 -0.07186 0.28000 -0.06878 0.43277 -0.06571 0.27957 0.07714 "
-"0.28571 0.08134 0.42857 0.08025 0.27957 0.57429 0.28571 0.57009 0.43168 0.57429 "
-"0.27848 0.71714 0.43277 0.71714 0.28265 0.72286 0.42857 0.72329 10 "
-"2 5 4 2 0 5 0 3 5 6 5 "
-"3 0 1 3 7 8 10 10 11 13 "
-"9 10 8 12 10 13 11 10 9 "
-;
-
-char *VTK_VECTOR_TEXT_59 = (char *) "18 0.432768 "
-"0.30857 -0.28726 0.36571 -0.25275 0.27323 -0.23714 0.39543 -0.22000 0.32384 -0.19143 "
-"0.33756 -0.16857 0.42327 -0.15714 0.43277 -0.10000 0.35472 -0.07714 0.28571 -0.07295 "
-"0.34857 -0.07295 0.28000 -0.06878 0.27957 0.07714 0.43168 0.07714 0.27957 0.57429 "
-"0.43168 0.57429 0.28265 0.72286 0.42857 0.72329 14 2 1 4 5 4 3 0 1 "
-"2 5 6 8 3 4 1 6 5 3 "
-"6 7 8 11 10 12 12 10 13 8 7 "
-"10 11 9 10 13 10 7 17 16 15 "
-"15 16 14 "
-;
-
-char *VTK_VECTOR_TEXT_60 = (char *) "11 0.952690 "
-"0.94857 0.09939 0.95269 0.10571 0.95236 0.22571 0.22894 0.40857 0.38919 0.46571 "
-"0.38919 0.47143 0.22748 0.52857 0.23192 0.53429 0.95098 0.70571 0.95216 0.83143 "
-"0.94857 0.83523 9 4 0 2 5 7 6 4 3 0 0 1 2 7 "
-"8 10 4 5 3 5 6 3 8 9 10 7 5 8 "
-;
-
-char *VTK_VECTOR_TEXT_61 = (char *) "12 0.952768 "
-"0.22857 0.23975 0.94857 0.23975 0.22437 0.35714 0.95277 0.35714 0.22857 0.36329 "
-"0.94857 0.36329 0.22857 0.57385 0.94857 0.57385 0.22437 0.58000 0.95277 0.58000 "
-"0.22857 0.69740 0.94857 0.69740 8 0 4 "
-"2 0 1 5 4 0 5 3 5 1 "
-"11 7 9 10 6 7 10 7 11 8 6 "
-"10 "
-;
-
-char *VTK_VECTOR_TEXT_62 = (char *) "11 0.952360 "
-"0.23429 0.09914 0.22857 0.10169 0.22748 0.22571 0.23192 0.23143 0.95116 0.40857 "
-"0.79073 0.46571 0.79073 0.47143 0.95236 0.52857 0.22897 0.70571 0.22857 0.83287 "
-"0.23429 0.83563 9 1 0 2 3 2 0 3 0 5 4 7 5 4 "
-"5 0 6 5 7 6 10 8 8 10 9 10 6 7 "
-;
-
-char *VTK_VECTOR_TEXT_63 = (char *) "45 0.918074 "
-"0.47429 -0.07186 0.62021 -0.07143 0.47118 0.07714 0.62329 0.07714 0.49979 0.19714 "
-"0.62021 0.19714 0.49563 0.20286 0.49563 0.27714 0.63681 0.31714 0.50816 0.34571 "
-"0.65714 0.36350 0.53669 0.41429 0.70857 0.42384 0.57868 0.47143 0.82857 0.53597 "
-"0.86902 0.58571 0.73258 0.62000 0.90437 0.65429 0.76086 0.66000 0.77522 0.70000 "
-"0.91580 0.70000 0.34857 0.71338 0.21034 0.73429 0.77866 0.75143 0.91807 0.76857 "
-"0.22605 0.80857 0.76571 0.80375 0.38286 0.82144 0.73714 0.85191 0.25098 0.87143 "
-"0.89143 0.86730 0.43597 0.88857 0.86812 0.90571 0.67429 0.90616 0.48571 0.91800 "
-"0.62857 0.92538 0.29296 0.93429 0.54857 0.93277 0.81143 0.96670 0.35429 0.98821 "
-"0.76571 0.99800 0.44571 1.02891 0.69714 1.02680 0.53143 1.04395 0.60000 1.04437 41 2 1 3 2 0 1 7 6 4 7 4 5 8 9 7 11 10 13 8 "
-"7 5 8 10 11 9 8 11 13 12 16 12 13 10 14 16 12 14 15 16 16 "
-"15 18 17 18 15 17 23 19 17 19 18 20 23 17 29 27 36 26 32 28 21 "
-"25 22 26 23 24 27 29 25 24 23 20 36 31 39 28 40 33 30 26 24 35 "
-"44 37 31 36 27 27 25 21 31 34 41 42 33 40 28 38 40 39 31 41 38 "
-"28 32 26 30 32 42 35 33 41 34 43 43 37 44 34 37 43 44 35 42 "
-;
-
-char *VTK_VECTOR_TEXT_64 = (char *) "114 1.632597 "
-"0.92571 -0.39563 1.16571 -0.38109 0.74857 -0.37236 0.65143 -0.34613 1.33143 -0.33070 "
-"0.54286 -0.29914 0.86286 -0.27866 1.06286 -0.28134 1.45650 -0.26000 0.73714 -0.25387 "
-"1.21143 -0.25387 0.43429 -0.22384 0.62286 -0.21216 1.32144 -0.20857 1.55582 -0.17429 "
-"0.53714 -0.16099 0.52571 -0.15258 0.53143 -0.15669 0.33714 -0.11650 1.45143 -0.11561 "
-"0.46286 -0.09260 0.80000 -0.07295 1.20571 -0.07252 1.09714 -0.06891 0.71429 -0.06252 "
-"1.49714 -0.06187 1.63260 -0.06000 0.29629 -0.04857 1.29714 -0.04498 0.90857 -0.03629 "
-"1.03384 -0.02571 0.62857 -0.01582 0.40486 -0.00857 0.59429 0.01873 1.41143 0.03296 "
-"0.82857 0.03907 0.77714 0.04327 1.01143 0.04414 1.20000 0.05050 1.16989 0.06571 "
-"1.25143 0.06086 0.90857 0.06821 0.72000 0.07561 0.54771 0.09429 1.15580 0.09429 "
-"0.24420 0.10000 0.35748 0.11143 0.96000 0.10725 0.68527 0.11714 1.33841 0.11714 "
-"1.51579 0.15714 0.66177 0.17429 1.41355 0.20286 1.03514 0.20857 0.65295 0.23143 "
-"0.22437 0.23714 0.51277 0.23714 0.33563 0.24857 1.45355 0.27714 1.07177 0.31143 "
-"1.58478 0.31143 0.65966 0.32857 1.48319 0.36857 0.53184 0.39714 0.23277 0.40286 "
-"0.34478 0.40857 1.60420 0.42571 1.08420 0.44286 0.71514 0.48857 0.25184 0.49429 "
-"1.49295 0.49429 0.57229 0.50000 1.60109 0.52857 1.05714 0.54144 0.75846 0.55143 "
-"0.38645 0.55714 1.47681 0.58571 1.01143 0.59527 0.81714 0.60331 1.58605 0.60857 "
-"1.12878 0.61429 0.65714 0.62418 0.86286 0.62319 0.96571 0.62151 0.92571 0.62991 "
-"0.42857 0.64350 1.44571 0.66730 0.32359 0.67714 1.06048 0.68286 0.74857 0.69641 "
-"1.15429 0.71588 1.28235 0.71714 1.00571 0.71800 0.82857 0.73109 0.92000 0.74152 "
-"1.52657 0.75143 0.51275 0.75714 0.37669 0.76286 1.38286 0.76132 0.59493 0.82571 "
-"1.30857 0.82821 1.45561 0.84857 0.47429 0.87296 0.73143 0.89681 1.18286 0.89580 "
-"1.08571 0.92395 1.37143 0.92400 0.92000 0.93580 0.58286 0.95188 1.30857 0.96371 "
-"0.71429 1.00899 1.18286 1.01470 0.92000 1.04437 1.01143 1.04395 114 0 6 2 1 7 0 6 0 7 "
-"7 1 10 2 9 3 3 12 5 9 2 "
-"6 10 4 13 4 10 1 15 5 12 "
-"5 15 11 13 8 19 12 3 9 8 13 "
-"4 11 20 18 11 15 16 17 16 15 "
-"14 19 8 26 25 14 20 11 16 22 38 "
-"23 25 19 14 23 39 30 30 39 37 "
-"27 46 45 18 32 27 32 18 20 21 36 "
-"24 35 29 41 24 42 31 29 35 21 "
-"22 28 40 38 22 40 34 49 40 33 31 "
-"48 36 21 35 37 47 41 33 48 43 "
-"43 51 56 44 37 39 34 40 28 47 37 "
-"53 50 52 34 38 39 23 52 49 34 "
-"37 44 53 27 32 46 42 24 36 48 31 "
-"42 37 41 29 45 57 55 53 44 59 "
-"51 54 56 52 50 58 58 60 62 43 48 "
-"51 45 46 57 56 61 63 64 55 57 "
-"91 80 44 60 58 50 62 66 70 56 54 "
-"61 44 80 67 59 44 67 71 63 61 "
-"64 65 69 67 80 73 65 64 57 66 62 "
-"60 68 71 61 71 68 81 69 75 87 "
-"72 70 66 74 81 68 77 73 80 70 79 "
-"76 75 69 65 83 77 88 87 85 97 "
-"81 74 89 89 78 93 86 76 79 70 72 "
-"79 74 78 89 88 77 80 75 85 87 "
-"82 84 94 91 90 80 86 95 98 78 82 "
-"93 92 83 88 93 82 94 84 83 92 "
-"94 84 92 97 96 102 95 86 79 102 99 "
-"108 95 101 98 96 97 85 96 99 102 "
-"98 101 100 103 108 99 100 109 104 106 100 "
-"101 108 103 110 105 113 107 100 106 109 "
-"104 111 105 107 112 110 111 104 109 113 105 "
-"111 112 107 113 107 110 103 "
-;
-
-char *VTK_VECTOR_TEXT_65 = (char *) "13 1.155731 "
-"0.14455 -0.07143 1.00000 -0.07252 1.15573 -0.07143 0.29143 -0.07103 0.40981 0.25429 "
-"0.86857 0.25754 0.45714 0.37713 0.82478 0.38000 0.45462 0.38571 0.58538 0.73429 "
-"0.63429 0.90068 0.56000 1.02454 0.71429 1.02644 13 5 "
-"1 2 0 8 11 6 4 5 12 10 7 0 3 4 0 4 8 6 5 7 6 "
-"8 4 7 5 2 8 9 11 9 10 11 12 7 2 11 10 12 "
-;
-
-char *VTK_VECTOR_TEXT_66 = (char *) "48 1.081090 "
-"0.25714 -0.07186 0.78286 -0.06723 0.86857 -0.04899 0.93714 -0.02045 1.00725 0.03714 "
-"0.39957 0.06000 0.73143 0.05621 0.80571 0.06891 1.04213 0.08857 0.87555 0.10571 "
-"1.06437 0.14000 0.91070 0.15143 1.08109 0.22000 0.93295 0.22571 0.93252 0.26571 "
-"1.07177 0.32286 0.90857 0.34064 1.04616 0.38571 0.86857 0.38686 0.79429 0.42252 "
-"0.39957 0.43143 1.01296 0.43143 0.69714 0.43563 0.97143 0.46686 0.88197 0.51143 "
-"0.40571 0.56437 0.72000 0.56705 0.39848 0.57429 0.96956 0.58571 0.80571 0.58930 "
-"0.84686 0.62000 0.99641 0.62571 0.86943 0.65429 1.02437 0.70571 0.88420 0.71143 "
-"1.02665 0.76857 0.87429 0.79232 1.01673 0.82000 0.84000 0.84984 0.77714 0.88538 "
-"0.98607 0.88857 0.39957 0.89429 0.71429 0.89580 0.93143 0.95296 0.85714 0.99756 "
-"0.80000 1.01470 0.25714 1.02615 0.70857 1.02680 50 1 6 0 2 7 1 "
-"0 20 46 7 2 9 1 7 6 20 27 "
-"46 9 4 11 4 9 3 2 3 9 "
-"11 10 13 8 11 4 10 11 8 12 13 "
-"10 14 17 16 14 15 17 16 21 18 "
-"14 13 12 15 14 12 23 18 21 5 0 "
-"6 19 26 22 18 24 19 16 17 21 "
-"24 18 23 26 19 29 19 24 29 25 22 "
-"26 22 25 20 30 29 24 32 28 31 "
-"28 32 30 32 31 34 0 5 20 34 35 "
-"36 33 34 31 28 30 24 36 40 38 "
-"38 44 39 35 37 36 34 33 35 25 27 "
-"20 27 41 46 40 36 37 43 38 40 "
-"39 45 42 42 47 41 38 43 44 45 39 "
-"44 47 46 41 47 42 45 "
-;
-
-char *VTK_VECTOR_TEXT_67 = (char *) "56 1.186046 "
-"0.69143 -0.08966 0.80000 -0.08705 0.60000 -0.07823 0.50857 -0.05070 0.93143 -0.05216 "
-"0.45714 -0.02486 1.00000 -0.01473 0.39597 0.02000 0.69714 0.03563 0.74857 0.03563 "
-"0.62286 0.04899 0.82286 0.04899 1.08000 0.05597 0.57143 0.06784 0.88000 0.07229 "
-"0.32571 0.10064 0.93143 0.10759 0.49143 0.11901 1.13800 0.14000 0.45600 0.15714 "
-"0.28930 0.16286 0.99641 0.18571 0.41502 0.22571 1.18605 0.27714 0.24319 0.28857 "
-"1.04571 0.31105 0.38244 0.32857 0.22748 0.36286 0.36723 0.44286 0.21866 0.52857 "
-"0.36991 0.55714 0.22705 0.60857 1.02857 0.69469 0.40657 0.71143 1.16694 0.72857 "
-"0.26286 0.74089 0.44187 0.78000 1.13927 0.80857 0.97143 0.80914 0.48000 0.82725 "
-"0.31750 0.84286 0.93714 0.85011 0.53143 0.86784 0.89143 0.88331 1.07582 0.90571 "
-"0.64000 0.91252 0.64571 0.91335 0.65714 0.91563 0.38286 0.91868 0.78857 0.91823 "
-"1.00571 0.96902 0.50286 0.99756 0.93143 1.01070 0.58286 1.02680 0.70286 1.04705 "
-"0.80000 1.04437 54 "
-"1 9 0 0 8 2 14 6 16 4 14 "
-"11 24 20 22 7 17 15 2 10 3 "
-"8 10 2 9 1 11 0 9 8 4 11 "
-"1 3 13 5 12 16 6 10 13 3 "
-"5 13 7 7 13 17 22 20 15 16 12 "
-"21 14 4 6 19 15 17 23 25 18 "
-"22 15 19 25 21 18 18 21 12 27 28 "
-"29 27 24 26 26 24 22 28 27 26 "
-"29 30 31 30 29 28 33 35 31 35 33 "
-"40 33 31 30 34 37 32 48 42 51 "
-"36 40 33 40 36 48 38 44 41 44 38 "
-"37 32 37 38 48 39 42 36 39 48 "
-"54 53 47 45 51 42 49 43 52 50 41 "
-"44 47 45 46 41 50 43 45 53 51 "
-"49 54 47 53 45 47 49 55 54 55 49 "
-"52 52 43 50 "
-;
-
-char *VTK_VECTOR_TEXT_68 = (char *) "34 1.167232 "
-"0.26286 -0.07186 0.70286 -0.07252 0.80000 -0.06109 0.89714 -0.03355 0.99555 0.02571 "
-"0.40528 0.06000 0.72571 0.05891 1.03582 0.06571 0.79547 0.07143 0.88000 0.10893 "
-"1.08150 0.12857 0.92115 0.14571 0.96657 0.21429 1.13966 0.26571 0.99470 0.28857 "
-"1.16420 0.39714 1.01823 0.43714 1.16723 0.52857 1.01823 0.53429 1.15277 0.64286 "
-"1.00000 0.65848 0.97714 0.72375 1.11216 0.77429 0.94286 0.78057 0.87429 0.84902 "
-"1.06607 0.85429 0.81714 0.87865 0.40528 0.89429 0.69143 0.89807 0.97714 0.94616 "
-"0.90857 0.98657 0.81143 1.01580 0.26286 1.02615 0.70286 1.02680 34 2 6 1 5 0 1 "
-"8 3 9 3 8 2 0 27 32 6 2 "
-"8 5 1 6 4 7 11 4 9 3 "
-"9 4 11 11 10 12 11 7 10 13 14 "
-"12 14 15 16 13 12 10 16 17 18 "
-"14 13 15 18 19 20 17 16 15 18 17 "
-"19 22 21 20 21 22 23 29 24 23 "
-"22 20 19 26 24 30 0 5 27 25 23 "
-"22 29 23 25 30 24 29 26 31 28 "
-"31 26 30 33 32 27 28 33 27 33 28 "
-"31 "
-;
-
-char *VTK_VECTOR_TEXT_69 = (char *) "15 1.080000 "
-"0.26857 -0.07186 1.08000 -0.06878 1.08000 0.05164 0.41100 0.06000 0.41100 0.42571 "
-"1.01143 0.43100 1.01563 0.55143 0.41714 0.55866 1.01143 0.55757 0.40991 0.56857 "
-"0.41100 0.89429 1.05143 0.89957 1.05563 1.02000 0.26857 1.02615 1.05143 1.02615 13 0 4 13 1 3 0 1 2 3 0 "
-"3 4 7 5 8 5 7 4 6 8 5 4 9 13 7 9 4 9 10 13 11 "
-"14 10 14 13 10 12 14 11 "
-;
-
-char *VTK_VECTOR_TEXT_70 = (char *) "12 1.005714 "
-"0.26857 -0.07186 0.40571 -0.07186 0.40991 0.42000 0.41714 0.42723 0.92615 0.43143 "
-"0.92615 0.55143 0.41714 0.55563 0.40991 0.56286 0.41100 0.89429 1.00571 0.90265 "
-"1.00571 1.02307 0.26857 1.02615 10 0 2 "
-"11 2 7 11 2 0 1 6 4 5 "
-"4 6 3 3 6 2 7 2 6 7 8 "
-"11 11 8 10 8 9 10 "
-;
-
-char *VTK_VECTOR_TEXT_71 = (char *) "60 1.234286 "
-"0.82286 -0.08966 0.65714 -0.07866 0.93143 -0.07335 0.56571 -0.05387 1.05143 -0.03355 "
-"0.48000 -0.01514 1.12000 0.00073 0.74286 0.03866 0.83429 0.04177 0.38857 0.05044 "
-"0.65143 0.05470 0.92571 0.06319 1.23260 0.07714 0.34857 0.09302 0.54286 0.10150 "
-"1.03429 0.11229 0.50286 0.13044 1.09252 0.15714 0.44421 0.19714 0.27429 0.21629 "
-"0.24252 0.31143 0.39320 0.31143 0.77714 0.36243 1.09143 0.35773 0.22748 0.39714 "
-"0.37605 0.40286 0.77295 0.48286 0.77714 0.48900 1.23429 0.48900 0.22437 0.51143 "
-"0.37295 0.51714 0.23320 0.59143 0.39748 0.65429 1.09143 0.68617 1.08571 0.69099 "
-"0.42073 0.71714 1.21977 0.72286 0.27387 0.73429 1.06286 0.75301 0.30645 0.80286 "
-"0.47616 0.80286 1.02286 0.82127 1.18498 0.82571 0.54286 0.86150 0.34857 0.86629 "
-"0.94286 0.88371 1.14857 0.88793 0.61143 0.89580 0.86286 0.91184 0.40168 0.92286 "
-"0.70857 0.91866 0.80000 0.92134 1.09714 0.94384 0.45714 0.96436 0.53714 1.00498 "
-"1.00000 1.00371 0.93714 1.02613 0.62857 1.03252 0.73714 1.04705 0.84571 1.04395 58 0 7 1 14 5 3 5 14 "
-"9 2 8 0 1 10 3 0 8 7 "
-"8 2 11 18 13 9 17 6 12 10 1 "
-"7 4 11 2 13 18 19 23 17 12 "
-"15 6 17 4 6 15 16 9 14 11 4 "
-"15 14 3 10 19 21 20 18 9 16 "
-"30 31 29 23 27 22 25 24 20 22 27 "
-"26 21 19 18 25 20 21 23 28 27 "
-"28 23 12 29 24 25 30 29 25 31 32 "
-"37 38 33 36 37 32 39 32 31 30 "
-"35 39 32 34 33 38 39 40 44 38 46 "
-"41 38 42 46 40 39 35 44 40 49 "
-"53 43 54 43 49 40 42 38 36 43 47 "
-"54 52 41 46 41 52 45 43 53 49 "
-"54 47 57 50 57 47 45 56 48 55 45 "
-"52 48 59 51 57 50 58 50 51 58 "
-"56 45 55 58 51 59 59 48 56 "
-;
-
-char *VTK_VECTOR_TEXT_72 = (char *) "16 1.125714 "
-"0.26857 -0.07186 0.40571 -0.07186 0.98857 -0.07295 0.98286 -0.06878 1.12571 -0.06878 "
-"0.40991 0.43714 0.41714 0.44437 0.97714 0.44329 0.41714 0.57277 0.97714 0.57385 "
-"0.40991 0.58000 0.98550 1.02571 1.12571 1.02307 0.26857 1.02615 0.40571 1.02615 "
-"1.12000 1.02723 14 4 9 7 0 5 13 5 10 13 "
-"5 0 1 8 7 9 9 4 11 10 5 "
-"8 6 8 5 4 3 2 7 8 6 "
-"14 13 10 12 15 11 3 4 7 4 12 "
-"11 "
-;
-
-char *VTK_VECTOR_TEXT_73 = (char *) "4 0.428571 "
-"0.42592 -0.07143 0.28571 -0.06878 0.28836 1.02571 0.42857 1.02307 2 1 3 2 3 1 0 "
-;
-
-char *VTK_VECTOR_TEXT_74 = (char *) "27 0.790089 "
-"0.45143 -0.09009 0.50857 -0.09009 0.37714 -0.07756 0.58404 -0.07714 0.33143 -0.06086 "
-"0.64000 -0.05641 0.26489 -0.01429 0.71429 -0.00117 0.46286 0.03866 0.53714 0.04706 "
-"0.74902 0.04857 0.41714 0.04899 0.57772 0.06571 0.21143 0.06772 0.37016 0.07714 "
-"0.34498 0.11143 0.77252 0.11143 0.62371 0.11714 0.18705 0.16286 0.32462 0.17429 "
-"0.64420 0.22571 0.79009 0.23143 0.18546 0.23714 0.31472 0.25429 0.64836 1.02571 "
-"0.78857 1.02307 0.78286 1.02723 25 10 "
-"12 7 4 2 11 0 1 8 3 8 1 11 2 8 0 8 2 8 3 9 9 "
-"3 12 4 14 6 7 12 5 3 5 12 6 15 13 12 10 17 14 4 11 13 "
-"19 18 6 14 15 22 19 23 17 16 20 13 15 19 16 17 10 22 18 19 21 "
-"20 16 20 21 24 25 26 24 21 25 24 "
-;
-
-char *VTK_VECTOR_TEXT_75 = (char *) "17 1.155019 "
-"0.25714 -0.07186 0.39429 -0.07186 1.15502 -0.07143 0.97143 -0.07140 0.89527 0.28857 "
-"0.89143 0.29371 0.89098 0.29429 0.39848 0.30000 0.57714 0.47913 0.40000 0.49126 "
-"0.68956 0.56857 0.68571 0.57371 0.68527 0.57429 1.13216 1.02571 0.25714 1.02615 "
-"0.39429 1.02615 0.94857 1.02680 15 0 9 14 0 7 9 3 10 8 3 6 10 9 8 16 4 5 6 7 "
-"0 1 3 4 6 16 8 12 10 11 12 4 3 2 8 10 12 9 7 8 13 "
-"16 12 15 14 9 "
-;
-
-char *VTK_VECTOR_TEXT_76 = (char *) "7 0.941339 "
-"0.25714 -0.07186 0.93714 -0.07186 0.94134 0.04857 0.39957 0.06000 0.93714 0.05472 "
-"0.25714 1.02615 0.39429 1.02615 5 3 0 1 0 3 5 2 4 1 3 1 4 6 5 3 "
-;
-
-char *VTK_VECTOR_TEXT_77 = (char *) "19 1.302857 "
-"0.39164 -0.07143 0.71429 -0.07186 1.17143 -0.07295 0.25714 -0.06878 0.84000 -0.06947 "
-"1.16571 -0.06878 1.30286 -0.06878 0.78286 0.09751 0.78857 0.09751 1.16000 0.83018 "
-"0.40000 0.84467 0.52151 0.88286 0.52000 0.88739 0.51748 0.89429 0.47580 1.02000 "
-"0.25979 1.02571 1.11429 1.02285 1.30286 1.02307 0.46857 1.02680 17 3 10 15 5 6 9 6 "
-"5 2 1 11 10 4 8 1 1 7 11 9 16 8 1 8 7 9 8 4 10 "
-"18 15 13 11 12 10 3 0 10 13 18 16 9 17 10 11 13 13 14 18 6 "
-"17 9 "
-;
-
-char *VTK_VECTOR_TEXT_78 = (char *) "14 1.125714 "
-"0.26286 -0.07186 0.39429 -0.07186 0.98286 -0.07295 1.12571 -0.06878 0.98286 0.17231 "
-"0.72045 0.31143 0.71678 0.31714 0.72000 0.31207 0.40000 0.78092 0.99122 1.02571 "
-"1.12571 1.02307 0.26286 1.02615 0.40571 1.02644 1.12000 1.02723 12 "
-"0 8 11 8 0 1 4 3 9 3 4 "
-"2 4 5 2 6 7 5 12 6 4 "
-"4 6 5 6 12 8 10 13 9 8 12 "
-"11 3 10 9 "
-;
-
-char *VTK_VECTOR_TEXT_79 = (char *) "63 1.267054 "
-"0.70286 -0.08966 0.77714 -0.08966 0.61143 -0.07605 0.89714 -0.06823 0.97143 -0.04073 "
-"0.49143 -0.03229 1.05650 0.00857 0.42286 0.01107 0.70857 0.03605 0.77143 0.03605 "
-"0.63429 0.04899 0.84571 0.04899 1.12725 0.07143 0.35044 0.07714 0.92716 0.08286 "
-"0.54857 0.08535 0.49143 0.12704 1.17465 0.13429 1.01296 0.15143 0.28571 0.17016 "
-"0.43955 0.18571 1.21184 0.20286 0.40784 0.23714 1.08086 0.26000 1.24613 0.30000 "
-"0.23109 0.31143 1.10665 0.34571 0.36764 0.36857 0.21295 0.43143 1.11848 0.43714 "
-"1.26705 0.43714 0.36193 0.51143 1.11848 0.51714 0.21563 0.54571 0.36991 0.59143 "
-"1.25522 0.61429 1.09966 0.63714 0.23236 0.64857 1.23681 0.68857 1.07070 0.71714 "
-"0.41143 0.73016 0.26645 0.75143 1.20486 0.76857 0.45561 0.79714 1.02286 0.79270 "
-"0.98857 0.82956 0.31429 0.83650 1.16045 0.84286 0.53143 0.86150 0.92000 0.87800 "
-"0.35582 0.88857 0.63429 0.90764 0.85143 0.90613 1.10286 0.90956 0.71429 0.92134 "
-"0.79429 0.91866 0.43493 0.95714 1.04000 0.95964 0.52000 1.00498 0.96000 1.00327 "
-"0.89714 1.02613 0.63429 1.03866 0.77714 1.04705 63 0 8 2 1 9 0 8 10 2 2 10 5 9 1 11 5 "
-"16 7 11 3 14 3 11 1 3 4 14 6 14 4 7 16 13 10 15 5 0 "
-"9 8 16 5 15 14 6 18 13 20 19 12 18 6 18 17 23 17 21 23 20 "
-"22 19 18 12 17 23 21 26 25 19 22 13 16 20 25 27 28 27 25 22 21 "
-"24 26 30 29 26 32 35 36 30 26 24 33 34 37 32 29 30 28 31 33 31 "
-"28 27 34 33 31 36 38 39 35 32 30 41 37 34 38 42 39 41 40 46 35 "
-"38 36 39 47 44 40 43 46 53 45 44 46 43 50 45 57 49 40 41 34 56 "
-"50 43 49 59 52 48 56 43 57 45 53 53 44 47 56 48 58 39 42 47 58 "
-"51 61 59 49 57 51 58 48 55 52 60 62 54 55 59 60 52 61 54 62 54 "
-"61 51 62 55 60 "
-;
-
-char *VTK_VECTOR_TEXT_80 = (char *) "31 1.098661 "
-"0.26286 -0.07186 0.40000 -0.07186 0.40420 0.36857 0.41143 0.37580 0.73714 0.37621 "
-"0.88571 0.40034 0.98343 0.44857 0.41143 0.50420 0.72571 0.50420 0.40420 0.51143 "
-"1.04045 0.51143 0.82947 0.52286 0.88571 0.55296 0.91678 0.58571 1.08252 0.59714 "
-"0.93966 0.63143 1.09866 0.68286 0.94966 0.72857 0.93355 0.79143 1.08530 0.80857 "
-"0.90857 0.83270 0.86857 0.86893 1.05927 0.87143 0.40528 0.89429 0.82286 0.88899 "
-"0.74857 0.89807 1.02439 0.92286 0.96000 0.97641 0.89143 1.00538 0.26286 1.02615 "
-"0.74286 1.02680 31 0 9 29 0 2 9 2 7 9 7 3 8 12 11 5 5 11 4 4 "
-"8 3 3 7 2 2 0 1 11 8 4 13 12 6 10 13 6 6 12 5 14 "
-"15 10 15 14 17 13 10 15 16 17 14 17 19 18 19 17 16 18 19 20 20 "
-"27 21 22 20 19 9 23 29 30 25 24 25 30 23 27 20 26 20 22 26 28 "
-"24 21 28 21 27 30 29 23 30 24 28 "
-;
-
-char *VTK_VECTOR_TEXT_81 = (char *) "66 1.276398 "
-"1.23429 -0.15444 1.13714 -0.11188 0.76571 -0.09009 0.64571 -0.08437 0.84000 -0.08034 "
-"0.58286 -0.07034 1.27640 -0.06000 0.93143 -0.05470 0.46857 -0.02322 1.00000 -0.02293 "
-"0.38857 0.03330 0.76000 0.03563 0.68000 0.03866 0.83547 0.04857 1.09814 0.04857 "
-"0.61714 0.05177 0.87591 0.06571 0.55429 0.07800 0.80000 0.10784 0.49143 0.12132 "
-"0.30857 0.12350 0.74115 0.12857 0.98286 0.13189 1.17355 0.14571 0.42857 0.19207 "
-"0.86857 0.19927 0.26286 0.20486 1.05355 0.22000 0.77714 0.23134 0.39277 0.26000 "
-"1.23177 0.27714 0.23387 0.28286 1.08823 0.30571 0.36420 0.36286 0.20991 0.40286 "
-"0.35580 0.43714 1.25866 0.43714 1.11009 0.44286 0.20723 0.51714 1.25252 0.58000 "
-"0.36420 0.59714 1.09823 0.60857 0.23470 0.67714 0.38857 0.68947 1.21184 0.73429 "
-"1.05143 0.73841 0.42902 0.76857 0.28821 0.80286 1.00571 0.80413 1.17188 0.81429 "
-"0.96000 0.84670 0.51429 0.85473 0.34473 0.88286 1.12000 0.88413 0.57714 0.89070 "
-"0.88571 0.89070 0.64571 0.91252 0.76571 0.92093 0.42857 0.95759 1.03429 0.95864 "
-"0.50286 0.99927 0.96571 0.99800 0.60000 1.03252 0.86857 1.03184 0.69714 1.04705 "
-"0.77143 1.04665 66 0 6 1 "
-"13 7 16 14 9 1 9 16 7 3 15 "
-"5 16 9 14 11 4 13 11 2 4 "
-"7 13 4 12 3 11 2 11 3 15 3 "
-"12 5 17 8 8 19 10 10 19 20 "
-"14 1 6 5 15 17 20 29 26 19 8 "
-"17 21 18 28 22 16 14 16 25 18 "
-"22 14 27 24 20 19 16 22 25 26 29 "
-"31 18 25 28 14 23 27 27 30 32 "
-"30 27 23 31 33 34 20 24 29 37 32 "
-"30 33 31 29 34 33 38 36 37 30 "
-"35 38 33 37 39 41 38 40 42 37 36 "
-"39 41 44 45 40 38 35 42 43 47 "
-"44 41 39 46 47 43 43 42 40 47 46 "
-"52 45 49 48 59 50 48 52 51 58 "
-"53 48 49 61 50 59 50 61 55 58 51 "
-"60 51 52 46 49 45 44 59 48 53 "
-"57 64 56 60 54 62 55 63 57 51 54 "
-"60 54 56 62 62 56 64 63 55 61 "
-"63 65 57 57 65 64 "
-;
-
-char *VTK_VECTOR_TEXT_82 = (char *) "46 1.225355 "
-"0.26857 -0.07186 0.40571 -0.07186 1.05143 -0.07215 1.22359 -0.07143 1.22535 -0.06571 "
-"1.17465 0.01429 1.17143 0.01936 1.17098 0.02000 0.84571 0.24343 1.00571 0.27650 "
-"0.76571 0.34698 0.91832 0.37429 0.73143 0.37678 0.40991 0.40857 0.68000 0.40437 "
-"0.41714 0.41580 0.62286 0.41538 0.84226 0.42571 0.92571 0.44706 0.99429 0.47502 "
-"1.07582 0.54000 0.41714 0.54420 0.40991 0.55143 0.80000 0.54764 0.88000 0.56538 "
-"1.11641 0.60286 0.94286 0.60439 0.96784 0.63714 1.13823 0.67714 0.98966 0.69429 "
-"0.99277 0.74571 1.14134 0.75143 0.97143 0.81493 1.12823 0.82000 0.93143 0.86115 "
-"1.10498 0.87714 0.89143 0.88498 0.40991 0.90000 0.41714 0.90723 0.78857 0.90723 "
-"1.07011 0.92857 1.01714 0.97579 0.97143 0.99865 0.87429 1.02109 0.26857 1.02615 "
-"0.80571 1.02723 46 2 9 8 3 5 2 0 37 "
-"44 5 7 2 5 6 7 3 4 5 "
-"2 7 9 18 23 17 11 8 9 8 11 "
-"10 0 22 37 11 17 10 21 16 23 "
-"21 15 16 23 10 17 19 24 18 23 18 "
-"24 23 12 10 15 21 13 0 21 22 "
-"16 14 23 23 14 12 20 26 19 26 20 "
-"27 24 19 26 27 25 29 28 30 29 "
-"31 30 28 25 27 20 30 33 32 28 29 "
-"25 33 30 31 32 40 34 35 32 33 "
-"0 1 13 0 13 21 41 34 40 43 36 "
-"42 38 39 45 32 35 40 42 34 41 "
-"34 42 36 36 43 39 44 38 45 43 45 "
-"39 37 38 44 "
-;
-
-char *VTK_VECTOR_TEXT_83 = (char *) "69 1.081090 "
-"0.71429 -0.08966 0.53714 -0.07866 0.82286 -0.07101 0.46286 -0.05959 0.38857 -0.02616 "
-"0.94286 -0.01678 0.33714 0.01044 0.64000 0.03866 0.73143 0.04177 1.00571 0.03883 "
-"0.56000 0.05177 0.28527 0.06571 0.50857 0.06930 0.83587 0.07143 1.04086 0.08857 "
-"0.88127 0.10000 0.43429 0.11330 0.24486 0.13429 0.92613 0.15714 1.07177 0.16286 "
-"0.38771 0.16857 0.94134 0.21429 0.36319 0.22571 0.21563 0.23714 1.08109 0.26571 "
-"0.21403 0.27714 0.93294 0.27714 0.34857 0.28916 0.91011 0.31714 1.06816 0.32857 "
-"0.84000 0.36943 1.04486 0.38000 0.76571 0.39673 0.98286 0.45241 0.53143 0.45748 "
-"0.42857 0.49343 0.92571 0.49070 0.37143 0.52535 0.82857 0.53109 0.31044 0.58000 "
-"0.53143 0.60899 0.43429 0.65616 0.26244 0.67143 0.39891 0.71143 0.90857 0.71084 "
-"0.25295 0.72286 1.04615 0.72286 0.39320 0.76857 0.40359 0.80857 1.03109 0.81429 "
-"0.26327 0.82000 0.87429 0.81493 0.45143 0.86956 0.82286 0.87258 0.28930 0.88286 "
-"0.98812 0.90000 0.50857 0.90041 0.76571 0.90151 0.57714 0.91563 0.67429 0.91866 "
-"0.95443 0.94000 0.35429 0.96099 0.89143 0.98784 0.40000 0.99188 0.83429 1.01470 "
-"0.50286 1.03184 0.74857 1.03823 0.57143 1.04437 0.67429 1.04705 67 2 "
-"8 0 0 7 1 6 4 16 6 16 11 0 8 7 7 10 1 8 2 13 5 "
-"15 13 1 10 3 10 12 3 9 15 5 4 3 12 15 14 18 5 13 2 14 "
-"15 9 16 4 12 21 24 26 18 19 21 11 20 17 20 11 16 17 22 23 19 "
-"18 14 22 17 20 25 23 27 23 22 27 24 21 19 26 31 28 28 33 30 24 "
-"29 26 30 38 32 26 29 31 34 32 38 33 28 31 34 40 35 33 36 30 39 "
-"43 42 38 30 36 41 37 35 40 34 38 37 41 39 41 35 40 50 48 54 39 "
-"41 43 44 46 49 45 42 43 45 47 50 48 50 47 60 51 55 47 45 43 51 "
-"60 53 54 48 61 44 49 51 55 51 49 48 52 61 56 63 52 57 66 59 61 "
-"52 63 63 56 65 62 53 60 53 64 57 53 62 64 59 66 58 65 58 67 58 "
-"65 56 66 57 64 67 58 68 68 58 66 "
-;
-
-char *VTK_VECTOR_TEXT_84 = (char *) "8 1.045714 "
-"0.54286 -0.07186 0.68000 -0.07186 0.53757 0.89429 0.68528 0.89429 0.17714 0.90265 "
-"1.04571 0.90265 0.17979 1.02571 1.04571 1.02307 6 0 3 2 3 0 "
-"1 6 4 2 6 3 7 6 2 3 "
-"3 5 7 "
-;
-
-char *VTK_VECTOR_TEXT_85 = (char *) "32 1.126804 "
-"0.65714 -0.09009 0.77143 -0.08705 0.53143 -0.07034 0.85714 -0.07101 0.47429 -0.05070 "
-"0.94286 -0.03629 0.38286 0.00704 1.02286 0.02445 0.65714 0.04437 0.78857 0.05320 "
-"0.33669 0.06000 0.58286 0.05748 0.84000 0.06823 0.52000 0.08535 1.07070 0.08857 "
-"0.89714 0.10154 0.46857 0.13025 1.09966 0.15714 0.29143 0.15866 0.94899 0.17429 "
-"0.43177 0.19714 0.27320 0.24286 0.97252 0.26000 1.12680 0.33429 0.26437 0.34000 "
-"0.40991 0.34000 0.98134 0.34571 0.98550 1.02571 1.12571 1.02307 0.26857 1.02615 "
-"0.40571 1.02615 1.12000 1.02723 30 3 9 1 10 20 18 8 0 "
-"1 0 11 2 7 15 5 0 8 11 "
-"8 1 9 9 3 12 13 4 2 5 12 "
-"3 15 7 19 16 10 6 12 5 15 "
-"4 13 6 13 2 11 21 18 20 13 16 "
-"6 19 17 22 17 19 14 7 14 19 "
-"10 16 20 25 24 21 23 26 22 23 22 "
-"17 25 21 20 24 25 29 30 29 25 "
-"28 31 27 26 23 27 23 28 27 "
-;
-
-char *VTK_VECTOR_TEXT_86 = (char *) "8 1.148571 "
-"0.57714 -0.07025 0.72571 -0.06947 0.64571 0.06079 0.65143 0.06062 0.15429 1.02560 "
-"0.30286 1.02531 1.00571 1.02531 1.14857 1.02560 6 0 2 4 3 2 "
-"0 3 7 6 1 3 0 3 1 7 "
-"2 5 4 "
-;
-
-char *VTK_VECTOR_TEXT_87 = (char *) "14 1.568063 "
-"0.45143 -0.07186 0.60000 -0.07017 1.13143 -0.06912 1.27429 -0.06912 0.52571 0.09707 "
-"1.20000 0.09787 1.13673 0.38000 0.86857 0.88103 0.16571 1.02562 0.78286 1.02446 "
-"1.42857 1.02446 1.56806 1.02571 0.30857 1.02615 0.95429 1.02615 12 "
-"2 6 7 6 2 5 1 4 0 7 9 "
-"4 11 10 5 3 5 2 8 0 4 "
-"13 7 6 9 7 13 7 4 1 11 5 "
-"3 12 8 4 "
-;
-
-char *VTK_VECTOR_TEXT_88 = (char *) "14 1.141168 "
-"0.15194 -0.07143 1.14117 -0.07143 0.32000 -0.07106 0.97143 -0.07140 0.65143 0.37795 "
-"0.74607 0.49429 0.56517 0.50000 0.74286 0.49909 0.74219 0.50000 0.65714 0.61727 "
-"0.20016 1.02571 0.96000 1.02568 1.11260 1.02571 0.36571 1.02644 12 "
-"0 2 6 3 5 4 5 6 4 5 8 "
-"6 5 3 1 5 7 8 4 6 2 "
-"9 6 8 12 11 8 6 13 10 13 6 "
-"9 11 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_89 = (char *) "12 1.145205 "
-"0.71164 -0.07143 0.57143 -0.06878 0.56891 0.39143 0.71787 0.39714 0.65143 0.51441 "
-"0.43179 0.85429 0.42857 0.85936 0.42812 0.86000 0.15284 1.02571 0.32000 1.02535 "
-"0.98286 1.02464 1.14521 1.02571 10 3 2 "
-"1 3 1 0 4 2 3 2 9 8 "
-"11 10 4 5 2 4 5 6 7 2 7 "
-"9 2 5 7 11 4 3 "
-;
-
-char *VTK_VECTOR_TEXT_90 = (char *) "11 1.040000 "
-"0.17714 -0.07186 1.04000 -0.06878 1.04000 0.05164 0.17395 0.06000 0.34602 0.06000 "
-"0.84777 0.89429 0.24000 0.89957 1.02395 0.90000 0.23580 1.02000 1.02286 1.02307 "
-"0.24000 1.02615 9 0 4 3 1 4 0 1 2 4 3 4 5 5 "
-"7 9 4 7 5 5 10 6 10 5 9 6 10 8 "
-;
-
-char *VTK_VECTOR_TEXT_91 = (char *) "8 0.541339 "
-"0.24528 -0.37429 0.54025 -0.37429 0.54025 -0.27143 0.38227 -0.26571 0.38286 0.91454 "
-"0.54134 0.92286 0.24836 1.02571 0.53714 1.02615 6 0 4 6 3 1 "
-"2 1 3 0 0 3 4 5 7 4 "
-"6 4 7 "
-;
-
-char *VTK_VECTOR_TEXT_92 = (char *) "5 0.564685 "
-"0.46286 -0.09182 0.56000 -0.09256 0.56469 -0.08857 0.14713 1.04286 0.24571 1.04358 3 0 4 3 0 2 4 0 "
-"1 2 "
-;
-
-char *VTK_VECTOR_TEXT_93 = (char *) "9 0.465968 "
-"0.17100 -0.37429 0.46597 -0.37429 0.17100 -0.27143 0.32571 -0.26723 0.33295 -0.26000 "
-"0.33143 0.91201 0.17143 0.91979 0.16991 1.02000 0.46286 1.02615 7 2 0 3 1 "
-"3 0 1 4 3 5 4 1 7 6 8 5 8 6 8 5 1 "
-;
-
-char *VTK_VECTOR_TEXT_94 = (char *) "11 0.817005 "
-"0.18389 0.44857 0.18857 0.44458 0.32000 0.44686 0.68571 0.44746 0.81143 0.44445 "
-"0.81700 0.44857 0.49714 0.88224 0.50286 0.88224 0.44571 1.04090 0.55429 1.04168 "
-"0.45143 1.04437 9 0 2 6 0 6 8 7 3 5 4 5 3 2 "
-"0 1 10 7 9 10 8 6 10 6 7 9 7 5 "
-;
-
-char *VTK_VECTOR_TEXT_95 = (char *) "4 1.011860 "
-"0.11957 -0.37429 1.01186 -0.37429 0.11957 -0.28857 1.01186 -0.28857 2 2 1 3 2 0 1 "
-;
-
-char *VTK_VECTOR_TEXT_96 = (char *) "11 0.486571 "
-"0.38857 0.82420 0.48000 0.82420 0.48403 0.82571 0.37714 0.82989 0.38286 0.82575 "
-"0.48657 0.83143 0.21296 1.02571 0.38771 1.02571 0.21412 1.03143 0.38286 1.03106 "
-"0.37714 1.03295 9 5 1 2 0 3 4 3 10 6 0 1 5 7 "
-"3 0 8 6 10 7 0 5 3 7 10 10 7 9 "
-;
-
-char *VTK_VECTOR_TEXT_97 = (char *) "70 0.929303 "
-"0.44000 -0.09009 0.50286 -0.08966 0.36571 -0.07756 0.57143 -0.07907 0.92716 -0.07143 "
-"0.79429 -0.07106 0.92930 -0.06571 0.62857 -0.06151 0.30857 -0.05514 0.27429 -0.03258 "
-"0.68000 -0.03629 0.90748 -0.00857 0.48000 0.01580 0.53143 0.01621 0.42768 0.02571 "
-"0.76571 0.02129 0.22073 0.03143 0.61804 0.03714 0.89866 0.03714 0.37130 0.06000 "
-"0.20613 0.06571 0.68000 0.07330 0.34538 0.10000 0.71429 0.10809 0.19580 0.11714 "
-"0.89295 0.13429 0.33907 0.15714 0.74538 0.16857 0.20319 0.19714 0.36000 0.20914 "
-"0.75580 0.22000 0.40000 0.24371 0.22812 0.25429 0.44571 0.26041 0.66286 0.29891 "
-"0.28000 0.31258 0.75848 0.31714 0.75429 0.32399 0.33714 0.34657 0.38857 0.36538 "
-"0.68571 0.41320 0.75772 0.43714 0.35289 0.48286 0.22093 0.50000 0.22857 0.49470 "
-"0.89252 0.50571 0.75580 0.51143 0.22857 0.53547 0.37800 0.54571 0.74286 0.55301 "
-"0.88680 0.56286 0.71429 0.58893 0.41714 0.59330 0.42228 0.59714 0.25800 0.60286 "
-"0.42286 0.59759 0.65143 0.61959 0.48000 0.62193 0.86498 0.62571 0.53143 0.62950 "
-"0.59429 0.62950 0.28187 0.63714 0.84571 0.65486 0.33714 0.68436 0.80571 0.69007 "
-"0.37915 0.70571 0.72571 0.72538 0.45714 0.72966 0.54286 0.74152 0.62286 0.74152 70 "
-"3 13 1 5 4 15 4 11 15 19 8 "
-"2 13 3 7 13 0 1 14 0 12 "
-"20 22 24 0 14 2 12 0 13 13 7 "
-"17 11 4 6 19 2 14 17 10 21 "
-"7 10 17 11 18 15 16 22 20 8 19 "
-"9 15 23 21 15 21 10 23 25 27 "
-"9 19 16 19 22 16 23 15 25 24 26 "
-"28 27 25 30 25 15 18 30 25 36 "
-"32 28 26 26 24 22 29 32 26 39 38 "
-"31 38 35 29 32 29 35 31 38 29 "
-"39 34 40 33 39 31 39 33 34 36 41 "
-"37 40 37 41 37 40 34 41 36 25 "
-"41 45 46 43 44 47 47 48 54 48 47 "
-"44 50 49 46 41 25 45 50 46 45 "
-"42 48 44 49 64 51 52 53 55 52 65 "
-"63 65 52 55 52 61 48 52 63 61 "
-"58 49 50 49 58 62 69 60 56 49 62 "
-"64 54 48 61 57 67 65 57 65 55 "
-"51 66 56 69 59 60 66 51 64 68 67 "
-"57 59 69 57 69 68 57 69 56 66 "
-;
-
-char *VTK_VECTOR_TEXT_98 = (char *) "49 0.932518 "
-"0.61143 -0.09009 0.50286 -0.07823 0.36000 -0.07186 0.24000 -0.06878 0.72000 -0.06213 "
-"0.45714 -0.05914 0.77143 -0.03188 0.36571 0.01806 0.59429 0.02193 0.83543 0.02571 "
-"0.52000 0.02823 0.66857 0.04645 0.46857 0.05179 0.42704 0.08857 0.72956 0.10000 "
-"0.88784 0.10571 0.39216 0.14000 0.75641 0.14000 0.91470 0.18000 0.37462 0.19143 "
-"0.78665 0.23714 0.36152 0.28857 0.93252 0.29429 0.79236 0.36857 0.93252 0.37429 "
-"0.36420 0.38000 0.77294 0.47714 0.39216 0.50000 0.90899 0.50000 0.42473 0.55143 "
-"0.73143 0.55546 0.88657 0.55714 0.45883 0.58571 0.67429 0.60498 0.50857 0.61641 "
-"0.63429 0.62252 0.56571 0.62991 0.37714 0.64118 0.83429 0.63841 0.37315 0.64857 "
-"0.80571 0.66686 0.74286 0.70784 0.46857 0.71355 0.68571 0.72899 0.56571 0.74109 "
-"0.61714 0.74152 0.24265 1.02571 0.37143 1.02307 0.36571 1.02723 49 3 25 46 5 1 10 5 12 7 8 0 4 11 6 14 11 "
-"4 6 0 8 1 2 7 3 8 4 11 10 1 8 21 3 19 12 13 7 12 "
-"5 10 14 9 17 9 14 6 17 15 20 16 7 13 15 18 20 15 17 9 3 "
-"7 19 22 20 18 20 22 23 28 26 23 22 24 23 25 3 21 30 43 33 39 "
-"46 25 28 23 24 27 39 25 26 31 30 7 16 19 31 26 28 37 32 42 39 "
-"27 37 40 30 38 29 37 27 38 30 31 35 33 43 32 34 42 35 45 36 37 "
-"29 32 42 34 36 45 35 43 43 30 41 41 30 40 36 45 44 42 36 44 47 "
-"48 46 39 47 46 "
-;
-
-char *VTK_VECTOR_TEXT_99 = (char *) "58 0.894057 "
-"0.53143 -0.08966 0.59429 -0.08966 0.45714 -0.07673 0.68000 -0.07294 0.72571 -0.05343 "
-"0.37714 -0.04331 0.33714 -0.01543 0.78857 -0.01011 0.58286 0.02152 0.29143 0.03016 "
-"0.49625 0.03143 0.62857 0.03034 0.83107 0.03714 0.45714 0.04943 0.69270 0.06571 "
-"0.26241 0.07143 0.85714 0.07873 0.40457 0.09429 0.72722 0.10571 0.37629 0.14000 "
-"0.74437 0.14000 0.22899 0.14571 0.37184 0.15143 0.36930 0.15714 0.88571 0.15295 "
-"0.89406 0.19714 0.76571 0.21540 0.21034 0.22571 0.34705 0.25429 0.20420 0.36286 "
-"0.34478 0.36857 0.21673 0.45429 0.36252 0.47143 0.75429 0.47269 0.88058 0.48857 "
-"0.88319 0.49429 0.38371 0.52286 0.23849 0.52857 0.72000 0.55200 0.86437 0.55714 "
-"0.43025 0.58000 0.69714 0.58127 0.28527 0.61429 0.47429 0.60943 0.48571 0.61387 "
-"0.83473 0.61429 0.49143 0.61641 0.63429 0.62041 0.54857 0.62950 0.58857 0.62991 "
-"0.81296 0.64286 0.32168 0.65429 0.35429 0.67964 0.76571 0.68535 0.44571 0.72327 "
-"0.67429 0.72816 0.53714 0.74109 0.60000 0.74109 56 2 13 5 0 8 2 11 4 14 "
-"1 8 0 3 11 1 15 23 21 2 10 "
-"13 11 8 1 11 3 4 7 14 4 "
-"10 2 8 14 7 18 17 6 13 6 5 "
-"13 17 15 9 18 12 20 7 12 18 "
-"17 9 6 16 20 12 24 20 16 19 15 "
-"17 15 19 23 23 19 22 27 28 29 "
-"26 20 24 26 24 25 21 28 27 28 21 "
-"23 29 30 31 28 30 29 31 32 37 "
-"39 38 33 34 39 33 32 31 30 37 32 "
-"36 55 49 47 37 36 42 51 42 36 "
-"34 35 39 45 41 38 52 40 43 46 43 "
-"44 50 41 45 56 49 57 40 51 36 "
-"51 40 52 45 38 39 52 43 54 47 41 "
-"53 54 46 48 56 48 49 53 41 50 "
-"54 48 56 54 43 46 57 49 55 55 47 "
-"53 "
-;
-
-char *VTK_VECTOR_TEXT_100 = (char *) "48 0.885714 "
-"0.51429 -0.09009 0.56571 -0.08966 0.62857 -0.07673 0.76571 -0.07186 0.88571 -0.06878 "
-"0.41143 -0.06486 0.67429 -0.05641 0.36000 -0.03669 0.30286 0.01025 0.76000 0.01806 "
-"0.53714 0.02152 0.49714 0.02891 0.60571 0.02891 0.68127 0.07143 0.41714 0.07561 "
-"0.23787 0.10571 0.71579 0.11143 0.38241 0.11714 0.74135 0.16286 0.21395 0.16857 "
-"0.74286 0.16739 0.74538 0.17429 0.34605 0.20286 0.76420 0.27714 0.19277 0.28857 "
-"0.33295 0.28857 0.19277 0.36286 0.76152 0.38571 0.33563 0.39714 0.73355 0.50000 "
-"0.22135 0.51143 0.36784 0.51714 0.69714 0.55841 0.42286 0.58686 0.26857 0.60793 "
-"0.63429 0.60943 0.48571 0.62151 0.56571 0.62950 0.74857 0.64048 0.75269 0.64857 "
-"0.30857 0.65582 0.65714 0.71355 0.40571 0.71756 0.50286 0.74109 0.55429 0.74152 "
-"0.75693 1.02571 0.88571 1.02307 0.88000 1.02723 48 0 11 5 12 6 13 "
-"1 2 12 7 14 8 10 0 1 14 7 "
-"5 10 1 12 6 12 2 0 10 11 "
-"8 17 15 9 16 13 14 5 11 4 9 "
-"3 6 9 13 9 4 18 16 9 18 "
-"15 22 19 17 8 14 22 15 17 20 18 "
-"21 21 18 4 19 25 24 21 4 23 "
-"25 19 22 26 24 25 26 28 30 39 27 "
-"4 26 25 28 39 38 29 29 38 32 "
-"27 39 29 30 31 34 32 38 35 31 30 "
-"28 40 34 31 36 42 33 23 4 27 "
-"35 41 37 33 40 31 40 33 42 41 35 "
-"38 42 36 43 37 43 36 44 37 41 "
-"37 44 43 46 47 45 39 4 45 4 46 "
-"45 "
-;
-
-char *VTK_VECTOR_TEXT_101 = (char *) "65 0.934539 "
-"0.54857 -0.09009 0.61143 -0.09009 0.45714 -0.07462 0.71429 -0.07101 0.40571 -0.05641 "
-"0.77714 -0.04331 0.33714 -0.01543 0.82857 -0.00670 0.29714 0.02154 0.56000 0.02152 "
-"0.60571 0.02193 0.49714 0.03563 0.68159 0.04286 0.88150 0.05429 0.45714 0.05514 "
-"0.26286 0.06636 0.72000 0.06759 0.40457 0.10000 0.91216 0.11143 0.77229 0.13429 "
-"0.37057 0.15143 0.22034 0.15714 0.36613 0.16286 0.92834 0.16286 0.36359 0.16857 "
-"0.91429 0.16966 0.79429 0.18111 0.35177 0.20286 0.20462 0.22571 0.33866 0.28286 "
-"0.34286 0.28900 0.93454 0.29429 0.19848 0.35714 0.93295 0.39714 0.34857 0.40134 "
-"0.78857 0.40134 0.34134 0.40857 0.79580 0.40857 0.20462 0.41429 0.35429 0.47261 "
-"0.22327 0.49429 0.91429 0.48975 0.77143 0.50661 0.38857 0.54057 0.74857 0.54629 "
-"0.40725 0.56286 0.25714 0.57001 0.71429 0.58154 0.87070 0.58571 0.45143 0.59759 "
-"0.68000 0.60498 0.29296 0.62000 0.49143 0.61681 0.63429 0.62252 0.54857 0.62950 "
-"0.59429 0.62991 0.33311 0.66000 0.81143 0.65543 0.77143 0.68607 0.41143 0.70930 "
-"0.72000 0.71355 0.45714 0.72605 0.66857 0.73050 0.54286 0.74152 0.60000 0.74152 65 0 9 11 10 "
-"1 3 10 3 12 5 12 3 17 8 6 10 0 1 0 11 2 4 14 6 0 "
-"10 9 7 16 5 5 16 12 14 2 11 16 7 19 14 4 2 15 8 17 26 "
-"18 25 17 6 14 15 27 21 7 13 19 23 25 18 20 15 17 26 19 18 18 "
-"19 13 24 20 22 15 20 24 15 24 27 21 27 28 28 29 32 33 37 35 29 "
-"28 27 32 29 38 35 34 30 40 39 46 33 35 30 31 33 30 36 38 29 36 "
-"29 34 37 41 42 40 38 36 30 34 29 39 40 36 41 37 33 46 43 51 51 "
-"49 56 42 48 44 48 42 41 44 48 47 49 51 45 43 46 39 56 49 59 50 "
-"62 53 57 47 48 64 55 53 45 51 43 55 63 54 58 47 57 62 50 60 59 "
-"52 61 59 49 52 47 60 50 61 54 63 60 47 58 61 52 54 64 53 62 55 "
-"64 63 "
-;
-
-char *VTK_VECTOR_TEXT_102 = (char *) "24 0.617143 "
-"0.28000 -0.07186 0.40571 -0.07186 0.27472 0.61429 0.41100 0.61429 0.16571 0.61957 "
-"0.56000 0.61957 0.56420 0.71714 0.16571 0.72329 0.27472 0.72857 0.41100 0.72857 "
-"0.56000 0.72329 0.41034 0.83143 0.27580 0.86000 0.43429 0.89555 0.28613 0.91714 "
-"0.46286 0.91294 0.50286 0.92134 0.60000 0.91830 0.31107 0.96857 0.34286 1.00099 "
-"0.38857 1.02784 0.61714 1.03086 0.46286 1.04395 0.52571 1.04437 22 0 3 2 "
-"3 0 1 4 8 7 9 3 5 2 3 "
-"8 5 6 10 4 2 8 9 8 3 "
-"8 11 12 11 8 9 12 11 14 9 5 "
-"10 13 19 18 13 18 14 13 14 11 "
-"23 15 16 15 23 22 21 23 17 15 20 "
-"13 19 13 20 20 15 22 23 16 17 "
-;
-
-char *VTK_VECTOR_TEXT_103 = (char *) "71 0.892518 "
-"0.46857 -0.39295 0.56571 -0.39563 0.66286 -0.37959 0.35429 -0.36200 0.74286 -0.34616 "
-"0.28571 -0.31868 0.80368 -0.30000 0.50857 -0.28437 0.62286 -0.27395 0.44571 -0.27101 "
-"0.23387 -0.24286 0.84657 -0.24286 0.69200 -0.23714 0.38171 -0.23143 0.72150 -0.20286 "
-"0.87177 -0.18000 0.34916 -0.15714 0.74899 -0.14000 0.22286 -0.13957 0.50857 -0.07295 "
-"0.56000 -0.07295 0.43429 -0.05959 0.65143 -0.05070 0.37143 -0.03355 0.69714 -0.02527 "
-"0.89252 -0.00857 0.74857 0.01873 0.75042 0.02000 0.75756 0.02000 0.75429 0.02333 "
-"0.29143 0.03381 0.53143 0.03866 0.57143 0.03907 0.47429 0.05216 0.64000 0.05787 "
-"0.41714 0.08704 0.68000 0.08439 0.23216 0.12857 0.38036 0.12857 0.72784 0.14000 "
-"0.35277 0.18571 0.20530 0.20857 0.75538 0.20857 0.19320 0.28286 0.33295 0.29429 "
-"0.76991 0.35714 0.19277 0.37429 0.33563 0.40857 0.75109 0.47143 0.35109 0.47714 "
-"0.21143 0.47832 0.72784 0.52286 0.23787 0.55143 0.39044 0.55143 0.69868 0.56286 "
-"0.66286 0.59393 0.27107 0.60857 0.45143 0.60498 0.48571 0.62041 0.56571 0.62991 "
-"0.57714 0.62764 0.58286 0.62723 0.76571 0.63477 0.32000 0.66384 0.68571 0.70213 "
-"0.39429 0.71229 0.77408 0.72286 0.88878 0.72286 0.62857 0.72816 0.46857 0.73580 "
-"0.56000 0.74152 71 1 7 0 8 4 12 2 8 1 0 "
-"9 3 7 1 8 5 13 10 9 0 7 13 5 3 8 2 4 6 14 12 6 "
-"12 4 11 15 17 11 14 6 13 3 9 14 11 17 10 16 18 16 10 13 17 "
-"25 28 23 21 33 22 32 20 32 19 20 35 23 33 19 31 21 23 35 30 31 "
-"19 32 32 22 34 26 29 36 17 15 25 33 21 31 26 36 24 24 34 22 26 "
-"27 29 36 34 24 36 29 39 30 38 37 39 28 25 39 29 28 37 40 41 38 "
-"40 37 30 35 38 39 25 42 44 46 43 44 43 41 44 41 40 42 25 45 67 "
-"51 48 46 47 50 67 48 45 47 46 44 50 49 52 49 50 47 67 62 51 62 "
-"54 51 56 52 49 54 62 55 55 64 61 60 61 59 53 56 49 56 53 63 63 "
-"57 65 65 58 69 65 57 58 70 59 61 59 69 58 64 55 62 67 45 25 67 "
-"66 62 63 53 57 68 70 61 59 70 69 64 68 61 "
-;
-
-char *VTK_VECTOR_TEXT_104 = (char *) "27 0.889502 "
-"0.24571 -0.07186 0.37143 -0.07186 0.76000 -0.07186 0.88571 -0.07186 0.37605 0.40286 "
-"0.37756 0.40857 0.75538 0.46000 0.88950 0.47714 0.38899 0.48286 0.74538 0.51714 "
-"0.88152 0.54571 0.42439 0.55143 0.72000 0.56914 0.47429 0.59355 0.68000 0.60331 "
-"0.85996 0.61429 0.53143 0.61748 0.61143 0.62379 0.37714 0.63983 0.81714 0.67296 "
-"0.45714 0.70045 0.77714 0.70213 0.50857 0.72437 0.68571 0.73538 0.58857 0.74152 "
-"0.24571 1.02615 0.37143 1.02615 25 0 "
-"4 25 4 18 25 6 2 3 9 6 7 7 6 3 18 8 11 18 11 13 9 "
-"15 12 12 19 14 10 9 7 18 13 20 8 4 5 15 9 10 4 0 1 18 "
-"4 8 17 24 16 19 21 14 14 23 17 20 16 22 16 20 13 19 12 15 17 "
-"23 24 23 14 21 24 22 16 18 26 25 "
-;
-
-char *VTK_VECTOR_TEXT_105 = (char *) "8 0.377143 "
-"0.25143 -0.07186 0.37714 -0.07186 0.25143 0.72329 0.37714 0.72329 0.25143 0.87403 "
-"0.37714 0.87403 0.25143 1.02615 0.37714 1.02615 4 3 2 0 3 0 "
-"1 4 5 6 7 6 5 "
-;
-
-char *VTK_VECTOR_TEXT_106 = (char *) "18 0.375625 "
-"0.14857 -0.39563 0.22286 -0.39252 0.07383 -0.38000 0.26857 -0.37914 0.31429 -0.34989 "
-"0.34036 -0.31714 0.18857 -0.27462 0.10286 -0.26950 0.36109 -0.26571 0.22331 -0.24857 "
-"0.37563 -0.16857 0.24152 -0.16286 0.24571 0.72329 0.37143 0.72329 0.24571 0.87403 "
-"0.37143 0.87403 0.24571 1.02615 0.37143 1.02615 14 1 6 0 3 6 1 4 6 "
-"3 9 10 11 7 0 6 7 2 0 "
-"9 5 8 5 9 4 6 4 9 9 8 "
-"10 11 10 12 13 12 10 14 15 16 "
-"17 16 15 "
-;
-
-char *VTK_VECTOR_TEXT_107 = (char *) "15 0.897876 "
-"0.37450 -0.07143 0.89788 -0.07143 0.24571 -0.06878 0.73714 -0.07035 0.38004 0.24286 "
-"0.68421 0.25429 0.68045 0.26000 0.68000 0.26064 0.46857 0.32924 0.38286 0.40888 "
-"0.57152 0.42571 0.69714 0.72283 0.86359 0.72286 0.24836 1.02571 0.37714 1.02307 13 2 9 13 4 2 0 5 8 3 5 "
-"3 1 5 6 7 9 14 13 11 9 10 5 7 8 7 10 8 8 9 4 12 "
-"11 10 9 8 10 2 4 9 "
-;
-
-char *VTK_VECTOR_TEXT_108 = (char *) "4 0.371429 "
-"0.36878 -0.07143 0.24000 -0.06878 0.24265 1.02571 0.37143 1.02307 2 1 3 2 3 1 0 "
-;
-
-char *VTK_VECTOR_TEXT_109 = (char *) "45 1.318074 "
-"0.24571 -0.07186 0.37143 -0.07186 0.72000 -0.07295 1.18857 -0.07186 1.31429 -0.07186 "
-"0.71429 -0.06878 0.84571 -0.06878 0.37866 0.37429 0.84723 0.40286 0.85335 0.46000 "
-"0.39109 0.48286 0.71277 0.48286 1.18437 0.48286 1.31807 0.52286 0.87787 0.53429 "
-"0.41143 0.53493 1.17395 0.54000 0.43582 0.56857 0.68784 0.56857 1.14857 0.58403 "
-"0.93143 0.59188 0.66286 0.59829 0.82857 0.60801 0.51009 0.61429 0.36571 0.61924 "
-"0.63429 0.61470 1.09714 0.61580 1.29355 0.62000 0.56000 0.62420 1.00571 0.62152 "
-"1.06286 0.62379 0.41311 0.67143 0.78857 0.66975 1.25561 0.67714 0.90857 0.68902 "
-"0.74286 0.70784 1.20571 0.71355 0.35735 0.72286 0.24571 0.72329 0.50286 0.72498 "
-"0.99429 0.73109 1.16000 0.73109 0.67429 0.73470 0.57714 0.74109 1.05143 0.74152 43 6 5 2 0 7 38 8 11 5 7 0 1 8 5 6 12 3 4 12 "
-"13 16 9 11 8 15 17 24 11 22 18 22 20 34 11 9 22 14 22 9 13 "
-"12 4 24 17 31 7 10 38 10 15 24 16 27 19 32 21 18 24 37 38 20 "
-"22 14 10 24 38 27 16 13 31 23 39 26 41 30 30 40 29 32 18 22 41 "
-"19 36 34 29 40 19 41 26 36 19 33 23 31 17 35 21 32 29 34 20 39 "
-"28 43 33 19 27 43 28 42 25 42 28 28 39 23 42 25 21 42 21 35 44 "
-"30 41 30 44 40 "
-;
-
-char *VTK_VECTOR_TEXT_110 = (char *) "38 0.889911 "
-"0.24571 -0.07186 0.37143 -0.07186 0.75429 -0.07186 0.88571 -0.07186 0.24152 -0.06571 "
-"0.37563 -0.06571 0.75009 -0.06571 0.88991 -0.06571 0.37605 0.40286 0.37866 0.41429 "
-"0.38134 0.44857 0.74665 0.48286 0.88950 0.48286 0.39849 0.51143 0.73229 0.54000 "
-"0.88420 0.54000 0.43011 0.56286 0.46286 0.58893 0.69714 0.58725 0.87008 0.59143 "
-"0.51580 0.61429 0.65143 0.61343 0.36571 0.62031 0.56571 0.62420 0.60571 0.62379 "
-"0.61714 0.62152 0.62286 0.62109 0.83955 0.64857 0.40725 0.66571 0.79429 0.69179 "
-"0.45714 0.70213 0.24152 0.71714 0.75429 0.71355 0.35735 0.72286 0.24571 0.72329 "
-"0.52571 0.73050 0.68571 0.73538 0.58857 0.74152 36 1 4 0 "
-"3 6 2 1 5 4 3 7 6 6 12 "
-"11 11 15 14 6 7 12 22 16 28 "
-"10 8 9 13 22 10 10 22 8 8 4 "
-"5 15 11 12 8 22 4 14 15 19 "
-"14 19 18 25 26 24 16 22 13 16 17 "
-"28 30 28 17 27 18 19 32 23 24 "
-"29 18 27 30 20 35 18 32 21 31 4 "
-"22 20 30 17 32 26 21 32 24 26 "
-"32 18 29 34 31 33 33 31 22 35 23 "
-"37 23 35 20 36 23 32 37 23 36 "
-;
-
-char *VTK_VECTOR_TEXT_111 = (char *) "65 0.938661 "
-"0.53143 -0.08966 0.59429 -0.09009 0.69143 -0.07101 0.41143 -0.06213 0.76571 -0.03759 "
-"0.34857 -0.02821 0.81714 -0.00099 0.29143 0.02154 0.54286 0.02193 0.60571 0.02420 "
-"0.50857 0.02823 0.64571 0.03563 0.86331 0.04857 0.45143 0.05216 0.25714 0.06636 "
-"0.70857 0.07330 0.89229 0.09429 0.40000 0.09597 0.22771 0.12286 0.38036 0.12286 "
-"0.37714 0.12793 0.37669 0.12857 0.75473 0.12857 0.76657 0.15143 0.77101 0.16286 "
-"0.77355 0.16857 0.92319 0.18000 0.20764 0.18571 0.34816 0.19714 0.78605 0.20857 "
-"0.33563 0.26000 0.19320 0.28286 0.93823 0.28857 0.79848 0.29429 0.33295 0.36286 "
-"0.93866 0.37429 0.19580 0.39714 0.79538 0.39714 0.35277 0.47143 0.92319 0.47143 "
-"0.21184 0.48286 0.77143 0.48947 0.23216 0.54000 0.38742 0.54000 0.89927 0.54000 "
-"0.74286 0.54057 0.71429 0.57275 0.42286 0.57813 0.87678 0.58000 0.27429 0.60984 "
-"0.48571 0.61580 0.64571 0.61580 0.54286 0.62950 0.58857 0.62950 0.60000 0.62723 "
-"0.60571 0.62680 0.83225 0.63714 0.31025 0.64857 0.34857 0.67864 0.75429 0.69641 "
-"0.40000 0.70784 0.45143 0.72605 0.68571 0.72538 0.53714 0.74152 0.60000 0.74109 65 11 4 15 8 "
-"0 1 17 7 5 11 2 4 2 9 1 8 1 9 0 8 10 0 10 3 2 "
-"11 9 3 13 5 10 13 3 6 12 22 6 15 4 15 6 22 18 28 27 17 "
-"5 13 14 19 18 16 23 22 19 7 17 7 19 14 18 19 21 24 23 25 25 "
-"23 16 19 20 21 16 22 12 26 29 25 27 30 31 26 25 16 28 18 21 29 "
-"26 33 30 27 28 31 34 36 33 32 35 26 32 33 34 31 30 33 35 37 40 "
-"36 34 37 39 41 40 38 42 39 37 35 47 57 43 38 40 34 43 49 42 46 "
-"45 56 39 44 41 41 48 45 43 57 49 41 44 48 43 42 38 57 47 58 54 "
-"55 53 56 45 48 50 60 47 64 63 53 64 55 62 53 63 52 59 62 51 61 "
-"60 50 64 53 55 51 62 55 52 61 50 59 46 56 61 52 63 46 59 51 58 "
-"47 60 "
-;
-
-char *VTK_VECTOR_TEXT_112 = (char *) "49 0.935625 "
-"0.24571 -0.37740 0.37454 -0.37429 0.56000 -0.08966 0.66857 -0.07966 0.47429 -0.06657 "
-"0.75429 -0.04331 0.37584 -0.00286 0.80571 -0.00704 0.38286 0.00159 0.59429 0.02152 "
-"0.52000 0.02891 0.63429 0.02992 0.85964 0.05429 0.45143 0.06725 0.70857 0.07330 "
-"0.39787 0.13429 0.39514 0.14000 0.39216 0.14571 0.76213 0.14571 0.90538 0.14571 "
-"0.37462 0.19714 0.78327 0.20857 0.92680 0.22571 0.36379 0.27143 0.36152 0.28286 "
-"0.79580 0.29429 0.93563 0.30000 0.36379 0.36857 0.79580 0.36857 0.92680 0.43714 "
-"0.78286 0.45547 0.38286 0.47232 0.75429 0.52921 0.41714 0.54057 0.88571 0.56444 "
-"0.44571 0.57582 0.69143 0.59964 0.51429 0.62213 0.65143 0.62213 0.36571 0.63051 "
-"0.56571 0.63563 0.82704 0.64857 0.45714 0.70784 0.74857 0.70657 0.24571 0.72329 "
-"0.36000 0.72329 0.51429 0.73177 0.69143 0.72899 0.62286 0.74152 49 0 1 6 0 24 44 3 9 2 2 10 4 3 11 9 4 "
-"13 8 10 2 9 11 5 14 11 3 5 7 14 5 4 10 13 14 12 18 14 "
-"7 12 0 20 24 15 8 13 8 15 6 19 18 12 18 19 21 21 22 25 24 "
-"27 44 17 15 16 22 21 19 28 25 26 22 26 25 6 15 17 29 30 28 23 "
-"24 20 20 6 17 29 28 26 30 34 32 27 31 44 0 6 20 31 39 44 32 "
-"41 36 41 32 34 31 33 39 42 37 46 39 35 42 34 30 29 39 33 35 38 "
-"47 40 35 37 42 47 38 43 40 46 37 43 36 41 39 45 44 46 40 48 48 "
-"40 47 38 36 43 "
-;
-
-char *VTK_VECTOR_TEXT_113 = (char *) "52 0.885714 "
-"0.76000 -0.37740 0.88571 -0.37740 0.56571 -0.09009 0.45143 -0.07673 0.65143 -0.06784 "
-"0.36000 -0.03188 0.70857 -0.03465 0.75580 -0.00286 0.74857 0.00454 0.29714 0.02418 "
-"0.54286 0.02152 0.57714 0.02193 0.58857 0.02420 0.59429 0.02462 0.47429 0.03927 "
-"0.64571 0.04371 0.43302 0.06571 0.70670 0.09429 0.23914 0.11143 0.38607 0.11714 "
-"0.38286 0.12221 0.38241 0.12286 0.75008 0.17429 0.21101 0.19143 0.34748 0.20857 "
-"0.76723 0.25429 0.19848 0.26000 0.76723 0.27143 0.33605 0.28286 0.76991 0.28857 "
-"0.19580 0.37429 0.33866 0.40286 0.75429 0.45277 0.21101 0.47143 0.35429 0.47832 "
-"0.73143 0.51301 0.39846 0.56286 0.69296 0.56857 0.25669 0.58571 0.45143 0.60902 "
-"0.61714 0.62213 0.49143 0.62723 0.76571 0.62602 0.29330 0.63714 0.56571 0.63522 "
-"0.72403 0.67143 0.36571 0.69641 0.66286 0.71355 0.77408 0.72286 0.88571 0.72329 "
-"0.44571 0.72966 0.56000 0.74152 52 29 27 25 "
-"49 42 32 22 7 25 3 13 11 2 13 "
-"3 4 13 2 6 15 4 11 13 12 "
-"3 14 5 13 4 15 10 3 11 15 6 "
-"8 14 3 10 15 8 17 24 23 18 "
-"5 16 9 17 8 22 14 16 5 9 19 "
-"18 19 20 21 18 19 21 42 35 32 "
-"7 22 8 16 19 9 49 48 42 7 0 "
-"1 24 18 21 23 24 26 26 28 30 "
-"28 26 24 30 31 33 34 33 31 31 30 "
-"28 33 34 38 49 29 25 36 43 38 "
-"49 25 7 35 42 37 37 45 40 45 37 "
-"42 29 49 32 45 47 40 39 43 36 "
-"46 39 50 40 47 44 43 39 46 36 38 "
-"34 41 44 51 41 50 39 49 7 1 "
-"50 41 51 51 44 47 "
-;
-
-char *VTK_VECTOR_TEXT_114 = (char *) "24 0.667686 "
-"0.24571 -0.07186 0.37143 -0.07186 0.24152 -0.06571 0.37563 -0.06571 0.37563 0.38000 "
-"0.39748 0.50000 0.41964 0.54571 0.44740 0.57429 0.61714 0.57787 0.62286 0.57880 "
-"0.48000 0.59294 0.57714 0.59395 0.51429 0.60134 0.36571 0.61385 0.41868 0.68857 "
-"0.66769 0.69429 0.66542 0.70000 0.24152 0.71714 0.35735 0.72286 0.24571 0.72329 "
-"0.46286 0.72436 0.60000 0.73109 0.51429 0.74109 0.55429 0.74109 22 1 2 0 "
-"1 3 2 4 2 3 5 6 13 5 13 "
-"17 21 11 15 2 4 17 4 5 17 "
-"6 7 13 18 17 13 7 10 14 13 7 "
-"14 14 12 20 11 21 12 9 15 11 "
-"12 14 10 19 17 18 20 12 22 8 9 "
-"11 21 15 16 22 12 23 23 12 21 "
-;
-
-char *VTK_VECTOR_TEXT_115 = (char *) "63 0.849502 "
-"0.56000 -0.09009 0.46286 -0.08705 0.65143 -0.07395 0.37143 -0.06723 0.70444 -0.05429 "
-"0.33143 -0.04943 0.76057 -0.02000 0.28571 -0.01813 0.79582 0.01429 0.50286 0.02152 "
-"0.55429 0.02152 0.56571 0.02379 0.57714 0.02420 0.24571 0.02636 0.64000 0.04200 "
-"0.41714 0.04371 0.22200 0.06571 0.38286 0.06725 0.68384 0.07714 0.83580 0.08286 "
-"0.69927 0.10000 0.34200 0.12286 0.84950 0.14000 0.71009 0.15714 0.19109 0.16286 "
-"0.19370 0.16857 0.32000 0.18615 0.69864 0.19143 0.84723 0.20286 0.65714 0.22784 "
-"0.83641 0.24286 0.80956 0.28857 0.34286 0.32371 0.75429 0.33641 0.30286 0.34421 "
-"0.69143 0.36327 0.25714 0.38445 0.22645 0.43714 0.41143 0.44538 0.37587 0.46571 "
-"0.35885 0.48286 0.21295 0.49429 0.69143 0.50460 0.34478 0.51714 0.81977 0.52286 "
-"0.67514 0.55143 0.35216 0.56286 0.22034 0.56857 0.64000 0.59465 0.38286 0.59829 "
-"0.79429 0.61016 0.24000 0.61573 0.42857 0.62041 0.58286 0.62252 0.48571 0.62991 "
-"0.74689 0.67143 0.28571 0.67258 0.70286 0.70045 0.33714 0.70613 0.38857 0.72538 "
-"0.61714 0.73050 0.47429 0.74109 0.54286 0.74109 61 2 12 0 10 1 12 12 2 14 14 4 6 7 17 13 0 "
-"12 1 4 14 2 11 10 12 15 3 1 3 15 5 9 1 10 14 6 18 15 "
-"1 9 17 5 15 6 8 18 5 17 7 21 16 13 16 21 24 18 8 20 23 "
-"28 27 21 13 17 19 22 23 26 25 21 21 25 24 20 19 23 19 20 8 28 "
-"23 22 27 33 29 28 30 27 31 27 30 27 31 33 29 38 32 35 29 33 29 "
-"35 38 34 38 36 32 38 34 36 40 37 39 36 38 41 43 47 43 41 37 36 "
-"39 40 50 45 42 43 37 40 47 46 51 46 47 43 53 60 54 45 57 48 52 "
-"58 49 45 55 57 51 49 56 49 51 46 50 42 44 48 57 53 56 49 58 55 "
-"45 50 52 59 58 59 52 61 52 54 61 60 53 57 61 54 62 62 54 60 "
-;
-
-char *VTK_VECTOR_TEXT_116 = (char *) "24 0.551972 "
-"0.42286 -0.08395 0.48000 -0.08437 0.55197 -0.07143 0.33714 -0.05914 0.29901 -0.02571 "
-"0.28041 0.00857 0.44571 0.04816 0.44453 0.04857 0.53714 0.04344 0.44000 0.05008 "
-"0.41057 0.07714 0.26748 0.10000 0.40152 0.11714 0.26597 0.61429 0.40260 0.61429 "
-"0.17143 0.61957 0.53450 0.62000 0.53866 0.71714 0.53450 0.72286 0.17143 0.72329 "
-"0.26597 0.72857 0.40260 0.72857 0.26748 0.91714 0.40000 0.99545 22 10 5 4 "
-"6 7 9 10 4 3 10 3 9 8 6 "
-"1 6 9 1 5 10 11 8 1 2 "
-"0 9 3 11 12 13 0 1 9 10 12 "
-"11 17 18 16 14 13 12 21 14 16 "
-"18 21 16 22 20 23 20 13 14 15 20 "
-"19 15 13 20 20 14 21 23 20 21 "
-;
-
-char *VTK_VECTOR_TEXT_117 = (char *) "38 0.884197 "
-"0.48571 -0.09009 0.53714 -0.09009 0.41714 -0.07673 0.77143 -0.07295 0.88000 -0.07186 "
-"0.63518 -0.06571 0.76571 -0.06878 0.88420 -0.06571 0.34857 -0.04771 0.70857 -0.01846 "
-"0.29901 -0.00857 0.27429 0.02730 0.52000 0.02723 0.56000 0.02764 0.47339 0.03714 "
-"0.76000 0.03684 0.61714 0.04135 0.43943 0.05429 0.65143 0.05787 0.41330 0.07714 "
-"0.25143 0.08437 0.69143 0.08704 0.39343 0.10571 0.38899 0.11714 0.71473 0.11714 "
-"0.38645 0.12286 0.73294 0.15714 0.23848 0.17429 0.37563 0.17429 0.75009 0.26000 "
-"0.23848 0.71714 0.37295 0.71714 0.75009 0.71714 0.88420 0.71714 0.24265 0.72286 "
-"0.36878 0.72286 0.75429 0.72329 0.88000 0.72329 36 6 3 15 "
-"3 7 15 3 4 7 8 17 10 2 14 "
-"17 2 17 8 5 13 1 19 11 10 "
-"9 16 5 12 1 13 0 12 2 12 0 "
-"1 9 18 16 13 5 16 14 2 12 "
-"11 22 20 21 18 9 15 21 9 21 15 "
-"24 20 28 27 11 19 22 24 7 26 "
-"19 10 17 24 15 7 25 22 23 20 22 "
-"25 20 25 28 26 7 29 31 30 27 "
-"33 29 7 34 31 35 34 30 31 31 27 "
-"28 36 33 37 32 29 33 36 32 33 "
-;
-
-char *VTK_VECTOR_TEXT_118 = (char *) "12 0.884203 "
-"0.45714 -0.06947 0.58857 -0.07103 0.52000 0.09808 0.52571 0.09808 0.47580 0.23714 "
-"0.16151 0.71714 0.88420 0.71714 0.16427 0.72286 0.30286 0.71951 0.74857 0.72090 "
-"0.88145 0.72286 0.29714 0.72395 10 4 0 "
-"2 0 4 5 3 2 0 1 3 0 "
-"3 6 9 8 11 5 9 6 10 7 5 "
-"11 8 5 4 3 1 6 "
-;
-
-char *VTK_VECTOR_TEXT_119 = (char *) "14 1.231638 "
-"0.39429 -0.07215 0.52571 -0.07215 0.97714 -0.07252 0.84571 -0.06947 0.45714 0.10650 "
-"0.46286 0.10650 0.92000 0.12073 0.69143 0.52785 0.15122 0.72286 0.28571 0.72090 "
-"0.62857 0.72243 0.76193 0.72286 1.23164 0.72286 1.10857 0.72329 12 "
-"2 6 3 0 4 8 3 6 7 5 0 "
-"1 12 13 6 5 4 0 7 10 5 "
-"11 10 7 7 5 1 11 7 6 4 9 "
-"8 12 6 2 "
-;
-
-char *VTK_VECTOR_TEXT_120 = (char *) "17 0.882498 "
-"0.15697 -0.07143 0.88073 -0.07143 0.15473 -0.06571 0.31429 -0.07035 0.72571 -0.07140 "
-"0.88250 -0.06571 0.52000 0.22529 0.52571 0.22529 0.60332 0.33429 0.43534 0.34000 "
-"0.51429 0.45005 0.17188 0.71714 0.86812 0.71714 0.17412 0.72286 0.86588 0.72286 "
-"0.32571 0.72395 0.71429 0.72395 15 1 5 4 2 6 9 8 6 7 3 2 0 4 8 7 6 2 3 4 "
-"5 8 8 10 6 10 9 6 15 11 9 16 10 8 15 9 10 12 16 8 13 "
-"11 15 16 12 14 "
-;
-
-char *VTK_VECTOR_TEXT_121 = (char *) "16 0.888063 "
-"0.34286 -0.39563 0.24000 -0.38043 0.41714 -0.37641 0.45714 -0.34956 0.50436 -0.29429 "
-"0.32000 -0.26680 0.22286 -0.25766 0.36652 -0.25429 0.54371 -0.22000 0.41293 -0.21429 "
-"0.46848 -0.07714 0.53714 0.09292 0.16998 0.72286 0.30857 0.71999 0.76000 0.72246 "
-"0.88806 0.72286 14 2 7 0 0 5 1 5 0 7 "
-"6 1 5 3 7 2 7 3 9 3 4 "
-"9 9 8 10 9 4 8 10 11 12 "
-"11 15 14 11 8 15 11 10 8 11 13 "
-"12 "
-;
-
-char *VTK_VECTOR_TEXT_122 = (char *) "17 0.872768 "
-"0.17714 -0.07295 0.86857 -0.07186 0.17143 -0.06878 0.87277 -0.06571 0.17146 0.03714 "
-"0.34212 0.03714 0.87277 0.03714 0.34132 0.04286 0.44000 0.04327 0.86857 0.04329 "
-"0.20571 0.61689 0.67062 0.62000 0.84991 0.64286 0.20152 0.71714 0.84991 0.71714 "
-"0.20571 0.72329 0.84571 0.72329 15 2 0 4 0 1 9 0 5 4 1 3 9 5 0 8 5 7 4 0 "
-"9 8 3 6 9 12 14 11 11 14 16 11 16 10 12 11 7 11 4 7 10 "
-"15 13 15 10 16 "
-;
-
-char *VTK_VECTOR_TEXT_123 = (char *) "39 0.611429 "
-"0.61143 -0.39454 0.46857 -0.38420 0.40000 -0.34154 0.61143 -0.27975 0.35748 -0.27143 "
-"0.52000 -0.26992 0.47787 -0.23143 0.46748 -0.19143 0.34134 -0.18000 0.46395 0.04286 "
-"0.33563 0.05429 0.45184 0.14571 0.32109 0.16286 0.29143 0.21832 0.42286 0.22716 "
-"0.25143 0.24943 0.18857 0.26528 0.39429 0.26698 0.31413 0.32286 0.18857 0.38615 "
-"0.25143 0.40073 0.41188 0.40286 0.29143 0.42775 0.43514 0.44286 0.32823 0.49429 "
-"0.45866 0.52286 0.34134 0.60286 0.46705 0.80857 0.34478 0.84857 0.47748 0.87143 "
-"0.35748 0.91143 0.50286 0.90821 0.50793 0.91143 0.50857 0.91188 0.61143 0.92814 "
-"0.40571 0.99511 0.46857 1.03294 0.53143 1.04437 0.61143 1.04329 37 0 3 5 6 2 5 2 6 4 0 5 1 2 "
-"1 5 4 7 8 7 4 6 8 9 10 10 11 12 9 8 7 11 10 9 12 "
-"17 13 12 14 17 14 12 11 18 15 13 16 15 20 18 13 17 16 20 19 15 "
-"18 20 21 22 18 22 21 24 22 20 18 24 25 26 23 24 21 25 24 23 26 "
-"27 28 27 26 25 28 29 30 29 28 27 30 29 35 31 32 33 36 31 33 31 "
-"36 29 36 33 37 34 38 37 35 29 36 34 37 33 "
-;
-
-char *VTK_VECTOR_TEXT_124 = (char *) "4 0.388571 "
-"0.28571 -0.39454 0.38857 -0.39563 0.28571 1.04329 0.38857 1.04437 2 3 2 0 3 0 1 "
-;
-
-char *VTK_VECTOR_TEXT_125 = (char *) "35 0.606299 "
-"0.17714 -0.39454 0.31429 -0.38613 0.39429 -0.33832 0.17714 -0.27975 0.27429 -0.26784 "
-"0.43681 -0.26000 0.31070 -0.23714 0.44950 -0.19714 0.32723 -0.15714 0.45295 0.04857 "
-"0.33295 0.11714 0.46857 0.16404 0.35387 0.19714 0.51429 0.23258 0.56000 0.25681 "
-"0.39429 0.26403 0.60630 0.26571 0.47702 0.32857 0.41714 0.36742 0.60571 0.38615 "
-"0.54857 0.39927 0.50171 0.43143 0.36086 0.43714 0.46748 0.50000 0.32991 0.56857 "
-"0.45252 0.78571 0.32723 0.80286 0.31748 0.87143 0.29143 0.90893 0.43470 0.91714 "
-"0.17714 0.92814 0.41629 0.95714 0.36571 1.01107 0.32000 1.03294 0.17714 1.04329 33 4 3 0 2 4 1 6 7 8 1 4 0 2 6 4 5 "
-"6 2 6 5 7 8 9 10 9 8 7 10 11 12 15 13 17 11 10 9 12 "
-"11 15 13 14 17 13 15 11 20 17 14 20 14 16 19 20 16 21 17 20 17 "
-"21 18 22 23 24 22 18 21 23 22 21 25 26 24 25 24 23 29 27 26 29 "
-"26 25 27 31 28 31 27 29 32 28 31 28 33 30 33 34 30 33 28 32 "
-;
-
-char *VTK_VECTOR_TEXT_126 = (char *) "25 0.971429 "
-"0.73714 0.34462 0.20759 0.35143 0.21143 0.34662 0.81143 0.34723 0.66857 0.35756 "
-"0.86857 0.36135 0.25143 0.38115 0.90857 0.38086 0.52000 0.41580 0.32571 0.42723 "
-"0.97140 0.43143 0.37143 0.43866 0.42286 0.44093 0.79429 0.49009 0.21028 0.50000 "
-"0.72571 0.49681 0.86286 0.50930 0.25714 0.54115 0.92571 0.54759 0.32571 0.57470 "
-"0.50286 0.57621 0.96571 0.58154 0.97143 0.58073 0.38857 0.58680 0.44000 0.58723 23 1 17 14 8 4 15 13 5 7 6 1 2 5 "
-"13 3 1 6 17 3 13 0 16 10 18 15 4 0 13 7 16 15 0 13 8 "
-"20 12 12 20 11 9 17 6 10 16 7 17 9 19 22 21 18 11 20 24 11 "
-"19 9 20 8 15 11 24 23 22 18 10 11 23 19 "
-;
-
-
-/*! Construct object with no string set and backing enabled.*/
-VTKViewer_VectorText::VTKViewer_VectorText()
-{
-  this->Text = NULL;
-
-  this->Letters[33] = VTK_VECTOR_TEXT_33;
-  this->Letters[34] = VTK_VECTOR_TEXT_34;
-  this->Letters[35] = VTK_VECTOR_TEXT_35;
-  this->Letters[36] = VTK_VECTOR_TEXT_36;
-  this->Letters[37] = VTK_VECTOR_TEXT_37;
-  this->Letters[38] = VTK_VECTOR_TEXT_38;
-  this->Letters[39] = VTK_VECTOR_TEXT_39;
-  this->Letters[40] = VTK_VECTOR_TEXT_40;
-  this->Letters[41] = VTK_VECTOR_TEXT_41;
-  this->Letters[42] = VTK_VECTOR_TEXT_42;
-  this->Letters[43] = VTK_VECTOR_TEXT_43;
-  this->Letters[44] = VTK_VECTOR_TEXT_44;
-  this->Letters[45] = VTK_VECTOR_TEXT_45;
-  this->Letters[46] = VTK_VECTOR_TEXT_46;
-  this->Letters[47] = VTK_VECTOR_TEXT_47;
-  this->Letters[48] = VTK_VECTOR_TEXT_48;
-  this->Letters[49] = VTK_VECTOR_TEXT_49;
-  this->Letters[50] = VTK_VECTOR_TEXT_50;
-  this->Letters[51] = VTK_VECTOR_TEXT_51;
-  this->Letters[52] = VTK_VECTOR_TEXT_52;
-  this->Letters[53] = VTK_VECTOR_TEXT_53;
-  this->Letters[54] = VTK_VECTOR_TEXT_54;
-  this->Letters[55] = VTK_VECTOR_TEXT_55;
-  this->Letters[56] = VTK_VECTOR_TEXT_56;
-  this->Letters[57] = VTK_VECTOR_TEXT_57;
-  this->Letters[58] = VTK_VECTOR_TEXT_58;
-  this->Letters[59] = VTK_VECTOR_TEXT_59;
-  this->Letters[60] = VTK_VECTOR_TEXT_60;
-  this->Letters[61] = VTK_VECTOR_TEXT_61;
-  this->Letters[62] = VTK_VECTOR_TEXT_62;
-  this->Letters[63] = VTK_VECTOR_TEXT_63;
-  this->Letters[64] = VTK_VECTOR_TEXT_64;
-  this->Letters[65] = VTK_VECTOR_TEXT_65;
-  this->Letters[66] = VTK_VECTOR_TEXT_66;
-  this->Letters[67] = VTK_VECTOR_TEXT_67;
-  this->Letters[68] = VTK_VECTOR_TEXT_68;
-  this->Letters[69] = VTK_VECTOR_TEXT_69;
-  this->Letters[70] = VTK_VECTOR_TEXT_70;
-  this->Letters[71] = VTK_VECTOR_TEXT_71;
-  this->Letters[72] = VTK_VECTOR_TEXT_72;
-  this->Letters[73] = VTK_VECTOR_TEXT_73;
-  this->Letters[74] = VTK_VECTOR_TEXT_74;
-  this->Letters[75] = VTK_VECTOR_TEXT_75;
-  this->Letters[76] = VTK_VECTOR_TEXT_76;
-  this->Letters[77] = VTK_VECTOR_TEXT_77;
-  this->Letters[78] = VTK_VECTOR_TEXT_78;
-  this->Letters[79] = VTK_VECTOR_TEXT_79;
-  this->Letters[80] = VTK_VECTOR_TEXT_80;
-  this->Letters[81] = VTK_VECTOR_TEXT_81;
-  this->Letters[82] = VTK_VECTOR_TEXT_82;
-  this->Letters[83] = VTK_VECTOR_TEXT_83;
-  this->Letters[84] = VTK_VECTOR_TEXT_84;
-  this->Letters[85] = VTK_VECTOR_TEXT_85;
-  this->Letters[86] = VTK_VECTOR_TEXT_86;
-  this->Letters[87] = VTK_VECTOR_TEXT_87;
-  this->Letters[88] = VTK_VECTOR_TEXT_88;
-  this->Letters[89] = VTK_VECTOR_TEXT_89;
-  this->Letters[90] = VTK_VECTOR_TEXT_90;
-  this->Letters[91] = VTK_VECTOR_TEXT_91;
-  this->Letters[92] = VTK_VECTOR_TEXT_92;
-  this->Letters[93] = VTK_VECTOR_TEXT_93;
-  this->Letters[94] = VTK_VECTOR_TEXT_94;
-  this->Letters[95] = VTK_VECTOR_TEXT_95;
-  this->Letters[96] = VTK_VECTOR_TEXT_96;
-  this->Letters[97] = VTK_VECTOR_TEXT_97;
-  this->Letters[98] = VTK_VECTOR_TEXT_98;
-  this->Letters[99] = VTK_VECTOR_TEXT_99;
-  this->Letters[100] = VTK_VECTOR_TEXT_100;
-  this->Letters[101] = VTK_VECTOR_TEXT_101;
-  this->Letters[102] = VTK_VECTOR_TEXT_102;
-  this->Letters[103] = VTK_VECTOR_TEXT_103;
-  this->Letters[104] = VTK_VECTOR_TEXT_104;
-  this->Letters[105] = VTK_VECTOR_TEXT_105;
-  this->Letters[106] = VTK_VECTOR_TEXT_106;
-  this->Letters[107] = VTK_VECTOR_TEXT_107;
-  this->Letters[108] = VTK_VECTOR_TEXT_108;
-  this->Letters[109] = VTK_VECTOR_TEXT_109;
-  this->Letters[110] = VTK_VECTOR_TEXT_110;
-  this->Letters[111] = VTK_VECTOR_TEXT_111;
-  this->Letters[112] = VTK_VECTOR_TEXT_112;
-  this->Letters[113] = VTK_VECTOR_TEXT_113;
-  this->Letters[114] = VTK_VECTOR_TEXT_114;
-  this->Letters[115] = VTK_VECTOR_TEXT_115;
-  this->Letters[116] = VTK_VECTOR_TEXT_116;
-  this->Letters[117] = VTK_VECTOR_TEXT_117;
-  this->Letters[118] = VTK_VECTOR_TEXT_118;
-  this->Letters[119] = VTK_VECTOR_TEXT_119;
-  this->Letters[120] = VTK_VECTOR_TEXT_120;
-  this->Letters[121] = VTK_VECTOR_TEXT_121;
-  this->Letters[122] = VTK_VECTOR_TEXT_122;
-  this->Letters[123] = VTK_VECTOR_TEXT_123;
-  this->Letters[124] = VTK_VECTOR_TEXT_124;
-  this->Letters[125] = VTK_VECTOR_TEXT_125;
-  this->Letters[126] = VTK_VECTOR_TEXT_126;
-  
-}
-
-/*!Calculate output.*/
-void VTKViewer_VectorText::Execute()
-{
-  vtkPolyData *output = this->GetOutput();
-  vtkPoints *newPoints;
-  vtkCellArray *newPolys;
-  int ptOffset = 0;
-  int aPoint, i;
-  int pos = 0;
-  float xpos = 0;
-  float ypos = 0;
-  int ptCount, triCount;
-  char *aLetter;
-  float width;
-  float ftmp[3];
-  
-  if (this->Text == NULL)
-    {
-    vtkErrorMacro (<< "Text is not set!");
-    return;
-    }
-
-  // Set things up; allocate memory
-  newPoints = vtkPoints::New();
-  newPolys = vtkCellArray::New();
-  ftmp[2] = 0.0;
-  
-  // Create Text
-  while (this->Text[pos])
-    {
-    switch (this->Text[pos])
-      {
-      case 32: 
-        xpos += 0.4;
-        break;
-        
-      case 10:
-        ypos -= 1.4;
-        xpos = 0;
-        break;
-        
-      default:
-        // if we have a valid character
-        if ((this->Text[pos] > 32)&&(this->Text[pos] < 127))
-          {
-          // add the result to our output
-          aLetter = this->Letters[this->Text[pos]];
-          ptCount = strtol(aLetter,&aLetter,10);
-          width = strtod(aLetter,&aLetter);
-          for (i = 0; i < ptCount; i++)
-            {
-            ftmp[0] = strtod(aLetter,&aLetter);
-            ftmp[1] = strtod(aLetter,&aLetter);
-            ftmp[0] += xpos;
-            ftmp[1] += ypos;
-            newPoints->InsertNextPoint(ftmp);
-            }
-          triCount = strtol(aLetter,&aLetter,10);
-          for (i = 0; i < triCount; i++)
-            {
-            newPolys->InsertNextCell(3);
-            aPoint = strtol(aLetter,&aLetter,10); 
-            newPolys->InsertCellPoint(aPoint + ptOffset);
-            aPoint = strtol(aLetter,&aLetter,10); 
-            newPolys->InsertCellPoint(aPoint + ptOffset);
-            aPoint = strtol(aLetter,&aLetter,10); 
-            newPolys->InsertCellPoint(aPoint + ptOffset);
-            }
-          ptOffset += ptCount;
-          xpos += width;
-          }
-        break;
-      }
-    pos++;
-    }
-  
-  //
-  // Update ourselves and release memory
-  //
-  output->SetPoints(newPoints);
-  newPoints->Delete();
-  
-  output->SetPolys(newPolys);
-  newPolys->Delete();
-}
-  
-/*!
-  Print text to stream
-  \param os - stream
-  \param indent
-*/
-void VTKViewer_VectorText::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  os << indent << "Text: " << (this->Text ? this->Text : "(none)") << "\n";
-}
-
-/*!Destructor.*/
-VTKViewer_VectorText::~VTKViewer_VectorText()
-{
-  if (this->Text)
-    {
-    delete [] this->Text;
-    }
-}
diff --git a/src/VTKViewer/VTKViewer_VectorText.h b/src/VTKViewer/VTKViewer_VectorText.h
deleted file mode 100755 (executable)
index b554919..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    $RCSfile$
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
-
-  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
-  All rights reserved.
-  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
-
-     This software is distributed WITHOUT ANY WARRANTY; without even 
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
-     PURPOSE.  See the above copyright notice for more information.*/
-
-// .NAME vtkVectorText - create polygonal text
-// .SECTION Description
-
-// vtkVectorText generates vtkPolyData from an input text string. Besides the
-// ASCII alphanumeric characters a-z, A-Z, 0-9, vtkVectorText also supports
-// ASCII punctuation marks. (The supported ASCII character set are the codes
-// (33-126) inclusive.) The only control character supported is the line feed
-// character "\n", which advances to a new line.
-//
-// To use thie class, you normally couple it with a vtkPolyDataMapper and a
-// vtkActor. In this case you would use the vtkActor's transformation methods
-// to position, orient, and scale the text. You may also wish to use a
-// vtkFollower to orient the text so that it always faces the camera.
-
-// .SECTION See Also
-// vtkTextMapper vtkCaptionActor2D
-
-// VTKViewer_VectorText.h is a copy of vtkVectorText.h file.
-// Purpose of copying: to remove linking to libHybrid.so VTK library 
-
-// Modified by Open CASCADE SAS (www.opencascade.com)
-
-#ifndef __VTKViewer_VectorText_h
-#define __VTKViewer_VectorText_h
-
-#include "vtkPolyDataSource.h"
-/*!Generates vtkPolyData from an input text string.
- *@see vtkVectorText
- */
-class VTKViewer_VectorText : public vtkPolyDataSource 
-{
-public:
-  static VTKViewer_VectorText *New();
-  vtkTypeRevisionMacro(VTKViewer_VectorText,vtkPolyDataSource);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/Get the text to be drawn.
-  vtkSetStringMacro(Text);
-  vtkGetStringMacro(Text);
-
-protected:
-  VTKViewer_VectorText();
-  ~VTKViewer_VectorText();
-
-  //! Main method, which calculate output
-  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
-
-  char *Text;
-  char *Letters[127];
-
-};
-
-#endif
-
-
index cae65130c49935a8ee481a9ec2323bfca46448c2..42ccf08ba5d5df7fb1b498c6cd3e213ecf4ddf17 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_ViewManager.h"
 #include "VTKViewer_ViewModel.h"
 
index 213df207a1dbb110a8d0820d1fc06009918d612a..fceeb8bac415f662c6ce6124b12f5c1d94648be8 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_VIEWMANAGER_H
 #define VTKVIEWER_VIEWMANAGER_H
 
index 6da15fdf82c003bfc787bc5f93242ad6c9f6508f..0e903ac3db291d4a0a818c51a4f93e0c882fe2e1 100755 (executable)
@@ -1,29 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_ViewModel.h"
 #include "VTKViewer_ViewWindow.h"
 #include "VTKViewer_ViewManager.h"
 #include "VTKViewer_RenderWindowInteractor.h"
 
+#include "QtxBackgroundTool.h"
 #include "SUIT_ViewWindow.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
@@ -33,6 +35,9 @@
 #include <QMouseEvent>
 #include <QToolBar>
 
+// VSR: Uncomment below line to allow texture background support in VTK viewer
+#define VTK_ENABLE_TEXTURED_BACKGROUND
+
 bool _InitializeVtkWarningsCall()
 {
   char* isOn = getenv( "VTK_WARNINGS_IS_ON" );  
@@ -47,7 +52,7 @@ static bool _InitializeVtkWarnings = _InitializeVtkWarningsCall();
 /*!Constructor.Sets background color to black.*/
 VTKViewer_Viewer::VTKViewer_Viewer()
 : SUIT_ViewModel(),
-myBgColor( Qt::black )
+  myDefaultBackground( Qtx::BackgroundData( Qt::black ) )
 {
 }
 
@@ -56,24 +61,62 @@ VTKViewer_Viewer::~VTKViewer_Viewer()
 {
 }
 
-/*!Gets background color.*/
+/*! Get data for supported background modes: gradient types, identifiers and supported image formats */
+QString VTKViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+  gradList << tr( "GT_HORIZONTALGRADIENT" )
+           << tr( "GT_VERTICALGRADIENT" )
+           << tr( "GT_FIRSTDIAGONALGRADIENT" )
+           << tr( "GT_SECONDDIAGONALGRADIENT" )
+           << tr( "GT_FIRSTCORNERGRADIENT" )
+           << tr( "GT_SECONDCORNERGRADIENT" )
+           << tr( "GT_THIRDCORNERGRADIENT" )
+           << tr( "GT_FOURTHCORNERGRADIENT" );
+  idList   << HorizontalGradient
+           << VerticalGradient
+           << FirstDiagonalGradient
+           << SecondDiagonalGradient
+           << FirstCornerGradient
+           << SecondCornerGradient
+           << ThirdCornerGradient
+           << FourthCornerGradient;
+#ifdef VTK_ENABLE_TEXTURED_BACKGROUND
+  txtList  << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+  return tr("BG_IMAGE_FILES");
+}
+
+/*!Gets background color [obsolete]*/
 QColor VTKViewer_Viewer::backgroundColor() const
 {
-  return myBgColor;
+  return background().color();
 }
 
-/*!Sets background color.*/
+/*!Sets background color [obsolete]*/
 void VTKViewer_Viewer::setBackgroundColor( const QColor& c )
 {
-  if ( c.isValid() )
-    myBgColor = c;
+  Qtx::BackgroundData bg = background();
+  bg.setColor( c );
+  setBackground( bg );
+}
+
+/*!Gets default background data.*/
+Qtx::BackgroundData VTKViewer_Viewer::background() const
+{
+  return myDefaultBackground;
+}
+
+/*!Sets default background data.*/
+void VTKViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+  myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black );
 }
 
 /*!Create new instance of VTKViewer_ViewWindow, sets background color and return pointer to it.*/
 SUIT_ViewWindow* VTKViewer_Viewer::createView( SUIT_Desktop* theDesktop )
 {
   VTKViewer_ViewWindow* vw = new VTKViewer_ViewWindow( theDesktop, this );
-  vw->setBackgroundColor( myBgColor );
+  vw->setBackground( myDefaultBackground );
   return vw;
 }
 
@@ -95,7 +138,7 @@ void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 void VTKViewer_Viewer::contextMenuPopup(QMenu* thePopup)
 {
   thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
-  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+  thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
 
   thePopup->addSeparator();
 
@@ -185,15 +228,32 @@ void VTKViewer_Viewer::onDumpView()
 }
 
 /*!On change back ground color event.*/
-void VTKViewer_Viewer::onChangeBgColor()
+void VTKViewer_Viewer::onChangeBackground()
 {
   VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
   if ( !aView )
     return;
 
-  QColor aColor = QColorDialog::getColor( aView->backgroundColor(), aView);
-  if ( aColor.isValid() )
-    aView->setBackgroundColor(aColor);
+  // get supported gradient types
+  QStringList gradList;
+  QIntList    idList, txtList;
+  QString     formats = backgroundData( gradList, idList, txtList );
+
+  // invoke dialog box
+  Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(),  // initial background
+                                                                  aView,                // parent for dialog box
+                                                                  txtList,              // allowed texture modes
+                                                                  true,                 // enable solid color mode
+                                                                  true,                 // enable gradient mode
+                                                                  false,                // disable custom gradient mode
+                                                                  !txtList.isEmpty(),   // enable texture mode
+                                                                  gradList,             // gradient names
+                                                                  idList,               // gradient identifiers
+                                                                  formats );            // image formats
+
+  // set chosen background data to the viewer
+  if ( bgData.isValid() )
+    aView->setBackground( bgData );
 }
 
 /*!On show tool bar event.*/
index 37298af3cdbf754a83d84495a161582863ed0a7b..9976152af5f85dc83ad656e592bdf402f3bb2858 100755 (executable)
@@ -1,28 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_VIEWMODEL_H
 #define VTKVIEWER_VIEWMODEL_H
 
 #include "VTKViewer.h"
+#include "Qtx.h"
 #include "SUIT_ViewModel.h"
 
 #include <QColor>
@@ -37,8 +39,22 @@ class VTKVIEWER_EXPORT VTKViewer_Viewer: public SUIT_ViewModel
   Q_OBJECT
 
 public:
+  /*! supported gradient types */
+  enum {
+    HorizontalGradient,
+    VerticalGradient,
+    FirstDiagonalGradient,
+    SecondDiagonalGradient,
+    FirstCornerGradient,
+    SecondCornerGradient,
+    ThirdCornerGradient,
+    FourthCornerGradient,
+    LastGradient = FourthCornerGradient,
+  };
+
   /*!Initialize type of viewer.*/
-  static QString Type() { return "VTKViewer"; }
+  static QString           Type() { return "VTKViewer"; }
+  static QString           backgroundData( QStringList&, QIntList&, QIntList& );
 
   VTKViewer_Viewer();
   virtual ~VTKViewer_Viewer();
@@ -51,35 +67,37 @@ public:
   virtual QString          getType() const { return Type(); }
 
 public:
-  void enableSelection(bool isEnabled);
+  void                     enableSelection(bool isEnabled);
   /*!Checks: is selection enabled*/
-  bool isSelectionEnabled() const { return mySelectionEnabled; }
+  bool                     isSelectionEnabled() const { return mySelectionEnabled; }
 
-  void enableMultiselection(bool isEnable);
+  void                     enableMultiselection(bool isEnable);
   /*!Checks: is multi selection enabled*/
-  bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
+  bool                     isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
 
-  int  getSelectionCount() const;
+  int                      getSelectionCount() const;
 
-  QColor backgroundColor() const;
-  void   setBackgroundColor( const QColor& );
+  QColor                   backgroundColor() const;                  // obsolete
+  void                     setBackgroundColor( const QColor& );      // obsolete
+  Qtx::BackgroundData      background() const;
+  void                     setBackground( const Qtx::BackgroundData& );
 
 signals:
-  void selectionChanged();
+  void                     selectionChanged();
 
 protected slots:
-  void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
-  void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+  void                     onMousePress( SUIT_ViewWindow*, QMouseEvent* );
+  void                     onMouseMove( SUIT_ViewWindow*, QMouseEvent* );
+  void                     onMouseRelease( SUIT_ViewWindow*, QMouseEvent* );
 
-  void onDumpView();
-  void onShowToolbar();
-  void onChangeBgColor();
+  void                     onDumpView();
+  void                     onShowToolbar();
+  void                     onChangeBackground();
 
 private:
-  QColor myBgColor;
-  bool   mySelectionEnabled;
-  bool   myMultiSelectionEnabled;
+  Qtx::BackgroundData      myDefaultBackground;
+  bool                     mySelectionEnabled;
+  bool                     myMultiSelectionEnabled;
 };
 
 #endif
index 20185b38afc4e90cac1c9d6621283cd051220ee6..fcafdae31c380daae699f5cc4522806680775bd4 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "VTKViewer_ViewWindow.h"
 #include "VTKViewer_ViewModel.h"
 #include "VTKViewer_RenderWindow.h"
 #include "VTKViewer_Trihedron.h"
 #include "VTKViewer_Transform.h"
 #include "VTKViewer_Utilities.h"
+#include "VTKViewer_Texture.h"
+#include "VTKViewer_OpenGLRenderer.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Tools.h>
 #include <SUIT_ResourceMgr.h>
 
+#include <QFileInfo>
 #include <QImage>
 
-#include <vtkRenderer.h>
 #include <vtkCamera.h>
+#include <vtkJPEGReader.h>
+#include <vtkBMPReader.h>
+#include <vtkTIFFReader.h>
+#include <vtkPNGReader.h>
+#include <vtkMetaImageReader.h>
+#include <vtkImageMapToColors.h>
+#include <vtkTexture.h>
 
 #include <QtxToolBar.h>
 #include <QtxMultiAction.h>
 /*! Construction*/
 VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, 
                                             VTKViewer_Viewer* theModel,
-                                           VTKViewer_InteractorStyle* iStyle,
-                                           VTKViewer_RenderWindowInteractor* rw )
+                                            VTKViewer_InteractorStyle* iStyle,
+                                            VTKViewer_RenderWindowInteractor* rw )
 : SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
 
   myTrihedron = VTKViewer_Trihedron::New();
   myTransform = VTKViewer_Transform::New();
-  myRenderer  = vtkRenderer::New() ;
+  myRenderer  = VTKViewer_OpenGLRenderer::New() ;
 
   myTrihedron->AddToRender( myRenderer );
 
@@ -67,16 +77,6 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
   myRenderer->LightFollowCameraOn();
   myRenderer->TwoSidedLightingOn();
 
-  // Set BackgroundColor
-  QString BgrColorRed   = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorRed");
-  QString BgrColorGreen = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorGreen");
-  QString BgrColorBlue  = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorBlue");
-
-  if( !BgrColorRed.isEmpty() && !BgrColorGreen.isEmpty() && !BgrColorBlue.isEmpty() ) 
-    myRenderer->SetBackground( BgrColorRed.toInt()/255., BgrColorGreen.toInt()/255., BgrColorBlue.toInt()/255. );
-  else
-    myRenderer->SetBackground( 0, 0, 0 );
-  
   // Create an interactor.
   myRWInteractor = rw ? rw : VTKViewer_RenderWindowInteractor::New();
   myRWInteractor->SetRenderWindow( myRenderWindow->getRenderWindow() );
@@ -92,6 +92,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
   setCentralWidget( myRenderWindow );
 
   myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
+  myToolBar->setFloatable( false );
 
   createActions();
   createToolBar();
@@ -118,6 +119,9 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
            this,           SIGNAL(contextMenuRequested( QContextMenuEvent * )) );
 
 
+  // set default background
+  setBackground( Qtx::BackgroundData( Qt::black ) );
+  // reset view
   onResetView();
 }
 
@@ -273,6 +277,20 @@ void VTKViewer_ViewWindow::createActions()
   connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
   myActionsMap[ RightId ] = aAction;
 
+  // \li Rotate anticlockwise
+  aAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
+                         tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this);
+  aAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+  myActionsMap[ AntiClockWiseId ] = aAction;
+
+  // \li Rotate clockwise
+  aAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
+                         tr( "MNU_CLOCKWISE_VIEW" ), 0, this);
+  aAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+  myActionsMap[ ClockWiseId ] = aAction;
+
   //! \li Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
                            tr( "MNU_RESET_VIEW" ), 0, this);
@@ -316,6 +334,9 @@ void VTKViewer_ViewWindow::createToolBar()
   aViewsAction->insertAction( myActionsMap[RightId] );
   myToolBar->addAction( aViewsAction );
 
+  myToolBar->addAction( myActionsMap[AntiClockWiseId] );
+  myToolBar->addAction( myActionsMap[ClockWiseId] );
+
   myToolBar->addAction( myActionsMap[ResetId] );
 }
 
@@ -379,6 +400,28 @@ void VTKViewer_ViewWindow::onRightView()
   onFitAll();
 }
 
+/*!
+  \brief Rotate view 90 degrees clockwise
+*/
+void VTKViewer_ViewWindow::onClockWiseView()
+{
+  vtkCamera* aCamera = myRenderer->GetActiveCamera(); 
+  aCamera->Roll(-90);
+  aCamera->OrthogonalizeViewUp();
+  Repaint();
+}
+
+/*!
+  \brief Rotate view 90 degrees conterclockwise
+*/
+void VTKViewer_ViewWindow::onAntiClockWiseView()
+{
+  vtkCamera* aCamera = myRenderer->GetActiveCamera(); 
+  aCamera->Roll(90);
+  aCamera->OrthogonalizeViewUp();
+  Repaint();
+}
+
 /*!On reset view slot.*/
 void VTKViewer_ViewWindow::onResetView()
 {
@@ -403,22 +446,166 @@ void VTKViewer_ViewWindow::onFitAll()
   Repaint();
 }
 
-/*!Set background of the viewport*/
-void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color )
+/*!Set background color of the viewport [obsolete]*/
+void VTKViewer_ViewWindow::setBackgroundColor( const QColor& c )
 {
-  if ( myRenderer )
-    myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
+  Qtx::BackgroundData bg = background();
+  bg.setColor( c );
+  setBackground( bg );
 }
 
-/*!Returns background of the viewport*/
+/*!Returns background color of the viewport [obsolete]*/
 QColor VTKViewer_ViewWindow::backgroundColor() const
 {
-  vtkFloatingPointType backint[3];
-  if ( myRenderer ) {
-    myRenderer->GetBackground( backint );
-    return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255));
+  return background().color();
+}
+
+/*!Set background of the viewport*/
+void VTKViewer_ViewWindow::setBackground( const Qtx::BackgroundData& bgData )
+{
+  bool ok = false;
+  if ( bgData.isValid() ) {
+    switch ( bgData.mode() ) {
+    case Qtx::ColorBackground:
+      {
+       QColor c = bgData.color();
+       if ( c.isValid() ) {
+         // show solid-colored background
+         getRenderer()->SetTexturedBackground( false );  // cancel texture mode
+         getRenderer()->SetGradientBackground( false );  // cancel gradient mode
+         getRenderer()->SetBackground( c.red()/255.0,
+                                       c.green()/255.0,
+                                       c.blue()/255.0 ); // set background color
+         ok = true;
+       }
+       break;
+      }
+    case Qtx::SimpleGradientBackground:
+      {
+       QColor c1, c2;
+       int type = bgData.gradient( c1, c2 );
+        if ( c1.isValid() )
+        {
+          if ( !c2.isValid() )
+            c2 = c1;
+
+          // show two-color gradient background
+          getRenderer()->SetTexturedBackground( false );    // cancel texture mode
+          getRenderer()->SetGradientBackground( true );     // switch to gradient mode
+
+          VTKViewer_OpenGLRenderer* aRenderer =
+            VTKViewer_OpenGLRenderer::SafeDownCast( getRenderer() );
+          if( aRenderer )
+          {
+            aRenderer->SetGradientType( type );
+            aRenderer->SetBackground( c1.redF(), c1.greenF(), c1.blueF() );
+            aRenderer->SetBackground2( c2.redF(), c2.greenF(), c2.blueF() );
+            ok = true;
+          }
+        }
+       break;
+      }
+    case Qtx::CustomGradientBackground:
+      {
+       // NOT IMPLEMENTED YET
+       getRenderer()->SetTexturedBackground( false );  // cancel texture mode
+       getRenderer()->SetGradientBackground( false );  // cancel gradient mode
+       // .........
+       break;
+      }
+    default:
+      break;
+    }
+    if ( bgData.isTextureShown() ) {
+      QString fileName;
+      int textureMode = bgData.texture( fileName );
+      QFileInfo fi( fileName );
+      if ( !fileName.isEmpty() && fi.exists() ) {
+       // read texture from file
+       QString extension = fi.suffix().toLower();
+       vtkImageReader2* aReader = 0;
+       if ( extension == "jpg" || extension == "jpeg" )
+         aReader = vtkJPEGReader::New();
+       else if ( extension == "bmp" )
+         aReader = vtkBMPReader::New();
+       else if ( extension == "tif" || extension == "tiff" )
+         aReader = vtkTIFFReader::New();
+       else if ( extension == "png" )
+         aReader = vtkPNGReader::New();
+       else if ( extension == "mhd" || extension == "mha" )
+         aReader = vtkMetaImageReader::New();           
+       if ( aReader ) {
+         // create texture
+         aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+         aReader->Update();
+         
+         VTKViewer_Texture* aTexture = VTKViewer_Texture::New();
+         vtkImageMapToColors* aMap = 0;
+         vtkAlgorithmOutput* anOutput;
+         /*
+         // special processing for BMP reader
+         vtkBMPReader* aBMPReader = (vtkBMPReader*)aReader;
+         if ( aBMPReader ) {
+           // Special processing for BMP file
+           aBMPReader->SetAllow8BitBMP(1);
+           
+           aMap = vtkImageMapToColors::New();
+           aMap->SetInputConnection( aBMPReader->GetOutputPort() );
+           aMap->SetLookupTable( (vtkScalarsToColors*)aBMPReader->GetLookupTable() );
+           aMap->SetOutputFormatToRGB();
+           
+           anOutput = aMap->GetOutputPort();
+         }
+         else {
+          }
+         */
+         anOutput = aReader->GetOutputPort( 0 );
+         aTexture->SetInputConnection( anOutput );
+         // set texture mode
+         // VSR: Currently, VTK only supports Stretch mode, so below code will give
+         // the same results for all modes
+         switch ( textureMode ) {
+         case Qtx::TileTexture:
+           aTexture->RepeatOn();
+           aTexture->EdgeClampOff();
+           aTexture->InterpolateOff();
+           break;
+         case Qtx::StretchTexture:
+           aTexture->RepeatOff();
+           aTexture->EdgeClampOff();
+           aTexture->InterpolateOn();
+           break;
+         case Qtx::CenterTexture:
+         default:
+           aTexture->RepeatOff();
+           aTexture->EdgeClampOn();
+           aTexture->InterpolateOff();
+           break;
+         }
+         // show textured background
+         getRenderer()->SetTexturedBackground( true );     // switch to texture mode
+         getRenderer()->SetBackgroundTexture( aTexture );  // set texture image
+         
+         // clean-up resources
+         if ( aMap )
+           aMap->Delete();
+         aReader->Delete();
+         aTexture->Delete();
+         ok = true;
+       }
+      }
+    }
   }
-  return palette().color( backgroundRole() );
+
+  if ( ok )
+    myBackground = bgData;
+}
+
+/*!Returns background of the viewport*/
+Qtx::BackgroundData VTKViewer_ViewWindow::background() const
+{
+  return myBackground;
 }
 
 /*!Repaint window. If \a theUpdateTrihedron is true - recalculate trihedron.*/
@@ -579,8 +766,8 @@ QString VTKViewer_ViewWindow::getVisualParameters()
 
   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] );
+                  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;
 }
 
index 3bceda6c595b55ebc9593477346daa9eb07c189d..d624ed5f5dc66b61d9aae8e860305eda5e955609 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef VTKVIEWER_VIEWWINDOW_H
 #define VTKVIEWER_VIEWWINDOW_H
 
@@ -49,19 +50,21 @@ class VTKVIEWER_EXPORT VTKViewer_ViewWindow : public SUIT_ViewWindow
 public:
   VTKViewer_ViewWindow( SUIT_Desktop*, VTKViewer_Viewer*,
                         VTKViewer_InteractorStyle* = 0,
-                       VTKViewer_RenderWindowInteractor* = 0 );
+                        VTKViewer_RenderWindowInteractor* = 0 );
   virtual ~VTKViewer_ViewWindow();
   
   /*!Gets tool bar.*/
-  QToolBar*    getToolBar() { return myToolBar; }
+  QToolBar*                         getToolBar() { return myToolBar; }
   
-  void         setBackgroundColor( const QColor& );
-  QColor       backgroundColor() const;
+  void                              setBackgroundColor( const QColor& ); // obsolete
+  QColor                            backgroundColor() const;             // obsolete
+  void                              setBackground( const Qtx::BackgroundData& );
+  Qtx::BackgroundData               background() const;
 
   /*!Gets renderer.*/
   vtkRenderer*                      getRenderer()     { return myRenderer;     }
   /*!Gets render window.*/
-  VTKViewer_RenderWindow*          getRenderWindow() { return myRenderWindow; }
+  VTKViewer_RenderWindow*           getRenderWindow() { return myRenderWindow; }
   /*!Gets render window interactor.*/
   VTKViewer_RenderWindowInteractor* getRWInteractor() { return myRWInteractor; }
   bool                              isTrihedronDisplayed();
@@ -83,6 +86,8 @@ public slots:
   void onBottomView();
   void onLeftView();
   void onRightView();
+  void onClockWiseView();
+  void onAntiClockWiseView();
   void onResetView();
   void onFitAll();
   void activateZoom();
@@ -110,7 +115,8 @@ private:
 
 private:
   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId,
-         FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, TrihedronShowId };
+         FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
+        ResetId, TrihedronShowId };
   typedef QMap<int, QtxAction*> ActionsMap;
   
   void    createActions();
@@ -129,6 +135,7 @@ private:
   ActionsMap                        myActionsMap;  
   
   double                            myCurScale;
+  Qtx::BackgroundData               myBackground;
 
   friend class VTKViewer_RenderWindowInteractor;
 };
diff --git a/src/VTKViewer/resources/VTKViewer_images.po b/src/VTKViewer/resources/VTKViewer_images.po
deleted file mode 100755 (executable)
index 4dcb8a5..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-#  File   : SALOMEGUI_icons.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_VTKVIEWER_VIEW_BACK"
-msgstr "view_back.png"
-
-msgid "ICON_VTKVIEWER_VIEW_BOTTOM"
-msgstr "view_bottom.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FRONT"
-msgstr "view_front.png"
-
-msgid "ICON_VTKVIEWER_VIEW_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_VTKVIEWER_VIEW_LEFT"
-msgstr "view_left.png"
-
-msgid "ICON_VTKVIEWER_VIEW_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_VTKVIEWER_VIEW_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_VTKVIEWER_VIEW_RIGHT"
-msgstr "view_right.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ROTATION_POINT"
-msgstr "view_rotation_point.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ROTATE"
-msgstr "view_rotate.png"
-
-msgid "ICON_VTKVIEWER_VIEW_TOP"
-msgstr "view_top.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_VTKVIEWER_VIEW_TRIHEDRON"
-msgstr "view_triedre.png"
-
-msgid "ICON_VTKVIEWER_VIEW_DUMP"
-msgstr "view_camera_dump.png"
-
index 7dd35028090e1f18fbbc0a73dd8a8055eda90a38..d92d54b8249ac8abf80eecb72eed3d0e9737df21 100644 (file)
@@ -1,28 +1,44 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
+    <message>
+        <source>ICON_VERTEX_MARKER_1</source>
+        <translation>marker_1.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_2</source>
+        <translation>marker_2.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_3</source>
+        <translation>marker_3.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_4</source>
+        <translation>marker_4.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_5</source>
+        <translation>marker_5.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_6</source>
+        <translation>marker_6.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_7</source>
+        <translation>marker_7.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_8</source>
+        <translation>marker_8.png</translation>
+    </message>
+    <message>
+        <source>ICON_VERTEX_MARKER_9</source>
+        <translation>marker_9.png</translation>
+    </message>
     <message>
         <source>ICON_VTKVIEWER_VIEW_GLOBALPAN</source>
         <translation>vtk_view_glpan.png</translation>
         <source>ICON_VTKVIEWER_VIEW_TRIHEDRON</source>
         <translation>vtk_view_triedre.png</translation>
     </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_CLOCKWISE</source>
+        <translation>occ_view_clockwise.png</translation>
+    </message>
+    <message>
+        <source>ICON_VTKVIEWER_VIEW_ANTICLOCKWISE</source>
+        <translation>occ_view_anticlockwise.png</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/VTKViewer/resources/VTKViewer_msg_en.po b/src/VTKViewer/resources/VTKViewer_msg_en.po
deleted file mode 100755 (executable)
index e1f3959..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-#  SALOME SALOMEGUI : implementation of desktop and GUI kernel
-#  File   : SALOMEGUI_msg_en.po
-#  Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-31 13:25+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTK_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "VTKViewer_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTKViewer_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "VTKViewer_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "VTKViewer_ViewManager::VTK_VIEW_TITLE"
-msgstr "VTK scene:%M - viewer:%V"
-
-msgid "MNU_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron"
-
-msgid "DSC_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron in the current view"
index 6efdc426705d1ae5603e62212e89d31e724aabee..1a7f4191731c6797db11590254ce69d682eaf2f9 100644 (file)
@@ -1,29 +1,24 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-
-  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
+    <message>
+        <source>DSC_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate view counterclockwise</translation>
+    </message>
+    <message>
+        <source>DSC_CLOCKWISE_VIEW</source>
+        <translation>Rotate View Clockwise</translation>
+    </message>
+    <message>
+        <source>MNU_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate counterclockwise</translation>
+    </message>
+    <message>
+        <source>MNU_CLOCKWISE_VIEW</source>
+        <translation>Rotate clockwise</translation>
+    </message>
     <message>
         <source>MNU_FRONT_VIEW</source>
         <translation>Front</translation>
         <translation>Back View</translation>
     </message>
 </context>
+<context>
+    <name>VTKViewer_MarkerDlg</name>
+    <message>
+        <source>SET_MARKER_TLT</source>
+        <translation>Set Point Marker</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_MarkerWidget</name>
+    <message>
+        <source>STANDARD_MARKER</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>CUSTOM_MARKER</source>
+        <translation>Custom</translation>
+    </message>
+    <message>
+        <source>TYPE</source>
+        <translation>Type:</translation>
+    </message>
+    <message>
+        <source>SCALE</source>
+        <translation>Scale:</translation>
+    </message>
+    <message>
+        <source>CUSTOM</source>
+        <translation>Texture:</translation>
+    </message>
+    <message>
+        <source>BROWSE</source>
+        <translation>Browse...</translation>
+    </message>
+    <message>
+        <source>LOAD_TEXTURE_TLT</source>
+        <translation>Load Texture</translation>
+    </message>
+</context>
 <context>
     <name>VTKViewer_ViewManager</name>
     <message>
         <translation>Show Toolbar</translation>
     </message>
     <message>
-        <source>MEN_CHANGE_BACKGROUD</source>
+        <source>MEN_CHANGE_BACKGROUND</source>
         <translation>Change Background...</translation>
     </message>
+    <message>
+        <source>GT_HORIZONTALGRADIENT</source>
+        <translation>Horizontal gradient</translation>
+    </message>
+    <message>
+        <source>GT_VERTICALGRADIENT</source>
+        <translation>Vertical gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTDIAGONALGRADIENT</source>
+        <translation>First diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDDIAGONALGRADIENT</source>
+        <translation>Second diagonal gradient</translation>
+    </message>
+    <message>
+        <source>GT_FIRSTCORNERGRADIENT</source>
+        <translation>First corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_SECONDCORNERGRADIENT</source>
+        <translation>Second corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_THIRDCORNERGRADIENT</source>
+        <translation>Third corner gradient</translation>
+    </message>
+    <message>
+        <source>GT_FOURTHCORNERGRADIENT</source>
+        <translation>Fourth corner gradient</translation>
+    </message>
+    <message>
+        <source>BG_IMAGE_FILES</source>
+        <translation>Image files (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644 (file)
index 74f5e47..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS  = Qtx
-SUBDIRS += DDS
-SUBDIRS += QDS
-SUBDIRS += SUIT
-SUBDIRS += SUITApp
-SUBDIRS += STD
-SUBDIRS += CAF
-SUBDIRS += CAM
-SUBDIRS += LogWindow
-SUBDIRS += PyInterp
-SUBDIRS += PyConsole
-SUBDIRS += Prs
-SUBDIRS += OBJECT
-SUBDIRS += GLViewer
-SUBDIRS += VTKViewer
-SUBDIRS += SVTK
-SUBDIRS += OCCViewer
-SUBDIRS += SOCC
-SUBDIRS += Plot2d
-SUBDIRS += SPlot2d
-SUBDIRS += SUPERVGraph
-SUBDIRS += QxGraph
-SUBDIRS += Event
-SUBDIRS += LightApp
-SUBDIRS += ResExporter
-SUBDIRS += TOOLSGUI
-SUBDIRS += SalomeApp
-SUBDIRS += Session