]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge from V5_1_main branch 24/11/2010
authorvsr <vsr@opencascade.com>
Thu, 25 Nov 2010 11:57:51 +0000 (11:57 +0000)
committervsr <vsr@opencascade.com>
Thu, 25 Nov 2010 11:57:51 +0000 (11:57 +0000)
204 files changed:
adm_local/cmake_files/FindCAS.cmake
adm_local/cmake_files/FindGUI.cmake
adm_local/cmake_files/FindSIPPYQT.cmake
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/check_pyqt.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]
configure.ac
doc/salome/gui/doxyfile.in
doc/salome/gui/images/geomview-alt.png
doc/salome/gui/images/graduatedaxes2.png [new file with mode: 0644]
doc/salome/gui/images/image111.png [new file with mode: 0755]
doc/salome/gui/images/image157.png
doc/salome/gui/images/occviewer_toolbar.png
doc/salome/gui/images/pref11.png
doc/salome/gui/images/pref12.png
doc/salome/gui/images/pref13.png
doc/salome/gui/images/pref14.png
doc/salome/gui/images/pref15.png
doc/salome/gui/images/pref21.png
doc/salome/gui/images/pref41.png [new file with mode: 0644]
doc/salome/gui/input/geometry_preferences.doc
doc/salome/gui/input/mesh_preferences.doc
doc/salome/gui/input/occ_3d_viewer.doc
doc/salome/gui/input/postpro_preferences.doc
doc/salome/gui/input/salome_preferences.doc
doc/salome/gui/input/vtk_3d_viewer.doc
src/CAF/Makefile.am
src/CAF/resources/CAF_msg_en.ts
src/CAF/resources/CAF_msg_fr.ts [new file with mode: 0644]
src/CAM/CAM_Module.cxx
src/CAM/CAM_Module.h
src/CAM/Makefile.am
src/CAM/resources/CAM_msg_en.ts
src/CAM/resources/CAM_msg_fr.ts [new file with mode: 0755]
src/GLViewer/Makefile.am
src/GLViewer/resources/GLViewer_msg_en.ts
src/GLViewer/resources/GLViewer_msg_fr.ts [new file with mode: 0755]
src/LightApp/LightApp.qrc [new file with mode: 0644]
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_WgViewModel.cxx [new file with mode: 0644]
src/LightApp/LightApp_WgViewModel.h [new file with mode: 0644]
src/LightApp/Makefile.am
src/LightApp/images/en.png [new file with mode: 0644]
src/LightApp/images/fr.png [new file with mode: 0644]
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/LightApp_msg_fr.ts [new file with mode: 0755]
src/LogWindow/Makefile.am
src/LogWindow/resources/LogWindow_msg_en.ts
src/LogWindow/resources/LogWindow_msg_fr.ts [new file with mode: 0755]
src/Makefile.am
src/OCCViewer/Makefile.am
src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx
src/OCCViewer/OCCViewer_CubeAxesDlg.cxx [new file with mode: 0644]
src/OCCViewer/OCCViewer_CubeAxesDlg.h [new file with mode: 0644]
src/OCCViewer/OCCViewer_FontWidget.cxx [new file with mode: 0644]
src/OCCViewer/OCCViewer_FontWidget.h [new file with mode: 0644]
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h
src/OCCViewer/resources/OCCViewer_images.ts
src/OCCViewer/resources/OCCViewer_msg_en.ts
src/OCCViewer/resources/OCCViewer_msg_fr.ts [new file with mode: 0755]
src/OCCViewer/resources/occ_view_graduated_axes.png [new file with mode: 0755]
src/OCCViewer/resources/occ_view_zooming_style_switch.png [new file with mode: 0755]
src/ObjBrowser/Makefile.am
src/ObjBrowser/resources/OB_msg_en.ts
src/ObjBrowser/resources/OB_msg_fr.ts [new file with mode: 0755]
src/Plot2d/Makefile.am
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewModel.cxx
src/Plot2d/resources/Plot2d_msg_en.ts
src/Plot2d/resources/Plot2d_msg_fr.ts [new file with mode: 0755]
src/PyConsole/Makefile.am
src/PyConsole/PyConsole_Console.cxx
src/PyConsole/PyConsole_Console.h
src/PyConsole/PyConsole_Editor.cxx
src/PyConsole/PyConsole_Editor.h
src/PyConsole/resources/PyConsole_msg_en.ts
src/PyConsole/resources/PyConsole_msg_fr.ts [new file with mode: 0755]
src/QDS/Makefile.am
src/QDS/resources/QDS_msg_en.ts
src/QDS/resources/QDS_msg_fr.ts [new file with mode: 0755]
src/Qtx/Makefile.am
src/Qtx/Qtx.cxx
src/Qtx/Qtx.h
src/Qtx/QtxAction.cxx
src/Qtx/QtxAction.h
src/Qtx/QtxColorButton.cxx
src/Qtx/QtxMainWindow.cxx
src/Qtx/QtxPagePrefMgr.cxx
src/Qtx/QtxPagePrefMgr.h
src/Qtx/QtxResourceMgr.cxx
src/Qtx/QtxResourceMgr.h
src/Qtx/QtxShortcutEdit.cxx [new file with mode: 0755]
src/Qtx/QtxShortcutEdit.h [new file with mode: 0755]
src/Qtx/QtxTreeView.cxx
src/Qtx/resources/Qtx_msg_fr.ts [new file with mode: 0644]
src/QxGraph/Makefile.am
src/QxGraph/resources/QxGraph_msg_en.ts
src/QxGraph/resources/QxGraph_msg_fr.ts [new file with mode: 0755]
src/QxScene/Makefile.am
src/QxScene/resources/QxSceneViewer_msg_en.ts
src/QxScene/resources/QxSceneViewer_msg_fr.ts [new file with mode: 0755]
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_GUILight/SALOME_PYQT_ModuleLight.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip
src/STD/Makefile.am
src/STD/resources/STD_msg_en.ts
src/STD/resources/STD_msg_fr.ts [new file with mode: 0755]
src/SUIT/Makefile.am
src/SUIT/SUIT_Application.cxx
src/SUIT/SUIT_Application.h
src/SUIT/SUIT_PreferenceMgr.cxx
src/SUIT/SUIT_PreferenceMgr.h
src/SUIT/SUIT_ShortcutMgr.cxx [new file with mode: 0644]
src/SUIT/SUIT_ShortcutMgr.h [new file with mode: 0644]
src/SUIT/SUIT_ViewManager.cxx
src/SUIT/SUIT_ViewManager.h
src/SUIT/SUIT_ViewWindow.cxx
src/SUIT/SUIT_ViewWindow.h
src/SUIT/resources/SUIT_msg_en.ts
src/SUIT/resources/SUIT_msg_fr.ts [new file with mode: 0755]
src/SUITApp/Makefile.am
src/SUITApp/SUITApp.cxx
src/SUITApp/resources/SUITApp_msg_en.ts
src/SUITApp/resources/SUITApp_msg_fr.ts [new file with mode: 0755]
src/SUPERVGraph/Makefile.am
src/SUPERVGraph/resources/SUPERVGraph_msg_en.ts
src/SUPERVGraph/resources/SUPERVGraph_msg_fr.ts [new file with mode: 0755]
src/SVTK/Makefile.am
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_CubeAxesDlg.h
src/SVTK/SVTK_FontWidget.cxx
src/SVTK/SVTK_FontWidget.h
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/SVTK_NonIsometricDlg.cxx
src/SVTK/SVTK_NonIsometricDlg.h
src/SVTK/SVTK_SetRotationPointDlg.cxx
src/SVTK/SVTK_SetRotationPointDlg.h
src/SVTK/SVTK_UpdateRateDlg.cxx
src/SVTK/SVTK_UpdateRateDlg.h
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.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.ts
src/SVTK/resources/SVTK_msg_en.ts
src/SVTK/resources/SVTK_msg_fr.ts [new file with mode: 0755]
src/SVTK/resources/vtk_view_zooming_style_switch.png [new file with mode: 0755]
src/SVTK/vtkPVAxesActor.cxx [new file with mode: 0644]
src/SVTK/vtkPVAxesActor.h [new file with mode: 0644]
src/SVTK/vtkPVAxesWidget.cxx [new file with mode: 0644]
src/SVTK/vtkPVAxesWidget.h [new file with mode: 0644]
src/SalomeApp/Makefile.am
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_NoteBookDlg.cxx
src/SalomeApp/addvars2notebook.py [new file with mode: 0644]
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_msg_en.ts
src/SalomeApp/resources/SalomeApp_msg_fr.ts [new file with mode: 0755]
src/SalomeApp/salome_pluginsmanager.py
src/Session/SALOME_Session_Server.cxx
src/Style/Makefile.am
src/Style/Style_PrefDlg.cxx
src/Style/Style_Salome.cxx
src/Style/resources/Style_msg_fr.ts [new file with mode: 0644]
src/TOOLSGUI/Makefile.am
src/TOOLSGUI/ToolsGUI_RegWidget.cxx
src/TOOLSGUI/ToolsGUI_RegWidget.h
src/TOOLSGUI/resources/ToolsGUI_msg_en.ts
src/TOOLSGUI/resources/ToolsGUI_msg_fr.ts [new file with mode: 0755]
src/VTKViewer/Makefile.am
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_CellCenters.cxx [new file with mode: 0644]
src/VTKViewer/VTKViewer_CellCenters.h [new file with mode: 0644]
src/VTKViewer/VTKViewer_InteractorStyle.h
src/VTKViewer/resources/VTKViewer_msg_en.ts
src/VTKViewer/resources/VTKViewer_msg_fr.ts [new file with mode: 0755]
src/ViewerTools/Makefile.am [new file with mode: 0755]
src/ViewerTools/ViewerTools.h [new file with mode: 0644]
src/ViewerTools/ViewerTools_CubeAxesDlgBase.cxx [new file with mode: 0644]
src/ViewerTools/ViewerTools_CubeAxesDlgBase.h [new file with mode: 0644]
src/ViewerTools/ViewerTools_DialogBase.cxx [new file with mode: 0644]
src/ViewerTools/ViewerTools_DialogBase.h [new file with mode: 0644]
src/ViewerTools/ViewerTools_FontWidgetBase.cxx [new file with mode: 0644]
src/ViewerTools/ViewerTools_FontWidgetBase.h [new file with mode: 0644]
src/ViewerTools/resources/ViewerTools_msg_en.ts [new file with mode: 0644]
src/ViewerTools/resources/ViewerTools_msg_fr.ts [new file with mode: 0755]

index aa7b8abba196cb97d884d40a92cbf4959e149426..a6f50a4563578fb0225ce6d24ab720e820fca531 100644 (file)
@@ -21,7 +21,7 @@ SET(CASROOT $ENV{CASROOT})
 
 SET(OCC_VERSION_MAJOR 6)
 SET(OCC_VERSION_MINOR 3)
-SET(OCC_VERSION_MAINTENANCE 0)
+SET(OCC_VERSION_MAINTENANCE 10)
 
 SET(CAS_CPPFLAGS)
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
@@ -33,6 +33,17 @@ SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_CONFIG_H)
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_LIMITS_H)
 SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${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)
   IF(CMAKE_BUILD_TYPE STREQUAL Debug)
     SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
index b34c590c846fc90537fe7a867ed9b008bbb7fda5..786568aa21a88cd4d0d8e1e4a9b7caee366bb8a8 100644 (file)
@@ -29,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)
@@ -36,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)
@@ -49,4 +55,5 @@ 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)
index 84ac4c878300831f15bb31070d7095c6fe2aee0f..448e6a980dd3ea956c24894b99b856fd92b3e315 100644 (file)
@@ -63,8 +63,11 @@ 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(qt_flag ${QTVERSION})
-STRING(REPLACE "." "_" qt_flag ${qt_flag})
+file(READ ${PYQT_SIPS}/QtCore/QtCoremod.sip SUPPORTED)
+STRING(REGEX MATCH "Qt_[0-9]_[0-9]_[0-9]}" SUPPORTED ${SUPPORTED})
+STRING(LENGTH ${SUPPORTED} len)
+MATH(EXPR len "${len}-1")
+STRING(SUBSTRING ${SUPPORTED} 0 ${len} SUPPORTED)
 
 IF(WINDOWS)
   SET(ws_flag WS_WIN)
@@ -72,5 +75,5 @@ ELSE(WINDOWS)
   SET(ws_flag WS_X11)
 ENDIF(WINDOWS)
 
-SET(PYQT_SIPFLAGS -x VendorID -x PyQt_NoPrintRangeBug -t ${ws_flag} -t Qt_${qt_flag} -g -s .cc -c .)
+SET(PYQT_SIPFLAGS -x VendorID -x PyQt_NoPrintRangeBug -t ${ws_flag} -t ${SUPPORTED} -g -s .cc -c .)
 SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES})
index ae39d272fc7141c8fe2d2a90b169867a6f9d04d8..8e01139bbf7dfaeb8ce1fd5b92ef69f2a3282127 100644 (file)
@@ -37,7 +37,6 @@ check_qwt.m4                  \
 check_SalomeObject.m4          \
 check_sip.m4                   \
 check_SupervGraphViewer.m4     \
-check_vtk.m4                   \
 check_VTKViewer.m4             \
 check_QxGraphViewer.m4          \
 check_TestRecorder.m4
index c23dac6d5acd09d1753bf7d1b092e393c27ffa21..3b2111d6b8ad28d1c204bf9d6a7535bfa396e014 100644 (file)
@@ -151,6 +151,9 @@ if test "x$pyqt_ok" == "xyes" ; then
     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"
 
index e007e76f9af90cbb4a342fe064b3ed174003de5f..d834777d82c3ed13d96705ea23896a1d8a8145a0 100644 (file)
@@ -67,6 +67,25 @@ if test -z $QWTHOME; then
         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
index 9fa0d1b9413c2e10cc36d18daa0dd77999bac251..0234ec580a8aca9b4d916dedc89774a9f1f4ce29 100644 (file)
@@ -74,6 +74,9 @@ if test "x$sip_ok" = "xyes" ; then
     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 97dd120..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-dnl  Copyright (C) 2007-2010  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, --with-vtk-version and --with-paraview 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 unless VTK from ParaView is detected)])],
-              [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 taking from environment variable)])])
-])
-
-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_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
-dnl Use VTK from ParaView unless --with-paraview=no is given
-dnl
-
-pv_vtk_ok=no
-
-case "x$with_paraview" in
-
-  xno )
-    PVHOME=""
-    ;;
-
-  xyes | x )
-  
-    if test -z $PVHOME ; then
-      AC_PATH_PROG(para_path, paraview)
-      if test "x$para_path" != "x" ; then
-         para_path=`dirname $para_path`
-         PVHOME=`dirname $para_path`
-      else
-        for d in /usr/local /usr ; do
-          if test -f ${d}/include/paraview${PVVERSION}/pqDialog.h ; then
-            AC_MSG_RESULT(trying ${d})
-            PVHOME="${d}"
-            break
-          fi
-          if test -f ${d}/include/paraview-3.7/pqDialog.h ; then
-            AC_MSG_RESULT(trying ${d})
-            PVHOME="${d}"
-            PVVERSION="-3.7"
-            break
-          fi
-          if test -f ${d}/include/paraview-3.8/pqDialog.h ; then
-            AC_MSG_RESULT(trying ${d})
-            PVHOME="${d}"
-            PVVERSION="-3.8"
-            break
-          fi
-          if test -f ${d}/include/paraview/pqDialog.h ; then
-            AC_MSG_RESULT(trying ${d})
-            PVHOME="${d}"
-            PVVERSION=""
-            break
-          fi
-        done
-      fi
-    fi
-    ;;
-
-  * )
-    PVHOME=${with_paraview}
-    ;;
-esac
-
-dnl Check VTK from ParaView.
-
-if test "x$PVHOME" != "x" ; then
-
-  if test "x$PVVERSION" = "x" ; then
-    for suffix in 3.7 3.8 ; do
-      if test -f $PVHOME/include/paraview-$suffix/vtkPVConfig.h ; then
-               PVVERSION=$suffix
-        break;
-      fi
-    done
-  fi   
-  if test "x$PVVERSION" = "x" ; then
-    PVVERSION=`basename $PVHOME | sed -e "s,[[^-]]*,,"`
-  else
-    if test "${PVVERSION:0:1}" != "-" ; then
-      PVVERSION="-$PVVERSION"
-    fi
-  fi
-
-  AC_CHECKING(for VTK from ParaView)
-
-  PV_LOCAL_INCLUDES="-I$PVHOME/include/paraview$PVVERSION $LOCAL_INCLUDES"
-  PV_LOCAL_LIBS="-L$PVHOME/lib/paraview$PVVERSION -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc $LOCAL_LIBS"
-  PV_TRY_LINK_LIBS="-L$PVHOME/lib/paraview$PVVERSION -lvtksys $TRY_LINK_LIBS"
-
-  dnl vtk headers
-  CPPFLAGS_old="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $PV_LOCAL_INCLUDES"
-  
-  AC_CHECK_HEADER(vtkPoints.h,pv_vtk_ok="yes",pv_vtk_ok="no")
-  
-  CPPFLAGS="$CPPFLAGS_old"
-  
-  if test "x$pv_vtk_ok" = "xyes"; then
-
-     dnl vtk libraries
-  
-     AC_MSG_CHECKING(linking VTK library from ParaView)
-  
-     LIBS_old="$LIBS"
-     LIBS="$LIBS $PV_TRY_LINK_LIBS"
-     CPPFLAGS_old="$CPPFLAGS"
-     CPPFLAGS="$CPPFLAGS $PV_LOCAL_INCLUDES"
-  
-     AC_CACHE_VAL(salome_cv_lib_pvvtk,[
-       AC_TRY_LINK([#include "vtkPoints.h"
-                   ],
-                [vtkPoints::New()],
-                [salome_cv_lib_pvvtk=yes],
-                [salome_cv_lib_pvvtk=no])
-     ])
-     pv_vtk_ok="$salome_cv_lib_pvvtk"
-     LIBS="$LIBS_old"
-     CPPFLAGS="$CPPFLAGS_old"
-     AC_MSG_RESULT($pv_vtk_ok)
-  fi
-
-  dnl Find out version of VTK from ParaView
-  PVVTKVERSION=" Undefined"
-  if test "x$pv_vtk_ok" = "xyes"; then
-     AC_MSG_CHECKING(VTK version)
-     PVVTKVERSION=`grep VTK_VERSION $PVHOME/include/paraview$PVVERSION/vtkConfigure.h`
-     AC_MSG_RESULT(${PVVTKVERSION:20:10})
-  fi
-fi
-
-dnl
-dnl Use regular VTK if no ParaView found or a newer version is provided via --with-vtk
-dnl 
-
-try_regular_vtk=no
-if test "$pv_vtk_ok" = "no"; then
-  try_regular_vtk=yes
-fi
-
-if test -z $with_vtk ; then
-  with_vtk=""
-fi
-case "x$with_vtk" in
-  xyes)
-    dnl in case user wrote --with-vtk=yes
-    with_vtk=""
-    ;;
-  xno)
-    dnl in case user wrote --with-vtk=no
-    with_vtk=""
-    AC_MSG_WARN(Value "no", specified for option --with-vtk, is not supported)
-    ;;
-  x)
-    ;;
-  *)
-    try_regular_vtk=yes
-    ;;
-esac
-
-if test "$try_regular_vtk" = "yes"; then
-
-  dnl Check regular VTK installation
-  AC_CHECKING(for regular VTK)
-  
-  dnl VTK install dir
-
-  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
-        fi
-        if test -f ${d}/include/vtk-5.0/vtkPlane.h ; then
-          AC_MSG_RESULT(trying ${d})
-          VTKHOME="${d}"
-          VTKSUFFIX="-5.0"
-          break
-        fi
-        if test -f ${d}/include/vtk-5.2/vtkPlane.h ; then
-          AC_MSG_RESULT(trying ${d})
-          VTKHOME="${d}"
-          VTKSUFFIX="-5.2"
-          break
-        fi
-        if test -f ${d}/include/vtk/vtkPlane.h ; then
-          AC_MSG_RESULT(trying ${d})
-          VTKHOME="${d}"
-          VTKSUFFIX=""
-          break
-        fi
-      done
-    fi
-  fi
-  
-  VTK_LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
-  VTK_LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
-  VTK_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
-    VTK_LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
-  fi
-  
-  dnl vtk headers
-  CPPFLAGS_old="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $VTK_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 regular VTK library)
-  
-     LIBS_old="$LIBS"
-     LIBS="$LIBS $VTK_TRY_LINK_LIBS"
-     CPPFLAGS_old="$CPPFLAGS"
-     CPPFLAGS="$CPPFLAGS $VTK_LOCAL_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"
-     AC_MSG_RESULT($vtk_ok)
-  fi
-  
-  VTKVERSION=" Undefined"
-  if test "x$vtk_ok" = "xyes"; then
-     AC_MSG_CHECKING(VTK version)
-     VTKVERSION=`grep VTK_VERSION $VTKHOME/include/vtk${VTKSUFFIX}/vtkConfigure.h`
-     AC_MSG_RESULT(${VTKVERSION:20:10})
-  fi
-fi
-
-dnl Select either of VTKs
-if  test "x$pv_vtk_ok" = "xyes" ; then
-  if test "x$vtk_ok" = "xyes" ; then
-     if test "$VTKVERSION" \> "$PVVTKVERSION" ; then
-       AC_MSG_RESULT([VTK from ParaView is older, ignored])
-       pv_vtk_ok=no
-     else
-       AC_MSG_RESULT([regular VTK is older, ignored])
-       vtk_ok=no
-     fi
-  fi
-fi  
-
-if  test "x$pv_vtk_ok" = "xyes" ; then
-  AC_MSG_RESULT(for VTK: yes)
-  VTK_INCLUDES="$PV_LOCAL_INCLUDES"
-  VTK_LIBS="$PV_LOCAL_LIBS"
-  VTK_MT_LIBS="$VTK_LIBS"
-  #VTKPY_MODULES=
-  vtk_ok=yes
-else
-    if  test "x$vtk_ok" = "xyes" ; then
-      AC_MSG_RESULT(for VTK: yes)
-      VTK_INCLUDES="$VTK_LOCAL_INCLUDES"
-      VTK_LIBS="$VTK_LOCAL_LIBS"
-      VTK_MT_LIBS="$VTK_LIBS"
-      #VTKPY_MODULES=
-    else
-      AC_MSG_RESULT(for VTK: no)
-      AC_MSG_WARN(unable to link with vtk library)
-    fi
-fi
-
-AC_LANG_RESTORE
-
-# Save cache
-AC_CACHE_SAVE
-
-])dnl
index 1ee35fac3df4dbc46ed56974af60f9361e89fd2f..8a235a268a79a73113d6fcafdeea8fdfdc38c4cc 100644 (file)
@@ -26,7 +26,7 @@
 # Modified by : Marc Tajchman (CEA)
 # Modified by : Mikhail PONIKAROV (OCN) - autotools usage
 #
-AC_INIT([Salome2 Project GUI module], [6.1.0], [webmaster.salome@opencascade.com], [SalomeGUI])
+AC_INIT([Salome2 Project GUI module], [6.2.0], [webmaster.salome@opencascade.com], [SalomeGUI])
 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
@@ -599,6 +599,19 @@ echo
 #  chmod +x ./bin/salome/*; \
 #])
 
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+  if test \"\$(echo \$[@] | grep -E '\\\-L/usr/lib(/../lib)?(64)? ')\" == \"\" \n\
+  then\n\
+    cmd=\"\1 \$[@]\"\n\
+  else\n\
+    cmd=\"\1 \"\`echo \$[@] | sed -r -e 's|(.*)-L/usr/lib(/../lib)?(64)? (.*)|\\\1\\\4 -L/usr/lib\\\3|g'\`\n\
+  fi\n\
+  \$cmd\n\
+}\n\
+CC=\"hack_libtool\"%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.
@@ -634,6 +647,7 @@ AC_OUTPUT([ \
   src/ObjBrowser/Makefile \
   src/Prs/Makefile \
   src/OBJECT/Makefile \
+  src/ViewerTools/Makefile \
   src/GLViewer/Makefile \
   src/VTKViewer/Makefile \
   src/SVTK/Makefile \
index 84772c7769db02ffbfdea6331770570fcadfcee8..4d4cd2fdabe8cbf8a7cc6c99d2616c6b5ef26014 100755 (executable)
@@ -62,4 +62,9 @@ GENERATE_LATEX    = NO
 #---------------------------------------------------------------------------
 #RTF related options
 #---------------------------------------------------------------------------
-GENERATE_RTF      = NO
\ No newline at end of file
+GENERATE_RTF      = NO
+
+#---------------------------------------------------------------------------
+#Search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE      = NO
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
diff --git a/doc/salome/gui/images/graduatedaxes2.png b/doc/salome/gui/images/graduatedaxes2.png
new file mode 100644 (file)
index 0000000..aa9dbf3
Binary files /dev/null and b/doc/salome/gui/images/graduatedaxes2.png differ
diff --git a/doc/salome/gui/images/image111.png b/doc/salome/gui/images/image111.png
new file mode 100755 (executable)
index 0000000..8f3a486
Binary files /dev/null and b/doc/salome/gui/images/image111.png differ
index dec5836f9145a7163d595a2cd7867d52e3ae0945..3c4b5040bc9c8ba5800295471a26bef8c78bcadc 100644 (file)
Binary files a/doc/salome/gui/images/image157.png and b/doc/salome/gui/images/image157.png differ
index 3e87ca31b20b181e19ee259b842f29a0542527b3..0cc7d3e80db6864f35ccf2b3cbd2c730d7f67a79 100644 (file)
Binary files a/doc/salome/gui/images/occviewer_toolbar.png and b/doc/salome/gui/images/occviewer_toolbar.png differ
index 39755e71076737e4e59b198f5b4ec4762835489a..a3af88c506591e06908bcb229ee1abc2da0f58c8 100755 (executable)
Binary files a/doc/salome/gui/images/pref11.png and b/doc/salome/gui/images/pref11.png differ
index b14da29b71e40d6b815f55a9fc4ea5de00e0a699..699d82ec148c23ecae1668f92c6438389281b2a7 100755 (executable)
Binary files a/doc/salome/gui/images/pref12.png and b/doc/salome/gui/images/pref12.png differ
index 56dd24a418d953c40201eaa152c7fc4f3837c946..0bd100d80bd5e1f9a7afd0e7cb65a4c985469217 100755 (executable)
Binary files a/doc/salome/gui/images/pref13.png and b/doc/salome/gui/images/pref13.png differ
index ec035a867afed8029fbe9abae3839d7562c2b95d..577c3ed8799b7d3bbcfcab2e9bee2eb4417e21cc 100755 (executable)
Binary files a/doc/salome/gui/images/pref14.png and b/doc/salome/gui/images/pref14.png differ
index 9f1195e5cf42c2e465f2e4befcdffb7e89db26e2..f90b585329abcb8785867093f4050829d637189b 100755 (executable)
Binary files a/doc/salome/gui/images/pref15.png and b/doc/salome/gui/images/pref15.png differ
index caf3519fde1480da7ff0e79f35e841634e3cd9bf..8b81c604cefb67f5fb901bf7cecf229c0bfa148b 100755 (executable)
Binary files a/doc/salome/gui/images/pref21.png and b/doc/salome/gui/images/pref21.png differ
diff --git a/doc/salome/gui/images/pref41.png b/doc/salome/gui/images/pref41.png
new file mode 100644 (file)
index 0000000..c4d943f
Binary files /dev/null and b/doc/salome/gui/images/pref41.png differ
index 81161225c67292da1742c35c200c18e378fa9b4f..d397e1b03bd62b3532fa6d7157b41a6f1fd9863d 100644 (file)
@@ -63,4 +63,15 @@ points (cross, asterisk, etc.).</li>
 </ul>
 </ul>
 
+<ul>
+<li><b>Origin and base vectors</b></li>
+<ul>
+<li><b>Length of base vectors</b> - allows to define the length
+of base vectors.</li>
+<li><b>Auto create</b> - allows to automatically create a point
+of origin and three base vectors of the rectangular coordinate
+system immediately after the module activation.</li>
+</ul>
+</ul>
+
 */
index 7fd8a38a25d908050d1bf9c7171eafd5e9579513..0b5a756d79a10a6bfc4961e0e1fbaf4d32b156d2 100644 (file)
@@ -10,10 +10,15 @@ later sessions with this module.
 \image html pref21.png
 
 <ul>
-<li><b>Update</b></li>
+<li><b>Automatic 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>
+<li><b>Size limit (elements)</b> - allows to specify the maximum
+number of elements in the resulting mesh for which the automatic updating
+of the presentation is performed. This option affects only
+<b>Compute</b> operation. Zero value means "no limit". Default value
+is 500 000 mesh elements.
 </ul>
 <li><b>Quality Controls</b></li>
 <ul>
index dcadc8d28a7eef3dd1dc59b4192996768c27e993..f1f3acba628cdfa47311b8555ef2135b91c448b5 100644 (file)
@@ -24,6 +24,12 @@ left mouse button, panning - by middle mouse button, zooming - by left and middl
 mouse buttons pressed simultaneously.</center>
 <hr>
 
+\image html image111.png
+\n <center><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.</center>
+<hr>
+
 \image html image88.png
 \n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
 <hr>
@@ -126,6 +132,40 @@ viewer.</li>
 \image html occviewer_axialscale.png
 \n <center><b>Scaling</b> - represents objects deformed (stretched or
 stuffed) along the axes of coordinates.</center>
+<hr>
+
+\image html image109.png
+\n <center><b>Graduated axes</b> - allows to define axes parameters 
+and graduate them.</center>
+
+\image html graduatedaxes2.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 axis name.</li>
+<li><b>Font</b> - allows to define the font color of the 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 the font color 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>
+<hr>
 
 <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.
 
index 6e2755a6b98a103eec64c11f0b9ec9ac159a9289..f8b0b1fca228e19fd30f8ed8b940800b1b594a2b 100644 (file)
@@ -129,7 +129,7 @@ structure of the study and can be visualized in a XY plot.</li>
 <ul>
 <li><b>Stream Lines Preferences</b></li>
 <ul>
-<li><b>Used points</b> - allows to define a default value of percentage
+<li><b>Used points</b> - allows to define a default percentage
 of points used for building the Stream Lines presentation.</li>
 </ul>
 </ul>
index 17d91caa3f4b5bcf5cb11e06451fd534cbdee23b..8e4065d36960e4c4e9b1644947a51e4a1fe979e2 100644 (file)
@@ -97,11 +97,20 @@ 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>Zooming mode</b> - this option allows to choose a zooming mode.</li>
+<ul>
+<li><b>Relative to the view's center</b> - allows to zoom the view 
+relatively to its center.</li>
+<li><b>Relative to the cursor</b> - allows to zoom the view
+relatively to the current cursor position..</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> 
+<li><b>Show static trihedron</b> - allows to show/hide the static trihedron
+located in the bottom-left corner of the viewer.
 </ul>
 <li><b>Spacemouse</b> - a mouse-like manipulator device specially designed
 for working with 3D presentations, objects, etc. You can reassign the
@@ -207,4 +216,17 @@ resizing columns on expanding an object browser item.</li>
 <b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.</li>
 </ul>
 
+<br><h2>Shortcuts Preferences</h2>
+
+\image html pref41.png
+
+<ul>
+<li>
+<b>Shortcuts settings</b> widget allows to define custom shortcuts for
+various operations.
+<br>To change keyboard sequence for a certain action - select the
+action and press the custom keys combination.
+</li>
+</ul>
+
 */
index a33ab8e162fcc471f130d1637eea2403e639804e..e5b73f2943b0ac6eeabe82af3988da11d4a5df3f 100644 (file)
@@ -24,6 +24,13 @@ left mouse button, panning - by middle mouse button, zooming - by left and middl
 mouse buttons pressed simultaneously.</center>
 <hr>
 
+\image html image111.png
+\n <center><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.</center>
+<hr>
+
 \image html image88.png
 \n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
 <hr>
index a0fc8e5ff6412ae40e2d945a0d0732aa1c61e18e..e95bc4463301948b63e8694cfc54f8301527ddd2 100755 (executable)
@@ -49,7 +49,8 @@ MOC_FILES =                   \
 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_LDFLAGS  = $(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS)
index 590baaac3825542f843eef01717d4c47fce68250..ed2ac521df9aa62a053232bfa65adfb22aa6fe31 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
diff --git a/src/CAF/resources/CAF_msg_fr.ts b/src/CAF/resources/CAF_msg_fr.ts
new file mode 100644 (file)
index 0000000..a1a8505
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>CAF_Application</name>
+    <message>
+        <source>MEN_APP_EDIT</source>
+        <translation>&amp;Editer</translation>
+    </message>
+    <message>
+        <source>INF_ALL_FILTER</source>
+        <translation>Tous les fichiers (*.*)</translation>
+    </message>
+    <message>
+        <source>INF_ALL_DOCUMENTS_FILTER</source>
+        <translation>Tous les documents lisibles</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT</source>
+        <translation>&amp;Editer</translation>
+    </message>
+    <message>
+        <source>MEN_APP_EDIT_UNDO</source>
+        <translation>&amp;Défaire</translation>
+    </message>
+    <message>
+        <source>MEN_APP_EDIT_REDO</source>
+        <translation>&amp;Refaire</translation>
+    </message>
+    <message>
+        <source>PRP_APP_EDIT_REDO</source>
+        <translation>Refaire la dernière opération</translation>
+    </message>
+    <message>
+        <source>PRP_APP_EDIT_UNDO</source>
+        <translation>Défaire la dernière opération</translation>
+    </message>
+    <message>
+        <source>TOT_APP_EDIT_REDO</source>
+        <translation>Refaire</translation>
+    </message>
+    <message>
+        <source>TOT_APP_EDIT_UNDO</source>
+        <translation>Défaire</translation>
+    </message>
+    <message>
+        <source>INF_APP_REDOACTIONS</source>
+        <translation> Refait %1 action(s) </translation>
+    </message>
+    <message>
+        <source>INF_APP_UNDOACTIONS</source>
+        <translation> Défait %1 action(s) </translation>
+    </message>
+    <message>
+        <source>ABOUT_INFO</source>
+        <translation>Application SUIT Caf</translation>
+    </message>
+</context>
+</TS>
index 39beee2d7045418e1fff437a39dc3bd6f8c6fc75..8e39ab66bb8e64ed6b931704794bd9ee17fa544a 100755 (executable)
@@ -835,9 +835,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 )
index 73aaf71b9f51b55190d48de63e7ffdf0d03b3e39..2a3022d665b4781321e2e9aaf15eb32ce6e90be8 100755 (executable)
@@ -128,7 +128,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
index cd568c63fa281c4d4a59877877edfecefdc338b2..98630d977ddf33334f670e3a2fa709d80f7f678a 100755 (executable)
@@ -51,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)
index 831ce43f14ac754a1f85a1eff07d02dea038887c..6779ef2282e2a0d0cf9043aef928bee251b68e5e 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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/CAM/resources/CAM_msg_fr.ts b/src/CAM/resources/CAM_msg_fr.ts
new file mode 100755 (executable)
index 0000000..09e8fec
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>ERROR_TLT</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>ERROR_ACTIVATE_MODULE_MSG</source>
+        <translation>Impossible d&apos;activer le module %1</translation>
+    </message>
+    <message>
+        <source>MODULE_ROOT_OBJECT_TOOLTIP</source>
+        <translation>%1 objet-racine du module</translation>
+    </message>
+</context>
+</TS>
index 1eec79e89bb7aebff0b33b8e9d5e82a348523fc9..e134a769f71aa1da251fbdd759978813ae827d92 100644 (file)
@@ -111,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)
index 667a0a688d0f85d0de516fb44c614827ecae09de..d99e2af4c218e827d122739caa2c5726b5f0a256 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_fr.ts b/src/GLViewer/resources/GLViewer_msg_fr.ts
new file mode 100755 (executable)
index 0000000..32fea6f
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>DSC_FITSELECT</source>
+        <translation>Montrer la zone choisie dans la vue</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Sauvegarder</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de vue</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoomer</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Montrer tous les objets dans la vue</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Déplacement global</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue</translation>
+    </message>
+    <message>
+        <source>GL_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png)</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Montrer la zone dans la vue</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
+    </message>
+    <message>
+        <source>CHANGE_BGCOLOR</source>
+        <translation>Changer la couleur d&apos;arrière-plan...</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue en cours dans un fichier image</translation>
+    </message>
+    <message>
+        <source>MNU_FITSELECT</source>
+        <translation>Afficher la sélection</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoomer la vue</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+</context>
+<context>
+    <name>GLViewer_ViewFrame</name>
+    <message>
+        <source>DUMP_VIEW_SAVE_FILE_DLG_CAPTION</source>
+        <translation>Sauvegarder la vue dans le fichier</translation>
+    </message>
+    <message>
+        <source>DUMP_VIEW_ERROR_DLG_TEXT</source>
+        <translation>Impossible de sauvegarder la vue dans le fichier</translation>
+    </message>
+    <message>
+        <source>DUMP_VIEW_ERROR_DLG_CAPTION</source>
+        <translation>Erreur</translation>
+    </message>
+</context>
+<context>
+    <name>GLViewer_ViewManager</name>
+    <message>
+        <source>GL_VIEW_TITLE</source>
+        <translation>Scène GL:%M - visualiseur:%V</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/LightApp/LightApp.qrc b/src/LightApp/LightApp.qrc
new file mode 100644 (file)
index 0000000..ffcce9a
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+  <file>images/en.png</file>
+  <file>images/fr.png</file>
+</qresource>
+</RCC>
index 63252a82266d2104681c3ce543cd80355f4a9585..7a2fb0fac8018fa973197c1eb22636be20227483 100644 (file)
@@ -54,6 +54,7 @@
 #include "LightApp_OBSelector.h"
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_DataObject.h"
+#include "LightApp_WgViewModel.h"
 
 #include <SALOME_Event.h>
 
@@ -70,6 +71,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>
   #include <SALOME_ListIO.hxx>
 #endif
 
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
 #define ToolBarMarker    0
 #define DockWidgetMarker 1
 
@@ -232,6 +242,8 @@ LightApp_Application::LightApp_Application()
 : CAM_Application( false ),
   myPrefs( 0 )
 {
+  Q_INIT_RESOURCE( LightApp );
+
   STD_TabDesktop* desk = new STD_TabDesktop();
 
   setDesktop( desk );
@@ -1361,6 +1373,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     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 );
   }
@@ -1381,7 +1394,9 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
       vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
       vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
                             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->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
                                resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
       vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
@@ -1410,6 +1425,24 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   return viewMgr;
 }
 
+SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, QWidget* w )
+{
+  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 ) );
+
+  if ( !vmType.isEmpty() && !myUserWmTypes.contains( vmType ) )
+    myUserWmTypes << vmType;
+
+  return vm;
+}
+
 /*!
   SLOT: Removes view manager from application
 */
@@ -1603,6 +1636,9 @@ void LightApp_Application::showPreferences( const QString& itemText )
     if ( desktop() )
       resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
     resourceMgr()->save();
+
+    // Update shortcuts
+    shortcutMgr()->updateShortcuts();
   }
 
   delete prefDlg;
@@ -1861,6 +1897,19 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
 
   int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
+
+  int langGroup = pref->addPreference( tr( "PREF_GROUP_LANGUAGE" ), genTab );
+  pref->setItemProperty( "columns", 2, langGroup );
+  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 );
+
   int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
 
   pref->setItemProperty( "columns", 2, studyGroup );
@@ -1949,6 +1998,17 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aStyleModeList, occStyleMode );
   pref->setItemProperty( "indexes", aModeIndexesList, occStyleMode );
 
+#if OCC_VERSION_LARGE > 0x06030010 // available only with OCC-6.3-sp11 and higher version
+  int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), occGroup,
+                                                 LightApp_Preferences::Selector, "OCCViewer", "zooming_mode" );
+  QStringList anOCCZoomingStyleModeList;
+  anOCCZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
+  anOCCZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
+
+  pref->setItemProperty( "strings", anOCCZoomingStyleModeList, occZoomingStyleMode );
+  pref->setItemProperty( "indexes", aModeIndexesList, occZoomingStyleMode );
+#endif
+
   // VTK Viewer
   int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
   pref->setItemProperty( "columns", 2, vtkGen );
@@ -1979,7 +2039,15 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
   pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
 
-  pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
+  int vtkZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), vtkGen,
+                                                 LightApp_Preferences::Selector, "VTKViewer", "zooming_mode" );
+
+  QStringList aVTKZoomingStyleModeList;
+  aVTKZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
+  aVTKZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
+
+  pref->setItemProperty( "strings", aVTKZoomingStyleModeList, vtkZoomingStyleMode );
+  pref->setItemProperty( "indexes", aModeIndexesList, vtkZoomingStyleMode );
 
   int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
                                       LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
@@ -1996,6 +2064,8 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aSpeedModeList, vtkSpeedMode );
   pref->setItemProperty( "indexes", aModeIndexesList, vtkSpeedMode );
 
+  pref->addPreference( tr( "PREF_SHOW_STATIC_TRIHEDRON" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "show_static_trihedron" );
+
   int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox );
   pref->setItemProperty( "columns", 2, vtkSM );
   int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM,
@@ -2158,6 +2228,12 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->addPreference( tr( "PREF_RESIZE_ON_EXPAND_ITEM" ), objSetGroup, LightApp_Preferences::Bool,
                        "ObjectBrowser", "resize_on_expand_item" );
 
+  // Shortcuts preferences
+  int shortcutTab = pref->addPreference( tr( "PREF_TAB_SHORTCUTS" ), salomeCat );
+  int shortcutGroup = pref->addPreference( tr( "PREF_GROUP_SHORTCUTS" ), shortcutTab );
+  pref->addPreference( tr( "" ), shortcutGroup,
+                       LightApp_Preferences::ShortcutTree, "shortcuts" );
+
   // MRU preferences
   int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
   pref->setItemProperty( "columns", 4, mruGroup );
@@ -2227,6 +2303,25 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   }
 #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" )) )
   {
@@ -2317,6 +2412,52 @@ 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( "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" ) ||
@@ -2425,6 +2566,10 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
         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" ) );
+  }
 }
 
 /*!
@@ -3244,6 +3389,7 @@ bool LightApp_Application::openAction( const int choice, const QString& aName )
 QStringList LightApp_Application::viewManagersTypes() const
 {
   QStringList aTypesList;
+  aTypesList += myUserWmTypes;
 #ifndef DISABLE_GLVIEWER
   aTypesList<<GLViewer_Viewer::Type();
 #endif
index f905b03f274e3762e83b1c0a6c1a775e3548499f..4561c4d779c1b3ce3aa57e85fa66f12b89e737ca 100644 (file)
@@ -35,6 +35,7 @@
 #include <CAM_Application.h>
 
 #include <QPointer>
+#include <QStringList>
 
 class LogWindow;
 #ifndef DISABLE_PYCONSOLE
@@ -124,6 +125,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;
@@ -285,6 +287,7 @@ protected:
   static LightApp_Preferences*        _prefs_;
 
   static int                          lastStudyId;
+  QStringList                         myUserWmTypes;
 };
 
 #ifdef WIN32
index 118fc9db43df3875fce81cf13260d2595c3604d1..c456acd828b84725e0e619344b8d250b849e410a 100644 (file)
@@ -46,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>
 
@@ -220,6 +221,14 @@ 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
 
@@ -251,6 +260,14 @@ 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() );
@@ -386,9 +403,9 @@ 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() ) ),
       *eraseAll = createAction( -1, tr( "TOP_ERASE_ALL" ), p, tr( "MEN_ERASE_ALL" ), tr( "STB_ERASE_ALL" ),
index 397cfaebc624c1a9911b3a3ae6083e3f1c28517c..a7b9b17d20ac0d3446daa93781ea1ed1fe028180 100644 (file)
@@ -176,7 +176,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();
@@ -186,12 +186,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() );
   }
-  
 }
 
 /*!
@@ -223,12 +221,12 @@ 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 )
     {
@@ -253,7 +251,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 );
 
@@ -268,7 +266,7 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj
 /*!
   select 'subobjects' with given indexes
 */
-void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject, 
+void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
                                             TColStd_IndexedMapOfInteger theIndex, bool append )
 {
   SUIT_DataOwnerPtrList aList;
@@ -294,7 +292,7 @@ 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()) ) );
@@ -305,7 +303,7 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap
             aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
         }
     }
-  
+
   setSelected( aList, append );
 
 }
@@ -326,13 +324,13 @@ 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 );
diff --git a/src/LightApp/LightApp_WgViewModel.cxx b/src/LightApp/LightApp_WgViewModel.cxx
new file mode 100644 (file)
index 0000000..e4a337c
--- /dev/null
@@ -0,0 +1,55 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_LightApp_WgViewModel.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#include "LightApp_WgViewModel.h"
+#include "SUIT_ViewWindow.h"
+
+LightApp_WgViewModel::LightApp_WgViewModel( const QString& type, QWidget* w )
+  : SUIT_ViewModel(),
+    myType( type ),
+    myWidget( w ),
+    myCreated( false )
+{
+}
+
+LightApp_WgViewModel::~LightApp_WgViewModel()
+{
+}
+
+SUIT_ViewWindow* LightApp_WgViewModel::createView( SUIT_Desktop* d )
+{
+  SUIT_ViewWindow* vw = 0;
+  if ( !myCreated ) {
+    vw = new SUIT_ViewWindow( d );
+    vw->setCentralWidget( myWidget );
+    myCreated = true;
+    vw->setClosable( false );///////////////////
+  }
+  return vw;
+}
+
+QString LightApp_WgViewModel::getType() const
+{
+  return myType;
+}
diff --git a/src/LightApp/LightApp_WgViewModel.h b/src/LightApp/LightApp_WgViewModel.h
new file mode 100644 (file)
index 0000000..a75b628
--- /dev/null
@@ -0,0 +1,47 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_LightApp_WgViewModel.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#ifndef LIGHTAPP_WGVIEWMODEL_H
+#define LIGHTAPP_WGVIEWMODEL_H
+
+#include "SUIT_ViewModel.h"
+#include "SUIT_ViewManager.h"
+
+class LightApp_WgViewModel : public SUIT_ViewModel
+{
+  Q_OBJECT
+
+public:
+  LightApp_WgViewModel( const QString& type, QWidget* w );
+  virtual ~LightApp_WgViewModel();
+
+  virtual SUIT_ViewWindow*  createView( SUIT_Desktop* d );
+  virtual QString           getType() const;
+
+private:
+  QString  myType;
+  QWidget* myWidget;
+  bool     myCreated;
+};
+#endif // LIGHTAPP_WGVIEWMODEL_H
index 7f682eec1dda2a739dd244146a500f1be4b34e74..a28fcc3bdd61ba836c371f67a7bc46939ad34a3c 100755 (executable)
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+EXTRA_DIST += images
+
+QRC_FILES = qrc_LightApp.cxx
+
 lib_LTLIBRARIES = libLightApp.la
 
 salomeinclude_HEADERS =                        \
@@ -55,7 +59,8 @@ salomeinclude_HEADERS =                       \
        LightApp_SwitchOp.h             \
        LightApp_Preferences.h          \
        LightApp_PreferencesDlg.h       \
-       LightApp_UpdateFlags.h
+       LightApp_UpdateFlags.h          \
+       LightApp_WgViewModel.h
 
 if ENABLE_PYCONSOLE
   salomeinclude_HEADERS += LightApp_PyInterp.h
@@ -102,7 +107,8 @@ dist_libLightApp_la_SOURCES =               \
        LightApp_Study.cxx              \
        LightApp_SwitchOp.cxx           \
        LightApp_Preferences.cxx        \
-       LightApp_PreferencesDlg.cxx
+       LightApp_PreferencesDlg.cxx     \
+       LightApp_WgViewModel.cxx
 
 if ENABLE_PYCONSOLE
   dist_libLightApp_la_SOURCES += LightApp_PyInterp.cxx
@@ -141,7 +147,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
@@ -157,8 +164,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      \
@@ -171,7 +177,8 @@ 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       \
diff --git a/src/LightApp/images/en.png b/src/LightApp/images/en.png
new file mode 100644 (file)
index 0000000..ff701e1
Binary files /dev/null and b/src/LightApp/images/en.png differ
diff --git a/src/LightApp/images/fr.png b/src/LightApp/images/fr.png
new file mode 100644 (file)
index 0000000..8332c4e
Binary files /dev/null and b/src/LightApp/images/fr.png differ
index 2da459c325bdf7a9cf94c57d2f8af174484c2609..dd1a20855c4cbaf7717e53818dd56a8d9cc52d0e 100644 (file)
@@ -33,6 +33,7 @@
   </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>
   </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="iso_number_v"   value="1" />
     <parameter name="trihedron_size" value="100" />
     <parameter name="navigation_mode" value="0" />
+    <parameter name="zooming_mode"   value="0" />
  </section>
  <section name="VTKViewer" >
     <!-- VTK viewer preferences -->
     <parameter name="relative_size"  value="true" />
     <parameter name="use_advanced_selection_algorithm" 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="9" />
     <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>
 </document>
index 9e799934b25cd4192dbbae9dd5382aad3d30ccd5..6ac1fc0585841d354b7db86fcf2ec284f2567b31 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -58,6 +37,11 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
 </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>
@@ -150,6 +134,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:</translation>
+    </message>
+    <message>
+        <source>PREF_ZOOMING_AT_CENTER</source>
+        <translation>Relative to the view'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>
@@ -170,6 +166,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>
@@ -474,6 +474,14 @@ 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_STUDY</source>
         <translation>Study properties</translation>
@@ -653,7 +661,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>
@@ -711,7 +727,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>
diff --git a/src/LightApp/resources/LightApp_msg_fr.ts b/src/LightApp/resources/LightApp_msg_fr.ts
new file mode 100755 (executable)
index 0000000..8606a27
--- /dev/null
@@ -0,0 +1,752 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>EXTERNAL_BROWSER_CANNOT_SHOW_PAGE</source>
+        <translation>Le navigateur externe &quot;%1&quot; ne peut pas trouver la page d&apos;aide &quot;%2&quot;. Voulez-vous le modifierdans les préférences ?</translation>
+    </message>
+    <message>
+        <source>ABOUT_COPYRIGHT</source>
+        <translation>Copyright (C) 2007-2010 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>
+    </message>
+    <message>
+        <source>ABOUT_CAPTION</source>
+        <translation>A propos de %1</translation>
+    </message>
+    <message>
+        <source>APP_NAME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>ABOUT_LICENSE</source>
+        <translation>GNU LGPL</translation>
+    </message>
+    <message>
+        <source>ABOUT_VERSION</source>
+        <translation>Version %1</translation>
+    </message>
+    <message>
+        <source>ENTRY_COLUMN</source>
+        <translation>Entrée</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_Application</name>
+    <message>
+        <source>LANG_CHANGED</source>
+        <translation>La langue de l&apos;application a été modifié.
+Les modifications seront appliquées à la prochaine session.</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_THEME</source>
+        <translation>T&amp;hème</translation>
+    </message>
+    <message>
+        <source>TOT_THEME</source>
+        <translation>Thème</translation>
+    </message>
+    <message>
+        <source>PRP_THEME</source>
+        <translation>Changer les propriétés du style </translation>
+    </message>
+    <message>
+        <source>INF_TOOLBAR_MODULES</source>
+        <translation>Modules</translation>
+    </message>
+    <message>
+        <source>PREF_SHOW_LEGEND</source>
+        <translation>Montrer la légende</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_RENAME</source>
+        <translation>&amp;Renommer</translation>
+    </message>
+    <message>
+        <source>PREF_MULTI_FILE</source>
+        <translation>Sauvegarde multi-fichiers</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PREFERENCES</source>
+        <translation>&amp;Préférences...</translation>
+    </message>
+    <message>
+        <source>PREF_TRIHEDRON_SHOW</source>
+        <translation>Afficher le trièdre</translation>
+    </message>
+    <message>
+        <source>PREF_TRIHEDRON_SIZE</source>
+        <translation>Taille du trièdre</translation>
+    </message>
+    <message>
+        <source>OBJECT_BROWSER</source>
+        <translation>Arbre d&apos;étude</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_PREFERENCES</source>
+        <translation>Permettre de changer les préférences</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DIRECTORIES</source>
+        <translation>Liste des répertoires</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_VTKVIEWER</source>
+        <translation>Visualiseur VTK 3D</translation>
+    </message>
+    <message>
+        <source>PREF_STORE_POS</source>
+        <translation>Enregistrer la position des fenêtres</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SAVE</source>
+        <translation>Intervalle d&apos;enregistrement automatique (min)</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SAVE_DISABLED</source>
+        <translation>Désactivé</translation>
+    </message>
+    <message>
+        <source>PREF_PROJECTION_MODE</source>
+        <translation>Mode de projection:</translation>
+    </message>
+    <message>
+        <source>PREF_ORTHOGRAPHIC</source>
+        <translation>Orthogonal</translation>
+    </message>
+    <message>
+        <source>PREF_PERSPECTIVE</source>
+        <translation>Perspective</translation>
+    </message>
+    <message>
+        <source>PREF_NAVIGATION</source>
+        <translation>Navigation:</translation>
+    </message>
+    <message>
+        <source>PREF_STANDARD_STYLE</source>
+        <translation>Style de contrôles type Salomé</translation>
+    </message>
+    <message>
+        <source>PREF_KEYFREE_STYLE</source>
+        <translation>Style sans clavier</translation>
+    </message>
+    <message>
+        <source>PREF_INCREMENTAL_SPEED</source>
+        <translation>Incrément de vitesse:</translation>
+    </message>
+    <message>
+        <source>PREF_INCREMENTAL_SPEED_MODE</source>
+        <translation>Mode de modification:</translation>
+    </message>
+    <message>
+        <source>PREF_ARITHMETIC</source>
+        <translation>Progression arithmétique</translation>
+    </message>
+    <message>
+        <source>PREF_GEOMETRICAL</source>
+        <translation>Progression géométrique</translation>
+    </message>
+    <message>
+        <source>PREF_FRAME_SPACEMOUSE</source>
+        <translation>Spacemouse</translation>
+    </message>
+    <message>
+        <source>PREF_SHOW_STATIC_TRIHEDRON</source>
+        <translation>Montrer le trièdre statique</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_1</source>
+        <translation>Réduire l&apos;incrément de vitesse</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_2</source>
+        <translation>Augmenter l&apos;incrément de vitesse</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_FUNC_3</source>
+        <translation>Changement Dominant/Combiné</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_1</source>
+        <translation>Bouton 1</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_2</source>
+        <translation>Bouton 2</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_3</source>
+        <translation>Bouton 3</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_4</source>
+        <translation>Bouton 4</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_5</source>
+        <translation>Bouton 5</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_6</source>
+        <translation>Bouton 6</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_7</source>
+        <translation>Bouton 7</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_8</source>
+        <translation>Bouton 8</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_*</source>
+        <translation>Bouton *</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_10</source>
+        <translation>Bouton 10</translation>
+    </message>
+    <message>
+        <source>PREF_SPACEMOUSE_BTN_11</source>
+        <translation>Bouton 11</translation>
+    </message>
+    <message>
+        <source>PREF_FRAME_RECORDING</source>
+        <translation>Enregistrement AVI</translation>
+    </message>
+    <message>
+        <source>PREF_ALL_DISLPAYED_FRAMES</source>
+        <translation>Enregistrer toutes les images affichées</translation>
+    </message>
+    <message>
+        <source>PREF_FPS</source>
+        <translation>FPS</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_TTL</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>PREF_PROGRESSIVE</source>
+        <translation>Progressif</translation>
+    </message>
+    <message>
+        <source>PREF_QUALITY</source>
+        <translation>Qualité</translation>
+    </message>
+    <message>
+        <source>PREF_RECORDING_MODE</source>
+        <translation>Mode</translation>
+    </message>
+    <message>
+        <source>PREF_SKIPPED_FRAMES</source>
+        <translation>Enregistrer à FPS donné</translation>
+    </message>
+    <message>
+        <source>PREF_FRAME_GROUP_NAMES</source>
+        <translation>Nom des groupes</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_NAMES_TEXT_COLOR</source>
+        <translation>Couleur du texte</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_NAMES_TRANSPARENCY</source>
+        <translation>Transparence</translation>
+    </message>
+    <message>
+        <source>PREF_BOTTOM</source>
+        <translation>Dessous</translation>
+    </message>
+    <message>
+        <source>PREF_CURVE_TYPE</source>
+        <translation>Type de courbe:</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_U</source>
+        <translation>Nombre d&apos;isolignes selon U</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_V</source>
+        <translation>Nombre d&apos;isolignes selon V</translation>
+    </message>
+    <message>
+        <source>PREF_POINTS</source>
+        <translation>Points</translation>
+    </message>
+    <message>
+        <source>PRP_MODULE</source>
+        <translation>Basculer vers le module &quot;%1&quot;</translation>
+    </message>
+    <message>
+        <source>PREF_ASCII_FILE</source>
+        <translation>Enregistrement ASCII</translation>
+    </message>
+    <message>
+        <source>PREFERENCES_NOT_LOADED</source>
+        <translation>Les préférences du module &quot;&lt;b&gt;%N&lt;/b&gt;&quot; seront accessibles quand le module sera chargé</translation>
+    </message>
+    <message>
+        <source>PREF_LINEAR</source>
+        <translation>Linéaire</translation>
+    </message>
+    <message>
+        <source>DATA_MODELS</source>
+        <translation>Modèles de données</translation>
+    </message>
+    <message>
+        <source>PRP_RENAME</source>
+        <translation>Renommer la fenêtre active</translation>
+    </message>
+    <message>
+        <source>TOT_RENAME</source>
+        <translation>Renommer</translation>
+    </message>
+    <message>
+        <source>LOG_WINDOW</source>
+        <translation>Fenêtre de messages</translation>
+    </message>
+    <message>
+        <source>PREF_SPLINE</source>
+        <translation>Spline</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SEARCH_TOOL</source>
+        <translation>Outil de recherche</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_HIDE_SEARCH_TOOL</source>
+        <translation>Cacher automatiquement</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SETTINGS</source>
+        <translation>Paramètres de l&apos;arbre d&apos;étude</translation>
+    </message>
+    <message>
+        <source>PRP_APP_MODULE</source>
+        <translation>Basculer au point neutre de la plate-forme SALOME</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_PY_CONSOLE</source>
+        <translation>Propriétés de la console Python</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_STYLE</source>
+        <translation>Style Salomé</translation>
+    </message>
+    <message>
+        <source>PREF_USE_SALOME_STYLE</source>
+        <translation>Utiliser le style Salomé</translation>
+    </message>
+    <message>
+        <source>PREF_MARKER_SIZE</source>
+        <translation>Taille de repère:</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_VIEWERS</source>
+        <translation>Visualiseurs</translation>
+    </message>
+    <message>
+        <source>PREF_APP</source>
+        <translation>Application</translation>
+    </message>
+    <message>
+        <source>PREF_TOP</source>
+        <translation>Dessus</translation>
+    </message>
+    <message>
+        <source>MEN_REFRESH</source>
+        <translation>Rafraîchir</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SIZE_FIRST</source>
+        <translation>Taille automatique pour la première colonne</translation>
+    </message>
+    <message>
+        <source>PREF_RESIZE_ON_EXPAND_ITEM</source>
+        <translation>Redimensionner les colonnes quand l&apos;objet est déplié</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_SUPERV</source>
+        <translation>Superviseur des graphes</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_OBJBROWSER</source>
+        <translation>Arbre d&apos;étude</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_GENERAL</source>
+        <translation>Général</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_0</source>
+        <translation>Vue &amp;GL </translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_1</source>
+        <translation>Vue &amp;Plot2d </translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_2</source>
+        <translation>Vue &amp;OCC</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_3</source>
+        <translation>Vue VT&amp;K</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_4</source>
+        <translation>Vue &amp;QxGraph</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_5</source>
+        <translation>Vue Qx&amp;Scene</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_NAME</source>
+        <translation>Objet</translation>
+    </message>
+    <message>
+        <source>PREF_LEGEND_POSITION</source>
+        <translation>Position de la Légende:</translation>
+    </message>
+    <message>
+        <source>PREF_RELATIVE_SIZE</source>
+        <translation>Taille Relative</translation>
+    </message>
+    <message>
+        <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Couleur de l&apos;arrière-plan</translation>
+    </message>
+    <message>
+        <source>PREF_FONT</source>
+        <translation>Police</translation>
+    </message>
+    <message>
+        <source>PREF_LEFT</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_DIRECTORIES</source>
+        <translation>Emplacements</translation>
+    </message>
+    <message>
+        <source>ACTIVATING_MODULE</source>
+        <translation>Activation du module &quot;%1&quot; en cours</translation>
+    </message>
+    <message>
+        <source>PREF_VERT_AXIS_SCALE</source>
+        <translation>Echelle de l&apos;axe vertical :</translation>
+    </message>
+    <message>
+        <source>PREF_HOR_AXIS_SCALE</source>
+        <translation>Echelle de l&apos;axe horizontal :</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_LANGUAGE</source>
+        <translation>Langue</translation>
+    </message>
+    <message>
+        <source>PREF_CURRENT_LANGUAGE</source>
+        <translation>Langue actuel</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_STUDY</source>
+        <translation>Propiétés de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>PREF_CATEGORY_SALOME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_OCCVIEWER</source>
+        <translation>Visualiseur OCC 3D</translation>
+    </message>
+    <message>
+        <source>PREF_LOGARITHMIC</source>
+        <translation>Logarithmique</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MODULE_HELP</source>
+        <translation>Module &amp;Aide</translation>
+    </message>
+    <message>
+        <source>PREF_SUPERV_TITLE_COLOR</source>
+        <translation>Couleur de titre</translation>
+    </message>
+    <message>
+        <source>PREF_PARAM</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>PREF_RIGHT</source>
+        <translation>Droite</translation>
+    </message>
+    <message>
+        <source>PREF_LINES</source>
+        <translation>Lignes</translation>
+    </message>
+    <message>
+        <source>INF_CANCELLED</source>
+        <translation>L&apos;activation du module est annulée</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_EXT_BROWSER</source>
+        <translation>Navigateur externe</translation>
+    </message>
+    <message>
+        <source>PREF_SUPERV_CTRL_COLOR</source>
+        <translation>Couleur de contrôle</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEF_COLUMNS</source>
+        <translation>Colonnnes par défaut </translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_PLOT2DVIEWER</source>
+        <translation>Visualiseur Plot2d</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MRU</source>
+        <translation>&amp;Récemment utilisés</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_PREFERENCES</source>
+        <translation>Préférences</translation>
+    </message>
+    <message>
+        <source>DEFINE_EXTERNAL_BROWSER</source>
+        <translation>Le navigateur externe n&apos;est pas trouvé. Voulez-vous le définir dans les préférences?</translation>
+    </message>
+    <message>
+        <source>PREF_AUTO_SIZE</source>
+        <translation>Taille automatique pour les autres colonnes</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_MRU</source>
+        <translation>Récemment utilisés</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_NEW</source>
+        <translation>&amp;Nouveau</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_OPEN</source>
+        <translation>&amp;Ouvrir...</translation>
+    </message>
+    <message>
+        <source>PYTHON_CONSOLE</source>
+        <translation>Console Python</translation>
+    </message>
+    <message>
+        <source>PREF_USE_ADVANCED_SELECTION_ALGORITHM</source>
+        <translation>Utiliser l&apos;algorithme de sélection avancée</translation>
+    </message>
+    <message>
+        <source>TOT_CLOSE</source>
+        <translation>Fermer</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CLOSE</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+    <message>
+        <source>PRP_CLOSE</source>
+        <translation>Fermer la fenêtre active</translation>
+    </message>
+    <message>
+        <source>TOT_CLOSE_ALL</source>
+        <translation>Tout fermer</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CLOSE_ALL</source>
+        <translation>&amp;Tout fermer</translation>
+    </message>
+    <message>
+        <source>PRP_CLOSE_ALL</source>
+        <translation>Fermer toutes les fenêtres</translation>
+    </message>
+    <message>
+        <source>TOT_GROUP_ALL</source>
+        <translation>Tout grouper</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_GROUP_ALL</source>
+        <translation>Tout &amp;grouper</translation>
+    </message>
+    <message>
+        <source>PRP_GROUP_ALL</source>
+        <translation>Grouper toutes les fenêtres</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_NOT_EXISTS</source>
+        <translation>Impossible d&apos;ouvrir %1.
+Le fichier n&apos;existe pas</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_MRU</source>
+        <translation>Montrer les études récemment utilisées</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_VISIBLE_COUNT</source>
+        <translation>Nombre d&apos;études</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_INSERT_MODE</source>
+        <translation>Mode d&apos;insertion</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_MOVE_FIRST</source>
+        <translation>Placer au début</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_MOVE_LAST</source>
+        <translation>Placer à la fin</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_ADD_FIRST</source>
+        <translation>Ajouter au début</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_ADD_LAST</source>
+        <translation>Ajouter à la fin</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_TYPE</source>
+        <translation>Type de lien</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_AUTO</source>
+        <translation>Auto</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_SHORT</source>
+        <translation>Court</translation>
+    </message>
+    <message>
+        <source>PREF_MRU_LINK_FULL</source>
+        <translation>Complet</translation>
+    </message>
+    <message>
+        <source>PREFERENCES_NOT_SUPPORTED</source>
+        <translation>Les préférences du module &quot;%1&quot; ne sont pas supportées</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_SHORTCUTS</source>
+        <translation>Raccourcis clavier</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_SHORTCUTS</source>
+        <translation>Réglage des raccourcis clavier</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_Module</name>
+    <message>
+        <source>MEN_HIDE</source>
+        <translation>Cacher</translation>
+    </message>
+    <message>
+        <source>TOP_DISPLAY_ONLY</source>
+        <translation>Afficher uniquement</translation>
+    </message>
+    <message>
+        <source>STB_DISPLAY_ONLY</source>
+        <translation>Afficher uniquement</translation>
+    </message>
+    <message>
+        <source>MEN_DISPLAY_ONLY</source>
+        <translation>Afficher uniquement</translation>
+    </message>
+    <message>
+        <source>TOP_HIDE</source>
+        <translation>Cacher</translation>
+    </message>
+    <message>
+        <source>MEN_ERASE_ALL</source>
+        <translation>Tout cacher</translation>
+    </message>
+    <message>
+        <source>STB_HIDE</source>
+        <translation>Cacher</translation>
+    </message>
+    <message>
+        <source>STB_SHOW</source>
+        <translation>Afficher</translation>
+    </message>
+    <message>
+        <source>TOP_SHOW</source>
+        <translation>Afficher</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW</source>
+        <translation>Afficher</translation>
+    </message>
+    <message>
+        <source>STB_ERASE_ALL</source>
+        <translation>Tout cacher</translation>
+    </message>
+    <message>
+        <source>TOP_ERASE_ALL</source>
+        <translation>Tout cacher</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_ModuleDlg</name>
+    <message>
+        <source>DESCRIPTION</source>
+        <translation>Vous activez le module
+       &lt;b&gt;%1&lt;/b&gt;.&lt;br&gt;Choisissez l&apos;action nécessaire avec le bouton correspondant ci-dessous</translation>
+    </message>
+    <message>
+        <source>CANCEL</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Activer le module</translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_NameDlg</name>
+    <message>
+        <source>TLT_RENAME</source>
+        <translation>Renommer</translation>
+    </message>
+    <message>
+        <source>NAME_LBL</source>
+        <translation>Nom: </translation>
+    </message>
+</context>
+<context>
+    <name>LightApp_PreferencesDlg</name>
+    <message>
+        <source>IMPORT_PREFERENCES</source>
+        <translation>Importer les préférences</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Préférences</translation>
+    </message>
+    <message>
+        <source>WARNING</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>IMPORT_BTN_TEXT</source>
+        <translation>Importer</translation>
+    </message>
+    <message>
+        <source>DEFAULT_QUESTION</source>
+        <translation>Voulez-vous restaurer les préférences par défaut ?</translation>
+    </message>
+    <message>
+        <source>DEFAULT_BTN_TEXT</source>
+        <translation>Défauts</translation>
+    </message>
+</context>
+</TS>
index 492ebb8ffe80b8c25f2375cfcfae4af77ffa98c9..166a2ac56a2ac74ead6a63f3dffdd8708c8dd865 100755 (executable)
@@ -37,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 91681176b591865b9e4853859f65173a9f655b25..a7421d8375c0dea27b001b797e0236341e45a819 100644 (file)
@@ -1,27 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
diff --git a/src/LogWindow/resources/LogWindow_msg_fr.ts b/src/LogWindow/resources/LogWindow_msg_fr.ts
new file mode 100755 (executable)
index 0000000..1e6a591
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>LogWindow</name>
+    <message>
+        <location filename="../LogWindow.cxx" line="293"/>
+        <source>EDIT_COPY_CMD</source>
+        <translation>&amp;Copier</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="298"/>
+        <source>EDIT_CLEAR_CMD</source>
+        <translation>&amp;Effacer</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="303"/>
+        <source>EDIT_SELECTALL_CMD</source>
+        <translation>&amp;Tout sélectionner</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="308"/>
+        <source>EDIT_SAVETOFILE_CMD</source>
+        <translation>&amp;Sauvegarder le journal dans un fichier...</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>ERR_ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>ERR_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <location filename="../LogWindow.cxx" line="368"/>
+        <source>BUT_OK</source>
+        <translation>&amp;OK</translation>
+    </message>
+</context>
+</TS>
index 8b684ec2e7983a747b0fde954d9b6157b4e974a8..7d4de20d23a97789ba92be777a3c7f18ea2f2842 100755 (executable)
@@ -49,6 +49,7 @@ if ENABLE_VTKVIEWER
   SUBDIRS_VTKVIEWER = VTKViewer
 if ENABLE_SALOMEOBJECT
     SUBDIRS_VTKVIEWER += SVTK
+    SUBDIRS_VIEWERTOOLS = ViewerTools
 endif
 endif
 
@@ -57,6 +58,7 @@ endif
 ##
 if ENABLE_OCCVIEWER
   SUBDIRS_OCCVIEWER = OCCViewer
+  SUBDIRS_VIEWERTOOLS = ViewerTools
 if ENABLE_SALOMEOBJECT
     SUBDIRS_OCCVIEWER += SOCC
 endif
@@ -114,10 +116,10 @@ if ENABLE_PYCONSOLE
   SUBDIRS_PY_LIGHT = SALOME_SWIG SALOME_PY SALOME_PYQT
 endif
 
-SUBDIRS = $(SUBDIRS_COMMON) $(SUBDIRS_OBJECT) $(SUBDIRS_GLVIEWER) $(SUBDIRS_VTKVIEWER) $(SUBDIRS_OCCVIEWER)  \
-          $(SUBDIRS_PLOT2DVIEWER) $(SUBDIRS_SUPERVGRAPHVIEWER) $(SUBDIRS_QXGRAPHVIEWER) $(SUBDIRS_PYCONSOLE) \
-          $(SUBDIRS_LIGHT) $(SUBDIRS_CORBA) $(SUBDIRS_PY_LIGHT)
+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 GLViewer VTKViewer SVTK OCCViewer SOCC Plot2d SPlot2d SUPERVGraph QxGraph QxScene \
+               OBJECT ViewerTools GLViewer VTKViewer SVTK OCCViewer SOCC Plot2d SPlot2d SUPERVGraph QxGraph QxScene \
                PyInterp PyConsole LightApp ResExporter TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
index 1a5e494971ba65f436061e803d6d313ea522b1ab..73f3e5fa82393c1c385f697f65edc8691bc55cdc 100755 (executable)
@@ -44,7 +44,9 @@ salomeinclude_HEADERS =                               \
        OCCViewer_AxialScaleDlg.h               \
        OCCViewer_SetRotationPointDlg.h         \
        OCCViewer_Trihedron.h                   \
-       OCCViewer_ToolTip.h \
+       OCCViewer_FontWidget.h                  \
+       OCCViewer_CubeAxesDlg.h                 \
+       OCCViewer_ToolTip.h                     \
        OCCViewer_ViewFrame.h
 
 dist_libOCCViewer_la_SOURCES =                 \
@@ -61,7 +63,9 @@ 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 =                                    \
@@ -76,7 +80,9 @@ 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)
@@ -89,6 +95,7 @@ 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          \
@@ -104,16 +111,21 @@ 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_maximized.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
 
 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 -I$(srcdir)/../OpenGLUtils
+       -I$(srcdir)/../SUIT -I$(srcdir)/../ViewerTools -I$(srcdir)/../Qtx \
+       -I$(srcdir)/../OpenGLUtils
 
 libOCCViewer_la_LDFLAGS  = $(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER)
-libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OpenGLUtils/libOpenGLUtils.la
+libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la \
+       ../ViewerTools/libViewerTools.la ../OpenGLUtils/libOpenGLUtils.la
index 574e7de739c54280bad193e7d170a855b800a9d0..95a4a96daa91ea92bda004879c1bcb01312202f6 100755 (executable)
@@ -181,25 +181,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;
-        else
-          curIndex = i - 1;
-        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
+         myParametersMap.removeAt( j );
+      }
+    }
     if( curIndex >= 0 )
     {
       myListBox->setCurrentItem( myListBox->item( curIndex ) );
@@ -208,8 +221,7 @@ void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
   }
   if( !myListBox->count() )
   {
-    myListBox->clear();
-    myListBox->insertItem( 0, "No Items" );
+    clearList();
   }
 }
 
@@ -220,8 +232,10 @@ void OCCViewer_CreateRestoreViewDlg::clearList()
 {
   myListBox->clear();
   myListBox->insertItem( 0, "No Items" );
-  
   myParametersMap.clear();
+       
+  //Clear view
+  myCurViewPort->reset();
 }
 
 /*!
diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx
new file mode 100644 (file)
index 0000000..9ecc2a6
--- /dev/null
@@ -0,0 +1,327 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "OCCViewer_CubeAxesDlg.h"
+
+#include "OCCViewer_FontWidget.h"
+#include "OCCViewer_ViewPort3d.h"
+#include "OCCViewer_ViewWindow.h"
+
+#include "QtxAction.h"
+#include "QtxIntSpinBox.h"
+
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLineEdit>
+
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
+/*!
+  \class OCCViewer_CubeAxesDlg::AxisWidget
+  \brief Axis tab widget of the "Graduated axis" dialog box
+  \internal
+*/
+
+/*!
+  Constructor
+*/
+OCCViewer_AxisWidget::OCCViewer_AxisWidget (QWidget* theParent)
+: ViewerTools_AxisWidgetBase(theParent)
+{
+}
+
+/*!
+  Destructor
+*/
+OCCViewer_AxisWidget::~OCCViewer_AxisWidget()
+{
+}
+
+/*!
+  Create font widget
+*/
+ViewerTools_FontWidgetBase* OCCViewer_AxisWidget::createFontWidget( QWidget* theParent )
+{
+  OCCViewer_FontWidget* aFontWidget = new OCCViewer_FontWidget( theParent );
+  aFontWidget->Initialize();
+  return aFontWidget;
+}
+
+/*!
+  Set axis data
+*/
+void OCCViewer_AxisWidget::SetData( const AxisData& theAxisData )
+{
+  myNameGrp->setChecked( theAxisData.DrawName );
+  myAxisName->setText( theAxisData.Name );
+  myNameFont->SetData( theAxisData.NameColor, 0, false, false, false );
+
+  myLabelsGrp->setChecked( theAxisData.DrawValues );
+  myLabelNumber->setValue( theAxisData.NbValues );
+  myLabelOffset->setValue( theAxisData.Offset );
+  myLabelsFont->SetData( theAxisData.Color, 0, false, false, false );
+
+  myTicksGrp->setChecked( theAxisData.DrawTickmarks );
+  myTickLength->setValue( theAxisData.TickmarkLength );
+}
+
+/*!
+  Get axis data
+*/
+void OCCViewer_AxisWidget::GetData( AxisData& theAxisData )
+{
+  theAxisData.DrawName = myNameGrp->isChecked();
+  theAxisData.Name = myAxisName->text();
+
+  int aNameFamily;
+  bool aNameBold, aNameItalic, aNameShadow;
+  myNameFont->GetData( theAxisData.NameColor, aNameFamily, aNameBold, aNameItalic, aNameShadow );
+
+  theAxisData.DrawValues = myLabelsGrp->isChecked();
+  theAxisData.NbValues = myLabelNumber->value();
+  theAxisData.Offset = myLabelOffset->value();
+
+  int aLabelFamily;
+  bool aLabelBold, aLabelItalic, aLabelShadow;
+  myLabelsFont->GetData( theAxisData.Color, aLabelFamily, aLabelBold, aLabelItalic, aLabelShadow );
+
+  theAxisData.DrawTickmarks = myTicksGrp->isChecked();
+  theAxisData.TickmarkLength = myTickLength->value();
+}
+
+/*
+  Class       : OCCViewer_CubeAxesDlg
+  Description : Dialog for specifying cube axes properties
+*/
+
+/*!
+  Constructor
+*/
+OCCViewer_CubeAxesDlg::OCCViewer_CubeAxesDlg(QtxAction* theAction,
+                                             OCCViewer_ViewWindow* theParent,
+                                             const char* theName):
+  ViewerTools_CubeAxesDlgBase(theAction,
+                              theParent, 
+                              theName),
+  myMainWindow(theParent)
+{
+}
+
+/*!
+  Destructor
+*/
+OCCViewer_CubeAxesDlg::~OCCViewer_CubeAxesDlg()
+{
+}
+
+/*!
+  Create axis widget
+*/
+ViewerTools_AxisWidgetBase* OCCViewer_CubeAxesDlg::createAxisWidget( QWidget* theParent )
+{
+  OCCViewer_AxisWidget* anAxisWidget = new OCCViewer_AxisWidget( theParent );
+  anAxisWidget->initialize();
+  return anAxisWidget;
+}
+
+/*!
+  Update dialog fields, connect signals and slots, show dialog
+*/
+void OCCViewer_CubeAxesDlg::initialize()
+{
+  ViewerTools_CubeAxesDlgBase::initialize();
+
+  for( int i = 0; i < 3; i++ )
+  {
+    if( OCCViewer_AxisWidget* anAxisWidget = dynamic_cast<OCCViewer_AxisWidget*>( myAxes[ i ] ) )
+    {
+      OCCViewer_AxisWidget::AxisData anAxisData;
+      switch( i )
+      {
+        case 0:
+          anAxisData.Name = "X";
+          anAxisData.NameColor = anAxisData.Color = Qt::red;
+          break;
+        case 1:
+          anAxisData.Name = "Y";
+          anAxisData.NameColor = anAxisData.Color = Qt::green;
+          break;
+        case 2:
+          anAxisData.Name = "Z";
+          anAxisData.NameColor = anAxisData.Color = Qt::blue;
+          break;
+      }
+      anAxisData.DrawName       = true;
+      anAxisData.DrawValues     = true;
+      anAxisData.NbValues       = 3;
+      anAxisData.Offset         = 2;
+      anAxisData.DrawTickmarks  = true;
+      anAxisData.TickmarkLength = 5;
+      anAxisWidget->SetData( anAxisData );
+    }
+  }
+}
+
+/*!
+  Update dialog fields, connect signals and slots, show dialog
+*/
+void OCCViewer_CubeAxesDlg::Update()
+{
+  ViewerTools_CubeAxesDlgBase::Update();
+}
+
+/*!
+  Verify validity of entry data
+*/
+bool OCCViewer_CubeAxesDlg::onApply()
+{
+  bool isOk = ViewerTools_CubeAxesDlgBase::onApply();
+
+  try
+  {
+    QWidget *aCurrWid = this->focusWidget();
+    aCurrWid->clearFocus();
+    aCurrWid->setFocus();
+
+    if( OCCViewer_ViewPort3d* aViewPort = myMainWindow->getViewPort() )
+    {
+      Handle(V3d_View) aView = aViewPort->getView();
+      if( !aView.IsNull() )
+        ApplyData( aView );
+    }
+  }
+  catch(...)
+  {
+    isOk = false;
+  }
+
+  return isOk;
+}
+
+/*!
+  Get graduated trihedron parameters
+*/
+void OCCViewer_CubeAxesDlg::GetData( bool& theIsVisible, OCCViewer_AxisWidget::AxisData theAxisData[3] )
+{
+  theIsVisible = myIsVisible->isChecked();
+  for( int i = 0; i < 3; i++ )
+    if( OCCViewer_AxisWidget* anAxisWidget = dynamic_cast<OCCViewer_AxisWidget*>( myAxes[ i ] ) )
+      anAxisWidget->GetData( theAxisData[i] );
+}
+
+/*!
+  Set graduated trihedron parameters
+*/
+void OCCViewer_CubeAxesDlg::SetData( bool theIsVisible, OCCViewer_AxisWidget::AxisData theAxisData[3] )
+{
+  myIsVisible->setChecked( theIsVisible );
+  for( int i = 0; i < 3; i++ )
+    if( OCCViewer_AxisWidget* anAxisWidget = dynamic_cast<OCCViewer_AxisWidget*>( myAxes[ i ] ) )
+      anAxisWidget->SetData( theAxisData[i] );
+}
+
+/*!
+  Apply graduated trihedron parameters
+*/
+void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
+{
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+  if( theView.IsNull() )
+    return;
+
+  if( myIsVisible->isChecked() )
+  {
+    OCCViewer_AxisWidget::AxisData anAxisData[3];
+    for( int i = 0; i < 3; i++ )
+      if( OCCViewer_AxisWidget* anAxisWidget = dynamic_cast<OCCViewer_AxisWidget*>( myAxes[ i ] ) )
+        anAxisWidget->GetData( anAxisData[i] );
+
+    // A gap used offset of axis names' offset
+    // (this hard-coded value will be removed when the
+    // font support will be introduced in OCC-6.4)
+    int aGap = 20;
+
+    theView->GraduatedTrihedronDisplay(
+      anAxisData[0].Name.toLatin1().constData(),
+      anAxisData[1].Name.toLatin1().constData(),
+      anAxisData[2].Name.toLatin1().constData(),
+      anAxisData[0].DrawName,
+      anAxisData[1].DrawName,
+      anAxisData[2].DrawName,
+      anAxisData[0].DrawValues,
+      anAxisData[1].DrawValues,
+      anAxisData[2].DrawValues,
+      Standard_True, // draw grid
+      Standard_False, // draw axes
+      anAxisData[0].NbValues - 1,
+      anAxisData[1].NbValues - 1,
+      anAxisData[2].NbValues - 1,
+      anAxisData[0].Offset,
+      anAxisData[1].Offset,
+      anAxisData[2].Offset,
+      anAxisData[0].Offset + aGap, // see above
+      anAxisData[1].Offset + aGap, // see above
+      anAxisData[2].Offset + aGap, // see above
+      anAxisData[0].DrawTickmarks,
+      anAxisData[1].DrawTickmarks,
+      anAxisData[2].DrawTickmarks,
+      anAxisData[0].TickmarkLength,
+      anAxisData[1].TickmarkLength,
+      anAxisData[2].TickmarkLength,
+      Quantity_NOC_WHITE, // grid color
+      Quantity_Color( anAxisData[0].NameColor.redF(),
+                      anAxisData[0].NameColor.greenF(),
+                      anAxisData[0].NameColor.blueF(),
+                      Quantity_TOC_RGB ),
+      Quantity_Color( anAxisData[1].NameColor.redF(),
+                      anAxisData[1].NameColor.greenF(),
+                      anAxisData[1].NameColor.blueF(),
+                      Quantity_TOC_RGB ),
+      Quantity_Color( anAxisData[2].NameColor.redF(),
+                      anAxisData[2].NameColor.greenF(),
+                      anAxisData[2].NameColor.blueF(),
+                      Quantity_TOC_RGB ),
+      Quantity_Color( anAxisData[0].Color.redF(),
+                      anAxisData[0].Color.greenF(),
+                      anAxisData[0].Color.blueF(),
+                      Quantity_TOC_RGB ),
+      Quantity_Color( anAxisData[1].Color.redF(),
+                      anAxisData[1].Color.greenF(),
+                      anAxisData[1].Color.blueF(),
+                      Quantity_TOC_RGB ),
+      Quantity_Color( anAxisData[2].Color.redF(),
+                      anAxisData[2].Color.greenF(),
+                      anAxisData[2].Color.blueF(),
+                      Quantity_TOC_RGB ) );
+  }
+  else
+    theView->GraduatedTrihedronErase();
+
+  theView->Redraw();
+#endif
+}
diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.h b/src/OCCViewer/OCCViewer_CubeAxesDlg.h
new file mode 100644 (file)
index 0000000..b570d38
--- /dev/null
@@ -0,0 +1,99 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 OCCVIEWER_CUBEAXESDLG_H
+#define OCCVIEWER_CUBEAXESDLG_H
+
+#include "OCCViewer.h"
+
+#include <ViewerTools_CubeAxesDlgBase.h>
+
+#include <V3d_View.hxx>
+
+class OCCViewer_ViewWindow;
+
+/*!
+ * Class       : OCCViewer_AxisWidget
+ * Description : Axis tab widget of the "Graduated axis" dialog box
+*/
+class OCCVIEWER_EXPORT OCCViewer_AxisWidget : public ViewerTools_AxisWidgetBase
+{
+public:
+  struct AxisData
+  {
+    bool    DrawName;
+    QString Name;
+    QColor  NameColor;
+    bool    DrawValues;
+    int     NbValues;
+    int     Offset;
+    QColor  Color;
+    bool    DrawTickmarks;
+    int     TickmarkLength;
+  };
+
+public:
+  OCCViewer_AxisWidget( QWidget* );
+  ~OCCViewer_AxisWidget();
+
+public:
+  void             SetData( const AxisData& );
+  void             GetData( AxisData& );
+
+protected:
+  virtual ViewerTools_FontWidgetBase* createFontWidget( QWidget* );
+};
+
+/*!
+ * Class       : OCCViewer_CubeAxesDlg
+ * Description : Dialog for specifynig cube axes properties
+ */
+class OCCVIEWER_EXPORT OCCViewer_CubeAxesDlg : public ViewerTools_CubeAxesDlgBase
+{
+  Q_OBJECT
+
+public:
+                  OCCViewer_CubeAxesDlg(QtxAction* theAction,
+                                        OCCViewer_ViewWindow* theParent,
+                                        const char* theName);
+  virtual         ~OCCViewer_CubeAxesDlg();
+
+  virtual void    initialize();
+
+  void            GetData( bool& theIsVisible, OCCViewer_AxisWidget::AxisData theAxisData[3] );
+  void            SetData( bool theIsVisible, OCCViewer_AxisWidget::AxisData theAxisData[3] );
+
+  void            ApplyData( const Handle(V3d_View)& theView );
+
+  virtual void    Update();
+
+private slots:
+  virtual bool    onApply();
+
+private:
+  virtual ViewerTools_AxisWidgetBase* createAxisWidget( QWidget* );
+
+private:
+  OCCViewer_ViewWindow* myMainWindow;
+};
+
+#endif
diff --git a/src/OCCViewer/OCCViewer_FontWidget.cxx b/src/OCCViewer/OCCViewer_FontWidget.cxx
new file mode 100644 (file)
index 0000000..d0a61ae
--- /dev/null
@@ -0,0 +1,99 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "OCCViewer_FontWidget.h"
+
+#include <QComboBox>
+
+//#include <vtkTextProperty.h>
+
+/*!
+ * Class       : OCCViewer_FontWidget
+ * Description : Dialog for specifynig font
+ */
+
+/*!
+  Constructor
+*/
+OCCViewer_FontWidget::OCCViewer_FontWidget( QWidget* theParent )
+: ViewerTools_FontWidgetBase( theParent )
+{
+}
+
+/*!
+  Destructor
+*/
+OCCViewer_FontWidget::~OCCViewer_FontWidget()
+{
+}
+
+void OCCViewer_FontWidget::InitializeFamilies()
+{
+  //myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
+  //myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
+  //myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
+}
+
+void OCCViewer_FontWidget::SetData( const QColor& theColor,
+                                    const int theFamily,
+                                    const bool theBold,
+                                    const bool theItalic,
+                                    const bool theShadow )
+{
+  ViewerTools_FontWidgetBase::SetData( theColor,
+                                       theFamily,
+                                       theBold,
+                                       theItalic,
+                                       theShadow );
+
+  /*
+  if ( theFamily == VTK_ARIAL )
+    myFamily->setCurrentIndex( 0 );
+  else if ( theFamily == VTK_COURIER )
+    myFamily->setCurrentIndex( 1 );
+  else
+    myFamily->setCurrentIndex( 2 );
+  */
+}
+
+void OCCViewer_FontWidget::GetData( QColor& theColor,
+                                    int& theFamily,
+                                    bool& theBold,
+                                    bool& theItalic,
+                                    bool& theShadow ) const
+{
+  ViewerTools_FontWidgetBase::GetData( theColor,
+                                       theFamily,
+                                       theBold,
+                                       theItalic,
+                                       theShadow );
+
+  /*
+  int anItem = myFamily->currentIndex();
+  if ( anItem == 0 )
+    theFamily = VTK_ARIAL;
+  else if ( anItem == 1 )
+    theFamily = VTK_COURIER;
+  else
+    theFamily = VTK_TIMES;
+  */
+}
diff --git a/src/OCCViewer/OCCViewer_FontWidget.h b/src/OCCViewer/OCCViewer_FontWidget.h
new file mode 100644 (file)
index 0000000..506d583
--- /dev/null
@@ -0,0 +1,50 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 OCCVIEWER_FONTWIDGET_H
+#define OCCVIEWER_FONTWIDGET_H
+
+#include "OCCViewer.h"
+
+#include <ViewerTools_FontWidgetBase.h>
+
+/*!
+ * Class       : OCCViewer_FontWidget
+ * Description : Dialog for specifynig font
+ */
+class OCCVIEWER_EXPORT OCCViewer_FontWidget : public ViewerTools_FontWidgetBase
+{
+  Q_OBJECT
+
+public:
+                OCCViewer_FontWidget( QWidget* );
+  virtual       ~OCCViewer_FontWidget();
+
+  virtual void  SetData( const QColor&, const int, const bool, const bool, const bool );
+
+  virtual void  GetData( QColor&, int&, bool&, bool&, bool& ) const;
+
+protected:
+  virtual void  InitializeFamilies();
+};
+
+#endif
index ebc094f48e0f5c8c775e891ca7a965aa48d42edb..32fdc73a42621d2606f89e1e7cca567bb871801a 100755 (executable)
@@ -120,6 +120,9 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTri
   // set interaction style to standard
   myInteractionStyle = 0;
 
+  // set zooming style to standard
+  myZoomingStyle = 0;
+
   // selection
   mySelectionEnabled = true;
   myMultiSelectionEnabled = true;
@@ -159,6 +162,7 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     view->initLayout();
     view->initSketchers();
     view->setInteractionStyle( interactionStyle() );
+    view->setZoomingStyle( zoomingStyle() );
     
     OCCViewer_ViewPort3d* vp3d = view->getViewPort();
     if ( vp3d )
@@ -333,6 +337,34 @@ void OCCViewer_Viewer::setInteractionStyle( const int 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
   \param isEnabled - new status
index 94f28153c682996786737063e9c2052bdcfbcc26..b46752e58f8f615ebaddc7db7af8d7f00c3f85d2 100755 (executable)
@@ -66,6 +66,47 @@ public:
         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;
@@ -135,6 +176,9 @@ public:
   int                             interactionStyle() const;
   void                            setInteractionStyle( const int );
 
+  int                             zoomingStyle() const;
+  void                            setZoomingStyle( const int );
+
   void                            enableSelection(bool isEnabled);
   bool                            isSelectionEnabled() const { return mySelectionEnabled; }
 
@@ -183,6 +227,7 @@ private:
   viewAspectList                  myViewAspects;
 
   int                             myInteractionStyle;
+  int                             myZoomingStyle;
 
   bool                            mySelectionEnabled;
   bool                            myMultiSelectionEnabled;
index f0cbe3d13efa2f87dbbdbe5ba438676d83f0420e..34bad67d3395c7beb3e9e2423f613ac8b2ff2c22 100755 (executable)
@@ -51,6 +51,14 @@ static int sx = 0;
 static int sy = 0;
 static Standard_Boolean zRotation = Standard_False;
 
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
 /*!
   Constructor
 */
@@ -59,7 +67,8 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V
     myScale( 1.0 ),
     myDegenerated( true ),
     myAnimate( false ),
-    myBusy( true )
+    myBusy( true ),
+    myIsAdvancedZoomingEnabled( false )
 {
   // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
   //selectVisualId();
@@ -309,6 +318,17 @@ void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
     activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
 }
 
+/*!
+  Inits 'zoom' transformation. [ protected ]
+*/
+void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
+{
+#if OCC_VERSION_LARGE > 0x06030010 // 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 ]
 */
@@ -318,7 +338,12 @@ 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 > 0x06030010 // 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 );
   }
 }
 
index 469ce17cb1777cd981bbe318d705bd29d98b9e92..125fcfa938082e75d0c7cff44c4ace48a565ed39 100755 (executable)
@@ -69,6 +69,7 @@ public:
   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 );
 
@@ -77,6 +78,9 @@ public:
   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; }
+
 protected:
     // EVENTS
   virtual void          paintEvent( QPaintEvent* );
@@ -100,6 +104,7 @@ private:
   bool                  myAnimate;
   bool                  myBusy;
   double                myScale;
+  bool                  myIsAdvancedZoomingEnabled;
 };
 
 #ifdef WIN32
index a82f2b9832eac83cd2a8559fad9411ecda29d2f0..06c1c0cefb31e29fa6cda63d003803f8545e1c6a 100755 (executable)
@@ -32,6 +32,7 @@
 #include "OCCViewer_ClippingDlg.h"
 #include "OCCViewer_SetRotationPointDlg.h"
 #include "OCCViewer_AxialScaleDlg.h"
+#include "OCCViewer_CubeAxesDlg.h"
 
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
 #include <Graphic3d_Structure.hxx>
 #include <Graphic3d_ExportFormat.hxx>
 
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
 static QEvent* l_mbPressEvent = 0;
 
 #ifdef WIN32
@@ -251,6 +260,7 @@ void OCCViewer_ViewWindow::initLayout()
 
   createActions();
   createToolBar();
+
   switch (my2dMode) {
   case XYPlane:
     onTopView();
@@ -262,6 +272,11 @@ void OCCViewer_ViewWindow::initLayout()
     onFrontView();
     break;
   }
+
+  // Graduated axes dialog
+  QtxAction* anAction = dynamic_cast<QtxAction*>( toolMgr()->action( GraduatedAxesId ) );
+  myCubeAxesDlg = new OCCViewer_CubeAxesDlg( anAction, this, "OCCViewer_CubeAxesDlg" );
+  myCubeAxesDlg->initialize();
 }
 
 /*!
@@ -384,20 +399,26 @@ 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 ( aSwitchToZoom )
+    if ( aSwitchToZoom ) {
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
       activateZoom();
+    }
     else if ( theEvent->button() == Qt::LeftButton )
       emit vpTransformationStarted ( PANVIEW );
     break;
 
   case ROTATE:
-    if ( aSwitchToZoom )
+    if ( aSwitchToZoom ) {
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
       activateZoom();
+    }
     else if ( theEvent->button() == Qt::LeftButton ) {
       myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
       emit vpTransformationStarted ( ROTATE );
@@ -408,7 +429,8 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
   /*  Try to activate a transformation */
     switch ( getButtonState(theEvent, anInteractionStyle) ) {
     case ZOOMVIEW:
-            activateZoom();
+      myViewPort->startZoomAtPoint( myStartX, myStartY );
+      activateZoom();
       break;
     case PANVIEW:
             activatePanning();
@@ -1052,46 +1074,54 @@ 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);
+  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 );
 
   // 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 );
 
   // Clone
@@ -1136,6 +1166,13 @@ void OCCViewer_ViewWindow::createActions()
   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);
@@ -1144,14 +1181,22 @@ void OCCViewer_ViewWindow::createActions()
   toolMgr()->registerAction( aAction, AmbientId );
 
   // Switch between interaction styles
-  aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+  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 );
 
- // Maximized view
+  // 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"));
@@ -1183,6 +1228,9 @@ void OCCViewer_ViewWindow::createToolBar()
 
   toolMgr()->append( DumpId, tid );
   toolMgr()->append( SwitchInteractionStyleId, tid );
+#if OCC_VERSION_LARGE > 0x06030010 // available only with OCC-6.3-sp11 and higher version
+  toolMgr()->append( SwitchZoomingStyleId, tid );
+#endif
   if( myModel->trihedronActivated() && (my2dMode == No2dMode) )
     toolMgr()->append( TrihedronShowId, tid );
 
@@ -1223,6 +1271,9 @@ 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 );
   } else {
     toolMgr()->append( AxialScaleId, tid );
@@ -1429,6 +1480,15 @@ void OCCViewer_ViewWindow::onAxialScale()
     myScalingDlg->show();
 }
 
+/*!
+  Shows Graduated Axes dialog
+*/
+void OCCViewer_ViewWindow::onGraduatedAxes()
+{
+  myCubeAxesDlg->Update();
+  myCubeAxesDlg->show();
+}
+
 void OCCViewer_ViewWindow::onAmbientToogle()
 {
   Handle(V3d_Viewer) viewer = myViewPort->getViewer();
@@ -1488,6 +1548,54 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
   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
+
   myRestoreFlag = 0;
 }
 
@@ -1520,6 +1628,19 @@ void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool 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
@@ -1538,6 +1659,24 @@ 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
@@ -1725,6 +1864,54 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   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;
 }
 
@@ -1736,13 +1923,73 @@ 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
+
+  return data.join("*");
 }
 
 /*!
@@ -1751,36 +1998,98 @@ 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( '*' );
+  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();
     }
-    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 );
 }
 
 /*!
index 498748a7c02e67600757a22d68f4d149cc5dbffa..3837db444ab77f3431e5b3c28b8af9007a13bf42 100755 (executable)
@@ -36,6 +36,7 @@ class OCCViewer_ClippingDlg;
 class OCCViewer_AxialScaleDlg;
 class OCCViewer_SetRotationPointDlg;
 class OCCViewer_Viewer;
+class OCCViewer_CubeAxesDlg;
 struct viewAspect;
 class QtxAction;
 
@@ -51,7 +52,8 @@ public:
   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
          ChangeRotationPointId, RotationId,
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
-         TrihedronShowId, AxialScaleId, AmbientId, SwitchInteractionStyleId, MaximizedId, UserId };
+         TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
+        SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, UserId };
 
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, 
                       PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
@@ -95,6 +97,9 @@ public:
   virtual int                     interactionStyle() const;
   virtual void                    setInteractionStyle( const int );
  
+  int                     zoomingStyle() const;
+  void                    setZoomingStyle( const int );
   void setTransformEnabled( const OperationType, const bool );
   bool transformEnabled( const OperationType ) const;
 
@@ -128,12 +133,14 @@ public slots:
   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 );
@@ -143,8 +150,7 @@ public slots:
   virtual void showEvent( QShowEvent * );
   virtual void hideEvent( QHideEvent * );
 
-  void onMaximizedView();
-
+  virtual void onMaximizedView();
 
 signals:
   void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
@@ -199,6 +205,8 @@ protected:
   OCCViewer_Viewer*     myModel;
   OCCViewer_ViewPort3d* myViewPort;
 
+  OCCViewer_CubeAxesDlg* myCubeAxesDlg;
+
   RotationPointType     myCurrPointType;
   RotationPointType     myPrevPointType;
   gp_Pnt                mySelectedPoint;
index e6a032c7a7165a3350a207a5224097a17bac0f36..d6f77585e7d1619de84c1ae58fdef3d10d713a49 100644 (file)
         <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>
         <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>
index 764efc208ab964cc18112b631cf3484c4088a7fa..909b278ec1415f0459255e24fec50e19c66615e5 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_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>
         <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)</translation>
diff --git a/src/OCCViewer/resources/OCCViewer_msg_fr.ts b/src/OCCViewer/resources/OCCViewer_msg_fr.ts
new file mode 100755 (executable)
index 0000000..c76f225
--- /dev/null
@@ -0,0 +1,318 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR" sourcelanguage="en_US">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Avant</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Vue de dessus</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panoramique</translation>
+    </message>
+    <message>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Dupliquer la scène</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRE</source>
+        <translation>Afficher/cacher le trièdre dans la scène</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRE</source>
+        <translation>Afficher/cacher le trièdre</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Dessus</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de vue</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Tourner le point de vue autour du centre de la scène</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Vue de gauche</translation>
+    </message>
+    <message>
+        <source>DSC_SHOOT_VIEW</source>
+        <translation>Memoriser l&apos;état courant de la scène et l&apos;ajouter dans la liste</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Redimentionner la scène pour montrer tous les objets</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Vue de devant</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINTGRAVITY_VIEW</source>
+        <translation>Point de Rotation : le centre de gravité</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Panoramique global</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue</translation>
+    </message>
+    <message>
+        <source>DSC_CLIPPING</source>
+        <translation>Définir le plan de coupe</translation>
+    </message>
+    <message>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Ouvrir une nouvelle fenêtre de visualisation pour la scène en cours</translation>
+    </message>
+    <message>
+        <source>INF_APP_SHOOT_VIEW</source>
+        <translation>Mémoriser la scène</translation>
+    </message>
+    <message>
+        <source>MNU_CLIPPING</source>
+        <translation>Plan de coupe</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Arrière</translation>
+    </message>
+    <message>
+        <source>MNU_SHOOT_VIEW</source>
+        <translation>Memoriser la vue</translation>
+    </message>
+    <message>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Changer le point autour duquel la scène est tournée</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Dessous</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Vue de droite</translation>
+    </message>
+    <message>
+        <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Changer le point de rotation</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Redimensionner la scène pour ne montrer que sa partie choisie par l&apos;encadré</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Vue de dessous</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène en cours dans un fichier image</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom la vue</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINT000_VIEW</source>
+        <translation>Point de Rotation : (0,0,0)</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATIONPOINTSELECTED_VIEW</source>
+        <translation>Point de Rotation : le point choisi par l&apos;utilisateur</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>DSC_PRESETS_VIEW</source>
+        <translation>Restaurer d&apos;un état mémorisé de la scène courante</translation>
+    </message>
+    <message>
+        <source>MNU_PRESETS_VIEW</source>
+        <translation>Restaurer la vue</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Droit</translation>
+    </message>
+    <message>
+        <source>INF_APP_PRESETS_VIEW</source>
+        <translation>Restaurer la scène</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Vue arrière</translation>
+    </message>
+    <message>
+        <source>DSC_SCALING</source>
+        <translation>Changer l&apos;échelle des axes de coordonnées</translation>
+    </message>
+    <message>
+        <source>MNU_SCALING</source>
+        <translation>Changer l&apos;échelle</translation>
+    </message>
+    <message>
+        <source>DSC_GRADUATED_AXES</source>
+        <translation>Axes gradués</translation>
+    </message>
+    <message>
+        <source>MNU_GRADUATED_AXES</source>
+        <translation>Axes gradués</translation>
+    </message>
+    <message>
+        <source>DSC_AMBIENT</source>
+        <translation>Ne montrer que la lumière d&apos;ambiance</translation>
+    </message>
+    <message>
+        <source>MNU_AMBIENT</source>
+        <translation>Ne montrer que la lumière d&apos;ambiance</translation>
+    </message>
+    <message>
+        <source>DSC_STYLE_SWITCH</source>
+        <translation>Changer le style d&apos;intéraction</translation>
+    </message>
+    <message>
+        <source>MNU_STYLE_SWITCH</source>
+        <translation>Changer le style d&apos;intéraction</translation>
+    </message>
+    <message>
+        <source>OCC_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_CreateRestoreViewDlg</name>
+    <message>
+        <source>CAPTION</source>
+        <translation>Restaurer la vue</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_SetRotationPointDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Utiliser le centre de la boîte englobante</translation>
+    </message>
+    <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Définir à l&apos;origine</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Indiquer le point de rotation</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Choisir le point dans la vue</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_ViewManager</name>
+    <message>
+        <source>OCC_VIEW_TITLE</source>
+        <translation>Scène OCC :%M - visualiseur:%V</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Sauvegarder la Vue</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Montrer la Barre d&apos;Outils</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Changer l&apos;arrière-plan</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_AxialScaleDlg</name>
+    <message>
+        <source>DLG_SCALING</source>
+        <translation>Changer l&apos;échelle des axes</translation>
+    </message>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/OCCViewer/resources/occ_view_graduated_axes.png b/src/OCCViewer/resources/occ_view_graduated_axes.png
new file mode 100755 (executable)
index 0000000..2b44c06
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_graduated_axes.png differ
diff --git a/src/OCCViewer/resources/occ_view_zooming_style_switch.png b/src/OCCViewer/resources/occ_view_zooming_style_switch.png
new file mode 100755 (executable)
index 0000000..8f3a486
Binary files /dev/null and b/src/OCCViewer/resources/occ_view_zooming_style_switch.png differ
index aa46ccd3785c7fbef76ff6a039f95f87397a7215..0e0f32a6efb4a76000ee47019d3661fa88499be7 100755 (executable)
@@ -45,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 cddaea49a99feb6a9897d9990b79433e4bc84dcf..ae666a88dcf1b3da7c7de0f7d75109ba5b59f17c 100644 (file)
@@ -1,26 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
diff --git a/src/ObjBrowser/resources/OB_msg_fr.ts b/src/ObjBrowser/resources/OB_msg_fr.ts
new file mode 100755 (executable)
index 0000000..a2d4d2f
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>OB_Browser</name>
+    <message>
+        <source>MEN_EXPAND_ALL</source>
+        <translation>Tout déplier</translation>
+    </message>
+    <message>
+        <source>MEN_COLLAPSE_ALL</source>
+        <translation>Tout réduire</translation>
+    </message>
+    <message>
+        <source>MEN_FIND</source>
+        <translation>Chercher</translation>
+    </message>
+</context>
+<context>
+    <name>OB_FindDlg</name>
+    <message>
+        <source>FIND</source>
+        <translation>Chercher</translation>
+    </message>
+    <message>
+        <source>CLOSE</source>
+        <translation>Fermer</translation>
+    </message>
+    <message>
+        <source>CASE_SENSITIVE</source>
+        <translation>Sensible à la casse</translation>
+    </message>
+    <message>
+        <source>IS_REG_EXP</source>
+        <translation>Expression régulière</translation>
+    </message>
+</context>
+</TS>
index dac45b6e104d4b1f86e39fda0b2a8d95fd038e51..8cb2b6e21aca9781f083bbb503fe7c198cb21f1e 100755 (executable)
@@ -87,7 +87,8 @@ dist_salomeres_DATA =                         \
 
 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
index 7f212a85bb45a43fb4dd6e8ac5c169efeb504d3b..0380785c91864357404c0f1a9bc2f2821aa45472 100755 (executable)
@@ -282,6 +282,7 @@ void Plot2d_ViewFrame::DisplayAll()
     updateCurve( clist.at( i ), false );
   }
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 /*!
    Removes all curves from the view
@@ -291,6 +292,7 @@ void Plot2d_ViewFrame::EraseAll()
   myPlot->clear();
   myPlot->getCurves().clear();
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 /*!
   Redraws viewframe contents
@@ -315,6 +317,7 @@ void Plot2d_ViewFrame::Display( const Plot2d_Prs* prs )
   setXGrid( myXGridMajorEnabled, myXGridMaxMajor, myXGridMinorEnabled, myXGridMaxMinor, true );
   setYGrid( myYGridMajorEnabled, myYGridMaxMajor, myYGridMinorEnabled, myYGridMaxMinor,
             myY2GridMajorEnabled, myY2GridMaxMajor, myY2GridMinorEnabled, myY2GridMaxMinor, true );
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -328,6 +331,7 @@ void Plot2d_ViewFrame::Erase( const Plot2d_Prs* prs, const bool )
   // erase all curves from presentation
   curveList aCurves = prs->getCurves();
   eraseCurves( aCurves );
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
@@ -363,6 +367,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 );
@@ -627,6 +635,7 @@ void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update )
   myPlot->updateYAxisIdentifiers();
   if ( update )
     myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -643,7 +652,7 @@ void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
   }
   fitAll();
   //myPlot->setUpdatesEnabled( true );
-// update legend
+  // update legend
   if ( update )
     myPlot->replot();
 }
@@ -665,6 +674,7 @@ void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
     if ( update )
       myPlot->replot();
   }
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -681,6 +691,7 @@ void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
 //  fitAll();
   if ( update )
     myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
 }
 
 /*!
@@ -691,7 +702,7 @@ void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
   if ( !curve )
     return;
   if ( hasPlotCurve( curve ) ) {
-  QwtPlotCurve* aPCurve = getPlotCurve( curve );
+    QwtPlotCurve* aPCurve = getPlotCurve( curve );
     if ( !curve->isAutoAssign() ) {
       Qt::PenStyle     ps = Plot2d::plot2qwtLine( curve->getLine() );
       QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
@@ -706,6 +717,7 @@ void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
     aPCurve->setVisible( true );
     if ( update )
       myPlot->replot();
+    if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
   }
 }
 
@@ -1158,19 +1170,21 @@ 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;
+    }
   }
 }
 
@@ -1547,6 +1561,7 @@ void Plot2d_ViewFrame::wheelEvent(QWheelEvent* event)
     myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s1() + aScale*(y2Map.s2() - y2Map.s1()) );
   }
   myPlot->replot();
+  if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
   myPnt = event->pos();
 }
 
@@ -1738,6 +1753,7 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent )
   canvas()->setMouseTracking( true );
 
   myPlotZoomer->setEnabled( true );
+  myPlotZoomer->setZoomBase();
 }
 
 /*!
@@ -2460,14 +2476,16 @@ void Plot2d_QwtPlotCurve::updateLegend( QwtLegend* legend ) const
 {
   QwtPlotCurve::updateLegend( legend );
 
-  QWidget* widget = legend->find( this );
-  if( Plot2d_QwtLegendItem* anItem = dynamic_cast<Plot2d_QwtLegendItem*>( widget ) ) {
-    int aMode = Plot2d_QwtLegendItem::IM_None;
-    if( myYAxisIdentifierEnabled )
-      aMode = myYAxis == QwtPlot::yRight ?
-        Plot2d_QwtLegendItem::IM_Right :
-        Plot2d_QwtLegendItem::IM_Left;
-    anItem->setYAxisIdentifierMode( aMode );
+  if ( legend ) {
+    QWidget* widget = legend->find( this );
+    if( Plot2d_QwtLegendItem* anItem = dynamic_cast<Plot2d_QwtLegendItem*>( widget ) ) {
+      int aMode = Plot2d_QwtLegendItem::IM_None;
+      if( myYAxisIdentifierEnabled )
+       aMode = myYAxis == QwtPlot::yRight ?
+         Plot2d_QwtLegendItem::IM_Right :
+         Plot2d_QwtLegendItem::IM_Left;
+      anItem->setYAxisIdentifierMode( aMode );
+    }
   }
 }
 
index 2e912da1ae822ebb913141deadc952b812cdbf28..a36346e0b2e6a31f2c47fa6efabd1669132a618d 100755 (executable)
@@ -121,7 +121,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];
index 3a084267ff79a4f1de0439c6ddfb4d0721b438c0..08b09ca768a1af8a42da81936854aa0fc2eaaed3 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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/Plot2d/resources/Plot2d_msg_fr.ts b/src/Plot2d/resources/Plot2d_msg_fr.ts
new file mode 100755 (executable)
index 0000000..9bad865
--- /dev/null
@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_LBL</source>
+        <translation>Type de courbe:</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
+        <translation>Enregistrer comme paramètres par défaut</translation>
+    </message>
+    <message>
+        <source>TLT_SETUP_CURVE</source>
+        <translation>Initialiser une courbe</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Enregistrer la vue...</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_HOR</source>
+        <translation>Axe horizontal:</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_VER</source>
+        <translation>Axe vertical:</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Dupliquer la vue</translation>
+    </message>
+    <message>
+        <source>POSTSCRIPT_FILES</source>
+        <translation>Fichiers PostScript (*.ps)</translation>
+    </message>
+    <message>
+        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
+        <translation>Fichiers PostScript encapsulés (*.eps)</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de vue</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle linéaire</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle linéaire</translation>
+    </message>
+    <message>
+        <source>CURVE_LINE_WIDTH_LAB</source>
+        <translation>Epaisseur du trait:</translation>
+    </message>
+    <message>
+        <source>CURVE_TYPE_POPUP</source>
+        <translation>Type de courbe</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Axe vertical: linéaire</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Axe horizontal: linéaire</translation>
+    </message>
+    <message>
+        <source>FIT_DATA_TLT</source>
+        <translation>Ajuster à la plage de données</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_TLT</source>
+        <translation>Marques de la grille et des axes</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>DASHDOT_LINE_LBL</source>
+        <translation>TiretPoint</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_SPLINES</source>
+        <translation>Changer la vue en mode splines</translation>
+    </message>
+    <message>
+        <source>INF_AXES_X</source>
+        <translation>Axe X</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_TLT</source>
+        <translation>Mode d&apos;échelle</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Ajuster la scène pour afficher tous les objets</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Axe horizontal: logarithmique</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Axe vertical: logarithmique</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Déplacement global</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Enregistrer la vue</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
+        <translation>Dessous</translation>
+    </message>
+    <message>
+        <source>INF_COORDINATES</source>
+        <translation>Coordonnées: X : %1, Y : %2</translation>
+    </message>
+    <message>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Ouvrir un nouveau visualiseur OCC pour la scène actuelle</translation>
+    </message>
+    <message>
+        <source>DASH_LINE_LBL</source>
+        <translation>Tiret</translation>
+    </message>
+    <message>
+        <source>DTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté vers le bas</translation>
+    </message>
+    <message>
+        <source>UTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté en haut</translation>
+    </message>
+    <message>
+        <source>LTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté à gauche </translation>
+    </message>
+    <message>
+        <source>RTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté à droite</translation>
+    </message>
+    <message>
+        <source>RECTANGLE_MARKER_LBL</source>
+        <translation>Rectangle</translation>
+    </message>
+    <message>
+        <source>TLT_SETUP_PLOT2D_VIEW</source>
+        <translation>Paramètres de visualisation Plot 2d</translation>
+    </message>
+    <message>
+        <source>CURVE_LINE_TYPE_LAB</source>
+        <translation>Type de trait:</translation>
+    </message>
+    <message>
+        <source>CROSS_MARKER_LBL</source>
+        <translation>Croix</translation>
+    </message>
+    <message>
+        <source>XCROSS_MARKER_LBL</source>
+        <translation>Croix diagonale</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_VER_TITLE</source>
+        <translation>Titre de l&apos;axe vertical</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_HOR_TITLE</source>
+        <translation>Titre de l&apos;axe horizontal</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_SETTINGS</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_LINES</source>
+        <translation>Lignes</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_SPLINES</source>
+        <translation>Dessiner les splines</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle logarithmique</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle logarithmique</translation>
+    </message>
+    <message>
+        <source>PLOT2D_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MAX_INTERVALS</source>
+        <translation>Intervalles max</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_LEFT</source>
+        <translation>Axe Y gauche</translation>
+    </message>
+    <message>
+        <source>CURVE_COLOR_LAB</source>
+        <translation>Couleur:</translation>
+    </message>
+    <message>
+        <source>CURVE_PREVIEW_LAB</source>
+        <translation>Prévisualiser</translation>
+    </message>
+    <message>
+        <source>DIAMOND_MARKER_LBL</source>
+        <translation>Diamant</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_TOP</source>
+        <translation>Dessus</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Changer l&apos;arrière-plan</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Changer l&apos;arrière-plan...</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Changer la couleur d&apos;arrière plan</translation>
+    </message>
+    <message>
+        <source>SOLID_LINE_LBL</source>
+        <translation>Solide</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_VER_MAJOR</source>
+        <translation>Verticale principale</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_HOR_MAJOR</source>
+        <translation>Horizontale principale</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_VER_MINOR</source>
+        <translation>Verticale secondaire</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_POINTS</source>
+        <translation>Dessiner des points</translation>
+    </message>
+    <message>
+        <source>PLOT2D_GRID_ENABLE_HOR_MINOR</source>
+        <translation>Horizontale secondaire</translation>
+    </message>
+    <message>
+        <source>PLOT2D_BACKGROUND_COLOR_LBL</source>
+        <translation>Couleur d&apos;arrière-plan:</translation>
+    </message>
+    <message>
+        <source>WRN_XLOG_NOT_ALLOWED</source>
+        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;abscisse.
+L&apos;échelle logarithmique de l&apos;abscisse n&apos;est pas permise.</translation>
+    </message>
+    <message>
+        <source>WRN_YLOG_NOT_ALLOWED</source>
+        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;ordonnée.
+L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Ajuster la scène à la zone choisie par l&apos;encadré</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_LEFT</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
+    </message>
+    <message>
+        <source>DOT_LINE_LBL</source>
+        <translation>Point</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_POINTS</source>
+        <translation>Dessiner les points</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_POINTS</source>
+        <translation>Changer la vue en mode points</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_LOGARITHMIC</source>
+        <translation>Logarithmique</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_RIGHT</source>
+        <translation>Droite</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue actuelle dans un fichier image</translation>
+    </message>
+    <message>
+        <source>WARNING</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_LEGEND</source>
+        <translation>Afficher la légende</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoomer la vue</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_SETTINGS</source>
+        <translation>Définit les paramètres de visualisation</translation>
+    </message>
+    <message>
+        <source>INF_COORDINATES_SOME_Y</source>
+        <translation>Coordonnées: X : %1, Y : %2 ( %3 )</translation>
+    </message>
+    <message>
+        <source>SCALING_POPUP</source>
+        <translation>Echelle</translation>
+    </message>
+    <message>
+        <source>PLOT2D_SCALE_MODE_LINEAR</source>
+        <translation>Linéaire</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_FITDATA</source>
+        <translation>Ajuster à l&apos;intervalle</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_POINTS</source>
+        <translation>Points</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
+        <translation>Spline</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_FITDATA</source>
+        <translation>&amp;Ajuster à l&apos;intervalle</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Axe horizontal: logarithmique</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Axe vertical: logarithmique</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_FITDATA</source>
+        <translation>Ajuster la vue à la plage de données indiquées</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Axe vertical: linéaire</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Axe horizontal: linéaire</translation>
+    </message>
+    <message>
+        <source>NONE_MARKER_LBL</source>
+        <translation>Aucun</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_SHOW_LEGEND</source>
+        <translation>Afficher la &amp;légende</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_SHOW_LEGEND</source>
+        <translation>Activer/désactiver la légende</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_SHOW_LEGEND</source>
+        <translation>Afficher la légende</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_RIGHT</source>
+        <translation>Axe Y droite</translation>
+    </message>
+    <message>
+        <source>DAHSDOTDOT_LINE_LBL</source>
+        <translation>TiretPointPoint</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_SPLINES</source>
+        <translation>Dessiner des splines</translation>
+    </message>
+    <message>
+        <source>CURVE_MARKER_TYPE_LAB</source>
+        <translation>Type de marqueur:</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_SETTINGS</source>
+        <translation>&amp;Paramètres</translation>
+    </message>
+    <message>
+        <source>CIRCLE_MARKER_LBL</source>
+        <translation>Cercle</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+    <message>
+        <source>NONE_LINE_LBL</source>
+        <translation>Aucun</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MARKER_SIZE_LBL</source>
+        <translation>Taille du marqueur:</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
+        <translation>Titre principal</translation>
+    </message>
+    <message>
+        <source>TOT_PLOT2D_CURVES_LINES</source>
+        <translation>Dessiner des lignes</translation>
+    </message>
+    <message>
+        <source>PRP_PLOT2D_CURVES_LINES</source>
+        <translation>Changer la vue en mode lignes</translation>
+    </message>
+    <message>
+        <source>MEN_PLOT2D_CURVES_LINES</source>
+        <translation>Dessiner les lignes</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_FitDataDlg</name>
+    <message>
+        <source>FIT_HORIZONTAL</source>
+        <translation>Ajuster horizontalement</translation>
+    </message>
+    <message>
+        <source>MIN_VALUE_LAB</source>
+        <translation>Min:</translation>
+    </message>
+    <message>
+        <source>VERTICAL_AXIS</source>
+        <translation>Axe vertical</translation>
+    </message>
+    <message>
+        <source>MAX_VALUE_LAB</source>
+        <translation>Max:</translation>
+    </message>
+    <message>
+        <source>HORIZONTAL_AXIS</source>
+        <translation>Axe horizontal</translation>
+    </message>
+    <message>
+        <source>VERTICAL_LEFT_AXIS</source>
+        <translation>Axe vertical gauche</translation>
+    </message>
+    <message>
+        <source>FIT_ALL</source>
+        <translation>Tout ajuster</translation>
+    </message>
+    <message>
+        <source>VERTICAL_RIGHT_AXIS</source>
+        <translation>Axe vertical droite</translation>
+    </message>
+    <message>
+        <source>FIT_VERTICAL</source>
+        <translation>Ajuster verticalement</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_ViewManager</name>
+    <message>
+        <source>PLOT2D_VIEW_TITLE</source>
+        <translation>Scène Plot2d:%M - visualiseur:%V</translation>
+    </message>
+</context>
+</TS>
index fe0b4a1f6dd744ef04daac271c77d85364cb44f2..e28a2b67fcca8d4e5ec251a5dbee283505a0cd85 100755 (executable)
@@ -44,7 +44,8 @@ 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
index bae6451573514130de4b4b8add0a7ac53d2a905c..4abd2af8e45f8455c1b262c56063b7a65fbca872 100644 (file)
@@ -128,6 +128,30 @@ 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 Change the python console's font.
   \param f new font
index 0666396fc0b0e219c39c027a7955c0742ee3a5b3..8833039fb77620e3bd6fc25da6daddf7d4a62121 100644 (file)
@@ -63,6 +63,10 @@ public:
   bool                isSync() const;
   void                setIsSync( const bool );
 
+  bool                isSuppressOutput() const;
+  void                setIsSuppressOutput( const bool );
+
+
   void                exec( const QString& );
   void                execAndWait( const QString& );
 
index c622c66a833e77a9b5339c12ba3d7d755187eb97..54496b36fb836d75b3def6227d2eefa5020d9818 100644 (file)
@@ -226,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 ) ); 
 }
 
 /*!
@@ -242,7 +243,8 @@ PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp,
   myInterp( 0 ),
   myCmdInHistory( -1 ),
   myEventLoop( 0 ),
-  myIsSync( false )
+  myIsSync( false ),
+  myIsSuppressOutput(false)
 {
   QString fntSet( "" );
   QFont aFont = SUIT_Tools::stringToFont( fntSet );
@@ -296,6 +298,30 @@ void PyConsole_Editor::setIsSync( const bool on )
   myIsSync = on;
 }
 
+/*!
+  \brief Get suppress output flag value.
+  
+  \sa setIsSuppressOutput()
+  \return 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 Put the string \a str to the python editor.
   \param str string to be put in the command line of the editor
index ae381467cd62b4413b2beae111fadd3ae06fcf19..6f8eba127022819d7c3b487121d08a2c013e08c5 100644 (file)
@@ -52,6 +52,9 @@ public:
   bool           isSync() const;
   void           setIsSync( const bool );
 
+  bool           isSuppressOutput() const;
+  void           setIsSuppressOutput(const bool);
+
 protected:
   virtual void   dropEvent( QDropEvent* event );
   virtual void   mouseReleaseEvent( QMouseEvent* event );
@@ -80,6 +83,7 @@ private:
   QString           myBanner;           //!< current banner
   QStringList       myQueue;            //!< python commands queue
   bool              myIsSync;           //!< synchronous mode flag
+  bool              myIsSuppressOutput; //!< suppress output flag
 };
 
 #endif // PYCONSOLE_EDITOR_H
index 986b476b1a8ccdcc16e1661a604ef69855fa9730..85393a2bf43151b66038132a164f075b373c5955 100644 (file)
@@ -1,28 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -50,7 +28,6 @@
         <translation>D&amp;ump commands</translation>
     </message>
 </context>
-
 <context>
     <name>PyConsole_Editor</name>
     <message>
@@ -58,8 +35,8 @@
         <translation>Dump commands</translation>
     </message>
     <message>
-       <source>PYTHON_FILES_FILTER</source>
-       <translation>PYTHON Files (*.py)</translation>
+        <source>PYTHON_FILES_FILTER</source>
+        <translation>PYTHON Files (*.py)</translation>
     </message>
 </context>
 </TS>
diff --git a/src/PyConsole/resources/PyConsole_msg_fr.ts b/src/PyConsole/resources/PyConsole_msg_fr.ts
new file mode 100755 (executable)
index 0000000..9109115
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>PyConsole_Console</name>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="216"/>
+        <source>EDIT_COPY_CMD</source>
+        <translation>&amp;Copier</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="221"/>
+        <source>EDIT_PASTE_CMD</source>
+        <translation>C&amp;oller</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="226"/>
+        <source>EDIT_CLEAR_CMD</source>
+        <translation>&amp;Effacer</translation>
+    </message>
+    <message>
+        <location filename="../PyConsole_Console.cxx" line="231"/>
+        <source>EDIT_SELECTALL_CMD</source>
+        <translation>&amp;Tout sélectionner</translation>
+    </message>
+    <message>
+        <source>EDIT_DUMPCOMMANDS_CMD</source>
+        <translation>&amp;Générer le script des commandes</translation>
+    </message>
+</context>
+<context>
+    <name>PyConsole_Editor</name>
+    <message>
+        <source>TOT_DUMP_PYCOMMANDS</source>
+        <translation>&amp;Générer le script des commandes</translation>
+    </message>
+    <message>
+        <source>PYTHON_FILES_FILTER</source>
+        <translation>Fichiers PYTHON (*.py)</translation>
+    </message>
+</context>
+</TS>
index cd641de0d98336bfe03acef711d27a5c4b828507..ff1bdea07959794e0f7f87658e63bb91b1083f54 100755 (executable)
@@ -82,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 0caa8c1f22833fcc0c184f28699358aec9c607a3..2388719f03add9accdee3ecd15e3db9d2a1ceb32 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -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>
diff --git a/src/QDS/resources/QDS_msg_fr.ts b/src/QDS/resources/QDS_msg_fr.ts
new file mode 100755 (executable)
index 0000000..d57669b
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>QDS_Datum</name>
+    <message>
+        <source>DATA_ERR_TITLE</source>
+        <translation>Valeur du paramètre incorrecte</translation>
+    </message>
+    <message>
+        <source>DATA_STRING</source>
+        <translation> chaîne de caractères non-vide</translation>
+    </message>
+    <message>
+        <source>DATA_NON_EMPTY</source>
+        <translation> non-vide</translation>
+    </message>
+    <message>
+        <source>DATA_MIN_LIMIT</source>
+        <translation> est supérieur à %1</translation>
+    </message>
+    <message>
+        <source>DATA_FLOAT</source>
+        <translation> réel</translation>
+    </message>
+    <message>
+        <source>DATA_RANGE</source>
+        <translation> dans l&apos;intervalle [%1, %2]</translation>
+    </message>
+    <message>
+        <source>DATA_SHOULD_BE_VALUE</source>
+        <translation>Devrait avoir la valeur %1</translation>
+    </message>
+    <message>
+        <source>DATA_INTEGER</source>
+        <translation> entier</translation>
+    </message>
+    <message>
+        <source>DATA_INCORRECT_VALUE</source>
+        <translation>La valeur du paramètre &quot;%1&quot; n&apos;est pas correcte.</translation>
+    </message>
+    <message>
+        <source>DATA_MAX_LIMIT</source>
+        <translation> est inférieur à %1</translation>
+    </message>
+    <message>
+        <source>DATA_INPUT_VALUE</source>
+        <translation>Indiquez une valeur correcte.</translation>
+    </message>
+</context>
+</TS>
index 633d33df9da4031bc18695938bb4c87d0bab4943..610935c5517772b87bc001fd3eb5b4dd5e7bd3bf 100755 (executable)
@@ -67,6 +67,7 @@ salomeinclude_HEADERS =               \
        QtxResourceMgr.h        \
        QtxRubberBand.h         \
        QtxSearchTool.h         \
+       QtxShortcutEdit.h       \
        QtxSplash.h             \
        QtxToolBar.h            \
        QtxToolTip.h            \
@@ -123,6 +124,7 @@ dist_libqtx_la_SOURCES =    \
        QtxResourceMgr.cxx      \
        QtxRubberBand.cxx       \
        QtxSearchTool.cxx       \
+       QtxShortcutEdit.cxx     \
        QtxSplash.cxx           \
        QtxToolBar.cxx          \
        QtxToolTip.cxx          \
@@ -171,6 +173,7 @@ MOC_FILES =                         \
        QtxPopupMgr_moc.cxx             \
        QtxRubberBand_moc.cxx           \
        QtxSearchTool_moc.cxx           \
+       QtxShortcutEdit_moc.cxx         \
        QtxSplash_moc.cxx               \
        QtxToolBar_moc.cxx              \
        QtxToolTip_moc.cxx              \
@@ -189,3 +192,6 @@ nodist_libqtx_la_SOURCES = $(MOC_FILES)
 
 libqtx_la_CPPFLAGS = $(QT_INCLUDES)
 libqtx_la_LDFLAGS  = $(QT_MT_LIBS)
+
+nodist_salomeres_DATA =                \
+       Qtx_msg_fr.qm
index ded4dd5016407c5b07cceb4d950014ecac1cb9d8..a095db966a4fb43e9bec0ea8999bf6bd769f765f 100755 (executable)
@@ -1384,6 +1384,45 @@ bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradien
   return success;
 }
 
+/*!
+  \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() );
+}
+
 #ifndef WIN32
 
 #include <X11/Xlib.h>
index c5bc82b2d11c3b3813341f447dbf9127958ba3c3..72a2a494fc4b85b52d2984a61a6d371d0b987a3d 100755 (executable)
@@ -113,6 +113,15 @@ public:
         Auto    //!< substitute environment variable by it's value if variable exists, and keep it as is otherwise
   } SubstMode;
 
+  class QTX_EXPORT Localizer
+  {
+  public:
+    Localizer();
+    ~Localizer();
+  private:
+    QString myCurLocale;
+  };
+
   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 );
index 0bc9508aa50f0978238c1ca07dbbfcb1ebe16ead..b706f850a5cfb02372bd8a2d93ea5c3ea89ab016 100755 (executable)
@@ -67,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 );
 }
@@ -85,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
@@ -92,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 );
@@ -102,6 +111,7 @@ QtxAction::QtxAction( const QString& text, const QIcon& icon,
   setToolTip( text );
   setShortcut( accel );
   setCheckable( toggle );
+  setShortcutActionName(shortcutAction);
 
   QApplication::instance()->installEventFilter( this );
 }
@@ -112,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 );
 }
 
@@ -208,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 c7a87293fcb127d17b765fcaedd24f93471b0f96..4536fa5ba6b943e63f36c22fbd3ce425b1e9b15c 100755 (executable)
@@ -43,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 af9a76673ec65f28a719ba871cd9c1ae4f3eb92b..635647d6c188fcbce3321d672d96489505ca86e8 100644 (file)
@@ -54,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 );
index 75abd996ffb0d589067f7b701ca34943fbd7743f..d3cb7662132e88a58f3ae74990fbe4a07355337f 100644 (file)
@@ -110,6 +110,9 @@ QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f )
   myMenuBar( 0 ),
   myStatusBar( 0 )
 {
+       //rnv: Enables tooltips for inactive windows.
+       //rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
+       setAttribute(Qt::WA_AlwaysShowToolTips);
 }
 
 /*!
index d59c3f89fc2770115e2a949183b2e9677ec25a82..979ee0e647356a1e3cdad5d1d7cac54e4eb69703 100644 (file)
@@ -29,6 +29,8 @@
 #include "QtxIntSpinBox.h"
 #include "QtxColorButton.h"
 #include "QtxDoubleSpinBox.h"
+#include "QtxShortcutEdit.h"
+#include "QtxResourceMgr.h"
 
 #include <QEvent>
 #include <QLayout>
@@ -3069,7 +3071,7 @@ void QtxPagePrefSpinItem::setPrecision( const QVariant& prec )
   if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
   {
     if ( prec.canConvert( QVariant::Int ) ) {
-      dsb->setDecimals( prec.toInt() );
+      dsb->setDecimals( qAbs( prec.toInt() ) );
       dsb->setPrecision( prec.toInt() );
     }
   }
@@ -4191,7 +4193,118 @@ 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() );
+    }
+  }
+}
 
 /*!
   \brief Constructor.
index 62f1c88bdfa4e1a0c21c677a6c5208d1a9d4c6ac..5b7ee10ebfec7c3091b5c4b96f3ebbe75edd7b90 100644 (file)
@@ -38,6 +38,8 @@ class QtxFontEdit;
 class QtxGroupBox;
 class QtxComboBox;
 class QtxColorButton;
+class QtxShortcutEdit;
+class QtxShortcutTree;
 
 class QToolBox;
 class QLineEdit;
@@ -50,6 +52,7 @@ class QFileDialog;
 class QDateTimeEdit;
 class QStackedWidget;
 class QSlider;
+class QTreeWidget;
 
 class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
 {
@@ -704,6 +707,32 @@ 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 QtxUserDefinedContent: public QWidget
 {
@@ -732,5 +761,4 @@ private:
   QtxUserDefinedContent* myContent;
 };
 
-
 #endif
index f68c292bc11daa6e2751f0da3c98445ee8e8d04d..8328d8a0a73ec5be9527f478b2243f9eb52c23f4 100644 (file)
@@ -31,6 +31,7 @@
 #include <QRegExp>
 #include <QTextStream>
 #include <QApplication>
+#include <QLibraryInfo>
 #ifndef QT_NO_DOM
 #include <QDomDocument>
 #include <QDomElement>
@@ -2096,6 +2097,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
@@ -2132,6 +2190,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.
 
@@ -2163,7 +2236,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()
@@ -2180,7 +2253,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()
@@ -2193,6 +2266,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.
   
@@ -2347,6 +2437,14 @@ 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 );
+    QTranslator* trans = new QtxTranslator( 0 );
+    if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) )
+      QApplication::instance()->installTranslator( trans );
+  }
+
   for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
   {
     QString prefix = *iter;
index 5c997077743c559a116fe5f2d122f5f502f517d5..9b5356369d4ddc7aeb7ce97547d2dfad2a6e02a5 100644 (file)
@@ -143,6 +143,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;
@@ -161,7 +162,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();
 
diff --git a/src/Qtx/QtxShortcutEdit.cxx b/src/Qtx/QtxShortcutEdit.cxx
new file mode 100755 (executable)
index 0000000..efa555d
--- /dev/null
@@ -0,0 +1,404 @@
+//  Copyright (C) 2007-2010  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,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "QtxShortcutEdit.h"
+
+#include <QWidget>
+#include <QLayout>
+#include <QList>
+
+#include <QToolButton>
+#include <QLineEdit>
+#include <QTableWidgetItem>
+#include <QMessageBox>
+
+#include <QKeyEvent>
+#include <QKeySequence>
+
+#define COLUMN_SIZE  500
+
+static const char* delete_icon[] = {
+"16 16 3 1",
+"` c #810000",
+"  c none",
+"# c #ffffff",
+"                ",
+"                ",
+" ``#        ``# ",
+" ````#     ``#  ",
+"  ````#   ``#   ",
+"    ```# `#     ",
+"     `````#     ",
+"      ```#      ",
+"     `````#     ",
+"    ```# ``#    ",
+"   ```#   ``#   ",
+"  ```#     `#   ",
+"  ```#      `#  ",
+"   `#        `# ",
+"                ",
+"                "
+};
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+*/
+QtxShortcutEdit::QtxShortcutEdit( QWidget* parent )
+: QFrame( parent )
+{
+  initialize();
+  myShortcut->installEventFilter(this);
+}
+
+/*!
+  \brief Destructor
+*/
+QtxShortcutEdit::~QtxShortcutEdit()
+{
+}
+
+/*!
+  \brief Sets custom shortcut
+  \param seq a key sequence describes a combination of keys
+  \sa shortcut()
+*/
+void QtxShortcutEdit::setShortcut( const QKeySequence& seq )
+{
+  QString txt = seq.toString(); 
+  myPrevShortcutText = txt;
+  myShortcut->setText( txt ); 
+}
+
+/*!
+  \brief Gets custom shortcut 
+  \return a key sequence describes a combination of keys
+  \sa setShortcut()
+*/
+QKeySequence QtxShortcutEdit::shortcut()
+{
+  return QKeySequence::fromString( myShortcut->text() );
+}
+
+/*!
+  \brief Gets the key sequence from keys that were pressed 
+  \param e a key event
+  \return a string representation of the key sequence
+*/
+QString QtxShortcutEdit::parseEvent( QKeyEvent* e )
+{
+  bool isShiftPressed = e->modifiers() & Qt::ShiftModifier;
+  bool isControlPressed = e->modifiers() & Qt::ControlModifier;
+  bool isAltPressed = e->modifiers() & Qt::AltModifier;
+  bool isMetaPressed = e->modifiers() & Qt::MetaModifier;
+  bool isModifiersPressed = isShiftPressed || isControlPressed || isAltPressed || isMetaPressed;
+  int result=0;
+  if( isControlPressed )
+    result += Qt::CTRL;
+  if( isAltPressed )
+    result += Qt::ALT;
+  if( isShiftPressed )
+    result += Qt::SHIFT;
+  if( isMetaPressed )
+    result += Qt::META;
+
+  int aKey = e->key();
+  if ( ( isValidKey( aKey ) && isModifiersPressed ) || ( ( aKey >= Qt::Key_F1 ) && ( aKey <= Qt::Key_F12 ) ) )
+    result += aKey;
+
+  return QKeySequence( result ).toString();
+}
+
+/*!
+  \brief Check if the key event contains a 'valid' key
+  \param aKey the code of the key
+  \return \c true if the key is 'valid'
+*/
+
+bool QtxShortcutEdit::isValidKey( int aKey )
+{
+  if ( aKey == Qt::Key_Underscore || aKey == Qt::Key_Escape || 
+     ( aKey >= Qt::Key_Backspace && aKey <= Qt::Key_Delete ) || 
+     ( aKey >= Qt::Key_Home && aKey <= Qt::Key_PageDown ) || 
+     ( aKey >= Qt::Key_F1 && aKey <= Qt::Key_F12 )  ||
+     ( aKey >= Qt::Key_Space && aKey <= Qt::Key_Asterisk ) ||
+     ( aKey >= Qt::Key_Comma && aKey <= Qt::Key_Question ) ||
+     ( aKey >= Qt::Key_A && aKey <= Qt::Key_AsciiTilde ) )
+    return true;
+  return false;
+}
+
+/*!
+  \brief Called when "Clear" button is clicked.
+*/
+void QtxShortcutEdit::onCliked() 
+{
+  myShortcut->setText( "" );
+}
+
+/*!
+  \brief Called when myShortcut loses focus.
+*/
+void QtxShortcutEdit::onEditingFinished() 
+{
+  if ( myShortcut->text().endsWith("+") )
+    myShortcut->setText( myPrevShortcutText );
+}
+
+/*!
+  \brief Custom event filter.
+  \param obj event receiver object
+  \param event event
+  \return \c true if further event processing should be stopped
+*/
+bool QtxShortcutEdit::eventFilter(QObject* obj, QEvent* event) 
+{ 
+  if ( obj == myShortcut ) { 
+    if (event->type() == QEvent::KeyPress ) {
+      QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
+      QString text = parseEvent( keyEvent );
+      if ( keyEvent->key() == Qt::Key_Delete || keyEvent->key() == Qt::Key_Backspace )
+        onCliked();
+      if ( text != "" )
+        myShortcut->setText( text );
+      return true;
+    }
+    if ( event->type() == QEvent::KeyRelease ) {
+      if ( myShortcut->text().endsWith("+") )
+        myShortcut->setText( myPrevShortcutText );
+      else myPrevShortcutText = myShortcut->text();
+
+      return true;
+    }
+  } 
+  return false;
+}
+
+/*
+  \brief Perform internal intialization.
+*/
+void QtxShortcutEdit::initialize()
+{
+  myPrevShortcutText = QString();
+
+  QHBoxLayout* base = new QHBoxLayout( this );
+  base->setMargin( 0 );
+  base->setSpacing( 5 );
+
+  base->addWidget( myShortcut = new QLineEdit( this ) );
+
+  QToolButton* deleteBtn = new QToolButton();
+  deleteBtn->setIcon( QPixmap( delete_icon ) );
+  base->addWidget( deleteBtn );
+  myShortcut->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
+  deleteBtn->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+
+  connect( deleteBtn, SIGNAL( clicked() ), this, SLOT( onCliked() ) );
+  connect( myShortcut, SIGNAL( editingFinished() ), this, SLOT( onEditingFinished() ) );
+}
+
+/*!
+  \brief Constructor
+  \param parent parent widget
+*/
+QtxShortcutTree::QtxShortcutTree( QWidget * parent ) : QTreeWidget( parent )
+{
+  setColumnCount( 2 );
+  setSelectionMode( QAbstractItemView::SingleSelection );
+  setColumnWidth ( 0, COLUMN_SIZE);
+  setSortingEnabled(false);
+  headerItem()->setHidden ( true ); 
+
+  this->installEventFilter(this);
+  connect( this, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT( onCurrentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
+
+}
+
+/*!
+  \brief Destructor
+*/
+QtxShortcutTree::~QtxShortcutTree(){}
+
+/*!
+  \brief Custom event filter. 
+  \param obj event receiver object
+  \param event event
+  \return \c true if further event processing should be stopped
+*/
+bool QtxShortcutTree::eventFilter(QObject* obj, QEvent* event) 
+{ 
+  if ( currentItem() && currentItem()->isSelected() ) {
+    
+    if (event->type() == QEvent::KeyPress ) {
+      QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
+      QString text = QtxShortcutEdit::parseEvent( keyEvent );
+      if ( keyEvent->key() == Qt::Key_Delete || keyEvent->key() == Qt::Key_Backspace )
+        currentItem()->setText( 1, "" );
+      if ( text != "" ) {
+       if ( text.endsWith( "+" ) || checkUniqueness( currentItem(), text ) )
+          currentItem()->setText( 1, text );
+      }
+      return true;
+    }
+    if ( event->type() == QEvent::KeyRelease ) {
+      if ( currentItem()->text( 1 ).endsWith( "+" ) )
+       currentItem()->setText( 1, myPrevBindings[ currentItem()->parent()->text( 0 ) ][ currentItem()->text( 0 ) ] );
+      else myPrevBindings[ currentItem()->parent()->text( 0 ) ][ currentItem()->text( 0 ) ] = currentItem()->text( 1 );
+
+      return true;
+    }    
+  } 
+  return false;
+}
+
+/*!
+  \brief Called when the current item changes.
+  \param cur the current item
+  \param prev the previous current item
+*/
+void QtxShortcutTree::onCurrentItemChanged( QTreeWidgetItem* cur, QTreeWidgetItem* prev )
+{
+  if ( prev && prev->text( 1 ).endsWith( "+" ) )
+      prev->setText( 1, myPrevBindings[ prev->parent()->text( 0 ) ][ prev->text( 0 ) ] );
+}
+
+/*!
+  \brief Set key bindings to the tree
+  \param title the name of top-level item
+  \param theShortcutMap map of key bindings
+*/
+void QtxShortcutTree::setBindings( const QString& title, const ShortcutMap& theShortcutMap )
+{
+  QTreeWidgetItem* item= new QTreeWidgetItem();
+  QFont font = item->font(0);
+  font.setBold(true);
+  
+  if ( findItems( title, Qt::MatchFixedString ).isEmpty()  ) {
+    item->setText( 0, title );
+    item->setFont( 0, font );
+    addTopLevelItem( item );
+    item->setFlags( Qt::ItemIsEnabled );
+  } else {
+    item = findItems( title, Qt::MatchFixedString ).first();
+    item->takeChildren();
+  }
+  for( ShortcutMap::const_iterator it = theShortcutMap.constBegin(); it != theShortcutMap.constEnd(); ++it )
+      item->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
+  myPrevBindings.insert( title, theShortcutMap);
+}
+
+/*!
+  \brief Get all sections names.
+  \return list of section names
+*/
+QStringList QtxShortcutTree::sections() const
+{
+  QStringList lst;
+  for( int i = 0; i < topLevelItemCount(); i++ )
+    lst << topLevelItem( i )->text( 0 ); 
+  return lst;
+}
+
+ShortcutMap* QtxShortcutTree::bindings( const QString& sec ) const
+{
+  ShortcutMap* aMap = new ShortcutMap();
+  QTreeWidgetItem* item = findItems( sec, Qt::MatchFixedString ).first();
+  int nbChildren = item->childCount();
+
+  for( int i = 0; i < nbChildren; i++ ) {
+    QTreeWidgetItem* child =  item->child(i);
+    aMap->insert( child->text( 0 ), child->text( 1 ) );
+  }
+
+  return aMap;
+}
+
+void QtxShortcutTree::focusOutEvent ( QFocusEvent* event )
+{
+  QWidget::focusOutEvent( event );
+  if ( currentItem() && currentItem()->isSelected() )
+    currentItem()->setText( 1, myPrevBindings[ currentItem()->parent()->text( 0 ) ][ currentItem()->text( 0 ) ] );
+}
+
+/*!
+  \brief Set the list of shortcuts general sections.
+  
+  Key combinations in general sections should not intersect
+  with any other key combinations.
+
+  \param sectionsList list of common section names
+*/
+void QtxShortcutTree::setGeneralSections( const QStringList& sectionsList )
+{
+  myGeneralSections = sectionsList;
+}
+
+/*!
+  \brief Check uniqueness of the shortcut.
+  \param item current item of the shortcut tree
+  \param shortcut shortcut appointed for the current item
+  \return \c true if the given shortcut is allowed
+*/
+bool QtxShortcutTree::checkUniqueness( QTreeWidgetItem* item, const QString& shortcut )
+{
+  // List of sections to check shortcut intersections
+  QStringList sectionsList;
+
+  // Current section
+  QString currentSection = currentItem()->parent()->text( 0 );
+
+  // If the current section is general 
+  if ( myGeneralSections.contains(currentSection) ) {
+    sectionsList = sections();
+    int currentSectionIndex = sectionsList.indexOf(currentSection);
+    sectionsList.move( currentSectionIndex, 0);
+  } 
+  else {
+    sectionsList = myGeneralSections;
+    sectionsList.prepend(currentSection);
+  }
+
+  // Iterate on sections
+  QStringList::const_iterator it;
+  for( it = sectionsList.constBegin(); it != sectionsList.constEnd(); ++it ) {
+    QString section = *it;
+
+    // Iterate on actual section
+    QTreeWidgetItem* sectionRoot = findItems( section, Qt::MatchFixedString ).first();
+    int nbChildren = sectionRoot->childCount();
+
+    for( int i = 0; i < nbChildren; i++ ) {
+      QTreeWidgetItem* child =  sectionRoot->child(i);
+      
+      if ( (child != item) && (shortcut == child->text( 1 )) ) {
+       bool res = QMessageBox::warning( parentWidget(), tr("Warning"), 
+                                        tr("The \"%1\" shortcut has already used by the \"%2\" action.\n")
+                                        .arg(shortcut, section + ":" + child->text( 0 ) ) +
+                                        tr("Do you want to reassign it from that action to the current one?"),
+                                        QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+       if (res) 
+         child->setText( 1, "" );
+       return res;     
+      }
+    }
+  }
+
+  return true;
+}
diff --git a/src/Qtx/QtxShortcutEdit.h b/src/Qtx/QtxShortcutEdit.h
new file mode 100755 (executable)
index 0000000..01791d7
--- /dev/null
@@ -0,0 +1,87 @@
+//  Copyright (C) 2007-2010  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,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  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 QTXSHORTCUTEDIT_H
+#define QTXSHORTCUTEDIT_H
+
+#include "Qtx.h"
+
+#include <QFrame>
+#include <QTreeWidget>
+
+class QLineEdit;
+class QPushButton;
+class QTreeWidgetItem;
+
+typedef QMap< QString, QString > ShortcutMap;
+
+class QTX_EXPORT QtxShortcutEdit : public QFrame
+{
+  Q_OBJECT
+
+public:
+  QtxShortcutEdit( QWidget* = 0 );
+  virtual ~QtxShortcutEdit();
+  void           setShortcut( const QKeySequence& );
+  QKeySequence   shortcut();
+  static QString parseEvent( QKeyEvent* );
+  static bool    isValidKey( int );
+
+
+private slots:
+  void           onCliked();
+  void           onEditingFinished();
+
+protected:
+  virtual bool   eventFilter( QObject*, QEvent* );
+
+private:
+  void           initialize();
+
+private:
+  QLineEdit*     myShortcut;
+  QString        myPrevShortcutText;
+};
+
+class QTX_EXPORT QtxShortcutTree : public QTreeWidget
+{
+  Q_OBJECT
+
+public:
+  QtxShortcutTree( QWidget * parent = 0 );
+  virtual ~QtxShortcutTree();
+  void                      setBindings( const QString&, const ShortcutMap& );
+  ShortcutMap*              bindings( const QString& ) const;
+  QStringList               sections() const;
+  void                      setGeneralSections( const QStringList& );
+
+protected:
+  virtual bool              eventFilter( QObject*, QEvent* );
+  virtual void              focusOutEvent( QFocusEvent* );
+  virtual bool              checkUniqueness( QTreeWidgetItem*, const QString& );
+
+private slots:
+  void                      onCurrentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* );
+
+private:
+  QMap< QString, ShortcutMap > myPrevBindings;
+  QStringList myGeneralSections;
+};
+
+#endif // QTXSHORTCUTEDIT_H
index d86270d85482f2ea6767119933ef340c9893265c..4370928386a93263852cf3c7ac2a4cc2854075ae 100644 (file)
@@ -124,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() );
   }
diff --git a/src/Qtx/resources/Qtx_msg_fr.ts b/src/Qtx/resources/Qtx_msg_fr.ts
new file mode 100644 (file)
index 0000000..5981c3c
--- /dev/null
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>QtxTreeView</name>
+    <message>
+        <source>Enable sorting</source>
+        <translation>Autoriser le tri</translation>
+    </message>
+</context>
+<context>
+    <name>QtxWorkspaceAction</name>
+    <message>
+        <source>Arranges the windows as overlapping tiles</source>
+        <translation>Ranger les fenêtres en les superposant</translation>
+    </message>
+    <message>
+        <source>Cascade</source>
+        <translation>Cascade</translation>
+    </message>
+    <message>
+        <source>Arranges the windows as nonoverlapping tiles</source>
+        <translation>Ranger les fenêtres sans les superposer</translation>
+    </message>
+    <message>
+        <source>Tile</source>
+        <translation>Mosaïque</translation>
+    </message>
+    <message>
+        <source>Arranges the windows as nonoverlapping horizontal tiles</source>
+        <translation>Ranger les fenêtres en mosaïque horizontale</translation>
+    </message>
+    <message>
+        <source>Tile horizontally</source>
+        <translation>Mosaïque horizontale</translation>
+    </message>
+    <message>
+        <source>Arranges the windows as nonoverlapping vertical tiles</source>
+        <translation>Ranger les fenêtres en mosaïque verticale</translation>
+    </message>
+    <message>
+        <source>Tile vertically</source>
+        <translation>Mosaïque verticale</translation>
+    </message>
+</context>
+<context>
+    <name>QtxMainWindow</name>
+    <message>
+        <source>Menu bar</source>
+        <translation>Barre de menu</translation>
+    </message>
+    <message>
+        <source>Status bar</source>
+        <translation>Barre de statut</translation>
+    </message>
+</context>
+<context>
+    <name>QtxPathDialog</name>
+    <message>
+        <source>Open file</source>
+        <translation>Ouvrir le fichier</translation>
+    </message>
+    <message>
+        <source>Save file</source>
+        <translation>Sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>File name</source>
+        <translation>Nom du fichier</translation>
+    </message>
+    <message>
+        <source>File name not specified</source>
+        <translation>Le nom du fichier n&apos;est pas indiqué</translation>
+    </message>
+    <message>
+        <source>File \&quot;%1\&quot; does not exist</source>
+        <translation>Le fichier \&quot;%1\&quot; n&apos;existe pas</translation>
+    </message>
+    <message>
+        <source>File \&quot;%1\&quot; already exist. Do you want to overwrite it?</source>
+        <translation>Le fichier \&quot;%1\&quot; existe déjà. Voulez-vous l&apos;écraser ?</translation>
+    </message>
+    <message>
+        <source>Directory \&quot;%1\&quot; does not exist</source>
+        <translation>Le répertoire \&quot;%1\&quot; n&apos;existe pas</translation>
+    </message>
+    <message>
+        <source>Directory \&quot;%1\&quot; can&apos;t be created because file with the same name exist</source>
+        <translation>Il est impossible de créer le répertoire \&quot;%1\&quot; parce qu&apos;un fichier avec ce nom existe déjà</translation>
+    </message>
+    <message>
+        <source>Directory \&quot;%1\&quot; not empty. Do you want to remove all files in this directory?</source>
+        <translation>Le répertoire \&quot;%1\&quot; n&apos;est pas vide. Voulez-vous supprimer tous les fichiers dans ce répertoire?</translation>
+    </message>
+    <message>
+        <source>File dialog</source>
+        <translation>Fenêtre de dialogue de fichiers</translation>
+    </message>
+    <message>
+        <source>All files (*.*)</source>
+        <translation>Tous les fichiers (*.*)</translation>
+    </message>
+</context>
+<context>
+    <name>QtxFontEdit</name>
+    <message>
+        <source>B</source>
+        <translatorcomment>Bold</translatorcomment>
+        <translation>G</translation>
+    </message>
+    <message>
+        <source>I</source>
+        <translatorcomment>Italic</translatorcomment>
+        <translation>I</translation>
+    </message>
+    <message>
+        <source>U</source>
+        <translatorcomment>Underline</translatorcomment>
+        <translation>S</translation>
+    </message>
+    <message>
+        <source>S</source>
+        <translatorcomment>Strikethrough</translatorcomment>
+        <translation>R</translation>
+    </message>
+</context>
+<context>
+    <name>QtxPathListEdit</name>
+    <message>
+        <source>Warning</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>Path \&quot;%1\&quot; doesn&apos;t exist. Add it to list anyway?</source>
+        <translation>Le chemin \&quot;%1\&quot; n&apos;existe pas. Faut-il l&apos;ajouter dans la liste?</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>Location \&quot;%1\&quot; doesn&apos;t point to file</source>
+        <translation>L&apos;emplacement \&quot;%1\&quot; ne pointe sur aucun fichier</translation>
+    </message>
+    <message>
+        <source>Location \&quot;%1\&quot; doesn&apos;t point to directory</source>
+        <translation>L&apos;emplacement \&quot;%1\&quot; ne pointe sur aucun répertoire</translation>
+    </message>
+    <message>
+        <source>Path \&quot;%1\&quot; already exist in the list</source>
+        <translation>Le chemin \&quot;%1\&quot; existe déjà dans la liste</translation>
+    </message>
+</context>
+<context>
+    <name>QtxMRUAction</name>
+    <message>
+        <source>Most Recently Used</source>
+        <translation>Récemment utilisés</translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation>Effacer</translation>
+    </message>
+    <message>
+        <source>&lt;Empty&gt;</source>
+        <translation>&lt;Vide&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>QtxDialog</name>
+    <message>
+        <source>&amp;OK</source>
+        <translation>&amp;OK</translation>
+    </message>
+    <message>
+        <source>&amp;Cancel</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <source>C&amp;lose</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+    <message>
+        <source>&amp;Help</source>
+        <translation>&amp;Aide</translation>
+    </message>
+    <message>
+        <source>&amp;Apply</source>
+        <translation>A&amp;ppliquer</translation>
+    </message>
+    <message>
+        <source>&amp;Yes</source>
+        <translation>&amp;Oui</translation>
+    </message>
+    <message>
+        <source>&amp;No</source>
+        <translation>&amp;Non</translation>
+    </message>
+</context>
+<context>
+    <name>QtxSearchTool</name>
+    <message>
+        <source>Case sensitive</source>
+        <translation>Sensible à la casse</translation>
+    </message>
+    <message>
+        <source>Regular expression</source>
+        <translation>Expression régulière</translation>
+    </message>
+    <message>
+        <source>Wrap search</source>
+        <translation>Terminer la recherche</translation>
+    </message>
+</context>
+<context>
+    <name>QtxSplash</name>
+    <message>
+        <source>Error</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>&amp;OK</source>
+        <translation>&amp;OK</translation>
+    </message>
+</context>
+<context>
+    <name>QtxWorkstack</name>
+    <message>
+        <source>Split vertically</source>
+        <translation>Diviser verticalement</translation>
+    </message>
+    <message>
+        <source>Split horizontally</source>
+        <translation>Diviser horisontalement</translation>
+    </message>
+    <message>
+        <source>Close</source>
+        <translation>Fermer</translation>
+    </message>
+    <message>
+        <source>Rename</source>
+        <translation>Renommer</translation>
+    </message>
+    <message>
+        <source>Enter new name:</source>
+        <translation>Indiquer un nouveau nom:</translation>
+    </message>
+</context>
+<context>
+    <name>QtxWorkstackAction</name>
+    <message>
+        <source>Split the active window on two vertical parts</source>
+        <translation>Diviser la fenêtre actuelle en deux parties verticales</translation>
+    </message>
+    <message>
+        <source>Split vertically</source>
+        <translation>Diviser verticalement</translation>
+    </message>
+    <message>
+        <source>Split the active window on two horizontal parts</source>
+        <translation>Diviser la fenêtre actuelle en deux parties horizontales</translation>
+    </message>
+    <message>
+        <source>Split horizontally</source>
+        <translation>Diviser horizontalement</translation>
+    </message>
+</context>
+<context>
+    <name>QtxColorButton</name>
+    <message>
+        <source>Auto</source>
+        <translation>Auto</translation>
+    </message>
+    <message>
+        <source>Other colors...</source>
+        <translation>Autres couleurs...</translation>
+    </message>
+</context>
+<context>
+    <name>QtxColorScale</name>
+    <message>
+        <source>Color scale</source>
+        <translation>Echelle de couleurs</translation>
+    </message>
+</context>
+</TS>
index a3ee2853c8d8567fd07a3d98bed08e3ec0b4f69b..d7366aee21d1c59316f938d5059ab105fcde9aa0 100755 (executable)
@@ -63,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 ddd193551c0b9ef92f7be4d23e9327488a30c64d..08f6833f9f87817567db907a969524f025d868c4 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_fr.ts b/src/QxGraph/resources/QxGraph_msg_fr.ts
new file mode 100755 (executable)
index 0000000..c03cdeb
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_CHANGE_BACKGROUND</source>
+        <translation>Changer l&apos;arrière-plan...</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de Visualisation</translation>
+    </message>
+</context>
+</TS>
index d877bf81e3fb78a81f0e41d5cbb7212993ae3c8b..72f9947c2e5cdac8430bfb852c1f9c79bbd60065 100755 (executable)
@@ -55,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 4ad001ec8020b8302272fbc50c8a57ee71945725..fe62d243d54c5c46262edf2324167dce42f59c7c 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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/QxSceneViewer_msg_fr.ts b/src/QxScene/resources/QxSceneViewer_msg_fr.ts
new file mode 100755 (executable)
index 0000000..a69b819
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_CHANGE_BACKGROUND</source>
+        <translation>Changer l&apos;arrière-plan</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+</context>
+<context>
+    <name>QxScene_ViewManager</name>
+    <message>
+        <source>QXSCENE_VIEW_TITLE</source>
+        <translation>QGraphics scène:%M - visualisateur:%V</translation>
+    </message>
+</context>
+</TS>
index 14bcf08bd1f45e187d10887ed6850266efc5793d..c89d9cc0b534f16aadd13318f955e1dcc038b687 100644 (file)
@@ -197,6 +197,15 @@ void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
   SALOME_PYQT_ModuleLight::onViewClosed( pview );
 }
 
+/*!
+  \brief Signal handler tryClose(SUIT_ViewWindow*) of a view
+  \param pview view user tries to close
+*/
+void SALOME_PYQT_Module::onViewTryClose( SUIT_ViewWindow* pview )
+{
+  SALOME_PYQT_ModuleLight::onViewTryClose( pview );
+}
+
 /*!
   \breif Process application preferences changing.
 
index 950f723ed01091bbbc5a6235780b1c6a5d25e219..f4a35eaeb6370311804891130fa224366ed87bac 100644 (file)
@@ -54,6 +54,7 @@ public slots:
   void                       onGUIEvent();
   void                       onActiveViewChanged( SUIT_ViewWindow* );
   void                       onViewClosed( SUIT_ViewWindow* );
+  void                       onViewTryClose( SUIT_ViewWindow* );
   void                       onViewCloned( SUIT_ViewWindow* );
 
 protected:
index 50861058ac3a4b190904f563c328decf56d32655..675ac783b9a56cbd3d12656e99d96eebcee27bd0 100644 (file)
@@ -862,7 +862,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
   // ... (the Python module is already imported)
   // ... finally call Python module's initialize() method
-  if ( PyObject_HasAttrString( myModule, "initialize" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"initialize" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"initialize", (char*)"" ) );
     if ( !res ) {
       PyErr_Print();
@@ -876,7 +876,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
   myWindowsMap.insert( LightApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
   myWindowsMap.insert( LightApp_Application::WT_LogWindow,     Qt::BottomDockWidgetArea );
 
-  if ( PyObject_HasAttrString( myModule , "windows" ) ) {
+  if ( PyObject_HasAttrString( myModule , (char*)"windows" ) ) {
     PyObjWrapper res1( PyObject_CallMethod( myModule, (char*)"windows", (char*)"" ) );
     if ( !res1 ) {
       PyErr_Print();
@@ -903,7 +903,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
 
   // get compatible view windows types from the Python module 
   // by calling views() method
-  if ( PyObject_HasAttrString( myModule , "views" ) ) {
+  if ( PyObject_HasAttrString( myModule , (char*)"views" ) ) {
     PyObjWrapper res2( PyObject_CallMethod( myModule, (char*)"views", (char*)"" ) );
     if ( !res2 ) {
       PyErr_Print();
@@ -966,7 +966,7 @@ void SALOME_PYQT_ModuleLight::activate( SUIT_Study* theStudy )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activate() method (for the new modules)
-  if ( PyObject_HasAttrString( myModule , "activate" ) ) {
+  if ( PyObject_HasAttrString( myModule , (char*)"activate" ) ) {
     PyObject* res1 = PyObject_CallMethod( myModule, (char*)"activate", (char*)"" );
     if ( !res1 || !PyBool_Check( res1 ) ) {
       PyErr_Print();
@@ -1039,7 +1039,7 @@ void SALOME_PYQT_ModuleLight::customize( SUIT_Study* theStudy )
 
   if ( IsCallOldMethods ) {
     // call Python module's setSettings() method (obsolete)
-    if ( PyObject_HasAttrString( myModule , "setSettings" ) ) {
+    if ( PyObject_HasAttrString( myModule , (char*)"setSettings" ) ) {
       PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setSettings", (char*)"" ) );
       if( !res ) {
         PyErr_Print();
@@ -1066,7 +1066,7 @@ void SALOME_PYQT_ModuleLight::deactivate( SUIT_Study* theStudy )
     return;
   }
   // then call Python module's deactivate() method
-  if ( PyObject_HasAttrString( myModule , "deactivate" ) ) {
+  if ( PyObject_HasAttrString( myModule , (char*)"deactivate" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"deactivate", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
@@ -1120,7 +1120,7 @@ void SALOME_PYQT_ModuleLight::studyChanged( SUIT_Study* theStudy )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activeStudyChanged() method
-  if ( PyObject_HasAttrString( myModule, "activeStudyChanged" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"activeStudyChanged" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"activeStudyChanged", (char*)"i", aStudyId ) );
     if( !res ) {
       PyErr_Print();
@@ -1154,7 +1154,7 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
 
   QString aContext( "" ), aObject( "" ), aParent( theContext );
 
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, "definePopup" ) ) {
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, (char*)"definePopup" ) ) {
     // call definePopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
     PyObjWrapper res( PyObject_CallMethod( myModule,
@@ -1189,7 +1189,7 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
 #endif
 
   // then call Python module's createPopupMenu() method (for new modules)
-  if ( PyObject_HasAttrString( myModule, "createPopupMenu" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"createPopupMenu" ) ) {
     PyObjWrapper res1( PyObject_CallMethod( myModule,
                                             (char*)"createPopupMenu",
                                             (char*)"Os",
@@ -1200,7 +1200,7 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
     }
   }
 
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, "customPopup" ) ) {
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, (char*)"customPopup" ) ) {
     // call customPopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
     PyObjWrapper res2( PyObject_CallMethod( myModule,
@@ -1233,7 +1233,7 @@ void SALOME_PYQT_ModuleLight::guiEvent( const int theId )
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString( myModule, "OnGUIEvent" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"OnGUIEvent" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"OnGUIEvent", (char*)"i", theId ) );
     if( !res ) {
       PyErr_Print();
@@ -1260,7 +1260,7 @@ void SALOME_PYQT_ModuleLight::initPreferences()
   // might be called during the module intialization process
   myInitModule = this;
 
-  if ( PyObject_HasAttrString( myModule, "createPreferences" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"createPreferences" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"createPreferences", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
@@ -1404,7 +1404,7 @@ void SALOME_PYQT_ModuleLight::setWorkSpace()
     PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) );
 #endif
     // ... and finally call Python module's setWorkspace() method (obsolete)
-    if ( PyObject_HasAttrString( myModule, "setWorkSpace" ) ) {
+    if ( PyObject_HasAttrString( myModule, (char*)"setWorkSpace" ) ) {
       PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setWorkSpace", (char*)"O", pyws.get() ) );
       if( !res ) {
         PyErr_Print();
@@ -1431,7 +1431,7 @@ void SALOME_PYQT_ModuleLight::prefChanged( const QString& section, const QString
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString( myModule, "preferenceChanged" ) ) {
+  if ( PyObject_HasAttrString( myModule, (char*)"preferenceChanged" ) ) {
     PyObjWrapper res( PyObject_CallMethod( myModule,
                                            (char*)"preferenceChanged", 
                                            (char*)"ss", 
@@ -1829,7 +1829,7 @@ void SALOME_PYQT_ModuleLight::activeViewChanged( const SUIT_ViewWindow* pview )
   
   connectView( pview );
 
-  if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) ) 
+  if ( PyObject_HasAttrString( myModule, (char*)"activeViewChanged" ) ) 
   {
     if ( !pview ) 
       return;   
@@ -1876,7 +1876,7 @@ void SALOME_PYQT_ModuleLight::viewCloned( const SUIT_ViewWindow* pview )
   if ( !myInterp || !myModule || !pview ) 
     return;  
 
-  if ( PyObject_HasAttrString( myModule, "viewCloned" ) ) 
+  if ( PyObject_HasAttrString( myModule, (char*)"viewCloned" ) ) 
   {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewCloned", (char*)"i", pview->getId() ) );
     if( !res )
@@ -1884,6 +1884,52 @@ void SALOME_PYQT_ModuleLight::viewCloned( const SUIT_ViewWindow* pview )
   }
 }
 
+/*!
+  \brief Signal handler tryClose(SUIT_ViewWindow*) of a view
+  \param pview view being closed
+*/
+void SALOME_PYQT_ModuleLight::onViewTryClose( SUIT_ViewWindow* pview )
+{
+  class ViewTryClose : public PyInterp_LockRequest
+  {
+  public:
+    ViewTryClose( PyInterp_Interp* _py_interp, SALOME_PYQT_ModuleLight* _obj, const SUIT_ViewWindow* _pview )
+      : PyInterp_LockRequest( _py_interp, 0, true ),
+        myObj(_obj),myView(_pview) {}
+
+  protected:
+    virtual void execute()
+    {
+      myObj->viewTryClose( myView );
+    }
+
+  private:
+    SALOME_PYQT_ModuleLight* myObj;
+    const SUIT_ViewWindow * myView;    
+  };
+
+  PyInterp_Dispatcher::Get()->Exec( new ViewTryClose( myInterp, this, pview ) );
+}
+
+/*!
+  \brief Processes the view closing attempt, calls Python module's viewTryClose() method
+  \param pview view user tries to close
+*/
+void SALOME_PYQT_ModuleLight::viewTryClose( const SUIT_ViewWindow* pview )
+{
+  if ( !myInterp || !myModule ) 
+    return;  
+
+  if ( PyObject_HasAttrString( myModule, (char*)"viewTryClose" ) ) 
+  {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewTryClose", (char*)"i", pview->getId() ) );
+    if ( !res )
+    {
+      PyErr_Print();
+    }
+  }
+}
+
 /*!
   \brief Signal handler closing(SUIT_ViewWindow*) of a view
   \param pview view being closed
@@ -1920,7 +1966,7 @@ void SALOME_PYQT_ModuleLight::viewClosed( const SUIT_ViewWindow* pview )
   if ( !myInterp || !myModule ) 
     return;  
 
-  if ( PyObject_HasAttrString( myModule, "viewClosed" ) ) 
+  if ( PyObject_HasAttrString( myModule, (char*)"viewClosed" ) ) 
   {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewClosed", (char*)"i", pview->getId() ) );
     if ( !res )
@@ -1941,9 +1987,13 @@ void SALOME_PYQT_ModuleLight::connectView( const SUIT_ViewWindow* pview )
       
   if ( viewMgr )
   {
+    disconnect( viewMgr, SIGNAL( tryCloseView( SUIT_ViewWindow* ) ),
+               this, SLOT( onViewTryClose( SUIT_ViewWindow* ) ) );
     disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
-               this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
+               this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
   
+    connect( viewMgr, SIGNAL( tryCloseView( SUIT_ViewWindow* ) ),
+            this, SLOT( onViewTryClose( SUIT_ViewWindow* ) ) );
     connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
              this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
   }
@@ -2388,7 +2438,7 @@ void SALOME_PYQT_ModuleLight::saveEvent(QStringList& theListOfFiles)
   if ( !myInterp || !myModule || (it == theListOfFiles.end()))
     return;
 
-  if ( PyObject_HasAttrString(myModule, "saveFiles") ) {
+  if ( PyObject_HasAttrString(myModule, (char*)"saveFiles") ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"saveFiles",
                                            (char*)"s", (*it).toLatin1().constData()));
     if( !res ) {
@@ -2470,7 +2520,7 @@ void SALOME_PYQT_ModuleLight::openEvent(QStringList theListOfFiles, bool &opened
 #else
   PyObjWrapper sipList( sipBuildResult( 0, "D", theList,  sipType_QStringList , NULL) );
 #endif
-  if ( PyObject_HasAttrString(myModule , "openFiles") ) {
+  if ( PyObject_HasAttrString(myModule , (char*)"openFiles") ) {
     PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"openFiles",
                                            (char*)"O", sipList.get()));
     if( !res || !PyBool_Check( res )) {
index 90fce396956d1d17c45ea190280b62724923e330..1fa012262cd67d37410db94702c241c5398d2f36 100644 (file)
@@ -158,12 +158,13 @@ public slots:
   void                       onGUIEvent();
 
   void                       onActiveViewChanged( SUIT_ViewWindow* );
+  void                       onViewTryClose( SUIT_ViewWindow* );
   void                       onViewClosed( SUIT_ViewWindow* );
   void                       onViewCloned( SUIT_ViewWindow* );
 
 protected:
   /* create data model */
-  virtual CAM_DataModel*          createDataModel();
+  virtual CAM_DataModel*     createDataModel();
 
 private:
   void                       init( CAM_Application* );
@@ -182,6 +183,7 @@ private:
   void                       setWorkSpace();
   
   void                       activeViewChanged( const SUIT_ViewWindow* );
+  void                       viewTryClose( const SUIT_ViewWindow* );
   void                       viewClosed( const SUIT_ViewWindow* );
   void                       viewCloned( const SUIT_ViewWindow* );
   void                       connectView( const SUIT_ViewWindow* );
index bfda59f2dd1e6386088370fd2949cc52f9215d86..f466eb9662967140f3b9e6f8f74b67b58cb36968 100644 (file)
@@ -2365,6 +2365,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
@@ -2483,6 +2522,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
index 0aaa9f395cb0772080c90bfa7e8cb4475cbf8dd0..885b708db24f60ed7caee549d5525758bbeba5d9 100644 (file)
@@ -230,10 +230,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 60bbb4f420ac7de3c64d4312399eea3548fea43f..229c82736250d03c224fedeae4a8c229a3201826 100644 (file)
@@ -317,9 +317,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/ ;
index 7c023b5772e78e7969d9d7ff5db147b8065c9c68..2e8d99fb405ef403e457606e0baa52028a512dcb 100755 (executable)
@@ -71,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 b6c4b838dd4f5fe521838490c3e811e5653de430..da25cadba10c4dcc6d0d712e843532d7dfed32da 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -409,7 +388,7 @@ Do you want to overwrite it?</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>
diff --git a/src/STD/resources/STD_msg_fr.ts b/src/STD/resources/STD_msg_fr.ts
new file mode 100755 (executable)
index 0000000..d4a11f3
--- /dev/null
@@ -0,0 +1,490 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>TOT_DESK_EDIT_CUT</source>
+        <translation>Couper</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_CUT</source>
+        <translation>Couper la sélection et la placer dans la presse-papier</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_CUT</source>
+        <translation>Co&amp;uper</translation>
+    </message>
+    <message>
+        <source>ERR_APP_NOAPP</source>
+        <translation>Pas d&apos;application</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW</source>
+        <translation>&amp;Fenêtre</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_EDIT_COPY</source>
+        <translation>Copier</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_CASCADE</source>
+        <translation>Cascade</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_COPY</source>
+        <translation>Copier la sélection dans le presse-papiers</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_CASCADE</source>
+        <translation>Ranger les fenêtres en cascade</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVEAS</source>
+        <translation>Enregistrer le document sous...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_COPY</source>
+        <translation>&amp;Copier</translation>
+    </message>
+    <message>
+        <source>MSG_CANT_SAVE</source>
+        <translation>Impossible de sauvegarder le fichier &quot;%1&quot;.</translation>
+    </message>
+    <message>
+        <source>INF_DESK_TOOLBAR_STANDARD</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>ALL_FILES</source>
+        <translation>Tous les fichiers (*.*)</translation>
+    </message>
+    <message>
+        <source>DESK_DEFAULTTITLE</source>
+        <translation>Qt Framework d&apos;Applications</translation>
+    </message>
+    <message>
+        <source>QUE_DESK_EXIT</source>
+        <translation>Voulez-vous vraiment quitter ?</translation>
+    </message>
+    <message>
+        <source>INF_INFO</source>
+        <translation>Information</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_UNKNOWNTYPE_OPEN</source>
+        <translation>Vous essayez d&apos;ouvrir un document de type inconnu
+( %1 )</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_UNKNOWNTYPE_SAVE</source>
+        <translation>Vous essayez de sauvegarder le document sous un type inconnu
+( %1 )</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_NEWWINDOW</source>
+        <translation>Créer une nouvelle fenêtre</translation>
+    </message>
+    <message>
+        <source>BUT_CANCEL</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_ABOUT</source>
+        <translation>&amp;A propos de...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_NEWWINDOW</source>
+        <translation>Créer une nouvelle fenêtre</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_STATUSBAR</source>
+        <translation>&amp;Barre de status</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_NEWWINDOW</source>
+        <translation>&amp;Nouvelle fenêtre</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_VIEW_STATUSBAR</source>
+        <translation>Activer ou désactiver la barre de status</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_DIRWITHNAMEEXIST_SAVE</source>
+        <translation>Impossible de sauvegarder le fichier %1.
+Un répertoire avec ce nom existe déjà sur le disque. Essayez d&apos;utiliser un autre nom</translation>
+    </message>
+    <message>
+        <source>BUT_NO</source>
+        <translation>N&amp;on</translation>
+    </message>
+    <message>
+        <source>BUT_OK</source>
+        <translation>O&amp;k</translation>
+    </message>
+    <message>
+        <source>FILTER_FILES</source>
+        <translation>Fichiers %1 (%2)</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_ACTIVATE</source>
+        <translation>Activer la fenêtre</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_PRINT</source>
+        <translation>Imprimer un document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_CLOSE</source>
+        <translation>Fermer le document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_NEW</source>
+        <translation>Créer un nouveau document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_NEW</source>
+        <translation>Crée un nouveau document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_MRU</source>
+        <translation>Ouvre un document</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_NEW</source>
+        <translation>&amp;Nouveau</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_MRU</source>
+        <translation>&amp;Fichiers récents</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_EDIT_PASTE</source>
+        <translation>Coller</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_DOCKWINDOWS</source>
+        <translation>Fenêtres</translation>
+    </message>
+    <message>
+        <source>BUT_YES</source>
+        <translation>O&amp;ui</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW</source>
+        <translation>&amp;Affichage</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_ABOUT</source>
+        <translation>Montre la boîte de dialogue &apos;A propos&apos;</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE</source>
+        <translation>Fic&amp;hier</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT</source>
+        <translation>&amp;Edition</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP</source>
+        <translation>A&amp;ide</translation>
+    </message>
+    <message>
+        <source>ERR_ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>ERR_DESK_NOAPP</source>
+        <translation>Pas d&apos;application enregistrée</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_CREATE</source>
+        <translation>Créer un nouveau document</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_ALREADYOPEN</source>
+        <translation>Le document %1 est déjà ouvert.
+Voulez-vous le réouvrir?</translation>
+    </message>
+    <message>
+        <source>BUT_APPLY</source>
+        <translation>A&amp;ppliquer</translation>
+    </message>
+    <message>
+        <source>BUT_CLOSE</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+    <message>
+        <source>INF_DESK_EXIT</source>
+        <translation>&amp;Quitter</translation>
+    </message>
+    <message>
+        <source>ERR_UNKNOWN</source>
+        <translation>Erreur inconnue</translation>
+    </message>
+    <message>
+        <source>BUT_HELP</source>
+        <translation>A&amp;ide</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_CLOSE</source>
+        <translation>Ferme le document actuel</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_PRINT</source>
+        <translation>Imprime le document actuel</translation>
+    </message>
+    <message>
+        <source>WRN_WARNING</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_HELP_ABOUT</source>
+        <translation>A propos...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_TOOLBARS</source>
+        <translation>Barres d&apos;&amp;outils</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_HSPLIT</source>
+        <translation>Diviser la fenêtre actuelle en deux parties horizontales</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_HSPLIT</source>
+        <translation>Séparation horizontale</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_EDIT_PASTE</source>
+        <translation>Insérer le contenu du presse-papiers au point d&apos;insertion</translation>
+    </message>
+    <message>
+        <source>DLG_LOAD_STUDY_CAPTION</source>
+        <translation>Ouvrir une étude</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_SEARCH</source>
+        <translation>Chercher de l&apos;information sur le sujet</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVEAS</source>
+        <translation>Sauvegarder le document actuel sous un nouveau nom</translation>
+    </message>
+    <message>
+        <source>INF_READY</source>
+        <translation>Prêt</translation>
+    </message>
+    <message>
+        <source>INF_CANCELLED</source>
+        <translation>Annulé</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VSPLIT</source>
+        <translation>Diviser la fenêtre actuelle en deux parties verticales</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VSPLIT</source>
+        <translation>Séparation verticale</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_TILE</source>
+        <translation>Ranger les fenêtres en mosaïque</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_CONTENTS</source>
+        <translation>&amp;Contenu</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_HELP_CONTENTS</source>
+        <translation>Afficher le sommaire de la référence documentaire</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_HTILE</source>
+        <translation>Mosaïque horizontale</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VTILE</source>
+        <translation>Mosaïque verticale</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_PERMISSIONDENIED_SAVE</source>
+        <translation>Impossible de sauvegarder le fichier %1. Autorisaton refusée.</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOCALREADYOPEN</source>
+        <translation>Impossible de sauvegarder le document sous le nom d&apos;un document déjà ouvert.
+Indiquez un autre nom pour le document que vous voulez sauvegarder.
+( %1 )</translation>
+    </message>
+    <message>
+        <source>TIT_FILE_SAVEAS</source>
+        <translation>Enregistrer sous</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_CLOSE</source>
+        <translation>Fer&amp;mer</translation>
+    </message>
+    <message>
+        <source>MSG_FILE_EXISTS</source>
+        <translation>Le fichier &quot;%1&quot; existe déjà.
+Voulez-vous l&apos;écraser ?</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_PRINT</source>
+        <translation>&amp;Imprimer</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_HELP_SEARCH</source>
+        <translation>&amp;Recherche...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_VIEW_STDTOOLBAR</source>
+        <translation>&amp;Standard</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVEAS</source>
+        <translation>Enre&amp;gistrer sous...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_VIEW_STDTOOLBAR</source>
+        <translation>Activer ou désactiver la barre standard</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVE</source>
+        <translation>Enregistrer le document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_EXIT</source>
+        <translation>Quitter l&apos;application</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_LOAD</source>
+        <translation>Charger le document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_OPEN</source>
+        <translation>Ouvrir un document</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_REOPEN</source>
+        <translation>Réouvrir un document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_EXIT</source>
+        <translation>Quitte l&apos;application</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_OPEN</source>
+        <translation>Ouvre un document existant</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_REOPEN</source>
+        <translation>Réouvrir le document actuel à partir d&apos;un fichier</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVE</source>
+        <translation>Sauvegarder le document actuel</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_LOAD</source>
+        <translation>Charge un document</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_HTILE</source>
+        <translation>Ranger les fenêtres en mosaïque horizontale</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VTILE</source>
+        <translation>Ranger les fenêtres en mosaïque verticale</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_TILE</source>
+        <translation>Mosaïque</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_EXIT</source>
+        <translation>&amp;Quitter</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_OPEN</source>
+        <translation>&amp;Ouvrir...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_REOPEN</source>
+        <translation>&amp;Réouvrir</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_LOAD</source>
+        <translation>Connec&amp;ter...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVE</source>
+        <translation>&amp;Enregistrer</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_EDIT_PASTE</source>
+        <translation>Co&amp;ller</translation>
+    </message>
+    <message>
+        <source>MEN_STUDIES_CHOICE</source>
+        <translation>Choisir une étude existante</translation>
+    </message>
+</context>
+<context>
+    <name>STD_Application</name>
+    <message>
+        <source>INF_DOC_MODIFIED</source>
+        <translation>Le document a été modifié.
+Voulez-vous sauvegarder les modifications?</translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVING</source>
+        <translation>Sauvegarde de l&apos;étude en cours</translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVED</source>
+        <translation>L&apos;étude %1 est sauvegardée</translation>
+    </message>
+    <message>
+        <source>TOT_DOCK_WINDOWS</source>
+        <translation>Montrer / cacher les fenêtres ancrables et les barres d&apos;outils</translation>
+    </message>
+    <message>
+        <source>MEN_DOCK_WINDOWS</source>
+        <translation>Fenêtres et Barres d&apos;outils</translation>
+    </message>
+    <message>
+        <source>ABOUT_INFO</source>
+        <translation>Application SUIT Std</translation>
+    </message>
+    <message>
+        <source>INF_DOC_SAVING_FAILS</source>
+        <translation>Impossible de sauvegarder le fichier &quot;%1&quot;.
+Il peut y avoir un problème de droit ou l&apos;espace disque restant est insuffisant.
+Essayez d&apos;utiliser un autre nom de fichier.</translation>
+    </message>
+    <message>
+        <source>INF_DOCUMENT_MODIFIED</source>
+        <translation>Le document &quot;%1&quot; a été modifié.
+Voulez-vous sauvegarder les changements?</translation>
+    </message>
+    <message>
+        <source>CLOSE_STUDY</source>
+        <translation>Fermer l&apos;étude actuelle</translation>
+    </message>
+    <message>
+        <source>CLOSE_QUESTION</source>
+        <translation>Voulez-vous sauvegarder l&apos;étude avant de la fermer?</translation>
+    </message>
+    <message>
+        <source>REOPEN_STUDY</source>
+        <translation>Réouvrir l&apos;étude</translation>
+    </message>
+    <message>
+        <source>REOPEN_QUESTION</source>
+        <translation>Voulez-vous vraiment réouvrir l&apos;étude?
+Toutes les modifications introduites après le dernier enregistrement seront perdues.</translation>
+    </message>
+</context>
+</TS>
index 1cf97028860a3e8fea1a60148fd69b30007aa5d9..9b1df08d98b3b95809944af406ae8d14577ef39e 100755 (executable)
@@ -61,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                  \
@@ -92,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              \
@@ -113,12 +115,14 @@ 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
 
 libsuit_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../ObjBrowser
 
index 7624b5c6a0c07e23f61d99b5c8929a4b79c0c7e5..e7129b5e867f954c1fa8d4e253ba8e052ab70e82 100755 (executable)
@@ -26,6 +26,7 @@
 #include "SUIT_Session.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
+#include "SUIT_ShortcutMgr.h"
 
 #include <QTimer>
 #include <QLabel>
@@ -37,6 +38,7 @@
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
+
 /*!
   \class StatusLabel
   \brief Status bar customization label. Used to workaroubd desktop resizing bug.
@@ -123,6 +125,9 @@ void SUIT_Application::start()
 {
   if ( desktop() )
     desktop()->show();
+
+  // Initialize shortcut manager
+  SUIT_ShortcutMgr::Init();
 }
 
 /*!
@@ -174,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
 
 /*!
@@ -612,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 )
index e04cee4f587aa52f3d28b6f5fd4675321b1441ef..3773977fc21bac50c2d74a0d53126d262199e5bf 100755 (executable)
@@ -37,6 +37,7 @@ class QWidget;
 class SUIT_Desktop;
 class SUIT_ViewModel;
 class SUIT_ResourceMgr;
+class SUIT_ShortcutMgr;
 class SUIT_Study;
 
 #ifdef WIN32
@@ -97,6 +98,8 @@ public:
 
   SUIT_ResourceMgr*     resourceMgr() const;
 
+  SUIT_ShortcutMgr*     shortcutMgr() const;
+
   //! Puts the message to the status bar  
   void putInfo ( const QString&, const int = 0 );
 
@@ -164,7 +167,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();
@@ -173,6 +177,7 @@ private:
   SUIT_Study*           myStudy;
   SUIT_Desktop*         myDesktop;
   QMap<int, QAction*>   myActionMap;
+  SUIT_ShortcutMgr*     myShortcutMgr;
 
   QLabel*               myStatusLabel;
 };
index 0263b413d7846c982d6fd2583bf946621b34faea..17be325607bd6cc5b1882d567762641f7b2ea9a5 100644 (file)
@@ -151,6 +151,12 @@ 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 UserDefined:
     item = new QtxUserDefinedItem(parent);
     break;
index be99b1dc608b5835cafade85bcc6822574a5c685..4a1d0a8ee1a3d8a7d8e6a4f66a2b16215d044c37 100644 (file)
@@ -37,7 +37,7 @@ 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, Slider, 
+                 GroupBox, Tab, Frame, Font, DirList, File, Slider, Shortcut, ShortcutTree, 
                  UserDefined = 1000 } PrefItemType;
 
 public:
diff --git a/src/SUIT/SUIT_ShortcutMgr.cxx b/src/SUIT/SUIT_ShortcutMgr.cxx
new file mode 100644 (file)
index 0000000..44eb8a9
--- /dev/null
@@ -0,0 +1,187 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "SUIT_ShortcutMgr.h"
+
+#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
+
+#include <QtxAction.h>
+
+#include <QApplication>
+#include <QActionEvent>
+
+SUIT_ShortcutMgr* SUIT_ShortcutMgr::myShortcutMgr = NULL;
+
+/*!
+  \brief Constructor
+*/
+SUIT_ShortcutMgr::SUIT_ShortcutMgr()
+: QObject()
+{
+  qApp->installEventFilter( this );
+}
+
+/*!
+  \brief Destructor
+*/
+SUIT_ShortcutMgr::~SUIT_ShortcutMgr()
+{
+  qApp->removeEventFilter( this );
+}
+
+/*!
+  \brief Create new instance of shortcut manager.
+*/
+void SUIT_ShortcutMgr::Init()
+{
+  if( myShortcutMgr==NULL )
+    myShortcutMgr = new SUIT_ShortcutMgr();
+}
+
+/*!
+  \brief Return shortcut manager. 
+*/
+SUIT_ShortcutMgr* SUIT_ShortcutMgr::getShortcutMgr()
+{
+  Init();
+  
+  return myShortcutMgr;
+}
+
+/*!
+  \brief Custom event filter for qapplication .
+  
+  Redefined from QObject::eventFilter();
+*/
+bool SUIT_ShortcutMgr::eventFilter( QObject* o, QEvent* e )
+{
+  if ( e->type() == QEvent::ActionAdded ) {
+    QActionEvent* anActionEvent = (QActionEvent*)e;
+    if (anActionEvent) {
+      QtxAction* anAction = qobject_cast<QtxAction*>( anActionEvent->action() );
+      if ( anAction )
+       processAction( anAction );
+    }
+  }
+
+  return QObject::eventFilter( o, e );
+}
+
+/*!
+  \brief Return key sequence for shortcut action name.
+  \param actionName name of shortcut action in preferences
+  \return key sequence defined in preferences or empty sequence
+*/
+QKeySequence SUIT_ShortcutMgr::getShortcutByActionName( const QString& actionName ) const
+{
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+  QString section = actionName.section( resMgr->sectionsToken(), 0, 0 );
+  section.prepend( QString("shortcuts") + resMgr->sectionsToken() );
+  QString parameter = actionName.section( resMgr->sectionsToken(), 1, 1 );
+
+  QString shortcutValue;
+  bool hasValue = resMgr->value( section, parameter, shortcutValue, false );
+
+  if ( !hasValue )
+    return QKeySequence();
+
+  return QKeySequence::fromString( shortcutValue );
+}
+
+/*!
+  \brief Set shortcut to the given action if the shortcut is defined.
+  \param action action to process
+ */
+void SUIT_ShortcutMgr::processAction( QtxAction* action )
+{
+  QString shortcutActionName = action->shortcutActionName();
+  if ( !shortcutActionName.isEmpty() ) {
+    // Add action to the actions map
+    if ( !myShortcutActions.contains( shortcutActionName, action ) ) {
+      myShortcutActions.insert( shortcutActionName, action );
+      connect( action, SIGNAL( destroyed( QObject* ) ), 
+              this, SLOT ( onActionDestroyed( QObject* ) ) );
+    }
+
+    QKeySequence keySeq = getShortcutByActionName( shortcutActionName );
+    action->setShortcut( keySeq );
+  }
+}
+
+/*!
+  \brief Enable/disable a shortcuts section.
+
+  Enables or disables actions which belong to the given shortcuts section.
+  Only actions which have an active desktop as a parent widget 
+  are taken into account.
+
+  \param section shorcuts section
+  \param on if \c true - action will be enabled, otherwise - disabled
+*/
+void SUIT_ShortcutMgr::setSectionEnabled( const QString& section, const bool on )
+{
+  QMap<QString, QtxAction*>::ConstIterator it;
+  for ( it = myShortcutActions.constBegin(); it != myShortcutActions.constEnd(); ++it ) {
+    QtxAction* action = it.value();
+    QString shortcutActionName = action->shortcutActionName();
+    QString actionSection = shortcutActionName.section( ":", 0, 0 );
+    if ( actionSection == section ) {
+      // Check if the action parent widget equals to the active desktop
+      SUIT_Application* app = SUIT_Session::session()->activeApplication();
+      if ( !app )
+       return;
+      if ( action->parentWidget() == (QWidget*)app->desktop() )
+       action->setEnabled( on );
+    }
+  }
+}
+
+/*!
+  \brief Update shortcuts from preferences.
+*/
+void SUIT_ShortcutMgr::updateShortcuts()
+{
+  QMap<QString, QtxAction*>::ConstIterator it;
+  for ( it = myShortcutActions.constBegin(); it != myShortcutActions.constEnd(); ++it ) {
+    QtxAction* action = it.value();
+    QKeySequence keySeq = getShortcutByActionName( action->shortcutActionName() );
+    action->setShortcut( keySeq );
+  }
+}
+
+/*!
+  \brief Called when the corresponding action is destroyed.
+  
+  Removes destroyed action from the actions list.
+
+  \param obj action being destroyed
+*/
+void SUIT_ShortcutMgr::onActionDestroyed( QObject* obj )
+{
+  QtxAction* anAction = (QtxAction*)obj;
+  
+  if ( anAction )
+    myShortcutActions.remove( anAction->shortcutActionName(), anAction );
+}
diff --git a/src/SUIT/SUIT_ShortcutMgr.h b/src/SUIT/SUIT_ShortcutMgr.h
new file mode 100644 (file)
index 0000000..eafd854
--- /dev/null
@@ -0,0 +1,75 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 SUIT_SHORTCUTMGR_H
+#define SUIT_SHORTCUTMGR_H
+
+#include "SUIT.h"
+
+#include <QObject>
+#include <QMultiMap>
+
+class QtxAction;
+
+class QKeySequence;
+
+#if defined WIN32
+#pragma warning( disable: 4251 )
+#endif
+
+/*!
+  \class SUIT_ShortcutMgr
+  \brief Class which manages shortcuts customization.
+*/
+class SUIT_EXPORT SUIT_ShortcutMgr: public QObject 
+{
+  Q_OBJECT
+public:
+  static void Init();
+  static SUIT_ShortcutMgr* getShortcutMgr();
+
+  void setSectionEnabled( const QString&, const bool = true );
+  void updateShortcuts();
+
+protected:
+  SUIT_ShortcutMgr();
+  virtual ~SUIT_ShortcutMgr();
+
+private slots:
+  void onActionDestroyed( QObject* );
+
+private:
+  virtual bool eventFilter( QObject* o, QEvent* e );
+
+  void processAction( QtxAction* );
+  QKeySequence getShortcutByActionName( const QString& ) const;
+
+private:
+  static SUIT_ShortcutMgr* myShortcutMgr;
+  QMultiMap<QString, QtxAction*> myShortcutActions;
+};
+
+#if defined WIN32
+#pragma warning( default: 4251 )
+#endif
+
+#endif
index 212702c5fabc301bd74c6e3dac37f7afcbf04ef8..1e55aecef99c4849abfa6fe2a640b1e73897c159 100755 (executable)
@@ -46,9 +46,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;
@@ -209,6 +209,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*)));
 
@@ -261,6 +264,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 a011b11fb2a869fc4f2781e732a82ed61a69f268..07c8ca8bf5bc1bcf1aa662ec1daf817229f07276 100755 (executable)
@@ -89,6 +89,7 @@ public slots:
 
 signals:
   void             lastViewClosed(SUIT_ViewManager*);
+  void             tryCloseView(SUIT_ViewWindow*);
   void             deleteView(SUIT_ViewWindow*);
   void             viewCreated(SUIT_ViewWindow*);
   void             mousePress(SUIT_ViewWindow*, QMouseEvent*);
index 9d41d22d347e786e1f2b90b852f5e37097576d71..bd081febd8515f67012a84c63579b5910590d44d 100755 (executable)
@@ -119,6 +119,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 );
 }
 
@@ -135,7 +136,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.
@@ -185,11 +187,12 @@ bool SUIT_ViewWindow::event( QEvent* e )
       if ( !fileName.isEmpty() )
       {
         QImage im = dumpView();
-        QString fmt = SUIT_Tools::extension( fileName ).toUpper();
-        bOk = dumpViewToFormat( im, fileName, fmt );
+       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" ) );
@@ -213,10 +216,25 @@ 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 )
+{
+  setProperty( "closable", on );
+}
+
 /*!
   \return string containing visual parameters of window
 */
-QString   SUIT_ViewWindow::getVisualParameters()
+QString SUIT_ViewWindow::getVisualParameters()
 {
   return "empty";
 }
index 7043c8497e18d3538bb08545d2b41b0c9c92fa40..7b044053fd2ce3ed863108026ca36605ecfc4243 100755 (executable)
@@ -53,6 +53,9 @@ public:
 
   bool              onAccelAction( int );
 
+  bool              closable() const;
+  bool              setClosable( const bool );
+
   virtual QString   getVisualParameters();
   virtual void      setVisualParameters( const QString& parameters );
 
@@ -70,6 +73,7 @@ public slots:
   virtual void      onDumpView();
 
 signals:
+  void              tryClosing( SUIT_ViewWindow* );
   void              closing( SUIT_ViewWindow* );
   void              mousePressed( SUIT_ViewWindow*, QMouseEvent* );
   void              mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
@@ -95,4 +99,4 @@ private:
   QMap<QString, QVariant> myCustomData;
 };
 
-#endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
+#endif // SUIT_VIEWWINDOW_H
index d477c7f9cb2c6b27d22533f8723ac36764aa48b1..c1435da5bad404f50a62202a39d585a34dc45712 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -99,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>
diff --git a/src/SUIT/resources/SUIT_msg_fr.ts b/src/SUIT/resources/SUIT_msg_fr.ts
new file mode 100755 (executable)
index 0000000..345b255
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MEN_DESK_WINDOW</source>
+        <translation>&amp;Fenêtre</translation>
+    </message>
+    <message>
+        <source>ERR_CANT_DUMP_VIEW</source>
+        <translation>Impossible de sauvegarder le contenu de la vue dans le fichier.</translation>
+    </message>
+    <message>
+        <source>TLT_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_CASCADE</source>
+        <translation>&amp;Cascade</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_CASCADE</source>
+        <translation>Superpose les fenêtres</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_NOT_EXIST</source>
+        <translation>Le répertoire &quot;%1&quot; n&apos;existe pas !</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_DIR</source>
+        <translation>&quot;%1&quot; n&apos;est pas un répertoire !</translation>
+    </message>
+    <message>
+        <source>CONTINUE</source>
+        <translation>Continuer</translation>
+    </message>
+    <message>
+        <source>CANCEL</source>
+        <translation>Annuler</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_EXIST</source>
+        <translation>Le fichier &quot;%1&quot; n&apos;existe pas !</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_FILEEXISTS</source>
+        <translation>Le fichier %1 existe déjà.
+Voulez-vous l&apos;écraser ?</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_ACTIVATE</source>
+        <translation>Active la fenêtre</translation>
+    </message>
+    <message>
+        <source>ERR_PERMISSION_DENIED</source>
+        <translation>Impossible de sauvegarder le fichier &quot;%1&quot;.
+Autorisation interdite.</translation>
+    </message>
+    <message>
+        <source>ERR_OPEN_PERMISSION_DENIED</source>
+        <translation>Impossible d&apos;ouvrir le fichier &quot;%1&quot;.
+Autorisation interdite.</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_READ_PERMISSION_DENIED</source>
+        <translation>Impossible de lire le répertoire &quot;%1&quot;.
+Autorisation interdite.</translation>
+    </message>
+    <message>
+        <source>ERR_DIR_WRITE_PERMISSION_DENIED</source>
+        <translation>Impossible d&apos;écrire dans le répertoire &quot;%1&quot;.
+Autorisation interdite.</translation>
+    </message>
+    <message>
+        <source>ERR_ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>QUE_FILE_EXISTS</source>
+        <translation>Le fichier %1 existe déjà.
+Voulez-vous l&apos;écraser ?</translation>
+    </message>
+    <message>
+        <source>WRN_WARNING</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>TLT_DUMP_VIEW</source>
+        <translation>Enregistrer la vue dans le fichier</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_TILE</source>
+        <translation>Place les fenêtres en mosaïque</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_VTILE</source>
+        <translation>Mosaïque &amp;verticale</translation>
+    </message>
+    <message>
+        <source>INF_DIRECTORIES_FILTER</source>
+        <translation>Répertoires</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_WINDOW_VTILE</source>
+        <translation>Place les fenêtres en mosaïque verticale</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_WINDOW_TILE</source>
+        <translation>&amp;Mosaïque</translation>
+    </message>
+    <message>
+        <source>NAME_COLUMN</source>
+        <translation>Nom</translation>
+    </message>
+</context>
+<context>
+    <name>SUIT_Study</name>
+    <message>
+        <source>OPERATION_LAUNCH</source>
+        <translation>Lancer l&apos;opération</translation>
+    </message>
+    <message>
+        <source>PREVIOUS_NOT_FINISHED</source>
+        <translation>L&apos;opération précédente n&apos;est pas aboutie et sera interrompue</translation>
+    </message>
+</context>
+<context>
+    <name>SUIT_FileDlg</name>
+    <message>
+        <source>LAB_QUICK_PATH</source>
+        <translation>Emplacement :</translation>
+    </message>
+    <message>
+        <source>BUT_ADD_PATH</source>
+        <translation>Ajouter un chemin</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_OPEN</source>
+        <translation>Ouvrir un fichier</translation>
+    </message>
+    <message>
+        <source>INF_DESK_DOC_SAVE</source>
+        <translation>Sauvegarder un fichier</translation>
+    </message>
+    <message>
+        <source>ALL_FILES_FILTER</source>
+        <translation>Tous les fichiers (*)</translation>
+    </message>
+</context>
+</TS>
index cd3632cb1d8aeebbf76f4510d7adf0bd4391a0ad..f92b88e22251070c46f0f4635f413b15a0028533 100644 (file)
@@ -46,7 +46,7 @@ MOC_FILES =                           \
 
 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
index 989542ba449359d09108b016735079bd946d53ff..9668c4e185f1f9e3d63fd20f27173205566d84f6 100644 (file)
@@ -248,7 +248,7 @@ int main( int argc, char* argv[] )
     {
       if ( resMgr )
       {
-        resMgr->loadLanguage( false );
+        resMgr->loadLanguage();
 
         splash = QtxSplash::splash( QPixmap() );
         splash->readSettings( resMgr );
index 23ba569c8d0a17ee024afda48003d0aaad13144e..b67d2ec370bcaad2bee5d422b3a74f7be22013f0 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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/SUITApp/resources/SUITApp_msg_fr.ts b/src/SUITApp/resources/SUITApp_msg_fr.ts
new file mode 100755 (executable)
index 0000000..92f8f53
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>APP_OK</source>
+        <translation>Ok</translation>
+    </message>
+    <message>
+        <source>APP_ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>APP_UNK_EXCEPTION</source>
+        <translation>Exception inconnue</translation>
+    </message>
+</context>
+</TS>
index f33bbbbcd19daa0d11baa0618d078c30700e4b3a..35e26250008cf85c90095b05f25cea58c6e3303d 100755 (executable)
@@ -49,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 922fe3dcdf7be72a4860778ca04aeffa05a27138..6a21a259ebf8ac397d613a61b9e0d38d59d0479b 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_fr.ts b/src/SUPERVGraph/resources/SUPERVGraph_msg_fr.ts
new file mode 100755 (executable)
index 0000000..27458b7
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacement de la vue</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+</context>
+</TS>
index 1b078781e538fc0f3cf8281419ab29c194681d28..232e9ef8354ae17caf9e5ca925764cabbdc1a120 100755 (executable)
@@ -36,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 \
@@ -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 \
@@ -93,7 +91,11 @@ dist_libSVTK_la_SOURCES= \
        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
@@ -106,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 \
@@ -127,6 +128,7 @@ 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 \
@@ -134,6 +136,7 @@ dist_salomeres_DATA=\
 
 nodist_salomeres_DATA =        \
        SVTK_msg_en.qm  \
+       SVTK_msg_fr.qm  \
        SVTK_images.qm
 
 libSVTK_la_CPPFLAGS =          \
@@ -143,6 +146,7 @@ libSVTK_la_CPPFLAGS =               \
        $(BOOST_CPPFLAGS)       \
        -I$(srcdir)/../Qtx      \
        -I$(srcdir)/../SUIT     \
+       -I$(srcdir)/../ViewerTools \
        -I$(srcdir)/../OBJECT   \
        -I$(srcdir)/../Prs      \
        -I$(srcdir)/../VTKViewer \
@@ -155,9 +159,10 @@ libSVTK_la_LDFLAGS =                       \
        $(KERNEL_LDFLAGS)
 
 
-libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
-                   ../Prs/libSalomePrs.la ../VTKViewer/libVTKViewer.la \
-                   ../OpenGLUtils/libOpenGLUtils.la -lSALOMELocalTrace
+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
 
 # Executable
 bin_PROGRAMS = SVTK
index 942e9af6222a50c1ff00d66326ea568b38b6e5d7..b979f550883ff3f7fdcb9a145b86db57fb05935c 100644 (file)
 #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;
@@ -293,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;
@@ -378,86 +226,28 @@ bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
 SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction,
                                    SVTK_ViewWindow* theParent,
                                    const char* theName):
-  SVTK_DialogBase(theAction,
-                  theParent, 
-                  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
-*/
-QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent)
-{
-  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
+  Destructor
 */
-QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent)
+SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
 {
-  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
+  Create axis widget
 */
-SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
+ViewerTools_AxisWidgetBase* SVTK_CubeAxesDlg::createAxisWidget( QWidget* theParent )
 {
+  SVTK_AxisWidget* anAxisWidget = new SVTK_AxisWidget( theParent );
+  anAxisWidget->initialize();
+  return anAxisWidget;
 }
 
 /*!
@@ -465,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
   {
@@ -495,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
@@ -520,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 6d615b8c6646c586b0ae54c98f1a5e5516832b33..57efc3b027cd03269dc66dc598b046ddd832e93f 100644 (file)
 #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);
   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 b8e3b28a8a5fe02e82ffa1d047bfffb944060829..fdbb838ba70d9c98f569619b0fcc0b8114e35850 100644 (file)
 //
 #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() ) );
 }
 
 /*!
@@ -77,32 +51,24 @@ SVTK_FontWidget::~SVTK_FontWidget()
 {
 }
 
-void SVTK_FontWidget::SetColor( const QColor& theColor )
-{
-  QPalette palette;
-  palette.setColor(myColorBtn->backgroundRole(), theColor);
-  myColorBtn->setPalette(palette);
-}
-
-QColor SVTK_FontWidget::GetColor() const
+void SVTK_FontWidget::InitializeFamilies()
 {
-  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 );
@@ -110,10 +76,6 @@ 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,
@@ -122,17 +84,17 @@ void SVTK_FontWidget::GetData( QColor& theColor,
                                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 6150dfe5ff82d94ba1f62ca8632d2acdbe31a165..dde1e4be7686e07b727911339a4c3da6d06b76f9 100644 (file)
 
 #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
 
@@ -49,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 b9cd1aec049192d1333e833e98d0e8a6dc6c7d9d..ec679bdcb1e093efaa15bdffd82f80ea3e019eee 100644 (file)
@@ -93,7 +93,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();
 
@@ -289,8 +290,22 @@ 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(); 
index db3b76cd58a8b635d02c90ba4c7ffdf569369702..4eac463ce4c7e77e0f6844cf30bb31b8df89b27d 100644 (file)
@@ -127,6 +127,7 @@ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{
 };
 
 class vtkPointPicker;
+class vtkTDxInteractorStyle;
 
 class SALOME_Actor;
 
@@ -228,6 +229,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();
@@ -350,6 +354,8 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
   bool                            myBBFirstCheck;
 
   QRubberBand*                    myRectBand; //!< selection rectangle rubber band
+
+  bool                            myIsAdvancedZoomingEnabled;
 };
 
 #ifdef WIN32
index a1c5c6da081c194fd6c976567668c847a9a46673..ac35cdc10c2504f00bca4497c7dfd4f4e82146c6 100644 (file)
@@ -47,9 +47,9 @@ SVTK_NonIsometricDlg
 ::SVTK_NonIsometricDlg(QtxAction* theAction,
                        SVTK_ViewWindow* theParent,
                        const char* theName):
-  SVTK_DialogBase(theAction,
-                  theParent, 
-                  theName),
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   m_MainWindow(theParent)
 {
   setWindowTitle(tr("DLG_TITLE"));
index 1e2573d1d44b04a6f39976040af7fb81710c08bd..dced659d9a365fd5e5263b7916821002f41bc5b3 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef SVTK_NONISOMETRICDLG_H
 #define SVTK_NONISOMETRICDLG_H
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 class SVTK_ViewWindow;
 
@@ -39,7 +39,7 @@ class QtxAction;
 class QPushButton;
 
 
-class SVTK_NonIsometricDlg : public SVTK_DialogBase
+class SVTK_NonIsometricDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
index 28ac37ec72fc945dd4c151fe1700843f3c60077e..eec869920d60730b97a269df7babbfb4e997c327 100755 (executable)
@@ -55,9 +55,9 @@ SVTK_SetRotationPointDlg
 ::SVTK_SetRotationPointDlg(QtxAction* theAction,
                            SVTK_ViewWindow* theParent,
                            const char* theName):
-  SVTK_DialogBase(theAction,
-                  theParent, 
-                  theName),
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   myMainWindow(theParent),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
index e87335e3f09a5bff874422de7250a0ff4487345c..ed807b66c921ebd8b7cee87331a3b18bfa6f28b6 100755 (executable)
@@ -31,7 +31,7 @@
 
 #include "SVTK.h"
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 
@@ -48,7 +48,7 @@ class QCheckBox;
 class vtkCallbackCommand;
 class vtkObject;
 
-class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
index 373471ffe17651c71521a671ecd78c2e7e2aa713..d73408be73f40f4875023d9103ab188705ba1a32 100644 (file)
@@ -169,9 +169,9 @@ SVTK_UpdateRateDlg
 ::SVTK_UpdateRateDlg(QtxAction* theAction,
                      SVTK_ViewWindow* theParent,
                      const char* theName):
-  SVTK_DialogBase(theAction,
-                  theParent, 
-                  theName),
+  ViewerTools_DialogBase(theAction,
+                         theParent, 
+                         theName),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
   myRWInteractor(theParent->GetInteractor()),
index 045c2d35aa56d7bfd9c2a336cacdcea6d80cea88..61ec0a622f0a50e518bf9723381d634402496276 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef SVTK_UPDATERATEDLG_H
 #define SVTK_UPDATERATEDLG_H
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 
@@ -46,7 +46,7 @@ class vtkCallbackCommand;
 class vtkObject;
 
 
-class SVTK_UpdateRateDlg : public SVTK_DialogBase
+class SVTK_UpdateRateDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
index c34ce6ac7a6261ea9f62a27533acf67da4ed3a12..58d4e47d86df71669c2c964cad2d23c3aa8d01af 100644 (file)
@@ -75,10 +75,12 @@ SVTK_Viewer::SVTK_Viewer()
 {
   myTrihedronSize = 105;
   myTrihedronRelative = true;
+  myIsStaticTrihedronVisible = true;
   myIncrementSpeed = 10;
   myIncrementMode = 0;
   myProjMode = 0;
   myStyle = 0;
+  myZoomingStyle = 0;
   mySpaceBtn[0] = 1;
   mySpaceBtn[1] = 2;
   mySpaceBtn[2] = 9;
@@ -130,8 +132,10 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
 
   aViewWindow->setBackgroundColor( backgroundColor() );
   aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
+  aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
   aViewWindow->SetProjectionMode( projectionMode() );
   aViewWindow->SetInteractionStyle( interactionStyle() );
+  aViewWindow->SetZoomingStyle( zoomingStyle() );
   aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
   aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
 
@@ -179,6 +183,31 @@ void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bo
   }
 }
 
+/*!
+  \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
@@ -235,6 +264,32 @@ void SVTK_Viewer::setInteractionStyle( const int 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 incremental speed value
 */
index f6a717a0aa2eda6a5462ac0e9ba729a5e90ec00c..5e038d2c79d3f92d4531c729ed71044b243c6b7a 100644 (file)
@@ -78,6 +78,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;
 
@@ -90,6 +96,12 @@ public:
   //! Sets interaction style
   void setInteractionStyle( const int );
 
+  //! Gets zooming style
+  int zoomingStyle() const;
+
+  //! Sets zooming style
+  void setZoomingStyle( const int );
+
   //! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
   int incrementalSpeed() const;
 
@@ -162,12 +174,14 @@ private:
   QColor myBgColor;
   vtkFloatingPointType myTrihedronSize;
   bool   myTrihedronRelative;
+  bool   myIsStaticTrihedronVisible;
   bool   mySelectionEnabled;
   bool   myMultiSelectionEnabled;
   int    myIncrementSpeed;
   int    myIncrementMode;
   int    myProjMode;
   int    myStyle;
+  int    myZoomingStyle;
   int    mySpaceBtn[3];
 };
 
index 600250b4d16a2722651f04fe2feab9e0d04034a8..b4400f55854185e0ee182ef5bb19ac318427e7e8 100755 (executable)
@@ -56,7 +56,7 @@ using namespace std;
 SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction,
                                              SVTK_ViewWindow* theParent,
                                              const char* theName):
-  SVTK_DialogBase(theAction, theParent, theName),
+  ViewerTools_DialogBase(theAction, theParent, theName),
   myMainWindow(theParent),
   myPriority(0.0),
   myEventCallbackCommand(vtkCallbackCommand::New()),
index b987700639b5a820c29fb027656d44453fd7e97e..acef99e54f8ef12efd7266aef095db12f02d3f8f 100755 (executable)
@@ -28,7 +28,7 @@
 
 #include "SVTK.h"
 
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
 
 #include <vtkSmartPointer.h>
 #include <vtkTimeStamp.h>
@@ -47,7 +47,7 @@ class QButtonGroup;
 class vtkCallbackCommand;
 class vtkObject;
 
-class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
 {
   Q_OBJECT;
 
index d88d66d8b55dccf6ba1d0f9392967d1018b8c529..a0118be865f5ac2373de72d6313b144dd8746e9d 100755 (executable)
@@ -44,6 +44,7 @@
 #include <vtkAxisActor2D.h>
 #include <vtkGL2PSExporter.h>
 #include <vtkInteractorStyle.h>
+#include <vtkProperty.h>
 
 #include "QtxAction.h"
 
@@ -78,6 +79,9 @@
 #include "SVTK_Recorder.h"
 #include "SVTK_RecorderDlg.h"
 
+#include "vtkPVAxesWidget.h"
+#include "vtkPVAxesActor.h"
+
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "VTKViewer_Algorithm.h"
@@ -161,14 +165,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();
   
@@ -180,6 +185,24 @@ 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);
   
@@ -657,6 +680,15 @@ 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 );
+}
+
 /*!
   Switches "keyboard free" interaction style on/off
 */
@@ -687,6 +719,22 @@ 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 );
+}
+
 /*!
   Sets incremental speed
   \param theValue - new incremental speed
@@ -957,6 +1005,22 @@ void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
   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
@@ -1510,8 +1574,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);
 }
 
@@ -1596,52 +1666,59 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
   // Projections
   anAction = new QtxAction(tr("MNU_FRONT_VIEW"), 
                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
-                           tr( "MNU_FRONT_VIEW" ), 0, this);
+                           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);
+                           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);
+                           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);
+                           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);
+                           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);
+                           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 );
 
   // Reset
   anAction = new QtxAction(tr("MNU_RESET_VIEW"), 
                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
-                           tr( "MNU_RESET_VIEW" ), 0, this);
+                           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
@@ -1718,6 +1795,15 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
   mgr->registerAction( anAction, SwitchInteractionStyleId );
 
+  // Switch between zomming 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 );
+
   // Start recording
   myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"), 
                                 theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
@@ -1763,6 +1849,7 @@ void SVTK_ViewWindow::createToolBar()
   
   mgr->append( DumpId, myToolBar );
   mgr->append( SwitchInteractionStyleId, myToolBar );
+  mgr->append( SwitchZoomingStyleId, myToolBar );
   mgr->append( ViewTrihedronId, myToolBar );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
index ac1a5f12249b7d5c736a6d888a74a1ed57b36296..9c2f827009fccb05ea49371907ca9601518f7ebe 100755 (executable)
@@ -59,10 +59,13 @@ 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;
 
@@ -218,6 +221,9 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
   virtual void SetInteractionStyle( const int );
 
+  //! Redirect the request to #SVTK_MainWindow::SetZoomingStyle
+  virtual void SetZoomingStyle( const int );
+
   //! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
   virtual void SetSpacemouseButtons( const int, const int, const int );
 
@@ -238,6 +244,12 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
                                      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();
   
@@ -286,6 +298,7 @@ public slots:
   void onViewParameters(bool theIsActivate);
 
   void onSwitchInteractionStyle(bool theOn);
+  void onSwitchZoomingStyle(bool theOn);
 
   void onStartRecording();
   void onPlayRecording();
@@ -365,6 +378,7 @@ protected:
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, 
          ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
          ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+         SwitchZoomingStyleId,
          StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
 
 
@@ -373,6 +387,7 @@ protected:
   SVTK_ViewModelBase* myModel;
 
   SVTK_RenderWindowInteractor* myInteractor;
+  vtkSmartPointer<SVTK_InteractorStyle> myDefaultInteractorStyle;
   vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
 
   QString myVisualParams; // used for delayed setting of view parameters 
@@ -397,6 +412,8 @@ protected:
   int myToolBar;
   int myRecordingToolBar;
 
+  vtkPVAxesWidget* myAxesWidget;
+
 private:
   QImage myDumpImage;
 };
index 2236a59bae8f5b8ae3def0ee936b0f91bcf786a1..6150f90b3501c67ba6c96c9143ab73678d075db5 100644 (file)
         <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>
index 9d7454fcfdcb4225116d6716256347bc96fdf96e..b717790b966b0adb9ec72dc38b15158bca29ca9e 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_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>
-    </message>
-    <message>
-        <source>LENGTH</source>
-        <translation>Length</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_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zomming style 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>
@@ -534,11 +454,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 +472,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>
diff --git a/src/SVTK/resources/SVTK_msg_fr.ts b/src/SVTK/resources/SVTK_msg_fr.ts
new file mode 100755 (executable)
index 0000000..1f220b7
--- /dev/null
@@ -0,0 +1,555 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Avant</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène...</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Vue de dessus</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Dessus</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de la vue</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Tourner le point de vue autour du centre de la scène</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Vue de gauche</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Redimensionner la scène pour montrer tous les objets</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRON</source>
+        <translation>Montrer/cacher le trièdre</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Vue de face</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Panoramique global</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Arrière</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRON</source>
+        <translation>Afficher/cacher le trièdre</translation>
+    </message>
+    <message>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Changer le point autour duquel la scène est tournée</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Dessous</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Vue de droite</translation>
+    </message>
+    <message>
+        <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Changer le point de rotation</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Redimensionner la scène pour ne montrer que sa partie choisie par l&apos;encadré</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Vue de dessous</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène actuelle dans un fichier image</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoomer la vue</translation>
+    </message>
+    <message>
+        <source>VTK_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Droite</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Vue arrière</translation>
+    </message>
+    <message>
+        <source>SVTK_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg *.pdf *.ps *.eps)</translation>
+    </message>
+    <message>
+        <source>MNU_VIEWPARAMETERS_VIEW</source>
+        <translation>Changer les paramètres de visualisation</translation>
+    </message>
+    <message>
+        <source>DSC_VIEWPARAMETERS_VIEW</source>
+        <translation>Changer les paramètres de la vue</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_PARALLEL_MODE</source>
+        <translation>Mode orthogonal</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_PARALLEL_MODE</source>
+        <translation>Choisir la projection orthogonale</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Mode perspective</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_PERSPECTIVE_MODE</source>
+        <translation>Choisir la projection en perspective</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_STYLE_SWITCH</source>
+        <translation>Changer le style d&apos;intéraction</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_STYLE_SWITCH</source>
+        <translation>Changer le style d&apos;interaction</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_FontWidget</name>
+    <message>
+        <source>ARIAL</source>
+        <translation>Arial</translation>
+    </message>
+    <message>
+        <source>TIMES</source>
+        <translation>Times</translation>
+    </message>
+    <message>
+        <source>COURIER</source>
+        <translation>Courier</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewWindow</name>
+    <message>
+        <source>DSC_SVTK_UPDATE_RATE</source>
+        <translation>Fréquence de mise à jour</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_SCALING</source>
+        <translation>Mise à l&apos;échelle</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_SCALING</source>
+        <translation>Mise à l&apos;échelle</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_GRADUATED_AXES</source>
+        <translation>Axes gradués</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_GRADUATED_AXES</source>
+        <translation>Axes gradués</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_UPDATE_RATE</source>
+        <translation>Fréquence de mise à jour</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_START</source>
+        <translation>Commencer l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_START</source>
+        <translation>Commencer l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_PLAY</source>
+        <translation>Jouer l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_PLAY</source>
+        <translation>Jouer l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_PAUSE</source>
+        <translation>Mettre en pause l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_PAUSE</source>
+        <translation>Mettre en pause l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_RECORDING_STOP</source>
+        <translation>Arrêter l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>MNU_SVTK_RECORDING_STOP</source>
+        <translation>Arrêter l&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_RECORD_LABEL</source>
+        <translation>Opérations d&apos;enregistrement</translation>
+    </message>
+    <message>
+        <source>MSG_NO_AVI_MAKER</source>
+        <translation>L&apos;outil jpeg2yuv, requis pour enregistrer les fichiers AVI, n&apos;est pas disponible.
+Consultez la documentation.</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_NonIsometricDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>MEN_SCALING</source>
+        <translation>Echelle</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Mise à l&apos;échelle</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_RecorderDlg</name>
+    <message>
+        <source>ALL_DISLPAYED_FRAMES</source>
+        <translation>Enregistrer toutes les images affichées</translation>
+    </message>
+    <message>
+        <source>CLOSE</source>
+        <translation>Fermer</translation>
+    </message>
+    <message>
+        <source>DLG_RECORDER_TITLE</source>
+        <translation>Magnéto</translation>
+    </message>
+    <message>
+        <source>FILE_NAME</source>
+        <translation>Sauvegarder dans le fichier : </translation>
+    </message>
+    <message>
+        <source>FLT_ALL_FILES</source>
+        <translation>Tous les fichiers (*.*)</translation>
+    </message>
+    <message>
+        <source>FLT_AVI_FILES</source>
+        <translation>Fichiers AVI (*.avi)</translation>
+    </message>
+    <message>
+        <source>FPS</source>
+        <translation>FPS : </translation>
+    </message>
+    <message>
+        <source>HELP</source>
+        <translation>Aide</translation>
+    </message>
+    <message>
+        <source>PROGRESSIVE</source>
+        <translation>Progressive</translation>
+    </message>
+    <message>
+        <source>QUALITY</source>
+        <translation>Qualité : </translation>
+    </message>
+    <message>
+        <source>RECORDING_MODE</source>
+        <translation>Mode : </translation>
+    </message>
+    <message>
+        <source>SETTINGS</source>
+        <translation>Réglages</translation>
+    </message>
+    <message>
+        <source>SKIPPED_FRAMES</source>
+        <translation>Enregistrer à FPS donné</translation>
+    </message>
+    <message>
+        <source>START</source>
+        <translation>Commencer</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_SetRotationPointDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>LBL_CENTER_OF_BOUNDING_BOX</source>
+        <translation>Centre de la boîte englobante</translation>
+    </message>
+    <message>
+        <source>RBUTTONGROUP_TITLE</source>
+        <translation>Le type du point de rotation</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Utiliser le centre de la boîte englobante</translation>
+    </message>
+    <message>
+        <source>LBL_ORIGIN</source>
+        <translation>Origine du système de coordonnées</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTED_POINT</source>
+        <translation>Point sélectionné</translation>
+    </message>
+    <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Réinitialiser à l&apos;origine</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Choisir un point dans la vue</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Définir le point de rotation </translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewParameterDlg</name>
+    <message>
+        <source>LBL_X</source>
+        <translation>X :</translation>
+    </message>
+    <message>
+        <source>LBL_Y</source>
+        <translation>Y :</translation>
+    </message>
+    <message>
+        <source>LBL_Z</source>
+        <translation>Z :</translation>
+    </message>
+    <message>
+        <source>LBL_DX</source>
+        <translation>DX :</translation>
+    </message>
+    <message>
+        <source>LBL_DY</source>
+        <translation>DY :</translation>
+    </message>
+    <message>
+        <source>LBL_DZ</source>
+        <translation>DZ :</translation>
+    </message>
+    <message>
+        <source>PROJECTION_MODE</source>
+        <translation>Mode de projection </translation>
+    </message>
+    <message>
+        <source>ORTHOGONAL_MODE</source>
+        <translation>Orthogonal</translation>
+    </message>
+    <message>
+        <source>PERSPECTIVE_MODE</source>
+        <translation>Perspective</translation>
+    </message>
+    <message>
+        <source>USE_BBCENTER</source>
+        <translation>Utiliser le centre de la boîte englobante</translation>
+    </message>
+    <message>
+        <source>LBL_TOBBCENTER</source>
+        <translation>Définir au centre de la boîte englobante</translation>
+    </message>
+    <message>
+        <source>LBL_TOORIGIN</source>
+        <translation>Initialiser à l&apos;origine</translation>
+    </message>
+    <message>
+        <source>LBL_SELECTPOINT</source>
+        <translation>Choisir un point de la vue</translation>
+    </message>
+    <message>
+        <source>FOCAL_POINT</source>
+        <translation>Point focal </translation>
+    </message>
+    <message>
+        <source>CAMERA_POSITION</source>
+        <translation>Position de la caméra</translation>
+    </message>
+    <message>
+        <source>WORLD_COORDINATES</source>
+        <translation>Coordonnées obsolues</translation>
+    </message>
+    <message>
+        <source>FOCAL_RELATIVE</source>
+        <translation>Relatif au point focal</translation>
+    </message>
+    <message>
+        <source>PROJECTION_DIRECTION</source>
+        <translation>Direction de la projection :</translation>
+    </message>
+    <message>
+        <source>FOCAL_DISTANCE</source>
+        <translation>Distance focale :</translation>
+    </message>
+    <message>
+        <source>VIEW_UP_DIRECTION</source>
+        <translation>Direction pour la vue verticale :</translation>
+    </message>
+    <message>
+        <source>ZOOMING</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>LBL_SCALE</source>
+        <translation>Echelle</translation>
+    </message>
+    <message>
+        <source>LBL_VIEW_ANGLE</source>
+        <translation>Angle de visualisation</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Paramètres de visualisation</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_UpdateRateDlg</name>
+    <message>
+        <source>INFORMATION_FRAME_TITLE</source>
+        <translation>Informations</translation>
+    </message>
+    <message>
+        <source>STILL</source>
+        <translation>Fréquence réduite de mise à jour , FPS</translation>
+    </message>
+    <message>
+        <source>INPUT_FRAME_TITLE</source>
+        <translation>Activer</translation>
+    </message>
+    <message>
+        <source>NUMBER_CELLS</source>
+        <translation>Nombre de cellules, -</translation>
+    </message>
+    <message>
+        <source>DESIRED</source>
+        <translation>Fréquence de mise à jour requise, FPS</translation>
+    </message>
+    <message>
+        <source>CURRENT_FPS</source>
+        <translation>Fréquence actuelle de mise à jour , FPS</translation>
+    </message>
+    <message>
+        <source>DLG_TITLE</source>
+        <translation>Fréquence de mise à jour </translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_ViewManager</name>
+    <message>
+        <source>VTK_VIEW_TITLE</source>
+        <translation>Scène VTK:%1 - visualiseur:%2</translation>
+    </message>
+</context>
+<context>
+    <name>SVTK_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue...</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Montrer la barre d&apos;outils</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Changer l&apos;arrière-plan...</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/SVTK/resources/vtk_view_zooming_style_switch.png b/src/SVTK/resources/vtk_view_zooming_style_switch.png
new file mode 100755 (executable)
index 0000000..8f3a486
Binary files /dev/null and b/src/SVTK/resources/vtk_view_zooming_style_switch.png differ
diff --git a/src/SVTK/vtkPVAxesActor.cxx b/src/SVTK/vtkPVAxesActor.cxx
new file mode 100644 (file)
index 0000000..25f471f
--- /dev/null
@@ -0,0 +1,812 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+#include "vtkPVAxesActor.h"
+#include "vtkObject.h"
+#include "vtkObjectFactory.h"
+
+#include "vtkActor.h"
+#include "vtkPropCollection.h"
+#include "vtkProperty.h"
+#include "vtkRenderWindow.h"
+#include "vtkTransform.h"
+#include "vtkCylinderSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkLineSource.h"
+#include "vtkPolyData.h"
+#include "vtkConeSource.h"
+#include "vtkSphereSource.h"
+#include "vtkVectorText.h"
+#include "vtkFollower.h"
+#include "vtkRenderer.h"
+
+#include <math.h>
+
+vtkCxxRevisionMacro(vtkPVAxesActor, "$Revision$");
+vtkStandardNewMacro(vtkPVAxesActor);
+
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData );
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData );
+
+//-----------------------------------------------------------------------------
+vtkPVAxesActor::vtkPVAxesActor()
+{
+  this->XAxisLabelText = NULL;
+  this->YAxisLabelText = NULL;
+  this->ZAxisLabelText = NULL;
+    
+  this->SetXAxisLabelText("X");
+  this->SetYAxisLabelText("Y");
+  this->SetZAxisLabelText("Z");
+  
+  //colors chosen to match the output of vtkAxes.cxx's LUT.
+  this->XAxisShaft = vtkActor::New();
+  this->XAxisShaft->GetProperty()->SetColor(1, 0, 0);
+  this->YAxisShaft = vtkActor::New();
+  this->YAxisShaft->GetProperty()->SetColor(1, 1, 0);
+  this->ZAxisShaft = vtkActor::New();
+  this->ZAxisShaft->GetProperty()->SetColor(0, 1, 0);
+
+  this->XAxisTip = vtkActor::New();
+  this->XAxisTip->GetProperty()->SetColor(1, 0, 0);
+  this->YAxisTip = vtkActor::New();
+  this->YAxisTip->GetProperty()->SetColor(1, 1, 0);
+  this->ZAxisTip = vtkActor::New();
+  this->ZAxisTip->GetProperty()->SetColor(0, 1, 0);
+
+  this->CylinderSource = vtkCylinderSource::New();
+  this->CylinderSource->SetHeight(1.0);
+  
+  this->LineSource = vtkLineSource::New();
+  this->LineSource->SetPoint1( 0.0, 0.0, 0.0 );
+  this->LineSource->SetPoint2( 0.0, 1.0, 0.0 );
+
+  this->ConeSource = vtkConeSource::New();
+  this->ConeSource->SetDirection( 0, 1, 0 );
+  this->ConeSource->SetHeight( 1.0 );
+   
+  this->SphereSource = vtkSphereSource::New();
+  
+  vtkPolyDataMapper *shaftMapper = vtkPolyDataMapper::New();
+  
+  this->XAxisShaft->SetMapper( shaftMapper );
+  this->YAxisShaft->SetMapper( shaftMapper );
+  this->ZAxisShaft->SetMapper( shaftMapper );
+  
+  shaftMapper->Delete();
+
+  vtkPolyDataMapper *tipMapper = vtkPolyDataMapper::New();
+  
+  this->XAxisTip->SetMapper( tipMapper );
+  this->YAxisTip->SetMapper( tipMapper );
+  this->ZAxisTip->SetMapper( tipMapper );
+  
+  tipMapper->Delete();
+
+  this->TotalLength[0] = 1.0;
+  this->TotalLength[1] = 1.0;
+  this->TotalLength[2] = 1.0;
+  this->NormalizedShaftLength[0] = 0.8;
+  this->NormalizedShaftLength[1] = 0.8;
+  this->NormalizedShaftLength[2] = 0.8;
+
+  this->NormalizedTipLength[0] = 0.2;
+  this->NormalizedTipLength[1] = 0.2;
+  this->NormalizedTipLength[2] = 0.2;
+
+  this->ConeResolution = 16;
+  this->SphereResolution = 16;
+  this->CylinderResolution = 16;
+  
+  this->ConeRadius = 0.4;
+  this->SphereRadius = 0.5;
+  this->CylinderRadius = 0.05;
+  
+  this->XAxisLabelPosition = 1;
+  this->YAxisLabelPosition = 1;
+  this->ZAxisLabelPosition = 1;
+  
+  this->ShaftType = vtkPVAxesActor::LINE_SHAFT;
+  this->TipType   = vtkPVAxesActor::CONE_TIP;
+
+  this->UserDefinedTip = NULL;
+  this->UserDefinedShaft = NULL;
+
+  this->XAxisVectorText = vtkVectorText::New();
+  this->YAxisVectorText = vtkVectorText::New();
+  this->ZAxisVectorText = vtkVectorText::New();
+  
+  this->XAxisLabel = vtkFollower::New();
+  this->YAxisLabel = vtkFollower::New();
+  this->ZAxisLabel = vtkFollower::New();
+  
+  vtkPolyDataMapper *xmapper = vtkPolyDataMapper::New();
+  vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New();
+  vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New();
+  
+  xmapper->SetInput( this->XAxisVectorText->GetOutput() );
+  ymapper->SetInput( this->YAxisVectorText->GetOutput() );
+  zmapper->SetInput( this->ZAxisVectorText->GetOutput() );
+  
+  this->XAxisLabel->SetMapper( xmapper );
+  this->YAxisLabel->SetMapper( ymapper );
+  this->ZAxisLabel->SetMapper( zmapper );
+  
+  xmapper->Delete();
+  ymapper->Delete();
+  zmapper->Delete();
+  
+  this->UpdateProps();
+}
+
+//-----------------------------------------------------------------------------
+vtkPVAxesActor::~vtkPVAxesActor()
+{
+  this->CylinderSource->Delete();
+  this->LineSource->Delete();
+  this->ConeSource->Delete();
+  this->SphereSource->Delete();  
+  
+  this->XAxisShaft->Delete();
+  this->YAxisShaft->Delete();
+  this->ZAxisShaft->Delete();  
+
+  this->XAxisTip->Delete();
+  this->YAxisTip->Delete();
+  this->ZAxisTip->Delete();  
+  
+  this->SetUserDefinedTip( NULL );
+  this->SetUserDefinedShaft( NULL );
+  
+  this->SetXAxisLabelText( NULL );
+  this->SetYAxisLabelText( NULL );
+  this->SetZAxisLabelText( NULL );
+  
+  this->XAxisVectorText->Delete();
+  this->YAxisVectorText->Delete();
+  this->ZAxisVectorText->Delete();
+
+  this->XAxisLabel->Delete();
+  this->YAxisLabel->Delete();
+  this->ZAxisLabel->Delete();
+}
+
+//-----------------------------------------------------------------------------
+// Shallow copy of an actor.
+void vtkPVAxesActor::ShallowCopy(vtkProp *prop)
+{
+  vtkPVAxesActor *a = vtkPVAxesActor::SafeDownCast(prop);
+  if ( a != NULL )
+    {
+    }
+
+  // Now do superclass
+  this->vtkProp3D::ShallowCopy(prop);
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::GetActors(vtkPropCollection *ac)
+{
+  ac->AddItem(this->XAxisShaft);
+  ac->AddItem(this->YAxisShaft);
+  ac->AddItem(this->ZAxisShaft);
+  ac->AddItem(this->XAxisTip);
+  ac->AddItem(this->YAxisTip);
+  ac->AddItem(this->ZAxisTip);
+  ac->AddItem(this->XAxisLabel);
+  ac->AddItem(this->YAxisLabel);
+  ac->AddItem(this->ZAxisLabel);
+
+}
+
+//-----------------------------------------------------------------------------
+int vtkPVAxesActor::RenderOpaqueGeometry(vtkViewport *vp)
+{
+  int          renderedSomething = 0; 
+
+  vtkRenderer *ren = vtkRenderer::SafeDownCast( vp );
+
+  this->UpdateProps();
+  
+  this->XAxisLabel->SetCamera( ren->GetActiveCamera() );
+  this->YAxisLabel->SetCamera( ren->GetActiveCamera() );
+  this->ZAxisLabel->SetCamera( ren->GetActiveCamera() );
+  
+  this->XAxisShaft->RenderOpaqueGeometry(vp);
+  this->YAxisShaft->RenderOpaqueGeometry(vp);
+  this->ZAxisShaft->RenderOpaqueGeometry(vp);
+
+  this->XAxisTip->RenderOpaqueGeometry(vp);
+  this->YAxisTip->RenderOpaqueGeometry(vp);
+  this->ZAxisTip->RenderOpaqueGeometry(vp);
+
+  this->XAxisLabel->RenderOpaqueGeometry(vp);
+  this->YAxisLabel->RenderOpaqueGeometry(vp);
+  this->ZAxisLabel->RenderOpaqueGeometry(vp);
+  
+  return renderedSomething;
+}
+
+//-----------------------------------------------------------------------------
+#if (VTK_MINOR_VERSION>=2)
+// porting to VTK 5.0.x
+int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
+{
+  int renderedSomething=0; 
+
+  this->UpdateProps();
+  
+  renderedSomething += this->XAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+
+  renderedSomething += this->XAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  
+  renderedSomething += this->XAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  
+  return renderedSomething;
+}
+
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+int vtkPVAxesActor::HasTranslucentPolygonalGeometry()
+{
+  int result = 0; 
+
+  this->UpdateProps();
+  
+  result |= this->XAxisShaft->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisShaft->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisShaft->HasTranslucentPolygonalGeometry();
+
+  result |= this->XAxisTip->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisTip->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisTip->HasTranslucentPolygonalGeometry();
+  
+  result |= this->XAxisLabel->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisLabel->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisLabel->HasTranslucentPolygonalGeometry();
+  
+  return result;
+}
+
+#else
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+int vtkPVAxesActor::RenderTranslucentGeometry(vtkViewport *vp)
+{
+  int renderedSomething=0; 
+
+  this->UpdateProps();
+  
+  renderedSomething += this->XAxisShaft->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisShaft->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisShaft->RenderTranslucentGeometry(vp);
+
+  renderedSomething += this->XAxisTip->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisTip->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisTip->RenderTranslucentGeometry(vp);
+  
+  renderedSomething += this->XAxisLabel->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisLabel->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisLabel->RenderTranslucentGeometry(vp);
+  
+  return renderedSomething;
+}
+#endif
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::ReleaseGraphicsResources(vtkWindow *win)
+{
+  this->XAxisShaft->ReleaseGraphicsResources( win );
+  this->YAxisShaft->ReleaseGraphicsResources( win );
+  this->ZAxisShaft->ReleaseGraphicsResources( win );
+
+  this->XAxisTip->ReleaseGraphicsResources( win );
+  this->YAxisTip->ReleaseGraphicsResources( win );
+  this->ZAxisTip->ReleaseGraphicsResources( win );
+    
+  this->XAxisLabel->ReleaseGraphicsResources( win );
+  this->YAxisLabel->ReleaseGraphicsResources( win );
+  this->ZAxisLabel->ReleaseGraphicsResources( win );
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::GetBounds(double bounds[6])
+{
+  double *bds = this->GetBounds();
+  bounds[0] = bds[0];
+  bounds[1] = bds[1];
+  bounds[2] = bds[2];
+  bounds[3] = bds[3];
+  bounds[4] = bds[4];
+  bounds[5] = bds[5];
+}
+
+//-----------------------------------------------------------------------------
+// Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
+double *vtkPVAxesActor::GetBounds()
+{
+  double bounds[6];
+  int i;
+  
+  this->XAxisShaft->GetBounds(this->Bounds);
+
+  this->YAxisShaft->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->ZAxisShaft->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->XAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->YAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->ZAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  double dbounds[6];
+  (vtkPolyDataMapper::SafeDownCast(this->YAxisShaft->GetMapper()))->
+    GetInput()->GetBounds( dbounds );
+  
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (dbounds[2*i+1]>this->Bounds[2*i+1])?(dbounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  // We want this actor to rotate / re-center about the origin, so give it
+  // the bounds it would have if the axes were symmetrical.
+  for (i = 0; i < 3; i++)
+    {
+    this->Bounds[2*i] = -this->Bounds[2*i+1];
+    }
+
+  return this->Bounds;
+}
+
+//-----------------------------------------------------------------------------
+unsigned long int vtkPVAxesActor::GetMTime()
+{
+  unsigned long mTime=this->Superclass::GetMTime();
+
+
+  return mTime;
+}
+
+//-----------------------------------------------------------------------------
+unsigned long int vtkPVAxesActor::GetRedrawMTime()
+{
+  unsigned long mTime=this->GetMTime();
+
+  return mTime;
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisTipProperty()
+{
+  return this->XAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisTipProperty()
+{
+  return this->YAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisTipProperty()
+{
+  return this->ZAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisShaftProperty()
+{
+  return this->XAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisShaftProperty()
+{
+  return this->YAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisShaftProperty()
+{
+  return this->ZAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisLabelProperty()
+{
+  return this->XAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisLabelProperty()
+{
+  return this->YAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisLabelProperty()
+{
+  return this->ZAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetTotalLength( float x, float y, float z )
+{
+  if ( this->TotalLength[0] != x ||
+       this->TotalLength[1] != y ||
+       this->TotalLength[2] != z )
+    {
+    this->TotalLength[0] = x;
+    this->TotalLength[1] = y;
+    this->TotalLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetNormalizedShaftLength( float x, float y, float z )
+{
+  if ( this->NormalizedShaftLength[0] != x ||
+       this->NormalizedShaftLength[1] != y ||
+       this->NormalizedShaftLength[2] != z )
+    {
+    this->NormalizedShaftLength[0] = x;
+    this->NormalizedShaftLength[1] = y;
+    this->NormalizedShaftLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetNormalizedTipLength( float x, float y, float z )
+{
+  if ( this->NormalizedTipLength[0] != x ||
+       this->NormalizedTipLength[1] != y ||
+       this->NormalizedTipLength[2] != z )
+    {
+    this->NormalizedTipLength[0] = x;
+    this->NormalizedTipLength[1] = y;
+    this->NormalizedTipLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetShaftType( int type )
+{
+  if ( this->ShaftType != type )
+    {
+    this->ShaftType = type;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetTipType( int type )
+{
+  if ( this->TipType != type )
+    {
+    this->TipType = type;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::UpdateProps()
+{
+  this->CylinderSource->SetRadius(this->CylinderRadius);
+  this->CylinderSource->SetResolution(this->CylinderResolution);
+  
+  
+  this->ConeSource->SetResolution(this->ConeResolution);
+  this->ConeSource->SetRadius(this->ConeRadius);
+  this->SphereSource->SetThetaResolution( this->SphereResolution );
+  this->SphereSource->SetPhiResolution( this->SphereResolution );
+  this->SphereSource->SetRadius(this->SphereRadius);
+  
+  switch ( this->ShaftType )
+    {
+    case vtkPVAxesActor::CYLINDER_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInput( this->CylinderSource->GetOutput() );
+      break;
+    case vtkPVAxesActor::LINE_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInput( this->LineSource->GetOutput() );
+      break;
+    case vtkPVAxesActor::USER_DEFINED_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInput( this->UserDefinedShaft );
+    }
+  
+  switch ( this->TipType )
+    {
+    case vtkPVAxesActor::CONE_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInput( this->ConeSource->GetOutput() );
+      break;      
+    case vtkPVAxesActor::SPHERE_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInput( this->SphereSource->GetOutput() );
+      break;      
+    case vtkPVAxesActor::USER_DEFINED_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInput( this->UserDefinedTip );
+    }
+  
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+    GetInput()->Update();
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+    GetInput()->Update();
+      
+  
+  
+  float scale[3];
+  double bounds[6];
+
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+    GetInput()->GetBounds( bounds );
+  
+  int i;
+  for ( i = 0; i < 3; i++ )
+    {
+    scale[i] = 
+      this->NormalizedShaftLength[i]*this->TotalLength[i] / 
+      (bounds[3] - bounds[2]);
+    }
+  
+  vtkTransform *xTransform = vtkTransform::New();
+  vtkTransform *yTransform = vtkTransform::New();
+  vtkTransform *zTransform = vtkTransform::New();
+  
+  xTransform->RotateZ( -90 );
+  zTransform->RotateX( 90 );
+  
+  xTransform->Scale( scale[0], scale[0], scale[0] );
+  yTransform->Scale( scale[1], scale[1], scale[1] );
+  zTransform->Scale( scale[2], scale[2], scale[2] );
+
+  xTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  yTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  zTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  
+  
+
+  this->XAxisShaft->SetUserTransform( xTransform );
+  this->YAxisShaft->SetUserTransform( yTransform );
+  this->ZAxisShaft->SetUserTransform( zTransform );
+
+  xTransform->Delete();
+  yTransform->Delete();
+  zTransform->Delete();
+  
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+    GetInput()->GetBounds( bounds );
+  
+  xTransform = vtkTransform::New();
+  yTransform = vtkTransform::New();
+  zTransform = vtkTransform::New();
+  
+  xTransform->RotateZ( -90 );
+  zTransform->RotateX( 90 );
+  
+  xTransform->Scale( this->TotalLength[0], this->TotalLength[0], this->TotalLength[0] );
+  yTransform->Scale( this->TotalLength[1], this->TotalLength[1], this->TotalLength[1] );
+  zTransform->Scale( this->TotalLength[2], this->TotalLength[2], this->TotalLength[2] );
+  
+  xTransform->Translate( 0, (1.0 - this->NormalizedTipLength[0]), 0 );
+  yTransform->Translate( 0, (1.0 - this->NormalizedTipLength[1]), 0 );
+  zTransform->Translate( 0, (1.0 - this->NormalizedTipLength[2]), 0 );
+  
+  xTransform->Scale( this->NormalizedTipLength[0], 
+                     this->NormalizedTipLength[0], 
+                     this->NormalizedTipLength[0] );
+
+  yTransform->Scale( this->NormalizedTipLength[1], 
+                     this->NormalizedTipLength[1], 
+                     this->NormalizedTipLength[1] );
+  
+  zTransform->Scale( this->NormalizedTipLength[2], 
+                     this->NormalizedTipLength[2], 
+                     this->NormalizedTipLength[2] );
+  
+  xTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  yTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  zTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+
+  
+  this->XAxisTip->SetUserTransform( xTransform );
+  this->YAxisTip->SetUserTransform( yTransform );
+  this->ZAxisTip->SetUserTransform( zTransform );
+
+  xTransform->Delete();
+  yTransform->Delete();
+  zTransform->Delete();
+
+  this->XAxisVectorText->SetText( this->XAxisLabelText );
+  this->YAxisVectorText->SetText( this->YAxisLabelText );
+  this->ZAxisVectorText->SetText( this->ZAxisLabelText );
+  
+  
+  float avgScale = 
+    (this->TotalLength[0] + this->TotalLength[1] + this->TotalLength[2])/15;
+  
+  this->XAxisShaft->GetBounds(bounds);
+  this->XAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->XAxisLabel->SetPosition( bounds[0] + this->XAxisLabelPosition *
+                                 (bounds[1]-bounds[0]),
+                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
+                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
+
+  this->YAxisShaft->GetBounds(bounds);
+  this->YAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->YAxisLabel->SetPosition( (bounds[0]+bounds[1])/2, 
+                                 bounds[2] + this->YAxisLabelPosition *
+                                 (bounds[3]-bounds[2]),
+                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
+
+  this->ZAxisShaft->GetBounds(bounds);
+  this->ZAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->ZAxisLabel->SetPosition( bounds[0], 
+                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
+                                 bounds[4] + this->ZAxisLabelPosition *
+                                 (bounds[5]-bounds[4]) );
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  
+  os << indent << "UserDefinedShaft: ";
+  if (this->UserDefinedShaft)
+    {
+    os << this->UserDefinedShaft << endl;
+    }
+  else
+    {
+    os << "(none)" << endl;
+    }
+  
+  os << indent << "UserDefinedTip: ";
+  if (this->UserDefinedTip)
+    {
+    os << this->UserDefinedTip << endl;
+    }
+  else
+    {
+    os << "(none)" << endl;
+    }
+  
+  os << indent << "XAxisLabelText: " << (this->XAxisLabelText ?
+                                         this->XAxisLabelText : "(none)")
+     << endl;
+  os << indent << "YAxisLabelText: " << (this->YAxisLabelText ?
+                                         this->YAxisLabelText : "(none)")
+     << endl;
+  os << indent << "ZAxisLabelText: " << (this->ZAxisLabelText ?
+                                         this->ZAxisLabelText : "(none)")
+     << endl;
+  os << indent << "XAxisLabelPosition: " << this->XAxisLabelPosition << endl;
+  os << indent << "YAxisLabelPosition: " << this->YAxisLabelPosition << endl;
+  os << indent << "ZAxisLabelPosition: " << this->ZAxisLabelPosition << endl;
+  
+  os << indent << "SphereRadius: " << this->SphereRadius << endl;
+  os << indent << "SphereResolution: " << this->SphereResolution << endl;
+  os << indent << "CylinderRadius: " << this->CylinderRadius << endl;
+  os << indent << "CylinderResolution: " << this->CylinderResolution << endl;
+  os << indent << "ConeRadius: " << this->ConeRadius << endl;
+  os << indent << "ConeResolution: " << this->ConeResolution << endl;
+  
+  os << indent << "NormalizedShaftLength: " 
+     << this->NormalizedShaftLength[0] << ","
+     << this->NormalizedShaftLength[1] << ","
+     << this->NormalizedShaftLength[2] << endl;
+  os << indent << "NormalizedTipLength: " 
+     << this->NormalizedTipLength[0] << ","
+     << this->NormalizedTipLength[1] << ","
+     << this->NormalizedTipLength[2] << endl;
+  os << indent << "TotalLength: " 
+     << this->TotalLength[0] << ","
+     << this->TotalLength[1] << ","
+     << this->TotalLength[2] << endl;
+}
+
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+void vtkPVAxesActor::AddToRender( vtkRenderer* theRenderer )
+{
+  theRenderer->AddActor(this->XAxisLabel);
+  theRenderer->AddActor(this->YAxisLabel);
+  theRenderer->AddActor(this->ZAxisLabel);
+}
diff --git a/src/SVTK/vtkPVAxesActor.h b/src/SVTK/vtkPVAxesActor.h
new file mode 100644 (file)
index 0000000..8b9d329
--- /dev/null
@@ -0,0 +1,293 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+// .NAME vtkPVAxesActor - a 3D axes representation
+// .SECTION Description
+// 
+// vtkPVAxesActor is used to represent 3D axes in the scene. The user can
+// define the geometry to use for the shaft and the tip, and the user can
+// set the text for the three axes. The text will follow the camera.
+
+
+#ifndef __vtkPVAxesActor_h
+#define __vtkPVAxesActor_h
+
+#include "SVTK.h"
+#include "vtkProp3D.h"
+
+class vtkRenderer;
+class vtkPropCollection;
+class vtkMapper;
+class vtkProperty;
+class vtkActor;
+class vtkFollower;
+class vtkCylinderSource;
+class vtkLineSource;
+class vtkConeSource;
+class vtkSphereSource;
+class vtkPolyData;
+class vtkVectorText;
+
+class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D
+{
+public:
+  static vtkPVAxesActor *New();
+  vtkTypeRevisionMacro(vtkPVAxesActor,vtkProp3D);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+
+  // Description: 
+  // For some exporters and other other operations we must be
+  // able to collect all the actors or volumes. These methods
+  // are used in that process.
+  virtual void GetActors(vtkPropCollection *);
+
+  // Description:
+  // Support the standard render methods.
+  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+#if (VTK_MINOR_VERSION>=2)
+  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x
+  virtual int HasTranslucentPolygonalGeometry();                         // porting to VTK 5.0.x
+#else
+  virtual int RenderTranslucentGeometry(vtkViewport *viewport);            // porting to VTK 5.0.x
+#endif
+
+  // Description:
+  // Shallow copy of an axes actor. Overloads the virtual vtkProp method.
+  void ShallowCopy(vtkProp *prop);
+
+  // Description:
+  // Release any graphics resources that are being consumed by this actor.
+  // The parameter window could be used to determine which graphic
+  // resources to release.
+  void ReleaseGraphicsResources(vtkWindow *);
+
+  // Description:
+  // Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). (The
+  // method GetBounds(double bounds[6]) is available from the superclass.)
+  void GetBounds(double bounds[6]);
+  double *GetBounds();
+
+  // Description:
+  // Get the actors mtime plus consider its properties and texture if set.
+  unsigned long int GetMTime();
+  
+  // Description:
+  // Return the mtime of anything that would cause the rendered image to 
+  // appear differently. Usually this involves checking the mtime of the 
+  // prop plus anything else it depends on such as properties, textures
+  // etc.
+  virtual unsigned long GetRedrawMTime();
+
+  // Description:
+  // Set the total length of the axes in 3 dimensions.
+  void SetTotalLength( float v[3] ) 
+    { this->SetTotalLength( v[0], v[1], v[2] ); }
+  void SetTotalLength( float x, float y, float z );
+  vtkGetVectorMacro( TotalLength, float, 3 );
+  
+  // Description:
+  // Set the normalized (0-1) length of the shaft.
+  void SetNormalizedShaftLength( float v[3] ) 
+    { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
+  void SetNormalizedShaftLength( float x, float y, float z );
+  vtkGetVectorMacro( NormalizedShaftLength, float, 3 );
+  
+  // Description:
+  // Set the normalized (0-1) length of the tip.
+  void SetNormalizedTipLength( float v[3] ) 
+    { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
+  void SetNormalizedTipLength( float x, float y, float z );
+  vtkGetVectorMacro( NormalizedTipLength, float, 3 );
+
+  // Description:
+  // Set/get the resolution of the pieces of the axes actor
+  vtkSetClampMacro(ConeResolution, int, 3, 128);
+  vtkGetMacro(ConeResolution, int);
+  vtkSetClampMacro(SphereResolution, int, 3, 128);
+  vtkGetMacro(SphereResolution, int);
+  vtkSetClampMacro(CylinderResolution, int, 3, 128);
+  vtkGetMacro(CylinderResolution, int);
+  
+  // Description:
+  // Set/get the radius of the pieces of the axes actor
+  vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(ConeRadius, float);
+  vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(SphereRadius, float);
+  vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(CylinderRadius, float);
+  
+  // Description:
+  // Set/get the positions of the axis labels
+  vtkSetClampMacro(XAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(XAxisLabelPosition, float);
+  vtkSetClampMacro(YAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(YAxisLabelPosition, float);
+  vtkSetClampMacro(ZAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(ZAxisLabelPosition, float);
+  
+  // Description:
+  // Set the type of the shaft to a cylinder, line, or user defined geometry.
+  void SetShaftType( int type );
+  void SetShaftTypeToCylinder()
+    { this->SetShaftType( vtkPVAxesActor::CYLINDER_SHAFT ); }
+  void SetShaftTypeToLine()
+    { this->SetShaftType( vtkPVAxesActor::LINE_SHAFT ); }
+  void SetShaftTypeToUserDefined()
+    { this->SetShaftType( vtkPVAxesActor::USER_DEFINED_SHAFT ); }
+
+  // Description:
+  // Set the type of the tip to a cone, sphere, or user defined geometry.
+  void SetTipType( int type );
+  void SetTipTypeToCone()
+    { this->SetTipType( vtkPVAxesActor::CONE_TIP ); }
+  void SetTipTypeToSphere()
+    { this->SetTipType( vtkPVAxesActor::SPHERE_TIP ); }
+  void SetTipTypeToUserDefined()
+    { this->SetTipType( vtkPVAxesActor::USER_DEFINED_TIP ); }
+
+  //BTX
+  // Description:
+  // Set the user defined tip polydata.
+  void SetUserDefinedTip( vtkPolyData * );
+  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
+  
+  // Description:
+  // Set the user defined shaft polydata.
+  void SetUserDefinedShaft( vtkPolyData * );
+  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
+
+  // Description:
+  // Get the tip properties.
+  vtkProperty *GetXAxisTipProperty();
+  vtkProperty *GetYAxisTipProperty();
+  vtkProperty *GetZAxisTipProperty();
+  
+  // Description:
+  // Get the shaft properties.
+  vtkProperty *GetXAxisShaftProperty();
+  vtkProperty *GetYAxisShaftProperty();
+  vtkProperty *GetZAxisShaftProperty();
+
+  // Description:
+  // Get the label properties.
+  vtkProperty *GetXAxisLabelProperty();
+  vtkProperty *GetYAxisLabelProperty();
+  vtkProperty *GetZAxisLabelProperty();
+  //ETX
+  //
+  // Description:
+  // Set the label text.
+  vtkSetStringMacro( XAxisLabelText );
+  vtkSetStringMacro( YAxisLabelText );
+  vtkSetStringMacro( ZAxisLabelText );
+  
+//BTX
+  enum
+  {
+    CYLINDER_SHAFT,
+    LINE_SHAFT,
+    USER_DEFINED_SHAFT
+  };
+  
+  
+  enum
+  {
+    CONE_TIP,
+    SPHERE_TIP,
+    USER_DEFINED_TIP
+  };
+  
+//ETX
+
+  void AddToRender( vtkRenderer* theRenderer ); // porting to VTK 5.0.x
+  
+protected:
+  vtkPVAxesActor();
+  ~vtkPVAxesActor();
+
+  vtkCylinderSource *CylinderSource;
+  vtkLineSource     *LineSource;
+  vtkConeSource     *ConeSource;
+  vtkSphereSource   *SphereSource;
+  
+  vtkActor          *XAxisShaft;
+  vtkActor          *YAxisShaft;
+  vtkActor          *ZAxisShaft;
+
+  vtkActor          *XAxisTip;
+  vtkActor          *YAxisTip;
+  vtkActor          *ZAxisTip;
+
+  void              UpdateProps();
+
+  float             TotalLength[3];
+  float             NormalizedShaftLength[3];
+  float             NormalizedTipLength[3];
+  
+  int               ShaftType;
+  int               TipType;
+  
+  vtkPolyData      *UserDefinedTip;
+  vtkPolyData      *UserDefinedShaft;
+  
+  char             *XAxisLabelText;
+  char             *YAxisLabelText;
+  char             *ZAxisLabelText;
+  
+  vtkVectorText    *XAxisVectorText;
+  vtkVectorText    *YAxisVectorText;
+  vtkVectorText    *ZAxisVectorText;
+  
+  vtkFollower      *XAxisLabel;
+  vtkFollower      *YAxisLabel;
+  vtkFollower      *ZAxisLabel;
+  
+  int              ConeResolution;
+  int              SphereResolution;
+  int              CylinderResolution;
+  
+  float            ConeRadius;
+  float            SphereRadius;
+  float            CylinderRadius;
+
+  float            XAxisLabelPosition;
+  float            YAxisLabelPosition;
+  float            ZAxisLabelPosition;
+  
+private:
+  vtkPVAxesActor(const vtkPVAxesActor&);  // Not implemented.
+  void operator=(const vtkPVAxesActor&);  // Not implemented.
+};
+
+#endif
+
diff --git a/src/SVTK/vtkPVAxesWidget.cxx b/src/SVTK/vtkPVAxesWidget.cxx
new file mode 100644 (file)
index 0000000..42d8000
--- /dev/null
@@ -0,0 +1,869 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+#include "vtkPVAxesWidget.h"
+
+#include "vtkActor2D.h"
+#include "vtkCallbackCommand.h"
+#include "vtkCamera.h"
+#include "vtkCoordinate.h"
+#include "vtkObjectFactory.h"
+#include "vtkPoints.h"
+#include "vtkPolyData.h"
+#include "vtkPolyDataMapper2D.h"
+#include "vtkProperty.h"
+#include "vtkProperty2D.h"
+#include "vtkPVAxesActor.h"
+#include "vtkRenderer.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+
+vtkStandardNewMacro(vtkPVAxesWidget);
+vtkCxxRevisionMacro(vtkPVAxesWidget, "$Revision$");
+
+vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor);
+vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer);
+
+//----------------------------------------------------------------------------
+class vtkPVAxesWidgetObserver : public vtkCommand
+{
+public:
+  static vtkPVAxesWidgetObserver *New()
+    {return new vtkPVAxesWidgetObserver;};
+  
+  vtkPVAxesWidgetObserver()
+    {
+      this->AxesWidget = 0;
+    }
+  
+  virtual void Execute(vtkObject* wdg, unsigned long event, void *calldata)
+    {
+      if (this->AxesWidget)
+        {
+        this->AxesWidget->ExecuteEvent(wdg, event, calldata);
+        }
+    }
+  
+  vtkPVAxesWidget *AxesWidget;
+};
+
+//----------------------------------------------------------------------------
+vtkPVAxesWidget::vtkPVAxesWidget()
+{
+  this->StartEventObserverId = 0;
+
+  this->EventCallbackCommand->SetCallback(vtkPVAxesWidget::ProcessEvents);
+  
+  this->Observer = vtkPVAxesWidgetObserver::New();
+  this->Observer->AxesWidget = this;
+  this->Renderer = vtkRenderer::New();
+  this->Renderer->SetViewport(0.0, 0.0, 0.2, 0.2);
+  this->Renderer->SetLayer(1);
+  this->Renderer->InteractiveOff();
+  this->Priority = 0.55;
+  this->AxesActor = vtkPVAxesActor::New();
+  this->Renderer->AddActor(this->AxesActor);
+  this->AxesActor->AddToRender(this->Renderer); // tmp
+  
+  this->ParentRenderer = NULL;
+  
+  this->Moving = 0;
+  this->MouseCursorState = vtkPVAxesWidget::Outside;
+
+  this->StartTag = 0;
+  
+  this->Interactive = 1;
+  
+  this->Outline = vtkPolyData::New();
+  this->Outline->Allocate();
+  vtkPoints *points = vtkPoints::New();
+  vtkIdType ptIds[5];
+  ptIds[4] = ptIds[0] = points->InsertNextPoint(1, 1, 0);
+  ptIds[1] = points->InsertNextPoint(2, 1, 0);
+  ptIds[2] = points->InsertNextPoint(2, 2, 0);
+  ptIds[3] = points->InsertNextPoint(1, 2, 0);
+  this->Outline->SetPoints(points);
+  this->Outline->InsertNextCell(VTK_POLY_LINE, 5, ptIds);
+  vtkCoordinate *tcoord = vtkCoordinate::New();
+  tcoord->SetCoordinateSystemToDisplay();
+  vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New();
+  mapper->SetInput(this->Outline);
+  mapper->SetTransformCoordinate(tcoord);
+  this->OutlineActor = vtkActor2D::New();
+  this->OutlineActor->SetMapper(mapper);
+  this->OutlineActor->SetPosition(0, 0);
+  this->OutlineActor->SetPosition2(1, 1);
+  
+  points->Delete();
+  mapper->Delete();
+  tcoord->Delete();
+}
+
+//----------------------------------------------------------------------------
+vtkPVAxesWidget::~vtkPVAxesWidget()
+{
+  this->Observer->Delete();
+  this->AxesActor->Delete();
+  this->OutlineActor->Delete();
+  this->Outline->Delete();
+  this->SetParentRenderer(NULL);
+  this->Renderer->Delete();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetEnabled(int enabling)
+{
+  if (!this->Interactor)
+    {
+    vtkErrorMacro("The interactor must be set prior to enabling/disabling widget");
+    }
+  
+  if (enabling)
+    {
+    if (this->Enabled)
+      {
+      return;
+      }
+    if (!this->ParentRenderer)
+      {
+      vtkErrorMacro("The parent renderer must be set prior to enabling this widget");
+      return;
+      }
+
+    this->Enabled = 1;
+    
+    if ( this->EventCallbackCommand )
+      {
+      vtkRenderWindowInteractor *i = this->Interactor;
+      i->AddObserver(vtkCommand::MouseMoveEvent,
+        this->EventCallbackCommand, this->Priority);
+      i->AddObserver(vtkCommand::LeftButtonPressEvent,
+        this->EventCallbackCommand, this->Priority);
+      i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
+        this->EventCallbackCommand, this->Priority);
+      }
+    
+    this->ParentRenderer->GetRenderWindow()->AddRenderer(this->Renderer);
+    if (this->ParentRenderer->GetRenderWindow()->GetNumberOfLayers() < 2)
+      {
+      this->ParentRenderer->GetRenderWindow()->SetNumberOfLayers(2);
+      }
+    this->AxesActor->SetVisibility(1);
+    // We need to copy the camera before the compositing observer is called.
+    // Compositing temporarily changes the camera to display an image.
+    this->StartEventObserverId = 
+      this->ParentRenderer->AddObserver(vtkCommand::StartEvent,this->Observer,1);
+    this->InvokeEvent(vtkCommand::EnableEvent, NULL);
+    }
+  else
+    {
+    if (!this->Enabled)
+      {
+      return;
+      }
+    
+    this->Enabled = 0;
+    this->Interactor->RemoveObserver(this->EventCallbackCommand);
+    
+    this->AxesActor->SetVisibility(0);
+    if (this->ParentRenderer)
+      {
+      if (this->ParentRenderer->GetRenderWindow())
+        {
+        this->ParentRenderer->GetRenderWindow()->RemoveRenderer(this->Renderer);
+        this->AxesActor->ReleaseGraphicsResources(this->ParentRenderer->GetRenderWindow());
+        }
+      if (this->StartEventObserverId != 0)
+        {
+        this->ParentRenderer->RemoveObserver(this->StartEventObserverId);
+        }
+      }
+    
+    this->InvokeEvent(vtkCommand::DisableEvent, NULL);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ExecuteEvent(vtkObject *vtkNotUsed(o),
+                                   unsigned long vtkNotUsed(event),
+                                   void *vtkNotUsed(calldata))
+{
+  if (!this->ParentRenderer)
+    {
+    return;
+    }
+  
+  vtkCamera *cam = this->ParentRenderer->GetActiveCamera();
+  double pos[3], fp[3], viewup[3];
+  cam->GetPosition(pos);
+  cam->GetFocalPoint(fp);
+  cam->GetViewUp(viewup);
+  
+  cam = this->Renderer->GetActiveCamera();
+  cam->SetPosition(pos);
+  cam->SetFocalPoint(fp);
+  cam->SetViewUp(viewup);
+  this->Renderer->ResetCamera();
+  
+  this->SquareRenderer();
+}
+
+void vtkPVAxesWidget::UpdateCursorIcon()
+{
+  if (!this->Enabled)
+    {
+    this->SetMouseCursor(vtkPVAxesWidget::Outside);
+    return;
+    }
+  
+  if (this->Moving)
+    {
+    return;
+    }
+  
+  int *parentSize = this->ParentRenderer->GetSize();
+  
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  double xNorm = x / (double)parentSize[0];
+  double yNorm = y / (double)parentSize[1];
+  
+  double pos[4];
+  this->Renderer->GetViewport(pos);
+  
+  int pState = this->MouseCursorState;
+  
+  if (xNorm > pos[0] && xNorm < pos[2] && yNorm > pos[1] && yNorm < pos[3])
+    {
+    this->MouseCursorState = vtkPVAxesWidget::Inside;
+    }
+  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[3]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::TopLeft;
+    }
+  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[3]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::TopRight;
+    }
+  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[1]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::BottomLeft;
+    }
+  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[1]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::BottomRight;
+    }
+  else
+    {
+    this->MouseCursorState = vtkPVAxesWidget::Outside;
+    }
+
+  if (pState == this->MouseCursorState)
+    {
+    return;
+    }
+  
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    this->Renderer->RemoveActor(this->OutlineActor);
+    }
+  else
+    {
+    this->Renderer->AddActor(this->OutlineActor);
+    }
+  this->Interactor->Render();
+  
+  this->SetMouseCursor(this->MouseCursorState);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetMouseCursor(int cursorState)
+{
+  switch (cursorState)
+    {
+    case vtkPVAxesWidget::Outside:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_DEFAULT);
+      break;
+    case vtkPVAxesWidget::Inside:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZEALL);
+      break;
+    case vtkPVAxesWidget::TopLeft:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENW);
+      break;
+    case vtkPVAxesWidget::TopRight:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENE);
+      break;
+    case vtkPVAxesWidget::BottomLeft:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESW);
+      break;
+    case vtkPVAxesWidget::BottomRight:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESE);
+      break;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ProcessEvents(vtkObject* vtkNotUsed(object),
+                                    unsigned long event,
+                                    void *clientdata,
+                                    void* vtkNotUsed(calldata))
+{
+  vtkPVAxesWidget *self =
+    reinterpret_cast<vtkPVAxesWidget*>(clientdata);
+
+  if (!self->GetInteractive())
+    {
+    return;
+    }
+  
+  switch (event)
+    {
+    case vtkCommand::LeftButtonPressEvent:
+      self->OnButtonPress();
+      break;
+    case vtkCommand::MouseMoveEvent:
+      self->OnMouseMove();
+      break;
+    case vtkCommand::LeftButtonReleaseEvent:
+      self->OnButtonRelease();
+      break;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnButtonPress()
+{
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    return;
+    }
+  
+  this->SetMouseCursor(this->MouseCursorState);
+
+  this->StartPosition[0] = this->Interactor->GetEventPosition()[0];
+  this->StartPosition[1] = this->Interactor->GetEventPosition()[1];
+  
+  this->Moving = 1;
+  this->EventCallbackCommand->SetAbortFlag(1);
+  this->StartInteraction();
+  this->InvokeEvent(vtkCommand::StartInteractionEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnButtonRelease()
+{
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    return;
+    }
+  
+  this->Moving = 0;
+  this->EndInteraction();
+  this->InvokeEvent(vtkCommand::EndInteractionEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnMouseMove()
+{
+  if (this->Moving)
+    {
+    switch (this->MouseCursorState)
+      {
+      case vtkPVAxesWidget::Inside:
+        this->MoveWidget();
+        break;
+      case vtkPVAxesWidget::TopLeft:
+        this->ResizeTopLeft();
+        break;
+      case vtkPVAxesWidget::TopRight:
+        this->ResizeTopRight();
+        break;
+      case vtkPVAxesWidget::BottomLeft:
+        this->ResizeBottomLeft();
+        break;
+      case vtkPVAxesWidget::BottomRight:
+        this->ResizeBottomRight();
+        break;
+      }
+    
+    this->UpdateCursorIcon();
+    this->EventCallbackCommand->SetAbortFlag(1);
+    this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
+    }
+  else
+    {
+    this->UpdateCursorIcon();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::MoveWidget()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  double newPos[4];
+  newPos[0] = vp[0] + dxNorm;
+  newPos[1] = vp[1] + dyNorm;
+  newPos[2] = vp[2] + dxNorm;
+  newPos[3] = vp[3] + dyNorm;
+
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    newPos[2] = vp[2] - vp[0];
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    newPos[3] = vp[3] - vp[1];
+    }
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = (int)(size[0] - size[0] * (vp[2]-vp[0]));
+    newPos[0] = 1 - (vp[2]-vp[0]);
+    newPos[2] = 1;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = (int)(size[1] - size[1]*(vp[3]-vp[1]));
+    newPos[1] = 1 - (vp[3]-vp[1]);
+    newPos[3] = 1;
+    }
+
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeTopLeft()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  int useX;
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    useX = 1;
+    }
+  else
+    {
+    change = dyNorm;
+    useX = 0;
+    }
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = useX ? vp[0] + change : vp[0] - change;
+  newPos[1] = vp[1];
+  newPos[2] = vp[2];
+  newPos[3] = useX ? vp[3] - change : vp[3] + change;
+  
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    }
+  if (newPos[0] >= newPos[2]-0.01)
+    {
+    newPos[0] = newPos[2] - 0.01;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = size[1];
+    newPos[3] = 1;
+    }
+  if (newPos[3] <= newPos[1]+0.01)
+    {
+    newPos[3] = newPos[1] + 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeTopRight()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    }
+  else
+    {
+    change = dyNorm;
+    }
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0];
+  newPos[1] = vp[1];
+  newPos[2] = vp[2] + change;
+  newPos[3] = vp[3] + change;
+  
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = size[0];
+    newPos[2] = 1;
+    }
+  if (newPos[2] <= newPos[0]+0.01)
+    {
+    newPos[2] = newPos[0] + 0.01;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = size[1];
+    newPos[3] = 1;
+    }
+  if (newPos[3] <= newPos[1]+0.01)
+    {
+    newPos[3] = newPos[1] + 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeBottomLeft()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  double *vp = this->Renderer->GetViewport();
+  
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    }
+  else
+    {
+    change = dyNorm;
+    }
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0] + change;
+  newPos[1] = vp[1] + change;
+  newPos[2] = vp[2];
+  newPos[3] = vp[3];
+  
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    }
+  if (newPos[0] >= newPos[2]-0.01)
+    {
+    newPos[0] = newPos[2] - 0.01;
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    }
+  if (newPos[1] >= newPos[3]-0.01)
+    {
+    newPos[1] = newPos[3] - 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeBottomRight()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  int useX;
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    useX = 1;
+    }
+  else
+    {
+    change = dyNorm;
+    useX = 0;
+    }
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0];
+  newPos[1] = useX ? vp[1] - change : vp[1] + change;
+  newPos[2] = useX ? vp[2] + change : vp[2] - change;
+  newPos[3] = vp[3];
+  
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = size[0];
+    newPos[2] = 1;
+    }
+  if (newPos[2] <= newPos[0]+0.01)
+    {
+    newPos[2] = newPos[0] + 0.01;
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    }
+  if (newPos[1] >= newPos[3]-0.01)
+    {
+    newPos[1] = newPos[3]-0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SquareRenderer()
+{
+  int *size = this->Renderer->GetSize();
+  if (size[0] == 0 || size[1] == 0)
+    {
+    return;
+    }
+  
+  double vp[4];
+  this->Renderer->GetViewport(vp);
+  
+  double deltaX = vp[2] - vp[0];
+  double newDeltaX = size[1] * deltaX / (double)size[0];
+  double deltaY = vp[3] - vp[1];
+  double newDeltaY = size[0] * deltaY / (double)size[1];
+
+  if (newDeltaX > 1)
+    {
+    if (newDeltaY > 1)
+      {
+      if (size[0] > size[1])
+        {
+        newDeltaX = size[1] / (double)size[0];
+        newDeltaY = 1;
+        }
+      else
+        {
+        newDeltaX = 1;
+        newDeltaY = size[0] / (double)size[1];
+        }
+      vp[0] = vp[1] = 0;
+      vp[2] = newDeltaX;
+      vp[3] = newDeltaY;
+      }
+    else
+      {
+      vp[3] = vp[1] + newDeltaY;
+      if (vp[3] > 1)
+        {
+        vp[3] = 1;
+        vp[1] = vp[3] - newDeltaY;
+        }
+      }
+    }
+  else
+    {
+    vp[2] = vp[0] + newDeltaX;
+    if (vp[2] > 1)
+      {
+      vp[2] = 1;
+      vp[0] = vp[2] - newDeltaX;
+      }
+    }
+  
+  this->Renderer->SetViewport(vp);
+  
+  this->Renderer->NormalizedDisplayToDisplay(vp[0], vp[1]);
+  this->Renderer->NormalizedDisplayToDisplay(vp[2], vp[3]);
+  
+  vtkPoints *points = this->Outline->GetPoints();
+  points->SetPoint(0, vp[0]+1, vp[1]+1, 0);
+  points->SetPoint(1, vp[2]-1, vp[1]+1, 0);
+  points->SetPoint(2, vp[2]-1, vp[3]-1, 0);
+  points->SetPoint(3, vp[0]+1, vp[3]-1, 0);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetInteractive(int state)
+{
+  if (this->Interactive != state)
+    {
+    this->Interactive = state;
+    }
+  
+  if (!state)
+    {
+    this->OnButtonRelease();
+    this->MouseCursorState = vtkPVAxesWidget::Outside;
+    this->Renderer->RemoveActor(this->OutlineActor);
+    if (this->Interactor)
+      {
+      this->SetMouseCursor(this->MouseCursorState);
+      // this->Interactor->Render();
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetOutlineColor(double r, double g, double b)
+{
+  this->OutlineActor->GetProperty()->SetColor(r, g, b);
+  if (this->Interactor)
+    {
+//    this->Interactor->Render();
+    }
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetOutlineColor()
+{
+  return this->OutlineActor->GetProperty()->GetColor();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetAxisLabelColor(double r, double g, double b)
+{
+  this->AxesActor->GetXAxisLabelProperty()->SetColor(r, g, b);
+  this->AxesActor->GetYAxisLabelProperty()->SetColor(r, g, b);
+  this->AxesActor->GetZAxisLabelProperty()->SetColor(r, g, b);
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetAxisLabelColor()
+{
+  return this->AxesActor->GetXAxisLabelProperty()->GetColor();
+}
+
+//----------------------------------------------------------------------------
+vtkRenderer* vtkPVAxesWidget::GetParentRenderer()
+{
+  return this->ParentRenderer;
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetViewport(double minX, double minY,
+                                  double maxX, double maxY)
+{
+  this->Renderer->SetViewport(minX, minY, maxX, maxY);
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetViewport()
+{
+  return this->Renderer->GetViewport();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os, indent);
+  
+  os << indent << "AxesActor: " << this->AxesActor << endl;
+  os << indent << "Interactive: " << this->Interactive << endl;
+}
diff --git a/src/SVTK/vtkPVAxesWidget.h b/src/SVTK/vtkPVAxesWidget.h
new file mode 100644 (file)
index 0000000..35c152a
--- /dev/null
@@ -0,0 +1,159 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+// .NAME vtkPVAxesWidget - A widget to manipulate an axe
+//
+// .SECTION Description
+// This widget creates and manages its own vtkPVAxesActor.
+
+
+#ifndef __vtkPVAxesWidget_h
+#define __vtkPVAxesWidget_h
+
+#include "SVTK.h"
+#include "vtkInteractorObserver.h"
+
+class vtkActor2D;
+class vtkKWApplication;
+class vtkPolyData;
+class vtkPVAxesActor;
+class vtkPVAxesWidgetObserver;
+class vtkRenderer;
+
+class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver
+{
+public:
+  static vtkPVAxesWidget* New();
+  vtkTypeRevisionMacro(vtkPVAxesWidget, vtkInteractorObserver);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Set/get the axes actor to be displayed in this 3D widget.
+  void SetAxesActor(vtkPVAxesActor *actor);
+  vtkGetObjectMacro(AxesActor, vtkPVAxesActor);
+
+  // Description:
+  // Enable the 3D widget.
+  virtual void SetEnabled(int);
+
+  //BTX
+  // Description:
+  // Set the renderer this 3D widget will be contained in.
+  void SetParentRenderer(vtkRenderer *ren);
+  vtkRenderer* GetParentRenderer();
+  //ETX
+  
+  // Description:
+  // Callback to keep the camera for the axes actor up to date with the
+  // camera in the parent renderer
+  void ExecuteEvent(vtkObject *o, unsigned long event, void *calldata);
+
+  // Description:
+  // Set/get whether to allow this 3D widget to be interactively moved/scaled.
+  void SetInteractive(int state);
+  vtkGetMacro(Interactive, int);
+  vtkBooleanMacro(Interactive, int);
+  
+  // Description:
+  // Set/get the color of the outline of this widget.  The outline is visible
+  // when (in interactive mode) the cursor is over this 3D widget.
+  void SetOutlineColor(double r, double g, double b);
+  double *GetOutlineColor();
+  
+  // Description:
+  // Set/get the color of the axis labels of this widget.
+  void SetAxisLabelColor(double r, double g, double b);
+  double *GetAxisLabelColor();
+  
+  // Description:
+  // Set/get the viewport to position/size this 3D widget.
+  void SetViewport(double minX, double minY, double maxX, double maxY);
+  double* GetViewport();
+  
+protected:
+  vtkPVAxesWidget();
+  ~vtkPVAxesWidget();
+  
+  vtkRenderer *Renderer;
+  vtkRenderer *ParentRenderer;
+  
+  vtkPVAxesActor *AxesActor;
+  vtkPolyData *Outline;
+  vtkActor2D *OutlineActor;
+  
+  static void ProcessEvents(vtkObject *object, unsigned long event,
+                            void *clientdata, void *calldata);
+
+  vtkPVAxesWidgetObserver *Observer;
+  int StartTag;
+  
+  int MouseCursorState;
+  int Moving;
+  int StartPosition[2];
+
+  int Interactive;
+  
+  void UpdateCursorIcon();
+  void SetMouseCursor(int cursorState);
+  
+//BTX
+  int State;
+  
+  enum AxesWidgetState
+  {
+    Outside = 0,
+    Inside,
+    TopLeft,
+    TopRight,
+    BottomLeft,
+    BottomRight
+  };
+//ETX
+  
+  void OnButtonPress();
+  void OnMouseMove();
+  void OnButtonRelease();
+
+  void MoveWidget();
+  void ResizeTopLeft();
+  void ResizeTopRight();
+  void ResizeBottomLeft();
+  void ResizeBottomRight();
+  
+  void SquareRenderer();
+
+  unsigned long StartEventObserverId;  
+private:
+  vtkPVAxesWidget(const vtkPVAxesWidget&);  // Not implemented
+  void operator=(const vtkPVAxesWidget&);  // Not implemented
+};
+
+#endif
index 9c94a2680f9775591cca7d2d46ebe8d82f7caa24..c82f8e5ebaf1e2bb2261576bbcf726d5a3bdcfec 100755 (executable)
@@ -98,13 +98,16 @@ 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@     \
index ed874a3f4d1170a03d21a6433df86a90dff8de11..6f049d5f6501269c93b9b562dab39dcd7b823436 100644 (file)
@@ -84,6 +84,7 @@
 #include <QListWidget>
 #include <QGridLayout>
 #include <QMenu>
+#include <QtDebug>
 
 #include <SALOMEDSClient_ClientFactory.hxx>
 #include <Basics_Utils.hxx>
@@ -205,26 +206,45 @@ void SalomeApp_Application::start()
     // import/execute python scripts
     if ( pyfiles.count() > 0 && activeStudy() ) {
       SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
-      if ( appStudy ) {
+      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(r\"%1\")" ).arg( fi.absoluteFilePath() );
-                pyConsole->exec( command );
-              }
-              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 );
-              }
+            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;
+               }
+             }
+             if ( !found ) {
+               qDebug() << "Can't execute file" << pyfiles[j];
+             }
             }
           }
         }
@@ -310,7 +330,7 @@ void SalomeApp_Application::createActions()
   // 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","Tools","Plugins");
+  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);
index 061976175d2eb6faa7ac102857c25069a162ae8d..9ab2640d25d131e752c6836245c1119f7e9c3c71 100644 (file)
@@ -301,7 +301,12 @@ bool NoteBook_TableRow::IsValidStringValue(const QString theValue)
     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;
 }
 
@@ -472,7 +477,13 @@ bool NoteBook_Table::IsValid() const
       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;
 }
 
@@ -481,7 +492,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));
   }
diff --git a/src/SalomeApp/addvars2notebook.py b/src/SalomeApp/addvars2notebook.py
new file mode 100644 (file)
index 0000000..6f23755
--- /dev/null
@@ -0,0 +1,67 @@
+
+import os
+import os.path
+
+def addvars2notebook(filename):
+    #
+    vars_and_values = []
+    contents = []
+    #
+    directory = os.path.dirname(filename)
+    base = os.path.basename(filename)
+    prefix = base[:-3] # remove ".py"
+    prefix = prefix + '_'
+    from os import listdir
+    l = listdir(directory)
+    for f in l:
+        if f.find(prefix) != 0: continue
+        if f[-3:] != ".py": continue
+        module = f[len(prefix):-3]
+        try:
+            mod = __import__("addvars2notebook_%s"%(module))
+        except ImportError:
+            continue
+        try:
+            func = mod.addvars2notebook
+        except AttributeError:
+            continue
+        fff = os.path.join(directory, f)
+        content = func(fff, vars_and_values)
+        contents.append([fff, content])
+        pass
+    #
+    if vars_and_values:
+        stream = open(filename)
+        content = stream.read()
+        stream.close()
+        fields = content.split("import iparameters")
+        if len(fields) == 2:
+            begin = fields[0]
+            if begin.find("## NoteBook E.A.") >= 0:
+                begin = begin.split("## NoteBook E.A.")[0]
+                pass
+            end = "import iparameters" + fields[1]
+            content = begin
+            content += "## NoteBook E.A.\n"
+            for var, value in vars_and_values:
+                content += "notebook.set(%s,%s)\n"%(var.__repr__(), value)
+                pass
+            content += end
+            stream = open(filename, "w")
+            stream.write(content)
+            stream.close()
+            #
+            for fff, content in contents:
+                stream = open(fff, "w")
+                stream.write(content)
+                stream.close()
+                pass
+            pass
+        pass
+    #
+    return
+
+if __name__ == "__main__":
+    import sys
+    addvars2notebook(sys.argv[1])
+    pass
index 970ca1d78c9c9d70ab9367a90fa047246dcc7916..358809fc3690ae3598557a6fc2654608f2330e36 100644 (file)
@@ -42,6 +42,7 @@
   </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|%PM_msg_%L.qm|%P_icons.qm|%P_images.qm|%PM_images.qm"/>
   </section>
   </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="iso_number_v"   value="1" />
     <parameter name="trihedron_size" value="100" />
     <parameter name="navigation_mode" value="0"/>
+    <parameter name="zooming_mode"   value="0" />
  </section>
  <section name="VTKViewer" >
     <!-- VTK viewer preferences -->
     <parameter name="group_names_transparency" value="0.5"/>
     <parameter name="projection_mode" value="0"/>
     <parameter name="navigation_mode" value="0"/>
+    <parameter name="zooming_mode" value="0" />
     <parameter name="speed_mode" value="0"/>
     <parameter name="speed_value" value="10"/>
+    <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="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>
 </document>
index e12a7d532d3a74ca4c6fa96d5184ae6fafde962b..2b98f750607c50112ecc30e4d4b587087bee30be 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
@@ -87,15 +66,15 @@ Python file must include only letters, digits and underscores and start from let
     </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>
@@ -185,6 +164,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>
@@ -261,6 +244,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>
@@ -277,6 +268,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>
@@ -309,6 +304,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>
@@ -382,101 +381,101 @@ Do you want to reload it ?</translation>
 </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>Variable Name Incorrect :%1</translation>
-       </message>
-        <message>      
-           <source>VARNAME_EXISTS</source>
-           <translation>Variable 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
+    <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 )
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Specify a floating-point value in range ( %1; %2 )
 with %3-digit precision</translation>
-        </message>
+    </message>
 </context>
 <context>
-    <name>SalomeApp_IntSpinBox</name>  
-        <message>
-            <source>VALID_RANGE_VAR_MSG</source>
-            <translation>Specify either a variable name or
+    <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>
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Specify an integer value in range ( %1; %2 )</translation>
+    </message>
 </context>
 </TS>
diff --git a/src/SalomeApp/resources/SalomeApp_msg_fr.ts b/src/SalomeApp/resources/SalomeApp_msg_fr.ts
new file mode 100755 (executable)
index 0000000..ad10328
--- /dev/null
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>WRN_FILE_NAME_BAD</source>
+        <translation>Indiquez un nom de fichier correct.
+Un fichier Python ne doit être composé que de lettres, chiffres et tirets bas et doit commencer avec une lettre ou un tiret bas.</translation>
+    </message>
+    <message>
+        <source>WRN_FILE_NOT_EXIST</source>
+        <translation>Le fichier %1 n&apos;existe pas.</translation>
+    </message>
+    <message>
+        <source>CLOSE_LOCKED_STUDY</source>
+        <translation>Fermer l&apos;étude verrouillée?</translation>
+    </message>
+    <message>
+        <source>PUBLISH_IN_STUDY</source>
+        <translation>Publier dans l&apos;étude</translation>
+    </message>
+    <message>
+        <source>BUT_NEW</source>
+        <translation>&amp;Nouvelle</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_ROOT_NAME</source>
+        <translation>Etats d&apos;IHM</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_ROOT_TOOLTIP</source>
+        <translation>Etats d&apos;IHM persistents</translation>
+    </message>
+    <message>
+        <source>SAVE_GUI_STATE</source>
+        <translation>Sauvegarder l&apos;état d&apos;IHM</translation>
+    </message>
+    <message>
+        <source>BUT_LOAD</source>
+        <translation>&amp;Charger</translation>
+    </message>
+    <message>
+        <source>BUT_OPEN</source>
+        <translation>&amp;Ouvrir</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_OBJECT_TOOLTIP</source>
+        <translation>Etat d&apos;IHM: %1 sauvegardé</translation>
+    </message>
+    <message>
+        <source>SAVE_POINT_DEF_NAME</source>
+        <translation>Etat d&apos;IHM: </translation>
+    </message>
+    <message>
+        <source>VALUE_COLUMN</source>
+        <translation>Valeur</translation>
+    </message>
+    <message>
+        <source>IOR_COLUMN</source>
+        <translation>IOR</translation>
+    </message>
+    <message>
+        <source>REFENTRY_COLUMN</source>
+        <translation>Entrée de réf.</translation>
+    </message>
+    <message>
+        <source>ERR_INCOMPATIBLE_TYPE</source>
+        <translation>Le type numérique de la variable &quot;%1&quot; n&apos;est pas compatible</translation>
+    </message>
+    <message>
+        <source>ERR_INVALID_VALUE</source>
+        <translation>La valeur n&apos;a pas été validée</translation>
+    </message>
+    <message>
+        <source>ERR_NO_VARIABLE</source>
+        <translation>La variable &quot;%1&quot; n&apos;existe pas.</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_Application</name>
+    <message>
+        <source>ALL_FILES_FILTER</source>
+        <translation>Tous les fichiers (*.*)</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_UNLOAD</source>
+        <translation>&amp;Déconnecter</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CLOSE</source>
+        <translation>&amp;Fermer sans sauvegarder</translation>
+    </message>
+    <message>
+        <source>MEN_WINDOWS_NEW</source>
+        <translation>Nouvelle Fenêtre</translation>
+    </message>
+    <message>
+        <source>MEN_DELETE_INVALID_REFERENCE</source>
+        <translation>Supprimer la Référence Invalide</translation>
+    </message>
+    <message>
+        <source>TOT_FILE_DESK_PREFERENCES</source>
+        <translation>Préférences</translation>
+    </message>
+    <message>
+        <source>MEN_DELETE_VS</source>
+        <translation>Supprimer</translation>
+    </message>
+    <message>
+        <source>MEN_OPENWITH</source>
+        <translation>Activer Module %1 </translation>
+    </message>
+    <message>
+        <source>MEN_DESK_REGISTRY_DISPLAY</source>
+        <translation>Affichage du registre CORBA</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_SAVE</source>
+        <translation>&amp;Sauvegarder &amp;&amp; Fermer</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Exécuter un script python</translation>
+    </message>
+    <message>
+        <source>PREF_STORE_VISUAL_STATE</source>
+        <translation>Sauvegarder/restaurer le dernier ètat d&apos;IHM</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Sauvegarder l&apos;état actuel des vues 3D, des objets affichés, etc.</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Sauvegarder l&apos;état d&apos;IHM</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
+        <translation>Sauvegarder l&apos;état d&apos;IHM</translation>
+    </message>
+    <message>
+        <source>MEN_RESTORE_VS</source>
+        <translation>Restaurer</translation>
+    </message>
+    <message>
+        <source>WRN_DUMP_STUDY_FAILED</source>
+        <translation>Impossible de générer le script de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PROPERTIES</source>
+        <translation>Pro&amp;priétés...</translation>
+    </message>
+    <message>
+        <source>QUE_DOC_ALREADYEXIST</source>
+        <translation>Le document %1 existe déjà dans le gestionnaire d&apos;études.
+Voulez-vous le recharger ?</translation>
+    </message>
+    <message>
+        <source>MEN_RENAME_VS</source>
+        <translation>Renommer</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_CATALOG_GENERATOR</source>
+        <translation>Générateur de catalogue</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Ajouter les variables au registre</translation>
+    </message>
+    <message>
+        <source>PUBLISH_IN_STUDY</source>
+        <translation>Publier dans l&apos;étude</translation>
+    </message>
+    <message>
+        <source>PREF_OBJ_BROWSER_SETTINGS</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_REGISTRY_DISPLAY</source>
+        <translation>Visualiser le contenu du registre du serveur CORBA</translation>
+    </message>
+    <message>
+        <source>PYTHON_FILES_FILTER</source>
+        <translation>Fichiers PYTHON (*.py)</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_DESCRIPTION</source>
+        <translation>Voulez-vous fermer ou décharger l&apos;étude avant de la fermer?</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_PROPERTIES</source>
+        <translation>Editer les propriétés de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>PREF_TAB_OBJBROWSER</source>
+        <translation>Arbre d&apos;étude</translation>
+    </message>
+    <message>
+        <source>STUDY_LOCKED</source>
+        <translation>VERROUILLEE</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CANCEL</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_NAME</source>
+        <translation>Objet</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_REGISTRY_DISPLAY</source>
+        <translation>Visualiser le registre CORBA</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_0</source>
+        <translation>Entrée</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_1</source>
+        <translation>Valeur</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_2</source>
+        <translation>IOR</translation>
+    </message>
+    <message>
+        <source>OBJ_BROWSER_COLUMN_3</source>
+        <translation>Entrée de référence</translation>
+    </message>
+    <message>
+        <source>PREF_CATEGORY_SALOME</source>
+        <translation>SALOME</translation>
+    </message>
+    <message>
+        <source>PYTHON_CONSOLE</source>
+        <translation>Console Python </translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Exécuter un scrip&amp;t...</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_TOOLS</source>
+        <translation>&amp;Outils</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PLUGINS_TOOLS</source>
+       <translation>Outils</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_PLUGINS</source>
+        <translation>Extensions</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_DUMP_STUDY</source>
+        <translation>Générer le script de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>MEN_VIEW_WNDS</source>
+        <translation>Fenêtres</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_DUMP_STUDY</source>
+        <translation>&amp;Générer le script de l&apos;étude...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_CATALOG_GENERATOR</source>
+        <translation>Génére un catalogue XML de l&apos;interface du composant</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Ajouter les variables de l&apos;étude au registre</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_DUMP_STUDY</source>
+        <translation>Génère le script python de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_FILE_NOTEBOOK</source>
+        <translation>Ouvrir le Registre</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_FILE_NOTEBOOK</source>
+        <translation>Re&amp;gistre...</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_NOTEBOOK</source>
+        <translation>Ouvrir le Registre</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_PROPERTIES</source>
+        <translation>Propriétés de l&apos;étude</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_DEF_COLUMNS</source>
+        <translation>Colonnes par défaut</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_FILE_LOAD_SCRIPT</source>
+        <translation>Exécute un script Python à partir d&apos;un fichier</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CATALOG_GENERATOR</source>
+        <translation>&amp;Genérateur de Catalogue</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
+        <translation>Ajouter les variables au Registre</translation>
+    </message>
+    <message>
+        <source>APPCLOSE_CAPTION</source>
+        <translation>Fermer l&apos;étude actuelle</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_MRU</source>
+        <translation>Dernières études ouvertes</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_MRU</source>
+        <translation>Dernières études ouvertes</translation>
+    </message>
+    <message>
+        <source>ACTIVATE_MODULE_OP_LOAD</source>
+        <translation>&amp;Charger...</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_StudyPropertiesDlg</name>
+    <message>
+        <source>PRP_MODE_FROM_SCRATCH</source>
+        <translation>du début</translation>
+    </message>
+    <message>
+        <source>PRP_AUTHOR</source>
+        <translation>Auteur</translation>
+    </message>
+    <message>
+        <source>PRP_LOCKED</source>
+        <translation>Verrouillée</translation>
+    </message>
+    <message>
+        <source>PRP_MODIFICATIONS</source>
+        <translation>Modifications</translation>
+    </message>
+    <message>
+        <source>PRP_NO</source>
+        <translation>Non</translation>
+    </message>
+    <message>
+        <source>PRP_YES</source>
+        <translation>Oui</translation>
+    </message>
+    <message>
+        <source>PRP_MODIFIED</source>
+        <translation>Modifiée</translation>
+    </message>
+    <message>
+        <source>PRP_DATE</source>
+        <translation>Créée</translation>
+    </message>
+    <message>
+        <source>PRP_MODE</source>
+        <translation>Mode</translation>
+    </message>
+    <message>
+        <source>PRP_MODE_FROM_COPYFROM</source>
+        <translation>copier de</translation>
+    </message>
+    <message>
+        <source>TLT_STUDY_PROPERTIES</source>
+        <translation>Propriétés de l&apos;étude</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_ExitDlg</name>
+    <message>
+        <source>SHUTDOWN_SERVERS</source>
+        <translation>Arrêter les serveurs autonomes</translation>
+    </message>
+</context>
+<context>
+    <name>NoteBook_Table</name>
+    <message>
+        <source>REMOVE_VARIABLE_IS_USED</source>
+        <translation>La variable &quot;%1&quot; est utilisée dans l&apos;étude.
+Voulez-vous vraiment la supprimer?</translation>
+    </message>
+    <message>
+        <source>RENAME_VARIABLE_IS_USED</source>
+        <translation>La variable &quot;%1&quot; est utilisée dans l&apos;étude.
+Voulez-vous vraiment la renommer?</translation>
+    </message>
+    <message>
+        <source>VARNAME_COLUMN</source>
+        <translation>Nom de la variable</translation>
+    </message>
+    <message>
+        <source>VARVALUE_COLUMN</source>
+        <translation>Valeur de la variable</translation>
+    </message>
+    <message>
+        <source>VARVALUE_INCORRECT</source>
+        <translation>La valeur de la variable n&apos;est pas correcte: %1</translation>
+    </message>
+    <message>
+        <source>VARNAME_INCORRECT</source>
+        <translation>Le nom de la variable n&apos;est pas correct: %1</translation>
+    </message>
+    <message>
+        <source>VARNAME_EXISTS</source>
+        <translation>La variable &quot;%1&quot; existe</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_NoteBookDlg</name>
+    <message>
+        <source>NOTEBOOK_TITLE</source>
+        <translation>Registre Salome</translation>
+    </message>
+    <message>
+        <source>BUT_UPDATE_STUDY</source>
+        <translation>&amp;Mettre l&apos;étude à jour</translation>
+    </message>
+    <message>
+        <source>BUT_REMOVE</source>
+        <translation>&amp;Supprimer</translation>
+    </message>
+    <message>
+        <source>BUT_APPLY_AND_CLOSE</source>
+        <translation>A&amp;ppliquer et Fermer</translation>
+    </message>
+    <message>
+        <source>BUT_HELP</source>
+        <translation>&amp;Aide</translation>
+    </message>
+    <message>
+        <source>CLOSE_CAPTION</source>
+        <translation>Fermer le Registre</translation>
+    </message>
+    <message>
+        <source>CLOSE_DESCRIPTION</source>
+        <translation>Voulez-vous sauvegarder les changements faits au Registre?</translation>
+    </message>
+    <message>
+        <source>INCORRECT_DATA</source>
+        <translation>Au moins une variable a été définie incorrectement.
+Editez ses paramètres ou retirez la de la liste.</translation>
+    </message>
+    <message>
+        <source>ERR_UPDATE_STUDY_FAILED</source>
+        <translation>Impossible de mettre l&apos;étude à jour!</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_DoubleSpinBox</name>
+    <message>
+        <source>VALID_RANGE_VAR_MSG</source>
+        <translation>Indiquez un nom de variable ou
+une valeur réelle dans l&apos;intervalle ( %1; %2 )
+avec une précision de %3 décimales</translation>
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Indiquez une valeur réelle dans l&apos;intervalle ( %1; %2 )
+avec une précision de %3 décimales</translation>
+    </message>
+</context>
+<context>
+    <name>SalomeApp_IntSpinBox</name>
+    <message>
+        <source>VALID_RANGE_VAR_MSG</source>
+        <translation>Indiquez un nom de variable ou
+une valeur entière dans l&apos;intervalle ( %1; %2 )</translation>
+    </message>
+    <message>
+        <source>VALID_RANGE_NOVAR_MSG</source>
+        <translation>Indiquez une valeur entière dans l&apos;intervalle ( %1; %2 )</translation>
+    </message>
+</context>
+</TS>
index 00199335d0cb8a5051afa8db928576c3e9fb609b..da726a8374e402c57af1170a1f36a02207dac74b 100644 (file)
@@ -77,12 +77,21 @@ plugins={}
 current_plugins_manager=None
 
 def initialize(module,name,basemenuname,menuname):
-  if plugins.has_key(name):return
-  plugins[name]=PluginsManager(module,name,basemenuname,menuname)
+  if not plugins.has_key(name):
+    if module:
+      plugins[name]={}
+    else:
+      plugins[name]=[]
+  if module:
+    studyId=sg.getActiveStudyId()
+    if plugins[name].has_key(studyId):return
+    plugins[name][studyId]=PluginsManager(module,name,basemenuname,menuname)
+  else:
+    plugins[name].append(PluginsManager(module,name,basemenuname,menuname))
 
 class Context:
-    def __init__(self,sg):
-        self.sg=sg
+    def __init__(self,sgpyqt):
+        self.sg=sgpyqt
         self.studyId=salome.sg.getActiveStudyId()
         self.study= salome.myStudyManager.GetStudyByID(self.studyId)
 
index 40e5a7ad03799acc0840e6a737543c88b27f1db9..d3d61e2e12449a752ca7b141c3b8f6f3818588b5 100755 (executable)
@@ -376,7 +376,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 );
index 4b2d215a5db6bf771ee7b3febc38d8133e067918..ec4efbf620b967fb8252ef1e134f2b88a53fa47f 100644 (file)
@@ -65,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 326dbcc03a2389bcfe7b5ebf065b406257cf3040..e748d06c65c162e514e61f98fa91171fe3b5ecb5 100644 (file)
@@ -127,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() );
@@ -376,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
@@ -496,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 );
 
index edc398565fa88b9e9d3698721f90142e5d5e2b5b..3df8e7f66f614acb9b856914453be46d4a564a85 100644 (file)
@@ -413,7 +413,8 @@ 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
diff --git a/src/Style/resources/Style_msg_fr.ts b/src/Style/resources/Style_msg_fr.ts
new file mode 100644 (file)
index 0000000..29604c9
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>Style_PrefDlg</name>
+    <message>
+        <source>Quick</source>
+        <translation>Rapide</translation>
+    </message>
+    <message>
+        <source>Auto</source>
+        <translation>Auto</translation>
+    </message>
+    <message>
+        <source>Base colors</source>
+        <translation>Couleurs de base</translation>
+    </message>
+    <message>
+        <source>Additional colors</source>
+        <translation>Couleurs supplémentaires</translation>
+    </message>
+    <message>
+        <source>Active</source>
+        <translation>Actif</translation>
+    </message>
+    <message>
+        <source>Inactive</source>
+        <translation>Inactif</translation>
+    </message>
+    <message>
+        <source>Disabled</source>
+        <translation>Désactivé</translation>
+    </message>
+    <message>
+        <source>Window text</source>
+        <translation>Texte de la fenêtre</translation>
+    </message>
+    <message>
+        <source>Button</source>
+        <translation>Bouton</translation>
+    </message>
+    <message>
+        <source>Light</source>
+        <translation>Clair</translation>
+    </message>
+    <message>
+        <source>Midlight</source>
+        <translation>Demi-clair</translation>
+    </message>
+    <message>
+        <source>Dark</source>
+        <translation>Foncé</translation>
+    </message>
+    <message>
+        <source>Mid</source>
+        <translation>Moyen</translation>
+    </message>
+    <message>
+        <source>Text</source>
+        <translation>Texte</translation>
+    </message>
+    <message>
+        <source>Bright text</source>
+        <translation>Texte éclairé</translation>
+    </message>
+    <message>
+        <source>Button text</source>
+        <translation>Texte du bouton</translation>
+    </message>
+    <message>
+        <source>Base</source>
+        <translation>Base</translation>
+    </message>
+    <message>
+        <source>Window</source>
+        <translation>Fenêtre</translation>
+    </message>
+    <message>
+        <source>Shadow</source>
+        <translation>Ombre</translation>
+    </message>
+    <message>
+        <source>Highlight</source>
+        <translation>Surligner</translation>
+    </message>
+    <message>
+        <source>Highlighted text</source>
+        <translation>Texte surligné</translation>
+    </message>
+    <message>
+        <source>Link</source>
+        <translation>Lien</translation>
+    </message>
+    <message>
+        <source>Visited link</source>
+        <translation>Lien visité</translation>
+    </message>
+    <message>
+        <source>Alternate base</source>
+        <translation>Base alternative</translation>
+    </message>
+    <message>
+        <source>Tooltip base</source>
+        <translation>Base d&apos;infobulle</translation>
+    </message>
+    <message>
+        <source>Tooltip text</source>
+        <translation>Texte d&apos;infobulle</translation>
+    </message>
+    <message>
+        <source>Border top</source>
+        <translation>Frontière de dessus</translation>
+    </message>
+    <message>
+        <source>Border bottom</source>
+        <translation>Frontière de dessous</translation>
+    </message>
+    <message>
+        <source>Tab border top</source>
+        <translation>Frontière de dessus de l&apos;onglet</translation>
+    </message>
+    <message>
+        <source>Tab border bottom</source>
+        <translation>Frontière de dessous de l&apos;onglet</translation>
+    </message>
+    <message>
+        <source>Field light</source>
+        <translation>Champ clair</translation>
+    </message>
+    <message>
+        <source>Field dark</source>
+        <translation>Champ foncé</translation>
+    </message>
+    <message>
+        <source>Slider</source>
+        <translation>Barre de défilement</translation>
+    </message>
+    <message>
+        <source>Lines</source>
+        <translation>Lignes</translation>
+    </message>
+    <message>
+        <source>Widget center</source>
+        <translation>Composant central</translation>
+    </message>
+    <message>
+        <source>Widget border</source>
+        <translation>Composant de frontière</translation>
+    </message>
+    <message>
+        <source>Header</source>
+        <translation>Titre</translation>
+    </message>
+    <message>
+        <source>Progress bar</source>
+        <translation>Barre d&apos;avancement</translation>
+    </message>
+    <message>
+        <source>Pointer</source>
+        <translation>Pointeur</translation>
+    </message>
+    <message>
+        <source>Checked</source>
+        <translation>Coché</translation>
+    </message>
+    <message>
+        <source>Table grid</source>
+        <translation>Quadrillage du tableau</translation>
+    </message>
+    <message>
+        <source>SALOME style preferences</source>
+        <translation>Préférences de style Salomé</translation>
+    </message>
+    <message>
+        <source>Enable SALOME Style</source>
+        <translation>Activer le style Salomé</translation>
+    </message>
+    <message>
+        <source>Font</source>
+        <translation>Caractères</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>None</source>
+        <translation>Aucun</translation>
+    </message>
+    <message>
+        <source>Horizontal</source>
+        <translation>Horizontal</translation>
+    </message>
+    <message>
+        <source>Inclined</source>
+        <translation>Incliné</translation>
+    </message>
+    <message>
+        <source>Transparency</source>
+        <translation>Transparence</translation>
+    </message>
+    <message>
+        <source>Widgets rounding</source>
+        <translation>Arrondi des objets-fenêtres</translation>
+    </message>
+    <message>
+        <source>Buttons</source>
+        <translation>Boutons</translation>
+    </message>
+    <message>
+        <source>Edit boxes</source>
+        <translation>Champs d&apos;édition</translation>
+    </message>
+    <message>
+        <source>Frames</source>
+        <translation>Cadres</translation>
+    </message>
+    <message>
+        <source>Sliders</source>
+        <translation>Barres de défilement</translation>
+    </message>
+    <message>
+        <source>Anti-aliased borders</source>
+        <translation>Frontières anticrénelées</translation>
+    </message>
+    <message>
+        <source>Handle</source>
+        <translation>Poignée</translation>
+    </message>
+    <message>
+        <source>Horizontal spacing</source>
+        <translation>Espacement horizontal</translation>
+    </message>
+    <message>
+        <source>Vertical spacing</source>
+        <translation>Espacement vertical</translation>
+    </message>
+    <message>
+        <source>Splitter handle size</source>
+        <translation>Taille de poignée du diviseur</translation>
+    </message>
+    <message>
+        <source>Slider handle size</source>
+        <translation>Taille de poignée de la barre de défilement</translation>
+    </message>
+    <message>
+        <source>Widget effect</source>
+        <translation>Effet des composants</translation>
+    </message>
+    <message>
+        <source>Highlight widgets</source>
+        <translation>Mettre en valeur les composants</translation>
+    </message>
+    <message>
+        <source>Auto raise widgets</source>
+        <translation>Activer les composants automatiquement</translation>
+    </message>
+    <message>
+        <source>Colors</source>
+        <translation>Couleurs</translation>
+    </message>
+    <message>
+        <source>Properties</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>[ Current ]</source>
+        <translation>[ Actuel ]</translation>
+    </message>
+    <message>
+        <source>[ Default ]</source>
+        <translation>[ Défaut ]</translation>
+    </message>
+    <message>
+        <source>Delete user theme</source>
+        <translation>Supprimer le thème utilisateur</translation>
+    </message>
+    <message>
+        <source>Remove theme %1?</source>
+        <translation>Supprimer le thème %1?</translation>
+    </message>
+    <message>
+        <source>Custom schema</source>
+        <translation>Schéma personnalisé</translation>
+    </message>
+</context>
+</TS>
index 0c41e9a8d7f0258fac6a0676a84d6f09895f7c5c..462bb6d65830cb7c4c437fa15b7cb5213a6923f6 100755 (executable)
@@ -48,7 +48,8 @@ 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@                     \
index ef267b1e3524f9faaa9813f52bf0c6dad12d6526..bc4a9f85dcae4108eb1459d03c76dbb5897ce3d2 100755 (executable)
 //  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
-//
 # 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",
@@ -138,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" ) ;
+    object = naming.Resolve( registryName );
+    if ( CORBA::is_nil( object ) ) throw CommException( "Unable to find the Registry service" );
+    aRegistry = Registry::Components::_narrow( object );
   }
-  catch( const ServiceUnreachable& ex )
+  catch( const CORBA::Exception& ex )
   {
-    MESSAGE( ex.what() )
-    exit( EXIT_FAILURE ) ;
-  }
-  catch( const CORBA::Exception& )
-  {
-    exit( EXIT_FAILURE ) ;
-  }
-
-  // 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() );
-    }
+    MESSAGE( "Error: can't access Registry server" );
   }
-  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();
 }
 
 /*!
@@ -462,7 +161,7 @@ ToolsGUI_RegWidget* ToolsGUI_RegWidget::myRegWidgetPtr = 0;
   \param orb CORBA ORB reference
   \param parent parent widget
 */
-ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb,
+ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_ptr orb,
                                                       QWidget* parent )
 {
   if ( !myRegWidgetPtr ) 
@@ -470,99 +169,108 @@ ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb,
   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();
 }
 
 /*!
@@ -570,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" ) );
   }
 }
 
@@ -848,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 586cc9867c9538b420f66ef4e4f62e198d0498b5..657bed0227b8e394b4e27e1314f5897fc055d7dc 100755 (executable)
 //  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
-//
 #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_var& orb, 
+  static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb, 
                                            QWidget* parent = 0 );
 
-  virtual QMenu*             createPopupMenu();
+private slots:
+  void                       refresh();
+  void                       showDetails( QTreeWidgetItem*, int );
+  void                       refreshInterval();
 
-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
index 8f25a61e57b256772b67920bd01b18be0054ce46..5bc21d2f421a3aa47e77f4e605da5244fe48f0e1 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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>
diff --git a/src/TOOLSGUI/resources/ToolsGUI_msg_fr.ts b/src/TOOLSGUI/resources/ToolsGUI_msg_fr.ts
new file mode 100755 (executable)
index 0000000..20a97c7
--- /dev/null
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>TOOLS_WRN_WARNING</source>
+        <translation>Avertissement</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_BROWSE</source>
+        <translation>Naviguer...</translation>
+    </message>
+    <message>
+        <source>TOOLS_ERR_ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>TOOLS_ERR_FILE_NOT_EXIST</source>
+        <translation>%1
+Le fichier n&apos;existe pas</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_OK</source>
+        <translation>&amp;Ok</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_APPLY</source>
+        <translation>&amp;Appliquer</translation>
+    </message>
+    <message>
+        <source>TOOLS_BUT_CLOSE</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+</context>
+<context>
+    <name>ToolsGUI_CatalogGeneratorDlg</name>
+    <message>
+        <source>TOOLS_MEN_EXPORT</source>
+        <translation>Exporter</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT</source>
+        <translation>Importer</translation>
+    </message>
+    <message>
+        <source>TOOLS_VERSION</source>
+        <translation>Version : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_NAME</source>
+        <translation>Nom : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_TYPE</source>
+        <translation>Type : </translation>
+    </message>
+    <message>
+        <source>TOOLS_XML_FILE</source>
+        <translation>XML : </translation>
+    </message>
+    <message>
+        <source>TOOLS_PNG_FILE</source>
+        <translation>Icône : </translation>
+    </message>
+    <message>
+        <source>TOOLS_SUPPLEMENT</source>
+        <translation>Données supplémentaires du composant</translation>
+    </message>
+    <message>
+        <source>TOOLS_AUTHOR</source>
+        <translation>Auteur : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_MULTISTD</source>
+        <translation>Multi-étude : </translation>
+    </message>
+    <message>
+        <source>TOOLS_COMP_USERNAME</source>
+        <translation>Nom utilisateur : </translation>
+    </message>
+    <message>
+        <source>TOOLS_CATALOG_GENERATOR</source>
+        <translation>Générateur du catalogue</translation>
+    </message>
+    <message>
+        <source>TOOLS_FILES</source>
+        <translation>Fichiers</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT_PNG</source>
+        <translation>Fichiers PNG ( *.png )</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_IMPORT_IDL</source>
+        <translation>Fichiers IDL ( *.idl )</translation>
+    </message>
+    <message>
+        <source>TOOLS_MEN_EXPORT_XML</source>
+        <translation>Fichiers XML ( *.xml )</translation>
+    </message>
+    <message>
+        <source>TOOLS_IDL_FILE</source>
+        <translation>IDL : </translation>
+    </message>
+</context>
+<context>
+    <name>ToolsGUI_RegWidget</name>
+    <message>
+        <source>TLT_REFRESH_INTERVAL</source>
+        <translation>Fréquence d&apos;actualisation</translation>
+    </message>
+    <message>
+        <source>LAB_REFRESH_INTERVAL</source>
+        <translation>Nouvelle fréquence d&apos;actualisation (en secondes)</translation>
+    </message>
+    <message>
+        <source>TLT_REGISTRY</source>
+        <translation>Registre</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>Actualiser</translation>
+    </message>
+    <message>
+        <source>STB_REFRESH</source>
+        <translation>Met à jour la liste des composants</translation>
+    </message>
+    <message>
+        <source>MEN_INTERVAL</source>
+        <translation>Fréquence d&apos;actualisation...</translation>
+    </message>
+    <message>
+        <source>STB_INTERVAL</source>
+        <translation>Changer la fréquence d&apos;actualisation</translation>
+    </message>
+    <message>
+        <source>MEN_CLOSE</source>
+        <translation>Fermer</translation>
+    </message>
+    <message>
+        <source>STB_CLOSE</source>
+        <translation>Fermer la fenêtre du Registre</translation>
+    </message>
+    <message>
+        <source>TAB_RUNNING</source>
+        <translation>En cours</translation>
+    </message>
+    <message>
+        <source>TAB_HISTORY</source>
+        <translation>Historique</translation>
+    </message>
+    <message>
+        <source>HDR_COMPONENT</source>
+        <translation>Composant</translation>
+    </message>
+    <message>
+        <source>HDR_PID</source>
+        <translation>PID</translation>
+    </message>
+    <message>
+        <source>HDR_USERNAME</source>
+        <translation>Nom de l&apos;utilisateur</translation>
+    </message>
+    <message>
+        <source>HDR_HOSTNAME</source>
+        <translation>Nom de l&apos;hôte</translation>
+    </message>
+    <message>
+        <source>HDR_STARTED</source>
+        <translation>Commencé</translation>
+    </message>
+    <message>
+        <source>HDR_FINISHED</source>
+        <translation>Terminé</translation>
+    </message>
+    <message>
+        <source>HDR_HELLO</source>
+        <translation>Dernier ping</translation>
+    </message>
+    <message>
+        <source>ERR_NO_REGISTRY</source>
+        <translation>Erreur: le serveur de registre n&apos;est pas trouvé</translation>
+    </message>
+    <message>
+        <source>INFO_SERVICE</source>
+        <translation>Service : %1</translation>
+    </message>
+    <message>
+        <source>INFO_PROCESS</source>
+        <translation>Le procédé ( PID : %1 ) sur la station %2 ( adresse IP : %3 ); lancé par l&apos;utilisateur %4 ( UID : %5 ) au répertoire %6.</translation>
+    </message>
+    <message>
+        <source>INFO_STARTED</source>
+        <translation>Commencé : %1</translation>
+    </message>
+    <message>
+        <source>INFO_LAST_PING</source>
+        <translation>Dernier signal : %1</translation>
+    </message>
+    <message>
+        <source>INFO_FINISHED</source>
+        <translation>Fini : %1</translation>
+    </message>
+    <message>
+        <source>INFO_RUNNING</source>
+        <translation>En cours</translation>
+    </message>
+    <message>
+        <source>INFO_TIME_DIFF</source>
+        <translation>Le temps de la station %1 est différent du temps du serveur. La différence est %2 secondes.</translation>
+    </message>
+</context>
+</TS>
index b5187b2956358372726d568ad6b920e6107c881d..56da23db41d1f8f8df075ebb425b2b6896f76ed1 100755 (executable)
@@ -59,7 +59,8 @@ salomeinclude_HEADERS =                               \
        VTKViewer_MarkerWidget.h                \
        VTKViewer_MarkerDlg.h                   \
        VTKViewer_PolyDataMapper.h              \
-       VTKViewer_DataSetMapper.h
+       VTKViewer_DataSetMapper.h               \
+       VTKViewer_CellCenters.h
 
 dist_libVTKViewer_la_SOURCES =                 \
        VTKViewer_CellLocationsArray.cxx        \
@@ -87,7 +88,8 @@ dist_libVTKViewer_la_SOURCES =                        \
        VTKViewer_MarkerWidget.cxx              \
        VTKViewer_MarkerDlg.cxx                 \
        VTKViewer_PolyDataMapper.cxx            \
-       VTKViewer_DataSetMapper.cxx
+       VTKViewer_DataSetMapper.cxx             \
+       VTKViewer_CellCenters.cxx
 
 MOC_FILES =                                            \
        VTKViewer_RenderWindow_moc.cxx                  \
@@ -131,7 +133,8 @@ dist_salomeres_DATA =                               \
 
 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
index 872ddefcd36d7b0d4deef2bda3baceca8b8e5361..7db52596a4520ad59fce84dcea0077a1edfc7e4c 100755 (executable)
@@ -67,6 +67,7 @@ vtkStandardNewMacro(VTKViewer_Actor);
 */
 VTKViewer_Actor
 ::VTKViewer_Actor():
+  myOpacity(1.0),
   myIsHighlighted(false),
   myIsPreselected(false),
   myRepresentation(VTK_SURFACE),
diff --git a/src/VTKViewer/VTKViewer_CellCenters.cxx b/src/VTKViewer/VTKViewer_CellCenters.cxx
new file mode 100644 (file)
index 0000000..91c9988
--- /dev/null
@@ -0,0 +1,184 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "VTKViewer_CellCenters.h"
+
+#include <vtkCell.h>
+#include <vtkCellData.h>
+#include <vtkDataSet.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+#include <vtkPoints.h>
+#include <vtkPolyData.h>
+#include <vtkCellArray.h>
+
+vtkCxxRevisionMacro(VTKViewer_CellCenters, "$Revision$");
+vtkStandardNewMacro(VTKViewer_CellCenters);
+
+/*!
+ * Class       : VTKViewer_CellCenters
+ * Description : Filter computing geometrical centers of given cells
+ *               (differs from native vtk filter by small fix for VTK_CONVEX_POINT_SET cells)
+ */
+
+/*!
+  Constructor
+*/
+VTKViewer_CellCenters::VTKViewer_CellCenters()
+{
+}
+
+/*!
+  Redefined main method
+*/
+int VTKViewer_CellCenters::RequestData(
+  vtkInformation *vtkNotUsed(request),
+  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()));
+  vtkPolyData *output = vtkPolyData::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+  vtkIdType cellId, numCells;
+  int subId;
+  vtkCellData *inCD;
+  vtkPointData *outPD;
+  vtkPoints *newPts;
+  vtkCell *cell;
+  double x[3], pcoords[3];
+  double *weights;
+
+  inCD=input->GetCellData();
+  outPD=output->GetPointData();
+
+  if ( (numCells = input->GetNumberOfCells()) < 1 )
+    {
+    vtkWarningMacro(<<"No cells to generate center points for");
+    return 1;
+    }
+
+  newPts = vtkPoints::New();
+  newPts->SetNumberOfPoints(numCells);
+  weights = new double [input->GetMaxCellSize()];
+
+  int abort=0;
+  vtkIdType progressInterval = numCells/10 + 1;
+  int hasEmptyCells = 0;
+  for (cellId=0; cellId < numCells && !abort; cellId++)
+    {
+    if ( ! (cellId % progressInterval) ) 
+      {
+      vtkDebugMacro(<<"Processing #" << cellId);
+      this->UpdateProgress (0.5*cellId/numCells);
+      abort = this->GetAbortExecute();
+      }
+
+    cell = input->GetCell(cellId);
+    if (cell->GetCellType() != VTK_EMPTY_CELL)
+      {
+        // fix for VTK_CONVEX_POINT_SET cells
+        if (cell->GetCellType() == VTK_CONVEX_POINT_SET )
+        {
+          x[0] = x[1] = x[2] = 0;
+          vtkPoints* aPoints = cell->GetPoints();
+          int aNbPoints = aPoints->GetNumberOfPoints();
+          for( int i = 0; i < aNbPoints; i++ )
+          {
+            double aCoord[3];
+            aPoints->GetPoint( i, aCoord );
+            x[0] += aCoord[0];
+            x[1] += aCoord[1];
+            x[2] += aCoord[2];
+          }
+          x[0] /= aNbPoints;
+          x[1] /= aNbPoints;
+          x[2] /= aNbPoints;
+        }
+        else
+        {
+          subId = cell->GetParametricCenter(pcoords);
+          cell->EvaluateLocation(subId, pcoords, x, weights);
+        }
+        newPts->SetPoint(cellId,x);
+      }
+    else
+      {
+      hasEmptyCells = 1;
+      }
+    }
+
+  if ( this->VertexCells )
+    {
+    vtkIdType pts[1];
+    vtkCellData *outCD=output->GetCellData();
+    vtkCellArray *verts = vtkCellArray::New();
+    verts->Allocate(verts->EstimateSize(1,numCells),1);
+
+    for (cellId=0; cellId < numCells && !abort; cellId++)
+      {
+      if ( ! (cellId % progressInterval) ) 
+        {
+        vtkDebugMacro(<<"Processing #" << cellId);
+        this->UpdateProgress (0.5+0.5*cellId/numCells);
+        abort = this->GetAbortExecute();
+        }
+
+      cell = input->GetCell(cellId);
+      if (cell->GetCellType() != VTK_EMPTY_CELL)
+        {
+        pts[0] = cellId;
+        verts->InsertNextCell(1,pts);
+        }
+      }
+
+    output->SetVerts(verts);
+    verts->Delete();
+    if (!hasEmptyCells)
+      {
+      outCD->PassData(inCD); //only if verts are generated
+      }
+    }
+
+  // clean up and update output
+  output->SetPoints(newPts);
+  newPts->Delete();
+
+  if (!hasEmptyCells)
+    {
+    outPD->PassData(inCD); //because number of points = number of cells
+    }
+  if (weights)
+    {
+    delete [] weights;
+    }
+
+  return 1;
+}
diff --git a/src/VTKViewer/VTKViewer_CellCenters.h b/src/VTKViewer/VTKViewer_CellCenters.h
new file mode 100644 (file)
index 0000000..7057d79
--- /dev/null
@@ -0,0 +1,60 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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_CELLCENTERS_H
+#define VTKVIEWER_CELLCENTERS_H
+
+#include "VTKViewer.h"
+
+#include <vtkCellCenters.h>
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
+
+/*!
+ * Class       : VTKViewer_CellCenters
+ * Description : Filter computing geometrical centers of given cells
+ *               (differs from native vtk filter by small fix for VTK_CONVEX_POINT_SET cells)
+ */
+class VTKVIEWER_EXPORT VTKViewer_CellCenters : public vtkCellCenters
+{
+public:
+  vtkTypeRevisionMacro(VTKViewer_CellCenters,vtkCellCenters);
+
+  static VTKViewer_CellCenters *New();
+
+protected:
+  VTKViewer_CellCenters();
+
+  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+private:
+  VTKViewer_CellCenters(const VTKViewer_CellCenters&);  // Not implemented.
+  void operator=(const VTKViewer_CellCenters&);  // Not implemented.
+};
+
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
+#endif
index 4b24412434c76aa4c02a095de70d7ae5627bcdc6..3798ef9d1f20556409390fe9c0caf586bd7a72f5 100644 (file)
@@ -32,6 +32,7 @@
 
 class vtkCell;
 class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
 
 #include <QObject>
 #include <QCursor>
index 76b6902fae887868d0d731bfb4dd1ecacd9dd6bd..c737763d7ecb0539256271d96a64355aaf8b674b 100644 (file)
@@ -1,27 +1,6 @@
-<!DOCTYPE TS><TS>
-<!--
-  Copyright (C) 2007-2010  CEA/DEN, EDF R&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/VTKViewer/resources/VTKViewer_msg_fr.ts b/src/VTKViewer/resources/VTKViewer_msg_fr.ts
new file mode 100755 (executable)
index 0000000..d88ebf2
--- /dev/null
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>@default</name>
+    <message>
+        <source>MNU_FRONT_VIEW</source>
+        <translation>Avant</translation>
+    </message>
+    <message>
+        <source>ERROR</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Enregistrer la vue...</translation>
+    </message>
+    <message>
+        <source>DSC_TOP_VIEW</source>
+        <translation>Vue de dessus</translation>
+    </message>
+    <message>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
+    </message>
+    <message>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Dessus</translation>
+    </message>
+    <message>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de vue</translation>
+    </message>
+    <message>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Tourner le point de vue autour du centre de la scène</translation>
+    </message>
+    <message>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
+    </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Vue de gauche</translation>
+    </message>
+    <message>
+        <source>DSC_FITALL</source>
+        <translation>Redimensionner la scène pour montrer tous les objets</translation>
+    </message>
+    <message>
+        <source>MNU_FITALL</source>
+        <translation>Ajuster tout</translation>
+    </message>
+    <message>
+        <source>MNU_ROTATE_VIEW</source>
+        <translation>Rotation</translation>
+    </message>
+    <message>
+        <source>DSC_SHOW_TRIHEDRON</source>
+        <translation>Montrer/Cacher le trièdre dans la vue actuelle</translation>
+    </message>
+    <message>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Vue de face</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Déplacement global</translation>
+    </message>
+    <message>
+        <source>INF_APP_DUMP_VIEW</source>
+        <translation>Enregistrer la vue</translation>
+    </message>
+    <message>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Arrière</translation>
+    </message>
+    <message>
+        <source>MNU_SHOW_TRIHEDRON</source>
+        <translation>Montrer/Cacher le trièdre</translation>
+    </message>
+    <message>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Dessous</translation>
+    </message>
+    <message>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
+    </message>
+    <message>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Vue de droite</translation>
+    </message>
+    <message>
+        <source>DSC_FITRECT</source>
+        <translation>Redimensionner la scène à la zone choisie par l&apos;encadré</translation>
+    </message>
+    <message>
+        <source>MNU_FITRECT</source>
+        <translation>Ajuster à la zone</translation>
+    </message>
+    <message>
+        <source>DSC_BOTTOM_VIEW</source>
+        <translation>Vue de dessous</translation>
+    </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarde la scène en cours dans un fichier image</translation>
+    </message>
+    <message>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom la vue</translation>
+    </message>
+    <message>
+        <source>VTK_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+    </message>
+    <message>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le Point de Vue </translation>
+    </message>
+    <message>
+        <source>ERR_DOC_CANT_SAVE_FILE</source>
+        <translation>Impossible de sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Droite</translation>
+    </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+    <message>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Vue de derrière</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_MarkerDlg</name>
+    <message>
+        <source>SET_MARKER_TLT</source>
+        <translation>Définir le symbole du point</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_MarkerWidget</name>
+    <message>
+        <source>STANDARD_MARKER</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>CUSTOM_MARKER</source>
+        <translation>Personnalisé</translation>
+    </message>
+    <message>
+        <source>TYPE</source>
+        <translation>Type:</translation>
+    </message>
+    <message>
+        <source>SCALE</source>
+        <translation>Echelle:</translation>
+    </message>
+    <message>
+        <source>CUSTOM</source>
+        <translation>Texture:</translation>
+    </message>
+    <message>
+        <source>BROWSE</source>
+        <translation>Naviguer...</translation>
+    </message>
+    <message>
+        <source>LOAD_TEXTURE_TLT</source>
+        <translation>Charger une texture</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_ViewManager</name>
+    <message>
+        <source>VTK_VIEW_TITLE</source>
+        <translation>VTK scène:%M - visualiseur:%V</translation>
+    </message>
+</context>
+<context>
+    <name>VTKViewer_Viewer</name>
+    <message>
+        <source>MEN_DUMP_VIEW</source>
+        <translation>Enregistrer la vue...</translation>
+    </message>
+    <message>
+        <source>MEN_SHOW_TOOLBAR</source>
+        <translation>Afficher la barre d&apos;outils</translation>
+    </message>
+    <message>
+        <source>MEN_CHANGE_BACKGROUD</source>
+        <translation>Changer l&apos;arrière-plan...</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/ViewerTools/Makefile.am b/src/ViewerTools/Makefile.am
new file mode 100755 (executable)
index 0000000..7a576f5
--- /dev/null
@@ -0,0 +1,56 @@
+#  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+#
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libViewerTools.la
+
+salomeinclude_HEADERS= \
+       ViewerTools.h \
+       ViewerTools_CubeAxesDlgBase.h \
+       ViewerTools_DialogBase.h \
+       ViewerTools_FontWidgetBase.h
+
+dist_libViewerTools_la_SOURCES= \
+       ViewerTools_CubeAxesDlgBase.cxx \
+       ViewerTools_DialogBase.cxx \
+       ViewerTools_FontWidgetBase.cxx
+
+MOC_FILES= \
+       ViewerTools_CubeAxesDlgBase_moc.cxx \
+       ViewerTools_DialogBase_moc.cxx \
+       ViewerTools_FontWidgetBase_moc.cxx
+
+nodist_libViewerTools_la_SOURCES= $(MOC_FILES)
+
+nodist_salomeres_DATA =        \
+       ViewerTools_msg_en.qm \
+       ViewerTools_msg_fr.qm
+
+libViewerTools_la_CPPFLAGS =   \
+       $(QT_INCLUDES)          \
+       -I$(srcdir)/../Qtx
+
+libViewerTools_la_LDFLAGS =    \
+       $(QT_MT_LIBS)
+
+libViewerTools_la_LIBADD = ../Qtx/libqtx.la
diff --git a/src/ViewerTools/ViewerTools.h b/src/ViewerTools/ViewerTools.h
new file mode 100644 (file)
index 0000000..b86f555
--- /dev/null
@@ -0,0 +1,41 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 VIEWERTOOLS_H
+#define VIEWERTOOLS_H
+
+#ifdef WIN32
+#  if defined VIEWERTOOLS_EXPORTS || defined ViewerTools_EXPORTS
+#    define VIEWERTOOLS_EXPORT __declspec(dllexport)
+#  else
+#   define VIEWERTOOLS_EXPORT __declspec(dllimport)
+#  endif
+#else
+#  define VIEWERTOOLS_EXPORT
+#endif
+
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#pragma warning ( disable: 4786 )
+#endif
+
+#endif
diff --git a/src/ViewerTools/ViewerTools_CubeAxesDlgBase.cxx b/src/ViewerTools/ViewerTools_CubeAxesDlgBase.cxx
new file mode 100644 (file)
index 0000000..f3f1e0e
--- /dev/null
@@ -0,0 +1,322 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "ViewerTools_CubeAxesDlgBase.h"
+
+#include "ViewerTools_FontWidgetBase.h"
+
+#include "QtxAction.h"
+#include "QtxIntSpinBox.h"
+
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QTabWidget>
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QLabel>
+
+/*!
+ * Class       : ViewerTools_AxisWidgetBase
+ * Description : Axis tab widget of the "Graduated axis" dialog box
+*/
+
+/*!
+  Constructor
+*/
+ViewerTools_AxisWidgetBase::ViewerTools_AxisWidgetBase (QWidget* theParent)
+: QFrame(theParent)
+{
+}
+
+/*!
+  Destructor
+*/
+ViewerTools_AxisWidgetBase::~ViewerTools_AxisWidgetBase()
+{
+}
+
+/*!
+  Initialize controls
+*/
+void ViewerTools_AxisWidgetBase::initialize()
+{
+  QList< QLabel* > aLabels;
+
+  // "Name" grp
+
+  myNameGrp = new QGroupBox(ViewerTools_CubeAxesDlgBase::tr("AXIS_NAME"), this);
+  myNameGrp->setCheckable( true );
+
+  QVBoxLayout* aVBox = new QVBoxLayout;
+  
+  QHBoxLayout* aHBox = new QHBoxLayout;
+  aHBox->setSpacing(5);
+  QLabel* aLabel = new QLabel(ViewerTools_CubeAxesDlgBase::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(ViewerTools_CubeAxesDlgBase::tr("FONT"));
+  aHBox->addWidget(aLabel);
+  myNameFont = createFontWidget(myNameGrp);
+  aHBox->addWidget(myNameFont);
+  aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
+
+  myNameGrp->setLayout(aVBox);
+
+  // "Labels" grp
+
+  myLabelsGrp = new QGroupBox(ViewerTools_CubeAxesDlgBase::tr("LABELS"), this);
+  myLabelsGrp->setCheckable( true );
+
+  aVBox = new QVBoxLayout;
+
+  aHBox = new QHBoxLayout;
+  aHBox->setSpacing(5);
+  aLabel = new QLabel(ViewerTools_CubeAxesDlgBase::tr("NUMBER"));
+  aHBox->addWidget(aLabel);
+  myLabelNumber = new QtxIntSpinBox(2,25,1,myLabelsGrp);
+  aHBox->addWidget(myLabelNumber);
+  aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
+
+  aHBox = new QHBoxLayout;
+  aHBox->setSpacing(5);
+  aLabel = new QLabel(ViewerTools_CubeAxesDlgBase::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(ViewerTools_CubeAxesDlgBase::tr("FONT"));
+  aHBox->addWidget(aLabel);
+  myLabelsFont = createFontWidget(myLabelsGrp);
+  aHBox->addWidget(myLabelsFont);
+  aLabels.append(aLabel);
+  aVBox->addLayout(aHBox);
+
+  myLabelsGrp->setLayout(aVBox);
+
+  // "Tick marks" grp
+
+  myTicksGrp = new QGroupBox(ViewerTools_CubeAxesDlgBase::tr("TICK_MARKS"), this);
+  myTicksGrp->setCheckable( true );
+
+  aVBox = new QVBoxLayout;
+
+  aHBox = new QHBoxLayout;
+  aHBox->setSpacing(5);
+  aLabel = new QLabel(ViewerTools_CubeAxesDlgBase::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);
+}
+
+void ViewerTools_AxisWidgetBase::UseName(const bool toUse)
+{
+  myNameGrp->setChecked(toUse);
+}
+
+void ViewerTools_AxisWidgetBase::SetName(const QString& theName)
+{
+  myAxisName->setText(theName);
+}
+
+void ViewerTools_AxisWidgetBase::SetNameFont(const QColor& theColor,
+                                             const int theFont,
+                                             const bool theIsBold,
+                                             const bool theIsItalic,
+                                             const bool theIsShadow)
+{
+  myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow);
+}
+
+/*
+  Class       : ViewerTools_CubeAxesDlgBase
+  Description : Dialog for specifying cube axes properties
+*/
+
+/*!
+  Constructor
+*/
+ViewerTools_CubeAxesDlgBase::ViewerTools_CubeAxesDlgBase(QtxAction* theAction,
+                                                         QWidget* theParent,
+                                                         const char* theName):
+  ViewerTools_DialogBase(theAction,
+                         theParent,
+                         theName)
+{
+  setWindowTitle(tr("CAPTION"));
+}
+
+/*!
+  Initialize controls
+*/
+void ViewerTools_CubeAxesDlgBase::initialize()
+{
+  QVBoxLayout* aLay = new QVBoxLayout(this);
+  aLay->setMargin(5);
+  aLay->setSpacing(5);
+  aLay->addWidget(createMainFrame(this));
+  aLay->addWidget(createButtonFrame(this));
+}
+
+/*!
+  Create frame containing dialog's input fields
+*/
+QWidget* ViewerTools_CubeAxesDlgBase::createMainFrame(QWidget* theParent)
+{
+  QFrame* aFrame = new QFrame(theParent);
+
+  myTabWg = new QTabWidget(aFrame);
+
+  myAxes[ 0 ] = createAxisWidget(myTabWg);
+  myAxes[ 1 ] = createAxisWidget(myTabWg);
+  myAxes[ 2 ] = createAxisWidget(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
+*/
+QWidget* ViewerTools_CubeAxesDlgBase::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
+*/
+ViewerTools_CubeAxesDlgBase::~ViewerTools_CubeAxesDlgBase()
+{
+}
+
+/*!
+  Update dialog fields, connect signals and slots, show dialog
+*/
+void ViewerTools_CubeAxesDlgBase::Update()
+{
+}
+
+/*!
+  Verify validity of entry data
+*/
+bool ViewerTools_CubeAxesDlgBase::isValid() const
+{
+  return true;
+}
+
+/*!
+  Verify validity of entry data
+*/
+bool ViewerTools_CubeAxesDlgBase::onApply()
+{
+  return true;
+}
+
+/*!
+  SLOT called when "Ok" button pressed.
+*/
+void ViewerTools_CubeAxesDlgBase::onOk()
+{
+  if (onApply())
+    onClose();
+}
+
+/*!
+  SLOT: called when "Close" button pressed. Close dialog
+*/
+void ViewerTools_CubeAxesDlgBase::onClose()
+{
+  reject();
+}
diff --git a/src/ViewerTools/ViewerTools_CubeAxesDlgBase.h b/src/ViewerTools/ViewerTools_CubeAxesDlgBase.h
new file mode 100644 (file)
index 0000000..d7e7b85
--- /dev/null
@@ -0,0 +1,119 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 VIEWERTOOLS_CUBEAXESDLGBASE_H
+#define VIEWERTOOLS_CUBEAXESDLGBASE_H
+
+#include "ViewerTools_DialogBase.h"
+
+#include <QFrame>
+
+class QWidget;
+class QPushButton;
+class QTabWidget;
+class QCheckBox;
+class QGroupBox;
+class QLineEdit;
+
+class QtxAction;
+class QtxIntSpinBox;
+
+class ViewerTools_FontWidgetBase;
+
+/*!
+ * Class       : ViewerTools_AxisWidgetBase
+ * Description : Axis tab widget of the "Graduated axis" dialog box
+*/
+class VIEWERTOOLS_EXPORT ViewerTools_AxisWidgetBase : public QFrame
+{
+public:
+  ViewerTools_AxisWidgetBase( QWidget* );
+  ~ViewerTools_AxisWidgetBase();
+
+  void             UseName( const bool );
+  void             SetName( const QString& );
+  void             SetNameFont( const QColor&, const int, const bool, const bool, const bool );
+
+public:
+  virtual void     initialize();
+
+protected:
+  virtual ViewerTools_FontWidgetBase* createFontWidget( QWidget* ) = 0;
+
+protected:
+  // name
+  QGroupBox*       myNameGrp;
+  QLineEdit*       myAxisName;
+  ViewerTools_FontWidgetBase* myNameFont;
+
+  // labels
+  QGroupBox*       myLabelsGrp;
+  QtxIntSpinBox*   myLabelNumber;
+  QtxIntSpinBox*   myLabelOffset;
+  ViewerTools_FontWidgetBase* myLabelsFont;
+
+  // tick marks
+  QGroupBox*       myTicksGrp;
+  QtxIntSpinBox*   myTickLength;
+};
+
+/*!
+ * Class       : ViewerTools_CubeAxesDlgBase
+ * Description : Dialog for specifying cube axes properties
+ */
+class VIEWERTOOLS_EXPORT ViewerTools_CubeAxesDlgBase : public ViewerTools_DialogBase
+{
+  Q_OBJECT
+
+public:
+                  ViewerTools_CubeAxesDlgBase(QtxAction* theAction,
+                                              QWidget* theParent,
+                                              const char* theName);
+  virtual         ~ViewerTools_CubeAxesDlgBase();
+
+  virtual void    initialize();
+
+  virtual void    Update();
+
+protected slots:
+  virtual void    onOk();
+  virtual bool    onApply();
+  virtual void    onClose();
+
+protected:
+  virtual QWidget* createButtonFrame( QWidget* );
+  virtual QWidget* createMainFrame  ( QWidget* );
+  virtual bool    isValid() const;
+
+  virtual ViewerTools_AxisWidgetBase* createAxisWidget( QWidget* ) = 0;
+
+protected:
+  QTabWidget*     myTabWg;
+  QCheckBox*      myIsVisible;
+
+  QPushButton*    myOkBtn;
+  QPushButton*    myApplyBtn;
+  QPushButton*    myCloseBtn;
+  ViewerTools_AxisWidgetBase* myAxes[ 3 ];
+};
+
+#endif
diff --git a/src/ViewerTools/ViewerTools_DialogBase.cxx b/src/ViewerTools/ViewerTools_DialogBase.cxx
new file mode 100644 (file)
index 0000000..2fc0e40
--- /dev/null
@@ -0,0 +1,79 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "ViewerTools_DialogBase.h"
+
+#include "QtxAction.h"
+
+/*!
+  Constructor
+*/
+ViewerTools_DialogBase
+::ViewerTools_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
+ */
+ViewerTools_DialogBase
+::~ViewerTools_DialogBase()
+{
+  // no need to delete child widgets, Qt does it all for us
+}
+
+void 
+ViewerTools_DialogBase
+::onParentShow()
+{
+  if(myAction->isChecked())
+    show();
+  else
+    hide();
+}
+
+void 
+ViewerTools_DialogBase
+::onParentHide()
+{
+  hide();
+}
+
+void 
+ViewerTools_DialogBase
+::done( int r )
+{
+  myAction->setChecked( false );
+  QDialog::done( r );
+}
diff --git a/src/ViewerTools/ViewerTools_DialogBase.h b/src/ViewerTools/ViewerTools_DialogBase.h
new file mode 100644 (file)
index 0000000..e9fcd56
--- /dev/null
@@ -0,0 +1,54 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 VIEWERTOOLS_DIALOGBASE_H
+#define VIEWERTOOLS_DIALOGBASE_H
+
+#include "ViewerTools.h"
+
+#include <QDialog>
+
+class QtxAction;
+
+class VIEWERTOOLS_EXPORT ViewerTools_DialogBase : public QDialog
+{
+  Q_OBJECT;
+
+public:
+  ViewerTools_DialogBase(QtxAction* theAction,
+                         QWidget* theParent,
+                         const char* theName = "", 
+                         bool theModal = FALSE, 
+                         Qt::WindowFlags theWFalgs = 0);
+
+  ~ViewerTools_DialogBase();
+
+protected slots:
+  void onParentShow();
+  void onParentHide();
+  virtual void done( int );
+
+protected:
+  QtxAction* myAction;
+};
+
+#endif // VIEWERTOOLS_DIALOGBASE_H
diff --git a/src/ViewerTools/ViewerTools_FontWidgetBase.cxx b/src/ViewerTools/ViewerTools_FontWidgetBase.cxx
new file mode 100644 (file)
index 0000000..2558546
--- /dev/null
@@ -0,0 +1,128 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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
+//
+
+#include "ViewerTools_FontWidgetBase.h"
+
+#include <QToolButton>
+#include <QComboBox>
+#include <QColorDialog>
+#include <QCheckBox>
+#include <QHBoxLayout>
+
+/*!
+ * Class       : ViewerTools_FontWidgetBase
+ * Description : Dialog for specifynig font
+ */
+
+/*!
+  Constructor
+*/
+ViewerTools_FontWidgetBase::ViewerTools_FontWidgetBase( QWidget* theParent )
+: QWidget( theParent )
+{
+}
+
+/*!
+  Destructor
+*/
+ViewerTools_FontWidgetBase::~ViewerTools_FontWidgetBase()
+{
+}
+
+void ViewerTools_FontWidgetBase::Initialize()
+{
+  myColorBtn = new QToolButton( this );
+  myColorBtn->setMinimumWidth( 20 );
+
+  myFamily = new QComboBox( this );
+  InitializeFamilies();
+
+  myBold = new QCheckBox( tr( "BOLD" ), this );
+  myItalic = new QCheckBox( tr( "ITALIC" ), this );
+  myShadow = new QCheckBox( tr( "SHADOW" ), this );
+
+  QHBoxLayout* aHBLayout = new QHBoxLayout;
+  aHBLayout->setMargin( 0 );
+  aHBLayout->setSpacing( 5 );
+  aHBLayout->addWidget(myColorBtn);
+  aHBLayout->addWidget(myFamily);
+  aHBLayout->addWidget(myBold);
+  aHBLayout->addWidget(myItalic);
+  aHBLayout->addWidget(myShadow);
+  aHBLayout->addStretch();
+  this->setLayout(aHBLayout);
+
+  connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) );
+
+  if( myFamily->count() == 0 )
+  {
+    myFamily->hide();
+    myBold->hide();
+    myItalic->hide();
+    myShadow->hide();
+  }
+}
+
+void ViewerTools_FontWidgetBase::SetColor( const QColor& theColor )
+{
+  QPalette palette;
+  palette.setColor(myColorBtn->backgroundRole(), theColor);
+  myColorBtn->setPalette(palette);
+}
+
+QColor ViewerTools_FontWidgetBase::GetColor() const
+{
+  return myColorBtn->palette().color( myColorBtn->backgroundRole() );
+}
+
+void ViewerTools_FontWidgetBase::onColor()
+{
+  QColor aColor = QColorDialog::getColor( GetColor(), this );
+  if ( aColor.isValid() )
+    SetColor( aColor );
+}
+
+void ViewerTools_FontWidgetBase::SetData( const QColor& theColor,
+                                          const int theFamily,
+                                          const bool theBold,
+                                          const bool theItalic,
+                                          const bool theShadow )
+{
+  SetColor( theColor );
+
+  myBold->setChecked( theBold );
+  myItalic->setChecked( theItalic );
+  myShadow->setChecked( theShadow );
+}
+
+void ViewerTools_FontWidgetBase::GetData( QColor& theColor,
+                                          int& theFamily,
+                                          bool& theBold,
+                                          bool& theItalic,
+                                          bool& theShadow ) const
+{
+  theColor = GetColor();
+
+  theBold = myBold->isChecked();
+  theItalic = myItalic->isChecked();
+  theShadow = myShadow->isChecked();
+}
diff --git a/src/ViewerTools/ViewerTools_FontWidgetBase.h b/src/ViewerTools/ViewerTools_FontWidgetBase.h
new file mode 100644 (file)
index 0000000..9ade57a
--- /dev/null
@@ -0,0 +1,71 @@
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&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 VIEWERTOOLS_FONTWIDGETBASE_H
+#define VIEWERTOOLS_FONTWIDGETBASE_H
+
+#include "ViewerTools.h"
+
+#include <QWidget>
+
+class QToolButton;
+class QComboBox;
+class QCheckBox;
+class QColor;
+
+/*!
+ * Class       : ViewerTools_FontWidgetBase
+ * Description : Dialog for specifying font
+ */
+class VIEWERTOOLS_EXPORT ViewerTools_FontWidgetBase : public QWidget
+{
+  Q_OBJECT
+
+public:
+                ViewerTools_FontWidgetBase( QWidget* );
+  virtual       ~ViewerTools_FontWidgetBase();
+
+  void          SetColor( const QColor& );
+  QColor        GetColor() const;
+
+  virtual void  SetData( const QColor&, const int, const bool, const bool, const bool );
+
+  virtual void  GetData( QColor&, int&, bool&, bool&, bool& ) const;
+
+public:
+  virtual void  Initialize();
+
+protected:
+  virtual void  InitializeFamilies() = 0;
+
+protected slots:
+  void          onColor();
+
+protected:
+  QToolButton*  myColorBtn;
+  QComboBox*    myFamily;
+  QCheckBox*    myBold;
+  QCheckBox*    myItalic;
+  QCheckBox*    myShadow;
+};
+
+#endif
diff --git a/src/ViewerTools/resources/ViewerTools_msg_en.ts b/src/ViewerTools/resources/ViewerTools_msg_en.ts
new file mode 100644 (file)
index 0000000..bfb45c8
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+    <name>ViewerTools_CubeAxesDlgBase</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>
+    </message>
+    <message>
+        <source>LABELS</source>
+        <translation>Labels</translation>
+    </message>
+    <message>
+        <source>LENGTH</source>
+        <translation>Length</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>
+    </message>
+</context>
+<context>
+    <name>ViewerTools_FontWidgetBase</name>
+    <message>
+        <source>BOLD</source>
+        <translation>Bold</translation>
+    </message>
+    <message>
+        <source>ITALIC</source>
+        <translation>Italic</translation>
+    </message>
+    <message>
+        <source>SHADOW</source>
+        <translation>Shadow</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/ViewerTools/resources/ViewerTools_msg_fr.ts b/src/ViewerTools/resources/ViewerTools_msg_fr.ts
new file mode 100755 (executable)
index 0000000..1fb1f71
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+    <name>ViewerTools_CubeAxesDlgBase</name>
+    <message>
+        <source>X_AXIS</source>
+        <translation>Axe X</translation>
+    </message>
+    <message>
+        <source>Y_AXIS</source>
+        <translation>Axe Y</translation>
+    </message>
+    <message>
+        <source>Z_AXIS</source>
+        <translation>Axe Z</translation>
+    </message>
+    <message>
+        <source>CAPTION</source>
+        <translation>Axes gradués</translation>
+    </message>
+    <message>
+        <source>IS_VISIBLE</source>
+        <translation>Visible</translation>
+    </message>
+    <message>
+        <source>FONT</source>
+        <translation>Couleur</translation>
+    </message>
+    <message>
+        <source>NAME</source>
+        <translation>Nom</translation>
+    </message>
+    <message>
+        <source>TICK_MARKS</source>
+        <translation>Marques de graduation</translation>
+    </message>
+    <message>
+        <source>LABELS</source>
+        <translation>Etiquettes</translation>
+    </message>
+    <message>
+        <source>LENGTH</source>
+        <translation>Longueur</translation>
+    </message>
+    <message>
+        <source>NUMBER</source>
+        <translation>Nombre</translation>
+    </message>
+    <message>
+        <source>OFFSET</source>
+        <translation>Décalage</translation>
+    </message>
+    <message>
+        <source>AXIS_NAME</source>
+        <translation>Nom de l&apos;axe </translation>
+    </message>
+</context>
+<context>
+    <name>ViewerTools_FontWidgetBase</name>
+    <message>
+        <source>BOLD</source>
+        <translation>Gras</translation>
+    </message>
+    <message>
+        <source>ITALIC</source>
+        <translation>Italique</translation>
+    </message>
+    <message>
+        <source>SHADOW</source>
+        <translation>Ombré</translation>
+    </message>
+</context>
+</TS>