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})
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)
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)
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)
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)
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)
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})
check_SalomeObject.m4 \
check_sip.m4 \
check_SupervGraphViewer.m4 \
-check_vtk.m4 \
check_VTKViewer.m4 \
check_QxGraphViewer.m4 \
check_TestRecorder.m4
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"
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
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
+++ /dev/null
-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
# 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
# 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.
src/ObjBrowser/Makefile \
src/Prs/Makefile \
src/OBJECT/Makefile \
+ src/ViewerTools/Makefile \
src/GLViewer/Makefile \
src/VTKViewer/Makefile \
src/SVTK/Makefile \
#---------------------------------------------------------------------------
#RTF related options
#---------------------------------------------------------------------------
-GENERATE_RTF = NO
\ No newline at end of file
+GENERATE_RTF = NO
+
+#---------------------------------------------------------------------------
+#Search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
</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>
+
*/
\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>
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>
\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.
<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>
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
<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>
+
*/
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>
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)
-<!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>
--- /dev/null
+<?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>&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>&Editer</translation>
+ </message>
+ <message>
+ <source>MEN_APP_EDIT_UNDO</source>
+ <translation>&Défaire</translation>
+ </message>
+ <message>
+ <source>MEN_APP_EDIT_REDO</source>
+ <translation>&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>
*/
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 )
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
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)
-<!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>
--- /dev/null
+<?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'activer le module %1</translation>
+ </message>
+ <message>
+ <source>MODULE_ROOT_OBJECT_TOOLTIP</source>
+ <translation>%1 objet-racine du module</translation>
+ </message>
+</context>
+</TS>
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)
-<!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>
--- /dev/null
+<?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'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'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>
--- /dev/null
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>images/en.png</file>
+ <file>images/fr.png</file>
+</qresource>
+</RCC>
+
#include "LightApp_OBSelector.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_DataObject.h"
+#include "LightApp_WgViewModel.h"
#include <SALOME_Event.h>
#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
: CAM_Application( false ),
myPrefs( 0 )
{
+ Q_INIT_RESOURCE( LightApp );
+
STD_TabDesktop* desk = new STD_TabDesktop();
setDesktop( desk );
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 );
}
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) ),
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
*/
if ( desktop() )
resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
resourceMgr()->save();
+
+ // Update shortcuts
+ shortcutMgr()->updateShortcuts();
}
delete prefDlg;
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 );
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 );
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" );
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,
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 );
}
#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" )) )
{
}
#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" ) ||
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" ) );
+ }
}
/*!
QStringList LightApp_Application::viewManagersTypes() const
{
QStringList aTypesList;
+ aTypesList += myUserWmTypes;
#ifndef DISABLE_GLVIEWER
aTypesList<<GLViewer_Viewer::Type();
#endif
#include <CAM_Application.h>
#include <QPointer>
+#include <QStringList>
class LogWindow;
#ifndef DISABLE_PYCONSOLE
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;
static LightApp_Preferences* _prefs_;
static int lastStudyId;
+ QStringList myUserWmTypes;
};
#ifdef WIN32
#include <SUIT_Operation.h>
#include <SUIT_ViewManager.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_ShortcutMgr.h>
#include <SUIT_Desktop.h>
#include <SUIT_TreeModel.h>
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
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() );
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" ),
/*!
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();
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() );
}
-
}
/*!
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 )
{
It.Initialize(theIndexes);
for(;It.More();It.Next())
remainsOwners.append( new LightApp_DataSubOwner( ioEntry, It.Key() ) );
-
+
bool append = false;
setSelected( remainsOwners, append );
/*!
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;
SUIT_DataOwnerPtrList aList;
MapIOOfMapOfInteger::Iterator it(theMapIO);
- for ( ; it.More(); it.Next() )
+ for ( ; it.More(); it.Next() )
{
if ( it.Value().IsEmpty() )
aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
}
}
-
+
setSelected( aList, append );
}
{
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 );
--- /dev/null
+// 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;
+}
--- /dev/null
+// 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
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
+EXTRA_DIST += images
+
+QRC_FILES = qrc_LightApp.cxx
+
lib_LTLIBRARIES = libLightApp.la
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
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
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
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 \
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 \
</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>
-<!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>
</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>
<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>
<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>
<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>
</message>
<message>
<source>PREFERENCES_NOT_SUPPORTED</source>
- <translation>Preferences for module "%1" not supported</translation>
+ <translation>Preferences for module "%1" 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>
<name>LightApp_ModuleDlg</name>
<message>
<source>DESCRIPTION</source>
- <translation>You're activating module
+ <translation>You're activating module
<b>%1</b>.<br>Please, select required action by pressing the corresponding button below.</translation>
</message>
<message>
--- /dev/null
+<?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 "%1" ne peut pas trouver la page d'aide "%2". Voulez-vous le modifierdans les préférences ?</translation>
+ </message>
+ <message>
+ <source>ABOUT_COPYRIGHT</source>
+ <translation>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</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'application a été modifié.
+Les modifications seront appliquées à la prochaine session.</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_THEME</source>
+ <translation>T&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>&Renommer</translation>
+ </message>
+ <message>
+ <source>PREF_MULTI_FILE</source>
+ <translation>Sauvegarde multi-fichiers</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_PREFERENCES</source>
+ <translation>&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'é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'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'incrément de vitesse</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_FUNC_2</source>
+ <translation>Augmenter l'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'isolignes selon U</translation>
+ </message>
+ <message>
+ <source>PREF_ISOS_V</source>
+ <translation>Nombre d'isolignes selon V</translation>
+ </message>
+ <message>
+ <source>PREF_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>PRP_MODULE</source>
+ <translation>Basculer vers le module "%1"</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 "<b>%N</b>" 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'arbre d'é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'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'étude</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_GENERAL</source>
+ <translation>Général</translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_0</source>
+ <translation>Vue &GL </translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_1</source>
+ <translation>Vue &Plot2d </translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_2</source>
+ <translation>Vue &OCC</translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_3</source>
+ <translation>Vue VT&K</translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_4</source>
+ <translation>Vue &QxGraph</translation>
+ </message>
+ <message>
+ <source>NEW_WINDOW_5</source>
+ <translation>Vue Qx&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'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 "%1" en cours</translation>
+ </message>
+ <message>
+ <source>PREF_VERT_AXIS_SCALE</source>
+ <translation>Echelle de l'axe vertical :</translation>
+ </message>
+ <message>
+ <source>PREF_HOR_AXIS_SCALE</source>
+ <translation>Echelle de l'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'é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 &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'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>&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'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>&Nouveau</translation>
+ </message>
+ <message>
+ <source>ACTIVATE_MODULE_OP_OPEN</source>
+ <translation>&Ouvrir...</translation>
+ </message>
+ <message>
+ <source>PYTHON_CONSOLE</source>
+ <translation>Console Python</translation>
+ </message>
+ <message>
+ <source>PREF_USE_ADVANCED_SELECTION_ALGORITHM</source>
+ <translation>Utiliser l'algorithme de sélection avancée</translation>
+ </message>
+ <message>
+ <source>TOT_CLOSE</source>
+ <translation>Fermer</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_CLOSE</source>
+ <translation>&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>&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 &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'ouvrir %1.
+Le fichier n'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'études</translation>
+ </message>
+ <message>
+ <source>PREF_MRU_INSERT_MODE</source>
+ <translation>Mode d'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 "%1" 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
+ <b>%1</b>.<br>Choisissez l'action nécessaire avec le bouton correspondant ci-dessous</translation>
+ </message>
+ <message>
+ <source>CANCEL</source>
+ <translation>&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>
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)
<?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>
--- /dev/null
+<?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>&Copier</translation>
+ </message>
+ <message>
+ <location filename="../LogWindow.cxx" line="298"/>
+ <source>EDIT_CLEAR_CMD</source>
+ <translation>&Effacer</translation>
+ </message>
+ <message>
+ <location filename="../LogWindow.cxx" line="303"/>
+ <source>EDIT_SELECTALL_CMD</source>
+ <translation>&Tout sélectionner</translation>
+ </message>
+ <message>
+ <location filename="../LogWindow.cxx" line="308"/>
+ <source>EDIT_SAVETOFILE_CMD</source>
+ <translation>&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>&OK</translation>
+ </message>
+</context>
+</TS>
SUBDIRS_VTKVIEWER = VTKViewer
if ENABLE_SALOMEOBJECT
SUBDIRS_VTKVIEWER += SVTK
+ SUBDIRS_VIEWERTOOLS = ViewerTools
endif
endif
##
if ENABLE_OCCVIEWER
SUBDIRS_OCCVIEWER = OCCViewer
+ SUBDIRS_VIEWERTOOLS = ViewerTools
if ENABLE_SALOMEOBJECT
SUBDIRS_OCCVIEWER += SOCC
endif
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
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 = \
OCCViewer_ClippingDlg.cxx \
OCCViewer_AxialScaleDlg.cxx \
OCCViewer_Trihedron.cxx \
- OCCViewer_ToolTip.cxx \
+ OCCViewer_FontWidget.cxx \
+ OCCViewer_CubeAxesDlg.cxx \
+ OCCViewer_ToolTip.cxx \
OCCViewer_ViewFrame.cxx
MOC_FILES = \
OCCViewer_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)
resources/occ_view_clipping.png \
resources/occ_view_clipping_pressed.png \
resources/occ_view_scaling.png \
+ resources/occ_view_graduated_axes.png \
resources/occ_view_ambient.png \
resources/occ_view_fitall.png \
resources/occ_view_fitarea.png \
resources/occ_view_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
*/
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 ) );
}
if( !myListBox->count() )
{
- myListBox->clear();
- myListBox->insertItem( 0, "No Items" );
+ clearList();
}
}
{
myListBox->clear();
myListBox->insertItem( 0, "No Items" );
-
myParametersMap.clear();
+
+ //Clear view
+ myCurViewPort->reset();
}
/*!
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
--- /dev/null
+// 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;
+ */
+}
--- /dev/null
+// 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
// set interaction style to standard
myInteractionStyle = 0;
+ // set zooming style to standard
+ myZoomingStyle = 0;
+
// selection
mySelectionEnabled = true;
myMultiSelectionEnabled = true;
view->initLayout();
view->initSketchers();
view->setInteractionStyle( interactionStyle() );
+ view->setZoomingStyle( zoomingStyle() );
OCCViewer_ViewPort3d* vp3d = view->getViewPort();
if ( vp3d )
}
}
+/*!
+ \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
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;
int interactionStyle() const;
void setInteractionStyle( const int );
+ int zoomingStyle() const;
+ void setZoomingStyle( const int );
+
void enableSelection(bool isEnabled);
bool isSelectionEnabled() const { return mySelectionEnabled; }
viewAspectList myViewAspects;
int myInteractionStyle;
+ int myZoomingStyle;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
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
*/
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();
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 ]
*/
// 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 );
}
}
virtual void pan( int , int );
virtual void setCenter( int , int );
virtual void fitRect( const QRect& );
+ virtual void startZoomAtPoint( int, int );
virtual void zoom( int, int, int, int );
virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
virtual void 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* );
bool myAnimate;
bool myBusy;
double myScale;
+ bool myIsAdvancedZoomingEnabled;
};
#ifdef WIN32
#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
createActions();
createToolBar();
+
switch (my2dMode) {
case XYPlane:
onTopView();
onFrontView();
break;
}
+
+ // Graduated axes dialog
+ QtxAction* anAction = dynamic_cast<QtxAction*>( toolMgr()->action( GraduatedAxesId ) );
+ myCubeAxesDlg = new OCCViewer_CubeAxesDlg( anAction, this, "OCCViewer_CubeAxesDlg" );
+ myCubeAxesDlg->initialize();
}
/*!
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 );
/* Try to activate a transformation */
switch ( getButtonState(theEvent, anInteractionStyle) ) {
case ZOOMVIEW:
- activateZoom();
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
+ activateZoom();
break;
case PANVIEW:
activatePanning();
// 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
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);
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"));
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 );
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 );
myScalingDlg->show();
}
+/*!
+ Shows Graduated Axes dialog
+*/
+void OCCViewer_ViewWindow::onGraduatedAxes()
+{
+ myCubeAxesDlg->Update();
+ myCubeAxesDlg->show();
+}
+
void OCCViewer_ViewWindow::onAmbientToogle()
{
Handle(V3d_Viewer) viewer = myViewPort->getViewer();
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;
}
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
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
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;
}
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("*");
}
/*!
*/
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 );
}
/*!
class OCCViewer_AxialScaleDlg;
class OCCViewer_SetRotationPointDlg;
class OCCViewer_Viewer;
+class OCCViewer_CubeAxesDlg;
struct viewAspect;
class QtxAction;
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,
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;
virtual void onCloneView();
virtual void onClipping( bool on );
virtual void onAxialScale();
+ virtual void onGraduatedAxes();
virtual void onAmbientToogle();
virtual void onMemorizeView();
virtual void onRestoreView();
virtual void onTrihedronShow();
virtual void setRestoreFlag();
virtual void onSwitchInteractionStyle( bool on );
+ virtual void onSwitchZoomingStyle( bool on );
virtual void activateSetRotationGravity();
virtual void activateSetRotationSelected( double theX, double theY, double theZ );
virtual void showEvent( QShowEvent * );
virtual void hideEvent( QHideEvent * );
- void onMaximizedView();
-
+ virtual void onMaximizedView();
signals:
void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
OCCViewer_Viewer* myModel;
OCCViewer_ViewPort3d* myViewPort;
+ OCCViewer_CubeAxesDlg* myCubeAxesDlg;
+
RotationPointType myCurrPointType;
RotationPointType myPrevPointType;
gp_Pnt mySelectedPoint;
<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>
-<!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>
--- /dev/null
+<?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'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'état courant de la scène et l'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'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'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'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'échelle des axes de coordonnées</translation>
+ </message>
+ <message>
+ <source>MNU_SCALING</source>
+ <translation>Changer l'é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'ambiance</translation>
+ </message>
+ <message>
+ <source>MNU_AMBIENT</source>
+ <translation>Ne montrer que la lumière d'ambiance</translation>
+ </message>
+ <message>
+ <source>DSC_STYLE_SWITCH</source>
+ <translation>Changer le style d'intéraction</translation>
+ </message>
+ <message>
+ <source>MNU_STYLE_SWITCH</source>
+ <translation>Changer le style d'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'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'Outils</translation>
+ </message>
+ <message>
+ <source>MEN_CHANGE_BACKGROUD</source>
+ <translation>Changer l'arrière-plan</translation>
+ </message>
+</context>
+<context>
+ <name>OCCViewer_AxialScaleDlg</name>
+ <message>
+ <source>DLG_SCALING</source>
+ <translation>Changer l'é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>
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)
-<!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>
--- /dev/null
+<?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>
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
updateCurve( clist.at( i ), false );
}
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
Removes all curves from the view
myPlot->clear();
myPlot->getCurves().clear();
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
Redraws viewframe contents
setXGrid( myXGridMajorEnabled, myXGridMaxMajor, myXGridMinorEnabled, myXGridMaxMinor, true );
setYGrid( myYGridMajorEnabled, myYGridMaxMajor, myYGridMinorEnabled, myYGridMaxMinor,
myY2GridMajorEnabled, myY2GridMaxMajor, myY2GridMinorEnabled, myY2GridMaxMinor, true );
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
// 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 )
}
break;
}
+ case QEvent::ContextMenu:
+ // Fix from SLN
+ // Do nothing because context menu is called from MouseRelease
+ return true;
}
}
return QWidget::eventFilter( watched, e );
myPlot->updateYAxisIdentifiers();
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
}
fitAll();
//myPlot->setUpdatesEnabled( true );
-// update legend
+ // update legend
if ( update )
myPlot->replot();
}
if ( update )
myPlot->replot();
}
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
// fitAll();
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
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() );
aPCurve->setVisible( true );
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
}
{
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;
+ }
}
}
myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s1() + aScale*(y2Map.s2() - y2Map.s1()) );
}
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
myPnt = event->pos();
}
canvas()->setMouseTracking( true );
myPlotZoomer->setEnabled( true );
+ myPlotZoomer->setZoomBase();
}
/*!
{
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 );
+ }
}
}
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];
-<!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>
--- /dev/null
+<?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'un nouveau centre de vue</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+ <translation>Changer la vue de l'axe vertical au mode d'échelle linéaire</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+ <translation>Changer la vue de l'axe horizontal au mode d'é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'é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'axe vertical</translation>
+ </message>
+ <message>
+ <source>PLOT2D_ENABLE_HOR_TITLE</source>
+ <translation>Titre de l'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'axe horizontal au mode d'échelle logarithmique</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+ <translation>Changer la vue de l'axe vertical au mode d'é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'arrière-plan</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+ <translation>Changer l'arrière-plan...</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
+ <translation>Changer la couleur d'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'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'abscisse.
+L'échelle logarithmique de l'abscisse n'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'ordonnée.
+L'échelle logarithmique de l'ordonnée n'est pas permise.</translation>
+ </message>
+ <message>
+ <source>DSC_FITRECT</source>
+ <translation>Ajuster la scène à la zone choisie par l'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'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>&Ajuster à l'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 &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>&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>
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
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
bool isSync() const;
void setIsSync( const bool );
+ bool isSuppressOutput() const;
+ void setIsSuppressOutput( const bool );
+
+
void exec( const QString& );
void execAndWait( const QString& );
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 ) );
}
/*!
myInterp( 0 ),
myCmdInHistory( -1 ),
myEventLoop( 0 ),
- myIsSync( false )
+ myIsSync( false ),
+ myIsSuppressOutput(false)
{
QString fntSet( "" );
QFont aFont = SUIT_Tools::stringToFont( fntSet );
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
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 );
QString myBanner; //!< current banner
QStringList myQueue; //!< python commands queue
bool myIsSync; //!< synchronous mode flag
+ bool myIsSuppressOutput; //!< suppress output flag
};
#endif // PYCONSOLE_EDITOR_H
<?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>
<translation>D&ump commands</translation>
</message>
</context>
-
<context>
<name>PyConsole_Editor</name>
<message>
<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>
--- /dev/null
+<?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>&Copier</translation>
+ </message>
+ <message>
+ <location filename="../PyConsole_Console.cxx" line="221"/>
+ <source>EDIT_PASTE_CMD</source>
+ <translation>C&oller</translation>
+ </message>
+ <message>
+ <location filename="../PyConsole_Console.cxx" line="226"/>
+ <source>EDIT_CLEAR_CMD</source>
+ <translation>&Effacer</translation>
+ </message>
+ <message>
+ <location filename="../PyConsole_Console.cxx" line="231"/>
+ <source>EDIT_SELECTALL_CMD</source>
+ <translation>&Tout sélectionner</translation>
+ </message>
+ <message>
+ <source>EDIT_DUMPCOMMANDS_CMD</source>
+ <translation>&Générer le script des commandes</translation>
+ </message>
+</context>
+<context>
+ <name>PyConsole_Editor</name>
+ <message>
+ <source>TOT_DUMP_PYCOMMANDS</source>
+ <translation>&Générer le script des commandes</translation>
+ </message>
+ <message>
+ <source>PYTHON_FILES_FILTER</source>
+ <translation>Fichiers PYTHON (*.py)</translation>
+ </message>
+</context>
+</TS>
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
-<!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>
</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>
--- /dev/null
+<?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'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 "%1" n'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>
QtxResourceMgr.h \
QtxRubberBand.h \
QtxSearchTool.h \
+ QtxShortcutEdit.h \
QtxSplash.h \
QtxToolBar.h \
QtxToolTip.h \
QtxResourceMgr.cxx \
QtxRubberBand.cxx \
QtxSearchTool.cxx \
+ QtxShortcutEdit.cxx \
QtxSplash.cxx \
QtxToolBar.cxx \
QtxToolTip.cxx \
QtxPopupMgr_moc.cxx \
QtxRubberBand_moc.cxx \
QtxSearchTool_moc.cxx \
+ QtxShortcutEdit_moc.cxx \
QtxSplash_moc.cxx \
QtxToolBar_moc.cxx \
QtxToolTip_moc.cxx \
libqtx_la_CPPFLAGS = $(QT_INCLUDES)
libqtx_la_LDFLAGS = $(QT_MT_LIBS)
+
+nodist_salomeres_DATA = \
+ Qtx_msg_fr.qm
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>
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 );
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 );
}
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
\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 );
setToolTip( text );
setShortcut( accel );
setCheckable( toggle );
+ setShortcutActionName(shortcutAction);
QApplication::instance()->installEventFilter( this );
}
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 );
}
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;
+}
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
: 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 );
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);
}
/*!
#include "QtxIntSpinBox.h"
#include "QtxColorButton.h"
#include "QtxDoubleSpinBox.h"
+#include "QtxShortcutEdit.h"
+#include "QtxResourceMgr.h"
#include <QEvent>
#include <QLayout>
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() );
}
}
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.
class QtxGroupBox;
class QtxComboBox;
class QtxColorButton;
+class QtxShortcutEdit;
+class QtxShortcutTree;
class QToolBox;
class QLineEdit;
class QDateTimeEdit;
class QStackedWidget;
class QSlider;
+class QTreeWidget;
class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
{
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
{
QtxUserDefinedContent* myContent;
};
-
#endif
#include <QRegExp>
#include <QTextStream>
#include <QApplication>
+#include <QLibraryInfo>
#ifndef QT_NO_DOM
#include <QDomDocument>
#include <QDomElement>
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
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.
\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()
\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()
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.
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;
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;
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();
--- /dev/null
+// 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;
+}
--- /dev/null
+// 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
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() );
}
--- /dev/null
+<?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'est pas indiqué</translation>
+ </message>
+ <message>
+ <source>File \"%1\" does not exist</source>
+ <translation>Le fichier \"%1\" n'existe pas</translation>
+ </message>
+ <message>
+ <source>File \"%1\" already exist. Do you want to overwrite it?</source>
+ <translation>Le fichier \"%1\" existe déjà. Voulez-vous l'écraser ?</translation>
+ </message>
+ <message>
+ <source>Directory \"%1\" does not exist</source>
+ <translation>Le répertoire \"%1\" n'existe pas</translation>
+ </message>
+ <message>
+ <source>Directory \"%1\" can't be created because file with the same name exist</source>
+ <translation>Il est impossible de créer le répertoire \"%1\" parce qu'un fichier avec ce nom existe déjà</translation>
+ </message>
+ <message>
+ <source>Directory \"%1\" not empty. Do you want to remove all files in this directory?</source>
+ <translation>Le répertoire \"%1\" n'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 \"%1\" doesn't exist. Add it to list anyway?</source>
+ <translation>Le chemin \"%1\" n'existe pas. Faut-il l'ajouter dans la liste?</translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation>Erreur</translation>
+ </message>
+ <message>
+ <source>Location \"%1\" doesn't point to file</source>
+ <translation>L'emplacement \"%1\" ne pointe sur aucun fichier</translation>
+ </message>
+ <message>
+ <source>Location \"%1\" doesn't point to directory</source>
+ <translation>L'emplacement \"%1\" ne pointe sur aucun répertoire</translation>
+ </message>
+ <message>
+ <source>Path \"%1\" already exist in the list</source>
+ <translation>Le chemin \"%1\" 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><Empty></source>
+ <translation><Vide></translation>
+ </message>
+</context>
+<context>
+ <name>QtxDialog</name>
+ <message>
+ <source>&OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>&Cancel</source>
+ <translation>&Annuler</translation>
+ </message>
+ <message>
+ <source>C&lose</source>
+ <translation>&Fermer</translation>
+ </message>
+ <message>
+ <source>&Help</source>
+ <translation>&Aide</translation>
+ </message>
+ <message>
+ <source>&Apply</source>
+ <translation>A&ppliquer</translation>
+ </message>
+ <message>
+ <source>&Yes</source>
+ <translation>&Oui</translation>
+ </message>
+ <message>
+ <source>&No</source>
+ <translation>&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>&OK</source>
+ <translation>&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>
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
-<!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>
--- /dev/null
+<?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'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>
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
-<!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>
--- /dev/null
+<?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'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>
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.
void onGUIEvent();
void onActiveViewChanged( SUIT_ViewWindow* );
void onViewClosed( SUIT_ViewWindow* );
+ void onViewTryClose( SUIT_ViewWindow* );
void onViewCloned( SUIT_ViewWindow* );
protected:
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();
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();
// 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();
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();
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();
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();
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();
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,
#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",
}
}
- 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,
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();
// 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();
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();
if ( !myInterp || !myModule )
return;
- if ( PyObject_HasAttrString( myModule, "preferenceChanged" ) ) {
+ if ( PyObject_HasAttrString( myModule, (char*)"preferenceChanged" ) ) {
PyObjWrapper res( PyObject_CallMethod( myModule,
(char*)"preferenceChanged",
(char*)"ss",
connectView( pview );
- if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) )
+ if ( PyObject_HasAttrString( myModule, (char*)"activeViewChanged" ) )
{
if ( !pview )
return;
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 )
}
}
+/*!
+ \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
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 )
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* ) ) );
}
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 ) {
#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 )) {
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* );
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* );
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
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
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 );
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/ ;
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)
-<!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>
</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>
--- /dev/null
+<?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&uper</translation>
+ </message>
+ <message>
+ <source>ERR_APP_NOAPP</source>
+ <translation>Pas d'application</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_WINDOW</source>
+ <translation>&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>&Copier</translation>
+ </message>
+ <message>
+ <source>MSG_CANT_SAVE</source>
+ <translation>Impossible de sauvegarder le fichier "%1".</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'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'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>&Annuler</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_HELP_ABOUT</source>
+ <translation>&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>&Barre de status</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_NEWWINDOW</source>
+ <translation>&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'utiliser un autre nom</translation>
+ </message>
+ <message>
+ <source>BUT_NO</source>
+ <translation>N&on</translation>
+ </message>
+ <message>
+ <source>BUT_OK</source>
+ <translation>O&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>&Nouveau</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_MRU</source>
+ <translation>&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&ui</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_VIEW</source>
+ <translation>&Affichage</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_HELP_ABOUT</source>
+ <translation>Montre la boîte de dialogue 'A propos'</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE</source>
+ <translation>Fic&hier</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_EDIT</source>
+ <translation>&Edition</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_HELP</source>
+ <translation>A&ide</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR</source>
+ <translation>Erreur</translation>
+ </message>
+ <message>
+ <source>ERR_DESK_NOAPP</source>
+ <translation>Pas d'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&ppliquer</translation>
+ </message>
+ <message>
+ <source>BUT_CLOSE</source>
+ <translation>&Fermer</translation>
+ </message>
+ <message>
+ <source>INF_DESK_EXIT</source>
+ <translation>&Quitter</translation>
+ </message>
+ <message>
+ <source>ERR_UNKNOWN</source>
+ <translation>Erreur inconnue</translation>
+ </message>
+ <message>
+ <source>BUT_HELP</source>
+ <translation>A&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'&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'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'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>&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'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&mer</translation>
+ </message>
+ <message>
+ <source>MSG_FILE_EXISTS</source>
+ <translation>Le fichier "%1" existe déjà.
+Voulez-vous l'écraser ?</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_PRINT</source>
+ <translation>&Imprimer</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_HELP_SEARCH</source>
+ <translation>&Recherche...</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_VIEW_STDTOOLBAR</source>
+ <translation>&Standard</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_SAVEAS</source>
+ <translation>Enre&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'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'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'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>&Quitter</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_OPEN</source>
+ <translation>&Ouvrir...</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_REOPEN</source>
+ <translation>&Réouvrir</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_LOAD</source>
+ <translation>Connec&ter...</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_SAVE</source>
+ <translation>&Enregistrer</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_EDIT_PASTE</source>
+ <translation>Co&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'étude en cours</translation>
+ </message>
+ <message>
+ <source>INF_DOC_SAVED</source>
+ <translation>L'étude %1 est sauvegardée</translation>
+ </message>
+ <message>
+ <source>TOT_DOCK_WINDOWS</source>
+ <translation>Montrer / cacher les fenêtres ancrables et les barres d'outils</translation>
+ </message>
+ <message>
+ <source>MEN_DOCK_WINDOWS</source>
+ <translation>Fenêtres et Barres d'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 "%1".
+Il peut y avoir un problème de droit ou l'espace disque restant est insuffisant.
+Essayez d'utiliser un autre nom de fichier.</translation>
+ </message>
+ <message>
+ <source>INF_DOCUMENT_MODIFIED</source>
+ <translation>Le document "%1" a été modifié.
+Voulez-vous sauvegarder les changements?</translation>
+ </message>
+ <message>
+ <source>CLOSE_STUDY</source>
+ <translation>Fermer l'étude actuelle</translation>
+ </message>
+ <message>
+ <source>CLOSE_QUESTION</source>
+ <translation>Voulez-vous sauvegarder l'étude avant de la fermer?</translation>
+ </message>
+ <message>
+ <source>REOPEN_STUDY</source>
+ <translation>Réouvrir l'étude</translation>
+ </message>
+ <message>
+ <source>REOPEN_QUESTION</source>
+ <translation>Voulez-vous vraiment réouvrir l'étude?
+Toutes les modifications introduites après le dernier enregistrement seront perdues.</translation>
+ </message>
+</context>
+</TS>
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 \
SUIT_TreeModel.cxx \
SUIT_ViewManager.cxx \
SUIT_ViewModel.cxx \
- SUIT_ViewWindow.cxx
+ SUIT_ViewWindow.cxx \
+ SUIT_ShortcutMgr.cxx
MOC_FILES = \
SUIT_Accel_moc.cxx \
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
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_ShortcutMgr.h"
#include <QTimer>
#include <QLabel>
#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
+
/*!
\class StatusLabel
\brief Status bar customization label. Used to workaroubd desktop resizing bug.
{
if ( desktop() )
desktop()->show();
+
+ // Initialize shortcut manager
+ SUIT_ShortcutMgr::Init();
}
/*!
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
/*!
*/
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 )
class SUIT_Desktop;
class SUIT_ViewModel;
class SUIT_ResourceMgr;
+class SUIT_ShortcutMgr;
class SUIT_Study;
#ifdef WIN32
SUIT_ResourceMgr* resourceMgr() const;
+ SUIT_ShortcutMgr* shortcutMgr() const;
+
//! Puts the message to the status bar
void putInfo ( const QString&, const int = 0 );
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();
SUIT_Study* myStudy;
SUIT_Desktop* myDesktop;
QMap<int, QAction*> myActionMap;
+ SUIT_ShortcutMgr* myShortcutMgr;
QLabel* myStatusLabel;
};
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;
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:
--- /dev/null
+// 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 );
+}
--- /dev/null
+// 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
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;
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*)));
QPointer<SUIT_ViewWindow> view( theView );
+ view->setClosable( false );
view->hide();
if ( !view->testAttribute( Qt::WA_DeleteOnClose ) )
signals:
void lastViewClosed(SUIT_ViewManager*);
+ void tryCloseView(SUIT_ViewWindow*);
void deleteView(SUIT_ViewWindow*);
void viewCreated(SUIT_ViewWindow*);
void mousePress(SUIT_ViewWindow*, QMouseEvent*);
*/
bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format )
{
+ Qtx::Localizer loc;
return dumpViewToFormat( dumpView(), fileName, format );
}
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.
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" ) );
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";
}
bool onAccelAction( int );
+ bool closable() const;
+ bool setClosable( const bool );
+
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& parameters );
virtual void onDumpView();
signals:
+ void tryClosing( SUIT_ViewWindow* );
void closing( SUIT_ViewWindow* );
void mousePressed( SUIT_ViewWindow*, QMouseEvent* );
void mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
QMap<QString, QVariant> myCustomData;
};
-#endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
+#endif // SUIT_VIEWWINDOW_H
-<!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>
</message>
<message>
<source>QUE_FILE_EXISTS</source>
- <translation>The file "%1" already exists.
+ <translation>The file %1 already exists.
Do you want to overwrite it?</translation>
</message>
<message>
--- /dev/null
+<?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>&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>&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 "%1" n'existe pas !</translation>
+ </message>
+ <message>
+ <source>ERR_FILE_NOT_DIR</source>
+ <translation>"%1" n'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 "%1" n'existe pas !</translation>
+ </message>
+ <message>
+ <source>QUE_DOC_FILEEXISTS</source>
+ <translation>Le fichier %1 existe déjà.
+Voulez-vous l'é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 "%1".
+Autorisation interdite.</translation>
+ </message>
+ <message>
+ <source>ERR_OPEN_PERMISSION_DENIED</source>
+ <translation>Impossible d'ouvrir le fichier "%1".
+Autorisation interdite.</translation>
+ </message>
+ <message>
+ <source>ERR_DIR_READ_PERMISSION_DENIED</source>
+ <translation>Impossible de lire le répertoire "%1".
+Autorisation interdite.</translation>
+ </message>
+ <message>
+ <source>ERR_DIR_WRITE_PERMISSION_DENIED</source>
+ <translation>Impossible d'écrire dans le répertoire "%1".
+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'é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 &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>&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'opération</translation>
+ </message>
+ <message>
+ <source>PREVIOUS_NOT_FINISHED</source>
+ <translation>L'opération précédente n'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>
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
{
if ( resMgr )
{
- resMgr->loadLanguage( false );
+ resMgr->loadLanguage();
splash = QtxSplash::splash( QPixmap() );
splash->readSettings( resMgr );
-<!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>
--- /dev/null
+<?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>
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
-<!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>
--- /dev/null
+<?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>
SALOME_Actor.h \
SVTK_RectPicker.h \
SVTK_DeviceActor.h \
- SVTK_DialogBase.h \
SVTK_FontWidget.h \
SVTK_CubeAxesActor2D.h \
SVTK_Functor.h \
SVTK_NonIsometricDlg.cxx \
SVTK_UpdateRateDlg.cxx \
SVTK_CubeAxesDlg.cxx \
- SVTK_DialogBase.cxx \
SVTK_FontWidget.cxx \
SVTK_Trihedron.cxx \
SVTK_View.cxx \
SVTK_Recorder.cxx \
SVTK_RecorderDlg.cxx \
SVTK_ImageWriter.cxx \
- SVTK_ImageWriterMgr.cxx
+ SVTK_ImageWriterMgr.cxx \
+ vtkPVAxesActor.h \
+ vtkPVAxesActor.cxx \
+ vtkPVAxesWidget.h \
+ vtkPVAxesWidget.cxx
# internal headers
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 \
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 \
nodist_salomeres_DATA = \
SVTK_msg_en.qm \
+ SVTK_msg_fr.qm \
SVTK_images.qm
libSVTK_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx \
-I$(srcdir)/../SUIT \
+ -I$(srcdir)/../ViewerTools \
-I$(srcdir)/../OBJECT \
-I$(srcdir)/../Prs \
-I$(srcdir)/../VTKViewer \
$(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
#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;
return true;
}
-bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
+bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
{
if (theActor == 0)
return false;
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;
}
/*!
*/
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
{
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
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();
-}
#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
//
#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() ) );
}
/*!
{
}
-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 );
myFamily->setCurrentIndex( 1 );
else
myFamily->setCurrentIndex( 2 );
-
- myBold->setChecked( theBold );
- myItalic->setChecked( theItalic );
- myShadow->setChecked( theShadow );
}
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();
}
#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
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
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
myHighlightSelectionPointActor(SVTK_Actor::New()),
- myRectBand(0)
+ myRectBand(0),
+ myIsAdvancedZoomingEnabled(false)
{
myPointPicker->Delete();
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();
};
class vtkPointPicker;
+class vtkTDxInteractorStyle;
class SALOME_Actor;
int CurrentState() const { return State; }
+ void SetAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+ bool IsAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
protected:
SVTK_InteractorStyle();
~SVTK_InteractorStyle();
bool myBBFirstCheck;
QRubberBand* myRectBand; //!< selection rectangle rubber band
+
+ bool myIsAdvancedZoomingEnabled;
};
#ifdef WIN32
::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"));
#ifndef SVTK_NONISOMETRICDLG_H
#define SVTK_NONISOMETRICDLG_H
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
class SVTK_ViewWindow;
class QPushButton;
-class SVTK_NonIsometricDlg : public SVTK_DialogBase
+class SVTK_NonIsometricDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
::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()),
#include "SVTK.h"
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
class vtkCallbackCommand;
class vtkObject;
-class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
::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()),
#ifndef SVTK_UPDATERATEDLG_H
#define SVTK_UPDATERATEDLG_H
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
class vtkObject;
-class SVTK_UpdateRateDlg : public SVTK_DialogBase
+class SVTK_UpdateRateDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
{
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;
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) );
}
}
+/*!
+ \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
}
}
+/*!
+ \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
*/
//! 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;
//! 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;
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];
};
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()),
#include "SVTK.h"
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
#include <vtkTimeStamp.h>
class vtkCallbackCommand;
class vtkObject;
-class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
#include <vtkAxisActor2D.h>
#include <vtkGL2PSExporter.h>
#include <vtkInteractorStyle.h>
+#include <vtkProperty.h>
#include "QtxAction.h"
#include "SVTK_Recorder.h"
#include "SVTK_RecorderDlg.h"
+#include "vtkPVAxesWidget.h"
+#include "vtkPVAxesActor.h"
+
#include "SALOME_ListIteratorOfListIO.hxx"
#include "VTKViewer_Algorithm.h"
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();
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);
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
*/
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
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
*/
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);
}
// 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
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" ) ),
mgr->append( DumpId, myToolBar );
mgr->append( SwitchInteractionStyleId, myToolBar );
+ mgr->append( SwitchZoomingStyleId, myToolBar );
mgr->append( ViewTrihedronId, myToolBar );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
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;
//! 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 );
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();
void onViewParameters(bool theIsActivate);
void onSwitchInteractionStyle(bool theOn);
+ void onSwitchZoomingStyle(bool theOn);
void onStartRecording();
void onPlayRecording();
FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId,
ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+ SwitchZoomingStyleId,
StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
SVTK_ViewModelBase* myModel;
SVTK_RenderWindowInteractor* myInteractor;
+ vtkSmartPointer<SVTK_InteractorStyle> myDefaultInteractorStyle;
vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
QString myVisualParams; // used for delayed setting of view parameters
int myToolBar;
int myRecordingToolBar;
+ vtkPVAxesWidget* myAxesWidget;
+
private:
QImage myDumpImage;
};
<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>
-<!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>
<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>
</message>
<message>
<source>WORLD_COORDINATES</source>
- <translation>World Coordinates</translation>
+ <translation>Absolute Coordinates</translation>
</message>
<message>
<source>FOCAL_RELATIVE</source>
--- /dev/null
+<?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'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'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'intéraction</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_STYLE_SWITCH</source>
+ <translation>Changer le style d'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'échelle</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_SCALING</source>
+ <translation>Mise à l'é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'enregistrement</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_RECORDING_START</source>
+ <translation>Commencer l'enregistrement</translation>
+ </message>
+ <message>
+ <source>DSC_SVTK_RECORDING_PLAY</source>
+ <translation>Jouer l'enregistrement</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_RECORDING_PLAY</source>
+ <translation>Jouer l'enregistrement</translation>
+ </message>
+ <message>
+ <source>DSC_SVTK_RECORDING_PAUSE</source>
+ <translation>Mettre en pause l'enregistrement</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_RECORDING_PAUSE</source>
+ <translation>Mettre en pause l'enregistrement</translation>
+ </message>
+ <message>
+ <source>DSC_SVTK_RECORDING_STOP</source>
+ <translation>Arrêter l'enregistrement</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_RECORDING_STOP</source>
+ <translation>Arrêter l'enregistrement</translation>
+ </message>
+ <message>
+ <source>LBL_TOOLBAR_RECORD_LABEL</source>
+ <translation>Opérations d'enregistrement</translation>
+ </message>
+ <message>
+ <source>MSG_NO_AVI_MAKER</source>
+ <translation>L'outil jpeg2yuv, requis pour enregistrer les fichiers AVI, n'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'é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'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'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'outils</translation>
+ </message>
+ <message>
+ <source>MEN_CHANGE_BACKGROUD</source>
+ <translation>Changer l'arrière-plan...</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+/*=========================================================================
+
+ 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);
+}
--- /dev/null
+/*=========================================================================
+
+ 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
+
--- /dev/null
+/*=========================================================================
+
+ 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;
+}
--- /dev/null
+/*=========================================================================
+
+ 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
# 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@ \
#include <QListWidget>
#include <QGridLayout>
#include <QMenu>
+#include <QtDebug>
#include <SALOMEDSClient_ClientFactory.hxx>
#include <Basics_Utils.hxx>
// 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];
+ }
}
}
}
// 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);
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;
}
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;
}
* 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));
}
--- /dev/null
+
+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
</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>
-<!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>
</message>
<message>
<source>ERR_INCOMPATIBLE_TYPE</source>
- <translation>Variable with name "%1" has incompatible numeric type</translation>
+ <translation>Variable with name "%1" has incompatible numeric type</translation>
</message>
<message>
<source>ERR_INVALID_VALUE</source>
- <translation>Value hasn't been validated</translation>
+ <translation>Value hasn't been validated</translation>
</message>
<message>
<source>ERR_NO_VARIABLE</source>
- <translation>Variable with name "%1" doesn't exist</translation>
+ <translation>Variable with name "%1" doesn't exist</translation>
</message>
</context>
<context>
<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>
<source>MEN_DESK_TOOLS</source>
<translation>&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>
<source>PRP_DESK_CATALOG_GENERATOR</source>
<translation>Generates XML catalog of a component'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>
<source>MEN_DESK_CATALOG_GENERATOR</source>
<translation>Catalog &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>
</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 "%1" 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 "%1" 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 "%1" 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>&Update Study</translation>
- </message>
- <message>
- <source>BUT_REMOVE</source>
- <translation>&Remove</translation>
- </message>
- <message>
- <source>BUT_APPLY_AND_CLOSE</source>
- <translation>A&pply and Close</translation>
- </message>
- <message>
- <source>BUT_HELP</source>
- <translation>&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>&Update Study</translation>
+ </message>
+ <message>
+ <source>BUT_REMOVE</source>
+ <translation>&Remove</translation>
+ </message>
+ <message>
+ <source>BUT_APPLY_AND_CLOSE</source>
+ <translation>A&pply and Close</translation>
+ </message>
+ <message>
+ <source>BUT_HELP</source>
+ <translation>&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>
--- /dev/null
+<?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'existe pas.</translation>
+ </message>
+ <message>
+ <source>CLOSE_LOCKED_STUDY</source>
+ <translation>Fermer l'étude verrouillée?</translation>
+ </message>
+ <message>
+ <source>PUBLISH_IN_STUDY</source>
+ <translation>Publier dans l'étude</translation>
+ </message>
+ <message>
+ <source>BUT_NEW</source>
+ <translation>&Nouvelle</translation>
+ </message>
+ <message>
+ <source>SAVE_POINT_ROOT_NAME</source>
+ <translation>Etats d'IHM</translation>
+ </message>
+ <message>
+ <source>SAVE_POINT_ROOT_TOOLTIP</source>
+ <translation>Etats d'IHM persistents</translation>
+ </message>
+ <message>
+ <source>SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état d'IHM</translation>
+ </message>
+ <message>
+ <source>BUT_LOAD</source>
+ <translation>&Charger</translation>
+ </message>
+ <message>
+ <source>BUT_OPEN</source>
+ <translation>&Ouvrir</translation>
+ </message>
+ <message>
+ <source>SAVE_POINT_OBJECT_TOOLTIP</source>
+ <translation>Etat d'IHM: %1 sauvegardé</translation>
+ </message>
+ <message>
+ <source>SAVE_POINT_DEF_NAME</source>
+ <translation>Etat d'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 "%1" n'est pas compatible</translation>
+ </message>
+ <message>
+ <source>ERR_INVALID_VALUE</source>
+ <translation>La valeur n'a pas été validée</translation>
+ </message>
+ <message>
+ <source>ERR_NO_VARIABLE</source>
+ <translation>La variable "%1" n'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>&Déconnecter</translation>
+ </message>
+ <message>
+ <source>APPCLOSE_CLOSE</source>
+ <translation>&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>&Sauvegarder && 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'IHM</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état actuel des vues 3D, des objets affichés, etc.</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état d'IHM</translation>
+ </message>
+ <message>
+ <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
+ <translation>Sauvegarder l'état d'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'étude</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_PROPERTIES</source>
+ <translation>Pro&priétés...</translation>
+ </message>
+ <message>
+ <source>QUE_DOC_ALREADYEXIST</source>
+ <translation>Le document %1 existe déjà dans le gestionnaire d'é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'é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'étude avant de la fermer?</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_PROPERTIES</source>
+ <translation>Editer les propriétés de l'étude</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_OBJBROWSER</source>
+ <translation>Arbre d'étude</translation>
+ </message>
+ <message>
+ <source>STUDY_LOCKED</source>
+ <translation>VERROUILLEE</translation>
+ </message>
+ <message>
+ <source>APPCLOSE_CANCEL</source>
+ <translation>&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&t...</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_TOOLS</source>
+ <translation>&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'étude</translation>
+ </message>
+ <message>
+ <source>MEN_VIEW_WNDS</source>
+ <translation>Fenêtres</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FILE_DUMP_STUDY</source>
+ <translation>&Générer le script de l'étude...</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_CATALOG_GENERATOR</source>
+ <translation>Génére un catalogue XML de l'interface du composant</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_ADD_VARS_TO_NOTEBOOK</source>
+ <translation>Ajouter les variables de l'étude au registre</translation>
+ </message>
+ <message>
+ <source>PRP_DESK_FILE_DUMP_STUDY</source>
+ <translation>Génère le script python de l'é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&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'é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'un fichier</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_CATALOG_GENERATOR</source>
+ <translation>&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'é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>&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'é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 "%1" est utilisée dans l'étude.
+Voulez-vous vraiment la supprimer?</translation>
+ </message>
+ <message>
+ <source>RENAME_VARIABLE_IS_USED</source>
+ <translation>La variable "%1" est utilisée dans l'é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'est pas correcte: %1</translation>
+ </message>
+ <message>
+ <source>VARNAME_INCORRECT</source>
+ <translation>Le nom de la variable n'est pas correct: %1</translation>
+ </message>
+ <message>
+ <source>VARNAME_EXISTS</source>
+ <translation>La variable "%1" 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>&Mettre l'étude à jour</translation>
+ </message>
+ <message>
+ <source>BUT_REMOVE</source>
+ <translation>&Supprimer</translation>
+ </message>
+ <message>
+ <source>BUT_APPLY_AND_CLOSE</source>
+ <translation>A&ppliquer et Fermer</translation>
+ </message>
+ <message>
+ <source>BUT_HELP</source>
+ <translation>&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'é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'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'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'intervalle ( %1; %2 )</translation>
+ </message>
+ <message>
+ <source>VALID_RANGE_NOVAR_MSG</source>
+ <translation>Indiquez une valeur entière dans l'intervalle ( %1; %2 )</translation>
+ </message>
+</context>
+</TS>
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)
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 );
../Qtx/libqtx.la
dist_salomeres_DATA = resources/SalomeStyle.xml
+
+nodist_salomeres_DATA = Style_msg_fr.qm
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() );
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
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 );
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
--- /dev/null
+<?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'infobulle</translation>
+ </message>
+ <message>
+ <source>Tooltip text</source>
+ <translation>Texte d'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'onglet</translation>
+ </message>
+ <message>
+ <source>Tab border bottom</source>
+ <translation>Frontière de dessous de l'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'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'é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>
# .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@ \
// 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",
"......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();
}
/*!
\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 )
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();
}
/*!
*/
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" ) );
}
}
\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
-}
-
// 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
-<!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>
</message>
<message>
<source>TOOLS_COMP_USERNAME</source>
- <translation>UserName : </translation>
+ <translation>User name : </translation>
</message>
<message>
<source>TOOLS_CATALOG_GENERATOR</source>
<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's time. The difference is %2 seconds.</translation>
+ </message>
+</context>
</TS>
--- /dev/null
+<?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'existe pas</translation>
+ </message>
+ <message>
+ <source>TOOLS_BUT_OK</source>
+ <translation>&Ok</translation>
+ </message>
+ <message>
+ <source>TOOLS_BUT_APPLY</source>
+ <translation>&Appliquer</translation>
+ </message>
+ <message>
+ <source>TOOLS_BUT_CLOSE</source>
+ <translation>&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'actualisation</translation>
+ </message>
+ <message>
+ <source>LAB_REFRESH_INTERVAL</source>
+ <translation>Nouvelle fréquence d'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'actualisation...</translation>
+ </message>
+ <message>
+ <source>STB_INTERVAL</source>
+ <translation>Changer la fréquence d'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'utilisateur</translation>
+ </message>
+ <message>
+ <source>HDR_HOSTNAME</source>
+ <translation>Nom de l'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'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'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>
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 \
VTKViewer_MarkerWidget.cxx \
VTKViewer_MarkerDlg.cxx \
VTKViewer_PolyDataMapper.cxx \
- VTKViewer_DataSetMapper.cxx
+ VTKViewer_DataSetMapper.cxx \
+ VTKViewer_CellCenters.cxx
MOC_FILES = \
VTKViewer_RenderWindow_moc.cxx \
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
*/
VTKViewer_Actor
::VTKViewer_Actor():
+ myOpacity(1.0),
myIsHighlighted(false),
myIsPreselected(false),
myRepresentation(VTK_SURFACE),
--- /dev/null
+// 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;
+}
--- /dev/null
+// 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
class vtkCell;
class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
#include <QObject>
#include <QCursor>
-<!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>
--- /dev/null
+<?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'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'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'outils</translation>
+ </message>
+ <message>
+ <source>MEN_CHANGE_BACKGROUD</source>
+ <translation>Changer l'arrière-plan...</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+# 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
--- /dev/null
+// 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
--- /dev/null
+// 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();
+}
--- /dev/null
+// 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
--- /dev/null
+// 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 );
+}
--- /dev/null
+// 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
--- /dev/null
+// 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();
+}
--- /dev/null
+// 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
--- /dev/null
+<?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>
--- /dev/null
+<?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'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>