From e208a04edd5d8cebc0185834ecdf3faec4514f99 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 13 Mar 2006 15:47:06 +0000 Subject: [PATCH] Join modifications from branch OCC_development_for_3_2_0a2 --- Makefile.in | 2 +- adm_local/Makefile.in | 41 + adm_local/unix/config_files/check_GUI.m4 | 61 -- adm_local/unix/config_files/check_Med.m4 | 45 - adm_local/unix/config_files/check_VISU.m4 | 42 + adm_local/unix/make_commence.in | 21 +- build_configure | 20 +- configure.in.base | 20 + idl/VISU_Gen.idl | 22 + src/CONVERTOR/Makefile.in | 14 +- src/CONVERTOR/VISU_Convertor_impl.cxx | 51 +- src/CONVERTOR/VISU_Convertor_impl.hxx | 3 +- src/CONVERTOR/VISU_MedConvertor.cxx | 156 ++-- src/CONVERTOR/VISU_MedConvertor.hxx | 3 +- src/ENGINE/VISU_Engine_i.cc | 8 + src/ENGINE/VISU_Engine_i.hh | 2 + src/OBJECT/Makefile.in | 3 +- src/OBJECT/VISU_Actor.h | 5 +- src/OBJECT/VISU_ActorFactory.h | 4 +- src/OBJECT/VISU_BoostSignals.h | 56 ++ src/OBJECT/VISU_GaussPtsAct.cxx | 15 +- src/PIPELINE/VISU_CutLinesPL.cxx | 5 +- src/PIPELINE/VISU_CutPlanesPL.cxx | 10 + src/VISUGUI/Makefile.in | 2 +- src/VISUGUI/VISUM_images.po | 67 -- src/VISUGUI/VISUM_msg_en.po | 757 ----------------- src/VISUGUI/VISU_icons.po | 61 -- src/VISUGUI/VISU_images.po | 35 +- src/VISUGUI/VISU_msg_en.po | 773 +++++++++++++++++- src/VISUGUI/VisuGUI.cxx | 355 ++++---- src/VISUGUI/VisuGUI.h | 1 - src/VISUGUI/VisuGUI_ActionsDef.h | 10 +- src/VISUGUI/VisuGUI_BuildProgressDlg.cxx | 77 +- src/VISUGUI/VisuGUI_BuildProgressDlg.h | 1 + src/VISUGUI/VisuGUI_ClippingDlg.cxx | 19 +- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 31 +- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 20 +- src/VISUGUI/VisuGUI_Displayer.cxx | 33 +- src/VISUGUI/VisuGUI_Module.cxx | 754 ++++++++++++----- src/VISUGUI/VisuGUI_Module.h | 29 +- src/VISUGUI/VisuGUI_NonIsometricDlg.cxx | 186 ----- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 6 +- src/VISUGUI/VisuGUI_PopupTools.cxx | 34 +- src/VISUGUI/VisuGUI_Prs3dTools.h | 109 +-- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 34 +- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 207 +++-- .../VisuGUI_ScalarMapOnDeformedShapeDlg.h | 4 +- src/VISUGUI/VisuGUI_Selection.cxx | 17 +- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 163 ++-- src/VISUGUI/VisuGUI_SweepPrefDlg.cxx | 161 ---- src/VISUGUI/VisuGUI_SweepPrefDlg.h | 67 -- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 78 +- src/VISUGUI/VisuGUI_Tools.cxx | 336 ++------ src/VISUGUI/VisuGUI_Tools.h | 48 +- src/VISUGUI/VisuGUI_TransparencyDlg.cxx | 2 +- src/VISUGUI/VisuGUI_ViewTools.cxx | 30 +- src/VISUGUI/VisuGUI_ViewTools.h | 188 +++-- src/VISU_I/Makefile.in | 7 +- src/VISU_I/VISUConfig.cc | 10 + src/VISU_I/VISUConfig.hh | 1 + src/VISU_I/VISU_ColoredPrs3d_i.cc | 2 +- src/VISU_I/VISU_ColoredPrs3d_i.hh | 2 +- src/VISU_I/VISU_DumpPython.cc | 33 +- src/VISU_I/VISU_Gen_i.cc | 113 +-- src/VISU_I/VISU_Mesh_i.cc | 5 +- src/VISU_I/VISU_Prs3d_i.cc | 4 +- src/VISU_I/VISU_Prs3d_i.hh | 1 - src/VISU_I/VISU_Result_i.cc | 56 +- src/VISU_I/VISU_Result_i.hh | 11 +- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc | 54 +- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh | 11 + src/VISU_I/VISU_TimeAnimation.cxx | 98 +-- src/VISU_I/VISU_TimeAnimation.h | 15 +- src/VISU_I/VISU_ViewManager_i.cc | 30 +- src/VISU_I/VISU_ViewManager_i.hh | 9 +- src/VISU_I/VISU_View_i.cc | 26 +- src/VISU_SWIG/VISU_Example_01.py | 12 + src/VISU_SWIG/visu.py | 23 + src/VVTK/VVTK_MainWindow.cxx | 4 +- src/VVTK/VVTK_Renderer.cxx | 57 +- src/VVTK/VVTK_ViewModel.cxx | 201 +---- src/VVTK/VVTK_ViewModel.h | 48 +- 82 files changed, 3006 insertions(+), 3131 deletions(-) create mode 100644 adm_local/Makefile.in delete mode 100755 adm_local/unix/config_files/check_GUI.m4 delete mode 100644 adm_local/unix/config_files/check_Med.m4 create mode 100755 adm_local/unix/config_files/check_VISU.m4 create mode 100644 src/OBJECT/VISU_BoostSignals.h delete mode 100644 src/VISUGUI/VISUM_images.po delete mode 100644 src/VISUGUI/VISUM_msg_en.po delete mode 100644 src/VISUGUI/VISU_icons.po delete mode 100644 src/VISUGUI/VisuGUI_NonIsometricDlg.cxx delete mode 100644 src/VISUGUI/VisuGUI_SweepPrefDlg.cxx delete mode 100644 src/VISUGUI/VisuGUI_SweepPrefDlg.h diff --git a/Makefile.in b/Makefile.in index 519f470b..a2d20a32 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,7 +14,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl: @COMMENCE@ -SUBDIRS = idl src doc +SUBDIRS = idl src doc adm_local BIN_SCRIPT= \ VERSION diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in new file mode 100644 index 00000000..9b5e810d --- /dev/null +++ b/adm_local/Makefile.in @@ -0,0 +1,41 @@ +# source path +top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:$(srcdir)/adm_local + + +all: resources + +install: + cp -rf @top_srcdir@/adm_local @prefix@ + +bin: + +resources : + cp -rf @top_srcdir@/adm_local $(top_builddir) + +inc: + +lib: + +depend: + +depend_idl: + +install-end: + +install-include: + +install-bin: + +uninstall: + +uninstall-idl: + +distclean: + +clean: + +distclean-other: + diff --git a/adm_local/unix/config_files/check_GUI.m4 b/adm_local/unix/config_files/check_GUI.m4 deleted file mode 100755 index d2c8eb8a..00000000 --- a/adm_local/unix/config_files/check_GUI.m4 +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -#------------------------------------------------------------ -# Check availability of Salome binary distribution -# -# Author : Marc Tajchman (CEA, 2002) -#------------------------------------------------------------ - -AC_DEFUN([CHECK_SALOME_GUI],[ - -AC_CHECKING(for SalomeGUI) - -SalomeGUI_ok=yes - -AC_ARG_WITH(gui, - --with-salome_gui=DIR root directory path of SALOME GUI installation, - SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="") - -if test "x$SALOME_GUI_DIR" = "x" ; then - if test "x$GUI_ROOT_DIR" != "x" ; then - SALOME_GUI_DIR=$GUI_ROOT_DIR - else - # search Salome binaries in PATH variable - AC_PATH_PROG(TEMP, libSalomeApp.so) - if test "x$TEMP" != "x" ; then - SALOME_GUI_DIR=`dirname $TEMP` - else - fi - fi -fi - -if test -f ${SALOME_GUI_DIR}/lib/salome/libSalomeApp.so ; then - SalomeGUI_ok=yes - AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR}) - GUI_ROOT_DIR=${SALOME_GUI_DIR} - AC_SUBST(GUI_ROOT_DIR) -else - AC_MSG_WARN("Cannot find compiled SALOME GUI distribution") -fi - -AC_MSG_RESULT(for SALOME GUI: $SalomeGUI_ok) - -])dnl - diff --git a/adm_local/unix/config_files/check_Med.m4 b/adm_local/unix/config_files/check_Med.m4 deleted file mode 100644 index 727bf438..00000000 --- a/adm_local/unix/config_files/check_Med.m4 +++ /dev/null @@ -1,45 +0,0 @@ -# Check availability of Med binary distribution -# -# Author : Nicolas REJNERI (OPEN CASCADE, 2003) -# - -AC_DEFUN([CHECK_MED],[ - -AC_CHECKING(for Med) - -Med_ok=no - -AC_ARG_WITH(med, - [ --with-med=DIR root directory path of MED installation ], - MED_DIR="$withval",MED_DIR="") - -if test "x$MED_DIR" == "x" ; then - -# no --with-med-dir option used - - if test "x$MED_ROOT_DIR" != "x" ; then - - # MED_ROOT_DIR environment variable defined - MED_DIR=$MED_ROOT_DIR - - fi -# -fi - -if test -f ${MED_DIR}/idl/salome/MED.idl ; then - Med_ok=yes - AC_MSG_RESULT(Using Med module distribution in ${MED_DIR}) - - if test "x$MED_ROOT_DIR" == "x" ; then - MED_ROOT_DIR=${MED_DIR} - fi - AC_SUBST(MED_ROOT_DIR) - -else - AC_MSG_WARN("Cannot find Med module sources") -fi - -AC_MSG_RESULT(for Med: $Med_ok) - -])dnl - diff --git a/adm_local/unix/config_files/check_VISU.m4 b/adm_local/unix/config_files/check_VISU.m4 new file mode 100755 index 00000000..7700fb57 --- /dev/null +++ b/adm_local/unix/config_files/check_VISU.m4 @@ -0,0 +1,42 @@ +########################################################### +# File : check_Visu.m4 +# Author : Vadim SANDLER (OCN) +# Created : 13/07/05 +# Copyright (C) 2005 Open CASCADE +# Check availability of VISU binary distribution +########################################################### + +AC_DEFUN([CHECK_VISU],[ + +AC_CHECKING(for VISU) + +Visu_ok=no + +AC_ARG_WITH(visu, + [ --with-visu=DIR root directory path of VISU module installation ], + VISU_DIR="$withval",VISU_DIR="") + +if test "x$VISU_DIR" == "x" ; then + # no --with-visu-dir option used + if test "x$VISU_ROOT_DIR" != "x" ; then + # VISU_ROOT_DIR environment variable defined + VISU_DIR=$VISU_ROOT_DIR + fi +fi + +if test -f ${VISU_DIR}/idl/salome/VISU_Gen.idl ; then + Visu_ok=yes + AC_MSG_RESULT(Using VISU module distribution in ${VISU_DIR}) + + if test "x$VISU_ROOT_DIR" == "x" ; then + VISU_ROOT_DIR=${VISU_DIR} + fi + AC_SUBST(VISU_ROOT_DIR) +else + AC_MSG_WARN("Cannot find VISU module sources") +fi + +AC_MSG_RESULT(for VISU: $Visu_ok) + +])dnl + diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index 574db11c..e28295ad 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -37,6 +37,7 @@ CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@ # BOOST Library BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ +BOOST_LIBSUFFIX = @BOOST_LIBSUFFIX@ BOOST_LIBS = @BOOST_LIBS@ # JAVA @@ -248,13 +249,23 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base ACLOCAL_SRC = \ -ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \ +ac_cxx_bool.m4 check_corba.m4 \ ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ -ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \ +ac_cxx_partial_specialization.m4 python.m4 \ ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_qt.m4 check_swig.m4 +ac_cc_warnings.m4 check_swig.m4 -$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) - cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files +ACLOCAL_GUI = \ +check_vtk.m4 check_opengl.m4 check_qt.m4 \ +check_GUI.m4 check_corba_in_GUI.m4 + +ACLOCAL_MED = check_Med.m4 + +$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ + $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \ + $(ACLOCAL_MED:%=@MED_ROOT_DIR@/adm_local/unix/config_files/%) + cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ + -I @GUI_ROOT_DIR@/adm_local/unix/config_files \ + -I @MED_ROOT_DIR@/adm_local/unix/config_files diff --git a/build_configure b/build_configure index 05354d02..4cc454a9 100755 --- a/build_configure +++ b/build_configure @@ -26,6 +26,22 @@ fi # echo "failed : KERNEL_SRC variable is not correct !" # exit #fi +######################################################################## +# Test if the GUI_ROOT_DIR is set correctly + +if test ! -d "${GUI_ROOT_DIR}"; then + echo "failed : GUI_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the MED_ROOT_DIR is set correctly + +if test ! -d "${MED_ROOT_DIR}"; then + echo "failed : MED_ROOT_DIR variable is not correct !" + exit +fi + ######################################################################## # find_in - utility function # @@ -204,7 +220,9 @@ else echo -n "Creating 'configure' script ... " fi -aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files +aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files if autoconf then echo "done" diff --git a/configure.in.base b/configure.in.base index 1396ae1e..e4b35d6e 100644 --- a/configure.in.base +++ b/configure.in.base @@ -266,6 +266,26 @@ echo CHECK_HTML_GENERATORS +echo +echo --------------------------------------------- +echo Testing GUI +echo --------------------------------------------- +echo + +CHECK_SALOME_GUI + +echo +echo --------------------------------------------- +echo Testing full GUI +echo --------------------------------------------- +echo + +CHECK_CORBA_IN_GUI +if test "x${CORBA_IN_GUI}" != "xyes"; then + echo "failed : For configure VISU module necessary full GUI !" + exit +fi + echo echo --------------------------------------------- echo Testing Kernel diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 5f7648d6..af87ae1c 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -599,6 +599,16 @@ module VISU { */ double GetScale(); + /*! + * Sets the scalar field + * \param theMeshName - mesh name + * \param theFieldName - the name of scalar field + * \param theIteration - the iteration number for scalar field + * \param theEntity - entity of scalar field + */ + void SetScalarField(in string theMeshName,in string theFieldName, + in long theIteration,in Entity theEntity); + }; //------------------------------------------------------- /*! @@ -1450,6 +1460,18 @@ module VISU { in Entity theEntity, in string theFieldName, in double theIteration); + /*! + * Creates a deformed shape presentation. + * \param theResult Data generated in other sources. (MED object or file) + * \param theMeshName One of the meshes presented in MED file + * \param theEntity Type of entity where the field is defined + * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector. + * \param theIteration Number of iteration on the field + */ + ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName, + in Entity theEntity, in string theFieldName, + in double theIteration); + /*! * Creates a vector presentation. * \param theResult Data generated in other sources. (MED object or file) diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index 59057158..b3bf4147 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -57,14 +57,22 @@ LIB_SRC = \ BIN = VISUConvertor BIN_SRC = -CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \ +CPPFLAGS+= -ftemplate-depth-32 \ + $(VTK_INCLUDES) \ + $(HDF5_INCLUDES) \ + $(QT_INCLUDES) \ + $(OCC_INCLUDES) \ + $(OCC_CXXFLAGS) \ -I${KERNEL_ROOT_DIR}/include/salome \ -I${MED_ROOT_DIR}/include/salome \ -I${GUI_ROOT_DIR}/include/salome \ $(BOOST_CPPFLAGS) -LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) \ - $(BOOST_LIBS) -lboost_thread-mt \ +LDFLAGS+= $(VTK_LIBS) \ + $(QT_LIBS) \ + $(CAS_KERNEL) \ + $(CAS_MATH) \ + $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \ -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \ -L${GUI_ROOT_DIR}/lib/salome -lVTKViewer diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index ba2a8ad5..8d1fe336 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -326,11 +326,11 @@ namespace VISU if(myIsAll) return myMeshOnEntity->GetElemObjID(theID); - vtkIdType anInputID; + vtkIdType anInputID, aStartID, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID); - PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID]; - return aSubProfileImpl->GetElemObjID(aID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartID,anInputDataSetID); + PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID]; + return aSubProfileImpl->GetElemObjID(anInputID); } vtkIdType @@ -383,12 +383,12 @@ namespace VISU if(myIsAll) return myMeshOnEntity->GetElemName(theObjID); - vtkIdType anInputID; vtkIdType aVTKId = GetElemVTKID(theObjID); + vtkIdType anInputID, aStartID, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID); - PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID]; - vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(aSubID); + anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartID,anInputDataSetID); + PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID]; + vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(anInputID); return myMeshOnEntity->GetElemName(anEntityObjId); } @@ -475,9 +475,10 @@ namespace VISU TGaussPointID TGaussSubMeshImpl - ::GetObjID(vtkIdType theID) const + ::GetObjID(vtkIdType theID, + vtkIdType theStartID) const { - TCellID aCellID = theID / myGauss->myNbPoints; + TCellID aCellID = theStartID + theID / myGauss->myNbPoints; TLocalPntID aLocalPntID = theID % myGauss->myNbPoints; return TGaussPointID(aCellID,aLocalPntID); @@ -514,12 +515,12 @@ namespace VISU TGaussMeshImpl ::GetObjID(vtkIdType theID) const { + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType anInputDataSetID; - vtkIdType anInputID = anAppendFilter->GetCellInputID(theID,anInputDataSetID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anInputDataSetID]; - return aSubMeshImpl.GetObjID(anInputID); + return aSubMeshImpl.GetObjID(anInputID,aStartId); } TVTKOutput* @@ -601,11 +602,11 @@ namespace VISU TMeshOnEntityImpl ::GetElemObjID(vtkIdType theID) const { - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID); - const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID]; - return aSubMesh->GetElemObjID(aID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); + const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID]; + return aSubMesh->GetElemObjID(anInputID); } std::string @@ -620,11 +621,11 @@ namespace VISU ::GetElemName(vtkIdType theObjID) const { vtkIdType aVTKId = GetElemVTKID(theObjID); - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID); - const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID]; - return aSubMesh->GetElemName(aSubID); + anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartId,anInputDataSetID); + const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID]; + return aSubMesh->GetElemName(anInputID); } //--------------------------------------------------------------- @@ -704,11 +705,11 @@ namespace VISU TGroupImpl ::GetElemObjID(vtkIdType theID) const { - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType anID = anAppendFilter->GetCellInputID(theID,anInputID); - const PFamilyImpl& aFamily = myFamilyArr[anInputID]; - return aFamily->GetElemObjID(anID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); + const PFamilyImpl& aFamily = myFamilyArr[anInputDataSetID]; + return aFamily->GetElemObjID(anInputID); } vtkIdType diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index c4efc7d2..20889db7 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -456,7 +456,8 @@ namespace VISU //! To implement the TGaussPtsIDMapper::GetObjID virtual TGaussPointID - GetObjID(vtkIdType theID) const; + GetObjID(vtkIdType theID, + vtkIdType theStartID) const; PGaussImpl myGauss; // -#include +#include "CASCatch.hxx" #include @@ -894,14 +893,16 @@ namespace //--------------------------------------------------------------- TGaussPointID TMEDGaussSubMesh - ::GetObjID(vtkIdType theID) const + ::GetObjID(vtkIdType theID, + vtkIdType theStartID) const { - TInt aNbPoints = myGauss->myNbPoints; - TCellID aCellID = theID / aNbPoints; + TCellID aCellID = theID / myGauss->myNbPoints; + TLocalPntID aLocalPntID = theID % myGauss->myNbPoints; + if(myIsElemNum) aCellID = myElemNum[aCellID]; - - TLocalPntID aLocalPntID = theID % aNbPoints; + else + aCellID += theStartID; return TGaussPointID(aCellID,aLocalPntID); } @@ -913,7 +914,10 @@ namespace ::Init(const MED::PElemInfo& theElemInfo) { myIsElemNum = theElemInfo->IsElemNum(); - myElemNum = theElemInfo->myElemNum; + + if(myIsElemNum) + myElemNum = theElemInfo->myElemNum; + if(theElemInfo->IsElemNames()) myElemInfo = theElemInfo; } @@ -958,7 +962,7 @@ extern "C" VISU_Convertor* CreateConvertor(const string& theFileName) { - if(MED::PWrapper aMed = MED::CrWrapper(theFileName)) + if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true)) return new VISU_MedConvertor(theFileName); return NULL; } @@ -1190,80 +1194,85 @@ VISU_MedConvertor INITMSG(MYDEBUG,"- iTimeStamp = "<GetPTimeStampInfo(aFieldInfo, - aMEntity, - aGeom2Size, - iTimeStamp); - - MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - - const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss(); - - const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal; - - const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value; - MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin(); - for(; anIter != aGeom2Value.end(); anIter++){ - const MED::TMeshValue& aMMeshValue = anIter->second; - MED::EGeometrieElement aMGeom = anIter->first; + MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo, + aMEntity, + aGeom2Size, + iTimeStamp); - TInt aNbElem = aMMeshValue.myNbElem; - TInt aNbGauss = aMMeshValue.myNbGauss; + MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo, + aMKey2Profile, + aKey2Gauss); - MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); - if(aGaussIter == aGeom2Gauss.end()) - aNbGauss = 1; + const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss(); - INITMSG(MYDEBUG, - "- aMGeom = "<GetMessageString()); } #endif } @@ -2166,7 +2175,8 @@ LoadGaussMesh(const MED::PWrapper& theMed, "; aNbGauss = "<myIsDone = true; diff --git a/src/CONVERTOR/VISU_MedConvertor.hxx b/src/CONVERTOR/VISU_MedConvertor.hxx index abcb6ad7..0ce3377a 100644 --- a/src/CONVERTOR/VISU_MedConvertor.hxx +++ b/src/CONVERTOR/VISU_MedConvertor.hxx @@ -99,7 +99,8 @@ namespace VISU virtual TGaussPointID - GetObjID(vtkIdType theID) const; + GetObjID(vtkIdType theID, + vtkIdType theStartID) const; }; typedef SharedPtr PMEDGaussSubMesh; diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 45dc68bc..b1a29e01 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -236,6 +236,14 @@ namespace VISU{ return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } + ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); + } Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, const char* theMeshName, diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index d9c665ac..b56e216c 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -86,6 +86,8 @@ namespace VISU{ const char* theFieldName, CORBA::Double theIteration); virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); + virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); //Create Digital Presentation virtual Table_ptr CreateTable(const char* theTableEntry); virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow); diff --git a/src/OBJECT/Makefile.in b/src/OBJECT/Makefile.in index e73a5816..0a5cbee8 100644 --- a/src/OBJECT/Makefile.in +++ b/src/OBJECT/Makefile.in @@ -33,6 +33,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl @COMMENCE@ EXPORT_HEADERS = \ + VISU_BoostSignals.h \ VISU_ActorFactory.h \ VISU_GaussPtsSettings.h \ VISU_GaussPtsActorFactory.h \ @@ -76,7 +77,7 @@ LDFLAGS+= \ -L${KERNEL_ROOT_DIR}/lib/salome LIBS+= \ - -lboost_signals-mt \ + -lboost_signals${BOOST_LIBSUFFIX} \ -lSalomeObject \ -lVisuPipeLine \ -lSVTK diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index ffeab72e..09d4d4bb 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -31,11 +31,10 @@ #include "SALOME_Actor.h" #include "VISU_ActorFactory.h" +#include "VISU_BoostSignals.h" #include #include -#include -#include class vtkProp; class vtkProperty; @@ -60,7 +59,7 @@ namespace VISU //---------------------------------------------------------------------------- class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor, - public boost::bsignals::trackable + public boost::signalslib::trackable { public: vtkTypeMacro(VISU_Actor,SALOME_Actor); diff --git a/src/OBJECT/VISU_ActorFactory.h b/src/OBJECT/VISU_ActorFactory.h index 97cee603..7395f1e1 100644 --- a/src/OBJECT/VISU_ActorFactory.h +++ b/src/OBJECT/VISU_ActorFactory.h @@ -29,7 +29,7 @@ #ifndef VISU_ACTOR_FACTORY_H #define VISU_ACTOR_FACTORY_H -#include +#include "VISU_BoostSignals.h" class VISU_Actor; @@ -46,7 +46,7 @@ namespace VISU This interface inherits from boost::bsignals::trackable in order to provide automatic diconnection from defined signals if the object is destroyed. */ - struct TActorFactory: public virtual boost::bsignals::trackable + struct TActorFactory: public virtual boost::signalslib::trackable { //! Just to make this class virtual virtual diff --git a/src/OBJECT/VISU_BoostSignals.h b/src/OBJECT/VISU_BoostSignals.h new file mode 100644 index 00000000..9723e36b --- /dev/null +++ b/src/OBJECT/VISU_BoostSignals.h @@ -0,0 +1,56 @@ +// VISU OBJECT : interactive object for VISU entities implementation +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : +// Author : +// Module : VISU +// $Header$ + +#ifndef VISU_BOOST_SIGNALS_H +#define VISU_BOOST_SIGNALS_H + +#ifdef signals +# ifndef QOBJECTDEFS_H +# error "Cannot recover the siganlas macro definition" +# else +# define EXTERNAL_SIGNALS_DEFINITION +# undef signals +# endif +#endif + +#include + +namespace boost { + namespace signalslib = BOOST_SIGNALS_NAMESPACE; +} + +#ifdef EXTERNAL_SIGNALS_DEFINITION +# undef EXTERNAL_SIGNALS_DEFINITION +# ifdef QT_MOC_CPP +# define signals signals +# else +# define signals protected +# endif +#endif + +#endif //VISU_BOOST_SIGNALS_H diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index e29785b0..8c06e2fc 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -556,7 +556,7 @@ VISU_GaussPtsAct case 'M' : case 'm' : { - if( myWidgetCtrl->GetEnabled() ) + if( IsSegmentationEnabled() ) { this->ChangeMagnification( myInteractor->GetShiftKey() ); return; @@ -568,7 +568,7 @@ VISU_GaussPtsAct case 'D' : case 'd' : { - if( myWidgetCtrl->GetEnabled() && myWidgetCtrl->IsSphereActive() ) + if( IsSegmentationEnabled() && myWidgetCtrl->IsSphereActive() ) { VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget(); aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() ); @@ -839,13 +839,16 @@ VISU_GaussPtsAct return; myOutlineActor->SetVisibility(false); - myTextActor->SetVisibility(0); - myCursorPyramidSelected->SetVisibility(0); - myCursorPyramid->SetVisibility(0); - myCellActor->SetVisibility(0); + myTextActor->SetVisibility(false); + myCursorPyramidSelected->SetVisibility(false); + myCursorPyramid->SetVisibility(false); + myCellActor->SetVisibility(false); GetScalarBarCtrl()->SetIsMarked(false); GetScalarBarCtrl()->Update(); + if(!theIsHighlight) + return; + bool anIsVisible = GetVisibility(); Selection_Mode aSelectionMode = mySelector->SelectionMode(); diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index b518dfad..e2cfe567 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -34,7 +34,10 @@ using namespace std; vtkStandardNewMacro(VISU_CutLinesPL); -VISU_CutLinesPL::VISU_CutLinesPL(){} +VISU_CutLinesPL::VISU_CutLinesPL(){ + myCondition = 1; + myPosition = 0; +} void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 63dd3e5a..2a547971 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -42,6 +42,16 @@ vtkStandardNewMacro(VISU_CutPlanesPL); VISU_CutPlanesPL::VISU_CutPlanesPL(){ myAppendPolyData = vtkAppendPolyData::New(); myIsShrinkable = false; + + myNbParts = 10; + + myBasePlane[0] = YZ; + myBasePlane[0] = XY; + + myDisplacement[0] = myDisplacement[1] = 0.5; + + myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0; + myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0; } VISU_CutPlanesPL::~VISU_CutPlanesPL(){ diff --git a/src/VISUGUI/Makefile.in b/src/VISUGUI/Makefile.in index 1c2f20f1..3ecc0aef 100644 --- a/src/VISUGUI/Makefile.in +++ b/src/VISUGUI/Makefile.in @@ -39,7 +39,7 @@ EXPORT_HEADERS= \ # .po files to transform in .qm PO_FILES = \ - VISU_msg_en.po VISU_images.po VISUM_msg_en.po VISUM_images.po + VISU_msg_en.po VISU_images.po # Libraries targets LIB = libVISU.la diff --git a/src/VISUGUI/VISUM_images.po b/src/VISUGUI/VISUM_images.po deleted file mode 100644 index 24d00e85..00000000 --- a/src/VISUGUI/VISUM_images.po +++ /dev/null @@ -1,67 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : VisuGUI_icons.po -# Module : VISU - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: 2005-05-10 15:20+0400\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "ICON_GAUSS_NEW_VIEWER" -msgstr "Visu_points.png" - -msgid "ICON_GAUSS_POINTS" -msgstr "Visu_gauss_points.png" - -msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH" -msgstr "Visu_vvtk_switch.png" - -msgid "ICON_VVTK_SELECTION_MODE_SWITCH" -msgstr "Visu_points.png" - -msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH" -msgstr "Visu_PlaneSegmentation.png" - -msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH" -msgstr "Visu_SphereSegmentation.png" - -msgid "ICON_VVTK_RECORDING_START" -msgstr "Visu_recording_start.png" - -msgid "ICON_VVTK_RECORDING_PLAY" -msgstr "Visu_recording_play.png" - -msgid "ICON_VVTK_RECORDING_PAUSE" -msgstr "Visu_recording_pause.png" - -msgid "ICON_VVTK_RECORDING_STOP" -msgstr "Visu_recording_stop.png" - -msgid "ICON_LOAD_TEXTURE" -msgstr "Visu_load_texture.png" diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po deleted file mode 100644 index e9676f43..00000000 --- a/src/VISUGUI/VISUM_msg_en.po +++ /dev/null @@ -1,757 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-02-22 16:56:46 CET\n" -"PO-Revision-Date: 2005-06-27 12:38+0400\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - -msgid "INF_VISU" -msgstr "Post-Pro Info" - -msgid "IMPORT_DONE" -msgstr "Importing is done" - -msgid "VisuGUI_Module::MEN_VISUALISATION" -msgstr "Visualization" - -msgid "VisuGUI_Module::TOOL_VISUALISATION" -msgstr "Visualization Toolbar" - -msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION" -msgstr "Store current configuration" - -msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION" -msgstr "Overwrite current configuration" - -msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION" -msgstr "Restore current configuration" - -msgid "VisuGUI_Module::MEN_GAUSS" -msgstr "Gauss" - -msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER" -msgstr "Points view" - -msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS" -msgstr "Gauss Points" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL" -msgstr "Gauss Points" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" -msgstr "Primitive" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE" -msgstr "Primitive Type" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE" -msgstr "Point sprite" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT" -msgstr "OpenGL point" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE" -msgstr "Geometrical sphere" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP" -msgstr "Maximum Size (Clamp)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE" -msgstr "Main Texture (16x16)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE" -msgstr "Alpha Channel Texture (16x16)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD" -msgstr "Alpha Channel Threshold" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION" -msgstr "Geometrical sphere resolution" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT" -msgstr "Notify when number of faces exceeds" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL" -msgstr "Size" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE" -msgstr "Range value for min size (%)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE" -msgstr "Range value for max size (%)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION" -msgstr "Magnification (%)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT" -msgstr "+/- Ratio" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL" -msgstr "Geometry" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE" -msgstr "Size of points (%)" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR" -msgstr "Color" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL" -msgstr "Deformed Shape" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR" -msgstr "Scale factor" - -msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL" -msgstr "Gauss Points Scalar Bar" - -msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" -msgstr "Gauss Points Scalar Bar" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR" -msgstr "Active bar" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL" -msgstr "Local" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL" -msgstr "Global" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL" -msgstr "Display global bar" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE" -msgstr "Scalar bar mode" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR" -msgstr "Bicolor" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW" -msgstr "Rainbow" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING" -msgstr "Spacing" - -msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" -msgstr "Inside Cursor" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL" -msgstr "Magnification (Inside and Outside)" - -msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" -msgstr "Outside Cursor" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR" -msgstr "Uniform Color" - -msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL" -msgstr "Color" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL" -msgstr "Picking" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL" -msgstr "Cursor" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE" -msgstr "Size of the cursor" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT" -msgstr "Height of the pyramids" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR" -msgstr "Selection cursor color" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" -msgstr "Tolerance" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" -msgstr "Point selection tolerance" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL" -msgstr "Information window" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY" -msgstr "Transparency" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION" -msgstr "Position" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT" -msgstr "Centered below the point" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER" -msgstr "Top-left corner of the 3D view" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL" -msgstr "Movement of the camera" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR" -msgstr "Zoom at first selected point (ratio)" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER" -msgstr "Number of steps between two positions" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL" -msgstr "Parent mesh element" - -msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH" -msgstr "Display parent mesh element" - -msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT" -msgstr "Navigation" - -msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT" -msgstr "Mouse" - -msgid "VisuGUI_Module::VISU_MOUSE_PREF" -msgstr "Mouse behaviour" - -msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD" -msgstr "Salome standard controls" - -msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE" -msgstr "Keyboard free" - -msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL" -msgstr "Keyboard" - -msgid "VisuGUI_Module::VISU_KEYBOARD_PREF" -msgstr "[+]/[-] Speed increment" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF" -msgstr "Spacemouse" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1" -msgstr "Decrease speed increment" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2" -msgstr "Increase speed increment" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3" -msgstr "Decrease Gauss points magnification" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4" -msgstr "Increase Gauss points magnification" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5" -msgstr "Dominant / combined switch" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1" -msgstr "Button 1" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2" -msgstr "Button 2" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3" -msgstr "Button 3" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4" -msgstr "Button 4" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5" -msgstr "Button 5" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6" -msgstr "Button 6" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7" -msgstr "Button 7" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8" -msgstr "Button 8" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10" -msgstr "Button 10" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11" -msgstr "Button 11" - -msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*" -msgstr "Button *" - -msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL" -msgstr "Camera movements" - -msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF" -msgstr "Number of steps between two positions" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL" -msgstr "Recorder" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL" -msgstr "Settings" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE" -msgstr "Mode" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES" -msgstr "Recording at a given FPS" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" -msgstr "Recording all displayed frames" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS" -msgstr "FPS" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY" -msgstr "Quality" - -msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE" -msgstr "Progressive" - -msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE" -msgstr "Gauss Points Preferences" - -msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE" -msgstr "Gauss Points Properties" - -msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE" -msgstr "Build progress" - -msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS" -msgstr "Settings" - -msgid "VisuGUI_BuildProgressDlg::FILE_NAME" -msgstr "Import file : " - -msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE" -msgstr "Build at once" - -msgid "VisuGUI_BuildProgressDlg::BUILD_ALL" -msgstr "Build all" - -msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS" -msgstr "Import progress" - -msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES" -msgstr "Build entities" - -msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS" -msgstr "Build fields" - -msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS" -msgstr "Build groups" - -msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX" -msgstr "Build min/max" - -msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME" -msgstr "Time" - -msgid "VisuGUI_BuildProgressDlg::TIME" -msgstr "Elapsed time : " - -msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE" -msgstr "Import from File" - -msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES" -msgstr "All Files (*.*)" - -msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES" -msgstr "MED Files (*.med)" - -msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH" -msgstr "Close dialog at finish" - -msgid "VisuGUI_BuildProgressDlg::START" -msgstr "Start" - -msgid "VisuGUI_BuildProgressDlg::CLOSE" -msgstr "Close" - -msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE" -msgstr "Recorder" - -msgid "VVTK_RecorderDlg::SETTINGS" -msgstr "Settings" - -msgid "VVTK_RecorderDlg::FILE_NAME" -msgstr "Save to file : " - -msgid "VVTK_RecorderDlg::FLT_ALL_FILES" -msgstr "All Files (*.*)" - -msgid "VVTK_RecorderDlg::FLT_AVI_FILES" -msgstr "AVI Files (*.avi)" - -msgid "VVTK_RecorderDlg::RECORDING_MODE" -msgstr "Mode : " - -msgid "VVTK_RecorderDlg::SKIPPED_FRAMES" -msgstr "Recording at a given FPS" - -msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES" -msgstr "Recording all displayed frames" - -msgid "VVTK_RecorderDlg::FPS" -msgstr "FPS : " - -msgid "VVTK_RecorderDlg::QUALITY" -msgstr "Quality : " - -msgid "VVTK_RecorderDlg::PROGRESSIVE" -msgstr "Progressive" - -msgid "VVTK_RecorderDlg::START" -msgstr "Start" - -msgid "VVTK_RecorderDlg::CLOSE" -msgstr "Close" - -msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE" -msgstr "Change Transparency" - -msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT" -msgstr "Transparent" - -msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE" -msgstr "Opaque" - -msgid "VisuGUI_TransparencyDlg::BUT_CLOSE" -msgstr "Close" - -msgid "VVTK_ViewManager::VTK_VIEW_TITLE" -msgstr "VISU scene:%1 - viewer:%2" - -msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START" -msgstr "Start recording" - -msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START" -msgstr "Start recording" - -msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY" -msgstr "Play recording" - -msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY" -msgstr "Play recording" - -msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE" -msgstr "Pause recording" - -msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE" -msgstr "Pause recording" - -msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP" -msgstr "Stop recording" - -msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP" -msgstr "Stop recording" - -msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH" -msgstr "Interaction Style Switch" - -msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH" -msgstr "Interaction Style Switch" - -msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH" -msgstr "Selection Mode Switch" - -msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH" -msgstr "Selection Mode Switch" - -msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH" -msgstr "Plane Segmentation" - -msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH" -msgstr "Plane Segmentation" - -msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" -msgstr "Sphere Segmentation" - -msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH" -msgstr "Sphere Segmentation" - -msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE" -msgstr "Primitive" - -msgid "VVTK_PrimitiveBox::POINT_SPRITE" -msgstr "Point Sprite" - -msgid "VVTK_PrimitiveBox::OPENGL_POINT" -msgstr "OpenGL Point" - -msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE" -msgstr "Geometrical Sphere" - -msgid "VVTK_PrimitiveBox::CLAMP" -msgstr "Maximum Size (Clamp) : " - -msgid "VVTK_PrimitiveBox::MAIN_TEXTURE" -msgstr "Main Texture (16x16) : " - -msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE" -msgstr "Alpha Channel Texture (16x16) : " - -msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD" -msgstr "Alpha Channel Threshold : " - -msgid "VVTK_PrimitiveBox::RESOLUTION" -msgstr "Resolution : " - -msgid "VVTK_PrimitiveBox::FACE_NUMBER" -msgstr "Number of faces : " - -msgid "VVTK_PrimitiveBox::FACE_LIMIT" -msgstr "Notify when number of faces exceeds : " - -msgid "VVTK_SizeBox::SIZE_TITLE" -msgstr "Size" - -msgid "VVTK_SizeBox::OUTSIDE_SIZE" -msgstr "Percentage of normal size(%) : " - -msgid "VVTK_SizeBox::GEOM_SIZE" -msgstr "Size of points (%) : " - -msgid "VVTK_SizeBox::MIN_SIZE" -msgstr "Range values for min size (%) : " - -msgid "VVTK_SizeBox::MAX_SIZE" -msgstr "max size (%) : " - -msgid "VVTK_SizeBox::MAGNIFICATION" -msgstr "Magnification (%) : " - -msgid "VVTK_SizeBox::INCREMENT" -msgstr "+/- Ratio : " - -msgid "VVTK_SizeBox::COLOR_TITLE" -msgstr "Color" - -msgid "VVTK_SizeBox::UNIFORM_COLOR" -msgstr "Uniform Color" - -msgid "VVTK_SizeBox::COLOR" -msgstr "Color : " - -msgid "VisuGUI_GaussPointsDlg::&Cancel" -msgstr "" - -msgid "VisuGUI_GaussPointsDlg::&OK" -msgstr "" - -msgid "VisuGUI_GaussPointsDlg::WARNING" -msgstr "Warning" - -msgid "VisuGUI_GaussPointsDlg::DLG_TITLE" -msgstr "Gauss Points" - -msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB" -msgstr "Gauss Points" - -msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB" -msgstr "Scalar Bar" - -msgid "VisuGUI_GaussPointsDlg::PRS_TITLE" -msgstr "Presentation" - -msgid "VisuGUI_GaussPointsDlg::RESULTS" -msgstr "Results" - -msgid "VisuGUI_GaussPointsDlg::GEOMETRY" -msgstr "Geometry" - -msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE" -msgstr "Deformed Shape" - -msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE" -msgstr "Deformed Shape" - -msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR" -msgstr "Scale Factor :" - -msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP" -msgstr "Active bar" - -msgid "VisuGUI_GaussScalarBarPane::LOCAL" -msgstr "Local" - -msgid "VisuGUI_GaussScalarBarPane::GLOBAL" -msgstr "Global" - -msgid "VisuGUI_GaussScalarBarPane::DISPLAYED" -msgstr "Displayed" - -msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP" -msgstr "Scalar range" - -msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING" -msgstr "Logarithmic scaling" - -msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN" -msgstr "Use field range" - -msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN" -msgstr "Use imposed range" - -msgid "VisuGUI_GaussScalarBarPane::LBL_MIN" -msgstr "Min:" - -msgid "VisuGUI_GaussScalarBarPane::LBL_MAX" -msgstr "Max:" - -msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP" -msgstr "Colors and labels" - -msgid "VisuGUI_GaussScalarBarPane::BICOLOR" -msgstr "Bicolor" - -msgid "VisuGUI_GaussScalarBarPane::RAINBOW" -msgstr "Rainbow" - -msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS" -msgstr "Nb. of colors:" - -msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS" -msgstr "Nb. of labels:" - -msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP" -msgstr "Orientation" - -msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN" -msgstr "Vertical" - -msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN" -msgstr "Horizontal" - -msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP" -msgstr "Origin" - -msgid "VisuGUI_GaussScalarBarPane::LBL_X" -msgstr "X:" - -msgid "VisuGUI_GaussScalarBarPane::LBL_Y" -msgstr "Y:" - -msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP" -msgstr "Dimensions" - -msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH" -msgstr "Width:" - -msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT" -msgstr "Height:" - -msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING" -msgstr "Spacing:" - -msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK" -msgstr "Save as default values" - -msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL" -msgstr "GAUSS viewer tools" - -msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE" -msgstr "Segmentation Cursor" - -msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE" -msgstr "Origin" - -msgid "VVTK_SegmentationCursorDlg::ORIGIN_X" -msgstr "X: " - -msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y" -msgstr "Y: " - -msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z" -msgstr "Z: " - -msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE" -msgstr "Direction" - -msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX" -msgstr "DX: " - -msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY" -msgstr "DY: " - -msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ" -msgstr "DZ: " - -msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE" -msgstr "Depth" - -msgid "VVTK_SegmentationCursorDlg::DEPTH" -msgstr "Depth of the cursor: " - -msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE" -msgstr "Radius" - -msgid "VVTK_SegmentationCursorDlg::RADIUS" -msgstr "Radius of the cursor :" - -msgid "VVTK_SegmentationCursorDlg::RATIO" -msgstr "+/- Ratio :" - -msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB" -msgstr "Segmentation Cursor" - -msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB" -msgstr "Gauss Points" - -msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS" -msgstr "Inside Cursor Gauss Points Presentation" - -msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS" -msgstr "Outside Cursor Gauss Points Presentation" - -msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE" -msgstr "Magnification" - -msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION" -msgstr "Magnification (%) : " - -msgid "VVTK_SegmentationCursorDlg::INCREMENT" -msgstr "+/- Ratio : " - -msgid "VVTK_PickingDlg::PICKING_DLG_TITLE" -msgstr "Picking" - -msgid "VVTK_PickingDlg::CURSOR_TITLE" -msgstr "Cursor" - -msgid "VVTK_PickingDlg::CURSOR_SIZE" -msgstr "Size of the cursor :" - -msgid "VVTK_PickingDlg::PYRAMID_HEIGHT" -msgstr "Height of the pyramids :" - -msgid "VVTK_PickingDlg::SELECTION_COLOR" -msgstr "Selection cursor color :" - -msgid "VVTK_PickingDlg::TOLERANCE_TITLE" -msgstr "Tolerance" - -msgid "VVTK_PickingDlg::POINT_TOLERANCE" -msgstr "Point tolerance :" - -msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE" -msgstr "Information window" - -msgid "VVTK_PickingDlg::TRANSPARENCY" -msgstr "Transparency :" - -msgid "VVTK_PickingDlg::POSITION" -msgstr "Position :" - -msgid "VVTK_PickingDlg::BELOW_POINT" -msgstr "Centered below the point" - -msgid "VVTK_PickingDlg::TOP_LEFT_CORNER" -msgstr "Top-left corner of the 3D view" - -msgid "VVTK_PickingDlg::CAMERA_TITLE" -msgstr "Movement of the camera" - -msgid "VVTK_PickingDlg::ZOOM_FACTOR" -msgstr "Zoom at first selected point (ratio) :" - -msgid "VVTK_PickingDlg::STEP_NUMBER" -msgstr "Number of steps between two positions :" - -msgid "VVTK_PickingDlg::PARENT_MESH_TITLE" -msgstr "Parent mesh element" - -msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH" -msgstr "Display parent mesh element" \ No newline at end of file diff --git a/src/VISUGUI/VISU_icons.po b/src/VISUGUI/VISU_icons.po deleted file mode 100644 index 525994aa..00000000 --- a/src/VISUGUI/VISU_icons.po +++ /dev/null @@ -1,61 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : VisuGUI_icons.po -# Module : VISU - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "ICON_OBJBROWSER_Visu" -msgstr "Visu_tree_visu.png" - -msgid "ICON_SCALAR_MAP" -msgstr "Visu_scalars.png" - -msgid "ICON_DEFORMED_SHAPE" -msgstr "Visu_deformed.png" - -msgid "ICON_SCALAR_MAP_ON_DEFORMED_SHAPE" -msgstr "Visu_scalarmapondeformedshape.png" - -msgid "ICON_VECTORS" -msgstr "Visu_vectors.png" - -msgid "ICON_ISO_SURFACES" -msgstr "Visu_isosurfaces.png" - -msgid "ICON_CUT_PLANES" -msgstr "Visu_cutplane.png" - -msgid "ICON_CUT_LINES" -msgstr "Visu_cutlines.png" - -msgid "ICON_STREAM_LINES" -msgstr "Visu_streamlines.png" diff --git a/src/VISUGUI/VISU_images.po b/src/VISUGUI/VISU_images.po index 7357d06a..ccc10ccc 100644 --- a/src/VISUGUI/VISU_images.po +++ b/src/VISUGUI/VISU_images.po @@ -86,8 +86,6 @@ msgstr "Visu_selectonly.png" msgid "ICON_SCALING" msgstr "Visu_scaling.png" -# - msgid "ICON_TIMEANIMATION" msgstr "Visu_anim.png" @@ -99,3 +97,36 @@ msgstr "Visu_plot3d.png" msgid "ICON_CUBE_AXES" msgstr "Visu_graduated_axes.png" + +msgid "ICON_GAUSS_NEW_VIEWER" +msgstr "Visu_points.png" + +msgid "ICON_GAUSS_POINTS" +msgstr "Visu_gauss_points.png" + +msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH" +msgstr "Visu_vvtk_switch.png" + +msgid "ICON_VVTK_SELECTION_MODE_SWITCH" +msgstr "Visu_points.png" + +msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH" +msgstr "Visu_PlaneSegmentation.png" + +msgid "ICON_VVTK_SPHERE_SEGMENTATION_SWITCH" +msgstr "Visu_SphereSegmentation.png" + +msgid "ICON_VVTK_RECORDING_START" +msgstr "Visu_recording_start.png" + +msgid "ICON_VVTK_RECORDING_PLAY" +msgstr "Visu_recording_play.png" + +msgid "ICON_VVTK_RECORDING_PAUSE" +msgstr "Visu_recording_pause.png" + +msgid "ICON_VVTK_RECORDING_STOP" +msgstr "Visu_recording_stop.png" + +msgid "ICON_LOAD_TEXTURE" +msgstr "Visu_load_texture.png" diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index eb50916f..4ba765cb 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -163,14 +163,20 @@ msgstr "Use Shading" #: VisuGUI.cxx +msgid "VisuGUI::MEN_IMPORT" +msgstr "Import" + msgid "VisuGUI::MEN_IMPORT_FROM_FILE" +msgstr "MED file" + +msgid "VisuGUI::IMPORT_FROM_FILE" msgstr "Import from File" -msgid "VisuGUI::MEN_EXPLORE_MED_FILE" -msgstr "Explore MED File" +msgid "VisuGUI::USE_BUILD_PROGRESS" +msgstr "Use build progress" msgid "VisuGUI::MEN_IMPORT_TABLE" -msgstr "Import table from File" +msgstr "Table from file" msgid "VisuGUI::MEN_SCALAR_MAP" msgstr "Scalar Map" @@ -380,9 +386,6 @@ msgid "VisuGUI::MEN_ARRANGE_ACTORS" msgstr "Arrange Actors" -msgid "VisuGUI::ERR_ERROR_IN_THE_FILE" -msgstr "Error in the file" - msgid "VisuGUI::ERR_ERROR_DURING_EXPORT" msgstr "Error has been occured during exporting to file" @@ -1275,3 +1278,761 @@ msgstr "Yes" msgid "VisuGUI_SetupPlot2dDlg::QUE_WANT_SAME_UNITS" msgstr "Do you want to choose all items with the same units for vertical axis?" +msgid "INF_VISU" +msgstr "Post-Pro Info" + +msgid "IMPORT_DONE" +msgstr "Importing is done" + +msgid "VisuGUI_Module::MEN_VISUALISATION" +msgstr "Visualization" + +msgid "VisuGUI_Module::TOOL_VISUALISATION" +msgstr "Visualization Toolbar" + +msgid "VisuGUI_Module::MEN_SAVE_CONFIGURATION" +msgstr "Store current configuration" + +msgid "VisuGUI_Module::MEN_OVERWRITE_CONFIGURATION" +msgstr "Overwrite current configuration" + +msgid "VisuGUI_Module::MEN_RESTORE_CONFIGURATION" +msgstr "Restore current configuration" + +msgid "VisuGUI_Module::MEN_GAUSS" +msgstr "Gauss" + +msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER" +msgstr "Points view" + +msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS" +msgstr "Gauss Points" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TTL" +msgstr "Gauss Points" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" +msgstr "Primitive" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_PRIMITIVE_TYPE" +msgstr "Primitive Type" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_POINTSPRITE" +msgstr "Point sprite" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_OPENGLPOINT" +msgstr "OpenGL point" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOMSPHERE" +msgstr "Geometrical sphere" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_CLAMP" +msgstr "Maximum Size (Clamp)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAIN_TEXTURE" +msgstr "Main Texture (16x16)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_TEXTURE" +msgstr "Alpha Channel Texture (16x16)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_ALPHA_THRESHOLD" +msgstr "Alpha Channel Threshold" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_RESOLUTION" +msgstr "Geometrical sphere resolution" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_FACE_LIMIT" +msgstr "Notify when number of faces exceeds" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE_GROUP_TTL" +msgstr "Size" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MIN_SIZE" +msgstr "Range value for min size (%)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAX_SIZE" +msgstr "Range value for max size (%)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION" +msgstr "Magnification (%)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_INCREMENT" +msgstr "+/- Ratio" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_GEOM_GROUP_TTL" +msgstr "Geometry" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_SIZE" +msgstr "Size of points (%)" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR" +msgstr "Color" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL" +msgstr "Deformed Shape" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALE_FACTOR" +msgstr "Scale factor" + +msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL" +msgstr "Gauss Points Scalar Bar" + +msgid "VisuGUI_Module::VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" +msgstr "Gauss Points Scalar Bar" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_ACTIVE_BAR" +msgstr "Active bar" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_LOCAL" +msgstr "Local" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_GLOBAL" +msgstr "Global" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_DISPLAY_GLOBAL" +msgstr "Display global bar" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_SCALAR_BAR_MODE" +msgstr "Scalar bar mode" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_BICOLOR" +msgstr "Bicolor" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_RAINBOW" +msgstr "Rainbow" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_SPACING" +msgstr "Spacing" + +msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" +msgstr "Inside Cursor" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL" +msgstr "Magnification (Inside and Outside)" + +msgid "VisuGUI_Module::VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" +msgstr "Outside Cursor" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_UNIFORM_COLOR" +msgstr "Uniform Color" + +msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL" +msgstr "Color" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_TAB_TTL" +msgstr "Picking" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL" +msgstr "Cursor" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE" +msgstr "Size of the cursor" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT" +msgstr "Height of the pyramids" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_SELECTION_COLOR" +msgstr "Selection cursor color" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" +msgstr "Tolerance" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" +msgstr "Point selection tolerance" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL" +msgstr "Information window" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_TRANSPARENCY" +msgstr "Transparency" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_POSITION" +msgstr "Position" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_BELOW_POINT" +msgstr "Centered below the point" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_TOP_LEFT_CORNER" +msgstr "Top-left corner of the 3D view" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_CAMERA_GROUP_TTL" +msgstr "Movement of the camera" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_ZOOM_FACTOR" +msgstr "Zoom at first selected point (ratio)" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_STEP_NUMBER" +msgstr "Number of steps between two positions" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_PARENT_MESH_TTL" +msgstr "Parent mesh element" + +msgid "VisuGUI_Module::VISU_PICKING_PREF_DISPLAY_PARENT_MESH" +msgstr "Display parent mesh element" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_TAB_TLT" +msgstr "Navigation" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT" +msgstr "Mouse" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF" +msgstr "Mouse behaviour" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD" +msgstr "Salome standard controls" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE" +msgstr "Keyboard free" + +msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL" +msgstr "Keyboard" + +msgid "VisuGUI_Module::VISU_KEYBOARD_PREF" +msgstr "[+]/[-] Speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF" +msgstr "Spacemouse" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1" +msgstr "Decrease speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2" +msgstr "Increase speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3" +msgstr "Decrease Gauss points magnification" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4" +msgstr "Increase Gauss points magnification" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5" +msgstr "Dominant / combined switch" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1" +msgstr "Button 1" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2" +msgstr "Button 2" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3" +msgstr "Button 3" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4" +msgstr "Button 4" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5" +msgstr "Button 5" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6" +msgstr "Button 6" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7" +msgstr "Button 7" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8" +msgstr "Button 8" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10" +msgstr "Button 10" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11" +msgstr "Button 11" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*" +msgstr "Button *" + +msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL" +msgstr "Camera movements" + +msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF" +msgstr "Number of steps between two positions" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_TAB_TTL" +msgstr "Recorder" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_GROUP_TTL" +msgstr "Settings" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_RECORDING_MODE" +msgstr "Mode" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_SKIPPED_FRAMES" +msgstr "Recording at a given FPS" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" +msgstr "Recording all displayed frames" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_FPS" +msgstr "FPS" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_QUALITY" +msgstr "Quality" + +msgid "VisuGUI_Module::VISU_RECORDER_PREF_PROGRESSIVE" +msgstr "Progressive" + +msgid "VisuGUI_GaussPointsDlg::DLG_PREF_TITLE" +msgstr "Gauss Points Preferences" + +msgid "VisuGUI_GaussPointsDlg::DLG_PROP_TITLE" +msgstr "Gauss Points Properties" + +msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE" +msgstr "Build progress" + +msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS" +msgstr "Settings" + +msgid "VisuGUI_BuildProgressDlg::FILE_NAME" +msgstr "Import file : " + +msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE" +msgstr "Build at once" + +msgid "VisuGUI_BuildProgressDlg::BUILD_ALL" +msgstr "Build all" + +msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS" +msgstr "Import progress" + +msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES" +msgstr "Build entities" + +msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS" +msgstr "Build fields" + +msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS" +msgstr "Build groups" + +msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX" +msgstr "Build min/max" + +msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME" +msgstr "Time" + +msgid "VisuGUI_BuildProgressDlg::TIME" +msgstr "Elapsed time : " + +msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE" +msgstr "Import from File" + +msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES" +msgstr "All Files (*.*)" + +msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES" +msgstr "MED Files (*.med)" + +msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH" +msgstr "Close dialog at finish" + +msgid "VisuGUI_BuildProgressDlg::START" +msgstr "Start" + +msgid "VisuGUI_BuildProgressDlg::CLOSE" +msgstr "Close" + +msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE" +msgstr "Error in the file" + +msgid "VVTK_RecorderDlg::DLG_RECORDER_TITLE" +msgstr "Recorder" + +msgid "VVTK_RecorderDlg::SETTINGS" +msgstr "Settings" + +msgid "VVTK_RecorderDlg::FILE_NAME" +msgstr "Save to file : " + +msgid "VVTK_RecorderDlg::FLT_ALL_FILES" +msgstr "All Files (*.*)" + +msgid "VVTK_RecorderDlg::FLT_AVI_FILES" +msgstr "AVI Files (*.avi)" + +msgid "VVTK_RecorderDlg::RECORDING_MODE" +msgstr "Mode : " + +msgid "VVTK_RecorderDlg::SKIPPED_FRAMES" +msgstr "Recording at a given FPS" + +msgid "VVTK_RecorderDlg::ALL_DISLPAYED_FRAMES" +msgstr "Recording all displayed frames" + +msgid "VVTK_RecorderDlg::FPS" +msgstr "FPS : " + +msgid "VVTK_RecorderDlg::QUALITY" +msgstr "Quality : " + +msgid "VVTK_RecorderDlg::PROGRESSIVE" +msgstr "Progressive" + +msgid "VVTK_RecorderDlg::START" +msgstr "Start" + +msgid "VVTK_RecorderDlg::CLOSE" +msgstr "Close" + +msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TITLE" +msgstr "Change Transparency" + +msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_TRANSPARENT" +msgstr "Transparent" + +msgid "VisuGUI_TransparencyDlg::TRANSPARENCY_OPAQUE" +msgstr "Opaque" + +msgid "VisuGUI_TransparencyDlg::BUT_CLOSE" +msgstr "Close" + +msgid "VVTK_ViewManager::VTK_VIEW_TITLE" +msgstr "Gauss scene:%1 - viewer:%2" + +msgid "VVTK_MainWindow::LBL_TOOLBAR_RECORD_LABEL" +msgstr "Recording Operations" + +msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_START" +msgstr "Start recording" + +msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_START" +msgstr "Start recording" + +msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PLAY" +msgstr "Play recording" + +msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PLAY" +msgstr "Play recording" + +msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_PAUSE" +msgstr "Pause recording" + +msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_PAUSE" +msgstr "Pause recording" + +msgid "VVTK_MainWindow::MNU_VVTK_RECORDING_STOP" +msgstr "Stop recording" + +msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP" +msgstr "Stop recording" + +msgid "VVTK_MainWindow1::LBL_TOOLBAR_GAUSS_LABEL" +msgstr "Gauss Viewer Tools" + +msgid "VVTK_MainWindow1::MNU_VVTK_INTERACTOR_STYLE_SWITCH" +msgstr "Interaction Style Switch" + +msgid "VVTK_MainWindow1::DSC_VVTK_INTERACTOR_STYLE_SWITCH" +msgstr "Interaction Style Switch" + +msgid "VVTK_MainWindow1::MNU_VVTK_SELECTION_MODE_SWITCH" +msgstr "Selection Mode Switch" + +msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH" +msgstr "Selection Mode Switch" + +msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH" +msgstr "Plane Segmentation" + +msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH" +msgstr "Plane Segmentation" + +msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" +msgstr "Sphere Segmentation" + +msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH" +msgstr "Sphere Segmentation" + +msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE" +msgstr "Primitive" + +msgid "VVTK_PrimitiveBox::POINT_SPRITE" +msgstr "Point Sprite" + +msgid "VVTK_PrimitiveBox::OPENGL_POINT" +msgstr "OpenGL Point" + +msgid "VVTK_PrimitiveBox::GEOMETRICAL_SPHERE" +msgstr "Geometrical Sphere" + +msgid "VVTK_PrimitiveBox::CLAMP" +msgstr "Maximum Size (Clamp) : " + +msgid "VVTK_PrimitiveBox::MAIN_TEXTURE" +msgstr "Main Texture (16x16) : " + +msgid "VVTK_PrimitiveBox::ALPHA_TEXTURE" +msgstr "Alpha Channel Texture (16x16) : " + +msgid "VVTK_PrimitiveBox::ALPHA_THRESHOLD" +msgstr "Alpha Channel Threshold : " + +msgid "VVTK_PrimitiveBox::RESOLUTION" +msgstr "Resolution : " + +msgid "VVTK_PrimitiveBox::FACE_NUMBER" +msgstr "Number of faces : " + +msgid "VVTK_PrimitiveBox::FACE_LIMIT" +msgstr "Notify when number of faces exceeds : " + +msgid "VVTK_SizeBox::SIZE_TITLE" +msgstr "Size" + +msgid "VVTK_SizeBox::OUTSIDE_SIZE" +msgstr "Percentage of normal size(%) : " + +msgid "VVTK_SizeBox::GEOM_SIZE" +msgstr "Size of points (%) : " + +msgid "VVTK_SizeBox::MIN_SIZE" +msgstr "Range values for min size (%) : " + +msgid "VVTK_SizeBox::MAX_SIZE" +msgstr "max size (%) : " + +msgid "VVTK_SizeBox::MAGNIFICATION" +msgstr "Magnification (%) : " + +msgid "VVTK_SizeBox::INCREMENT" +msgstr "+/- Ratio : " + +msgid "VVTK_SizeBox::COLOR_TITLE" +msgstr "Color" + +msgid "VVTK_SizeBox::UNIFORM_COLOR" +msgstr "Uniform Color" + +msgid "VVTK_SizeBox::COLOR" +msgstr "Color : " + +msgid "VisuGUI_GaussPointsDlg::&Cancel" +msgstr "" + +msgid "VisuGUI_GaussPointsDlg::&OK" +msgstr "" + +msgid "VisuGUI_GaussPointsDlg::WARNING" +msgstr "Warning" + +msgid "VisuGUI_GaussPointsDlg::DLG_TITLE" +msgstr "Gauss Points" + +msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB" +msgstr "Gauss Points" + +msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB" +msgstr "Scalar Bar" + +msgid "VisuGUI_GaussPointsDlg::PRS_TITLE" +msgstr "Presentation" + +msgid "VisuGUI_GaussPointsDlg::RESULTS" +msgstr "Results" + +msgid "VisuGUI_GaussPointsDlg::GEOMETRY" +msgstr "Geometry" + +msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE" +msgstr "Deformed Shape" + +msgid "VisuGUI_GaussPointsDlg::DEFORMED_SHAPE_TITLE" +msgstr "Deformed Shape" + +msgid "VisuGUI_GaussPointsDlg::SCALE_FACTOR" +msgstr "Scale Factor :" + +msgid "VisuGUI_GaussScalarBarPane::ACTIVE_BAR_GRP" +msgstr "Active bar" + +msgid "VisuGUI_GaussScalarBarPane::LOCAL" +msgstr "Local" + +msgid "VisuGUI_GaussScalarBarPane::GLOBAL" +msgstr "Global" + +msgid "VisuGUI_GaussScalarBarPane::DISPLAYED" +msgstr "Displayed" + +msgid "VisuGUI_GaussScalarBarPane::SCALAR_RANGE_GRP" +msgstr "Scalar range" + +msgid "VisuGUI_GaussScalarBarPane::LOGARITHMIC_SCALING" +msgstr "Logarithmic scaling" + +msgid "VisuGUI_GaussScalarBarPane::FIELD_RANGE_BTN" +msgstr "Use field range" + +msgid "VisuGUI_GaussScalarBarPane::IMPOSED_RANGE_BTN" +msgstr "Use imposed range" + +msgid "VisuGUI_GaussScalarBarPane::LBL_MIN" +msgstr "Min:" + +msgid "VisuGUI_GaussScalarBarPane::LBL_MAX" +msgstr "Max:" + +msgid "VisuGUI_GaussScalarBarPane::COLORS_LABELS_GRP" +msgstr "Colors and labels" + +msgid "VisuGUI_GaussScalarBarPane::BICOLOR" +msgstr "Bicolor" + +msgid "VisuGUI_GaussScalarBarPane::RAINBOW" +msgstr "Rainbow" + +msgid "VisuGUI_GaussScalarBarPane::LBL_NB_COLORS" +msgstr "Nb. of colors:" + +msgid "VisuGUI_GaussScalarBarPane::LBL_NB_LABELS" +msgstr "Nb. of labels:" + +msgid "VisuGUI_GaussScalarBarPane::ORIENTATION_GRP" +msgstr "Orientation" + +msgid "VisuGUI_GaussScalarBarPane::VERTICAL_BTN" +msgstr "Vertical" + +msgid "VisuGUI_GaussScalarBarPane::HORIZONTAL_BTN" +msgstr "Horizontal" + +msgid "VisuGUI_GaussScalarBarPane::ORIGIN_GRP" +msgstr "Origin" + +msgid "VisuGUI_GaussScalarBarPane::LBL_X" +msgstr "X:" + +msgid "VisuGUI_GaussScalarBarPane::LBL_Y" +msgstr "Y:" + +msgid "VisuGUI_GaussScalarBarPane::DIMENSIONS_GRP" +msgstr "Dimensions" + +msgid "VisuGUI_GaussScalarBarPane::LBL_WIDTH" +msgstr "Width:" + +msgid "VisuGUI_GaussScalarBarPane::LBL_HEIGHT" +msgstr "Height:" + +msgid "VisuGUI_GaussScalarBarPane::LBL_SPACING" +msgstr "Spacing:" + +msgid "VisuGUI_GaussScalarBarPane::SAVE_DEFAULT_CHK" +msgstr "Save as default values" + +msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL" +msgstr "GAUSS viewer tools" + +msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_DLG_TITLE" +msgstr "Segmentation Cursor" + +msgid "VVTK_SegmentationCursorDlg::ORIGIN_TITLE" +msgstr "Origin" + +msgid "VVTK_SegmentationCursorDlg::ORIGIN_X" +msgstr "X: " + +msgid "VVTK_SegmentationCursorDlg::ORIGIN_Y" +msgstr "Y: " + +msgid "VVTK_SegmentationCursorDlg::ORIGIN_Z" +msgstr "Z: " + +msgid "VVTK_SegmentationCursorDlg::DIRECTION_TITLE" +msgstr "Direction" + +msgid "VVTK_SegmentationCursorDlg::DIRECTION_DX" +msgstr "DX: " + +msgid "VVTK_SegmentationCursorDlg::DIRECTION_DY" +msgstr "DY: " + +msgid "VVTK_SegmentationCursorDlg::DIRECTION_DZ" +msgstr "DZ: " + +msgid "VVTK_SegmentationCursorDlg::DEPTH_TITLE" +msgstr "Depth" + +msgid "VVTK_SegmentationCursorDlg::DEPTH" +msgstr "Depth of the cursor: " + +msgid "VVTK_SegmentationCursorDlg::RADIUS_TITLE" +msgstr "Radius" + +msgid "VVTK_SegmentationCursorDlg::RADIUS" +msgstr "Radius of the cursor :" + +msgid "VVTK_SegmentationCursorDlg::RATIO" +msgstr "+/- Ratio :" + +msgid "VVTK_SegmentationCursorDlg::SEGMENTATION_CURSOR_TAB" +msgstr "Segmentation Cursor" + +msgid "VVTK_SegmentationCursorDlg::GAUSS_POINTS_TAB" +msgstr "Gauss Points" + +msgid "VVTK_SegmentationCursorDlg::INSIDE_GAUSS_POINTS" +msgstr "Inside Cursor Gauss Points Presentation" + +msgid "VVTK_SegmentationCursorDlg::OUTSIDE_GAUSS_POINTS" +msgstr "Outside Cursor Gauss Points Presentation" + +msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION_TITLE" +msgstr "Magnification" + +msgid "VVTK_SegmentationCursorDlg::MAGNIFICATION" +msgstr "Magnification (%) : " + +msgid "VVTK_SegmentationCursorDlg::INCREMENT" +msgstr "+/- Ratio : " + +msgid "VVTK_PickingDlg::PICKING_DLG_TITLE" +msgstr "Picking" + +msgid "VVTK_PickingDlg::CURSOR_TITLE" +msgstr "Cursor" + +msgid "VVTK_PickingDlg::CURSOR_SIZE" +msgstr "Size of the cursor :" + +msgid "VVTK_PickingDlg::PYRAMID_HEIGHT" +msgstr "Height of the pyramids :" + +msgid "VVTK_PickingDlg::SELECTION_COLOR" +msgstr "Selection cursor color :" + +msgid "VVTK_PickingDlg::TOLERANCE_TITLE" +msgstr "Tolerance" + +msgid "VVTK_PickingDlg::POINT_TOLERANCE" +msgstr "Point tolerance :" + +msgid "VVTK_PickingDlg::INFO_WINDOW_TITLE" +msgstr "Information window" + +msgid "VVTK_PickingDlg::TRANSPARENCY" +msgstr "Transparency :" + +msgid "VVTK_PickingDlg::POSITION" +msgstr "Position :" + +msgid "VVTK_PickingDlg::BELOW_POINT" +msgstr "Centered below the point" + +msgid "VVTK_PickingDlg::TOP_LEFT_CORNER" +msgstr "Top-left corner of the 3D view" + +msgid "VVTK_PickingDlg::CAMERA_TITLE" +msgstr "Movement of the camera" + +msgid "VVTK_PickingDlg::ZOOM_FACTOR" +msgstr "Zoom at first selected point (ratio) :" + +msgid "VVTK_PickingDlg::STEP_NUMBER" +msgstr "Number of steps between two positions :" + +msgid "VVTK_PickingDlg::PARENT_MESH_TITLE" +msgstr "Parent mesh element" + +msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH" +msgstr "Display parent mesh element" \ No newline at end of file diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 3128e69f..3c2ad867 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -73,6 +73,7 @@ #include "SalomeApp_Application.h" #include "SalomeApp_DataModel.h" #include "SalomeApp_Study.h" +#include "SalomeApp_CheckFileDlg.h" #include "LightApp_SelectionMgr.h" #include "LightApp_Selection.h" #include "LightApp_Preferences.h" @@ -95,7 +96,6 @@ #include "VisuGUI_PopupTools.h" #include "VisuGUI_NameDlg.h" -#include "VisuGUI_FileDlg.h" #include "VisuGUI_CursorDlg.h" #include "VisuGUI_Selection.h" #include "VisuGUI_TimeAnimation.h" @@ -142,6 +142,8 @@ #include "VisuGUI_Timer.h" +#include "VVTK_ViewModel.h" + using namespace VISU; #ifdef _DEBUG_ @@ -172,55 +174,68 @@ OnImportFromFile() if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()"); if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) ) return; + + SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); - VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) ); - aBuildProgressDlg->setGenerator( GetVisuGen(this) ); - aBuildProgressDlg->show(); -} - - -void -VisuGUI:: -OnExploreMEDFile() -{ - if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()"); - _PTR(Study) aStudy = GetCStudy(GetAppStudy(this)); - if ( CheckLock(aStudy,GetDesktop(this)) ) - return; - - SALOME_MED::MED_Gen_var aGen = GetMEDEngine(); - + // Get file name QStringList aFilter; - aFilter.append( tr("FLT_MED_FILES") ); - aFilter.append( tr("FLT_ALL_FILES") ); - - QFileInfo aFileInfo = - SUIT_FileDlg::getFileName(GetDesktop(this), - "", - aFilter, - tr("MEN_EXPLORE_MED_FILE"), - true); - if(aFileInfo.exists()){ - application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." ); - std::string aStudyName = aStudy->Name(); - try + aFilter.append( tr( "FLT_MED_FILES" ) ); + aFilter.append( tr( "FLT_ALL_FILES" ) ); + + bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false); + + SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") ); + fd->setCaption( tr( "IMPORT_FROM_FILE" ) ); + fd->setFilters( aFilter ); + fd->SetChecked( toUseBuildProgress ); + fd->exec(); + QFileInfo aFileInfo( fd->selectedFile() ); + toUseBuildProgress = fd->IsChecked(); + delete fd; + + // Check the file name + if ( !aFileInfo.exists() ) + return; + + if ( !toUseBuildProgress ) { - aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str()); + bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true ); + bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true ); + bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true ); + bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false ); + bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false ); + + QString anInfo("Importing From File " + aFileInfo.filePath() + "..." ); + application()->putInfo( anInfo ); + + QApplication::setOverrideCursor(Qt::waitCursor); + VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() ); + + if (CORBA::is_nil(aResult.in())) { + SUIT_MessageBox::warn1(GetDesktop(this), + tr("WRN_VISU"), + VisuGUI_BuildProgressDlg::tr("ERR_ERROR_IN_THE_FILE"), + tr("BUT_OK")); + QApplication::restoreOverrideCursor(); + }else{ + aResult->SetBuildFields( toBuildFields, toBuildMinMax ); + aResult->SetBuildGroups( toBuildGroups ); + aResult->Build( toBuildAll, toBuildAtOnce ); + + UpdateObjBrowser(this); + application()->putInfo( anInfo + tr("INF_DONE")); + QApplication::restoreOverrideCursor(); + } } - catch(...) + else { - SUIT_MessageBox::warn1(GetDesktop(this), - tr("WRN_VISU"), - tr("ERR_ERROR_IN_THE_FILE"), - tr("BUT_OK")); + VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) ); + aBuildProgressDlg->setFileName( aFileInfo.filePath() ); + aBuildProgressDlg->setGenerator( GetVisuGen(this) ); + aBuildProgressDlg->show(); } - application()->putInfo(aFileInfo.filePath()+tr("INF_DONE")); - getApp()->updateObjectBrowser(true); // as need to update MED tree - getApp()->updateActions(); - } } - void VisuGUI:: OnImportTableFromFile() @@ -472,9 +487,10 @@ OnCreateMesh() return; // create a VTK view window if it does not exist - GetViewWindow( this, /*create=*/true ); + SVTK_ViewWindow* aViewWindow = GetViewWindow(this); - CreateMesh(this, anIO); + // create mesh presentation and display it in aViewWindow + CreateMesh(this, anIO, aViewWindow); } void @@ -486,7 +502,7 @@ OnCreateManyMesh() return; // create a VTK view window if it does not exist - GetViewWindow( this, /*create=*/true ); + SVTK_ViewWindow* aViewWindow = GetViewWindow(this); // Get selected SObject LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); @@ -498,7 +514,8 @@ OnCreateManyMesh() if (anIO.IsNull() || !anIO->hasEntry()) return; - CreateMesh(this, anIO); + // create mesh presentation and display it in aViewWindow + CreateMesh(this, anIO, aViewWindow); } } @@ -581,62 +598,65 @@ OnDisplayPrs() { if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs"); + LightApp_SelectionMgr* mgr = GetSelectionMgr(this); + if (!mgr) return; + QApplication::setOverrideCursor(Qt::waitCursor); + + SVTK_ViewWindow* vw = GetActiveViewWindow(this); + SALOME_ListIO aSel, aList; - LightApp_SelectionMgr* mgr = GetSelectionMgr(this); - mgr->selectedObjects( aSel ); + mgr->selectedObjects(aSel); + extractContainers(aSel, aList); - extractContainers( aSel, aList ); + for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) { + Handle(SALOME_InteractiveObject) anIO = it.Value(); + CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry()); - Handle(SALOME_InteractiveObject) anIO; - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { - anIO = it.Value(); - CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); - if ( !CORBA::is_nil( anObject ) ) { + if (!CORBA::is_nil(anObject)) { // is it Prs3d object ? VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(anObject).in()); - if(aPrsObject){ + if (aPrsObject) { if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object"); //UpdateViewer( this, aPrsObject ); - SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true ); - if ( vw ) - { - displayer()->Display( anIO->getEntry() ); + if (vw) { + displayer()->Display(anIO->getEntry()); vw->highlight(anIO, 1); } continue; } // is it Curve ? VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(anObject).in()); - if(aCurve){ + if (aCurve) { if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object"); //PlotCurve( this, aCurve, VISU::eDisplay ); - displayer()->Display( anIO->getEntry() ); + displayer()->Display(anIO->getEntry()); continue; } // is it Container ? VISU::Container_i* aContainer = dynamic_cast(VISU::GetServant(anObject).in()); - if(aContainer){ + if (aContainer) { if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object"); //PlotContainer( this, aContainer, VISU::eDisplay ); - displayer()->Display( anIO->getEntry() ); + displayer()->Display(anIO->getEntry()); continue; } // is it Table ? VISU::Table_i* aTable = dynamic_cast(VISU::GetServant(anObject).in()); - if(aTable){ + if (aTable) { if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object"); //PlotTable( this, aTable, VISU::eDisplay ); - displayer()->Display( anIO->getEntry() ); + displayer()->Display(anIO->getEntry()); continue; } } } - SVTK_ViewWindow* vw = GetViewWindow( this ); - if ( vw ) { + + if (vw) { vw->getRenderer()->ResetCameraClippingRange(); vw->Repaint(); } + QApplication::restoreOverrideCursor(); } @@ -656,27 +676,24 @@ OnErasePrs() QApplication::setOverrideCursor(Qt::waitCursor); - SVTK_ViewWindow* vw = GetViewWindow( this ); - if (vw) - vw->unHighlightAll(); + //SVTK_ViewWindow* vw = GetActiveViewWindow(this); + //if (vw) + // vw->unHighlightAll(); SALOME_ListIO aList, aSel; LightApp_SelectionMgr* mgr = GetSelectionMgr(this); - mgr->selectedObjects( aSel ); + mgr->selectedObjects(aSel); + extractContainers(aSel, aList); - extractContainers( aSel, aList ); - - Handle(SALOME_InteractiveObject) anIO; - for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) { - anIO = it.Value(); - CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); - if (!CORBA::is_nil(anObject)) - RemoveScalarBarPosition(this,anObject); - ErasePrs( this, anObject, false ); + for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) { + Handle(SALOME_InteractiveObject) anIO = it.Value(); + CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this), anIO->getEntry()); + //ErasePrs(this, anObject, /*repaint_view_window = */false); + ErasePrs(this, anObject, /*repaint_view_window = */true); } - if (vw) - vw->Repaint(); + //if (vw) + // vw->Repaint(); QApplication::restoreOverrideCursor(); } @@ -686,7 +703,7 @@ VisuGUI:: OnEraseAll() { startOperation( myEraseAll ); - if (SVTK_ViewWindow* vw = GetViewWindow(this)) { + if (SVTK_ViewWindow* vw = GetActiveViewWindow(this)) { vw->unHighlightAll(); if (vtkRenderer *aRen = vw->getRenderer()) { vtkActor *anActor; @@ -694,7 +711,7 @@ OnEraseAll() for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) { if (anActor->GetVisibility() > 0) if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) { - RemoveScalarBarPosition(this,anVISUActor->GetPrs3d()); + RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d()); anVISUActor->VisibilityOff(); } } @@ -711,26 +728,17 @@ VisuGUI:: OnEditScalarMap() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditDeformedShape() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } void @@ -738,12 +746,8 @@ VisuGUI:: OnEditScalarMapOnDeformedShape() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } void @@ -751,82 +755,53 @@ VisuGUI:: OnEditCutPlanes() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditCutLines() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditIsoSurfaces() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditVectors() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditStreamLines() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } - void VisuGUI:: OnEditPlot3D() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){ - aViewWindow->highlight(anIO, 1); - } - } + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) + EditPrs3d(this, anIO, aPrs3d); } @@ -899,7 +874,7 @@ OnChangeColor() VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in()); if (!aPrs3d) return; - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (!vw) return; VISU_Actor* anActor = GetActor(aPrs3d, vw); @@ -971,7 +946,7 @@ OnChangeWireframeColor() VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in()); if (!aPrs3d) return; - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (!vw) return; VISU_Actor* anActor = GetActor(aPrs3d, vw); @@ -1006,7 +981,7 @@ OnChangeOpacity() VISU::Prs3d_i* aPrsObject = dynamic_cast(aServant.in()); if (!aPrsObject) return; - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (!vw) return; VISU_Actor* anActor = GetActor(aPrsObject, vw); @@ -1029,7 +1004,7 @@ OnChangeLines() VISU::Prs3d_i* aPrsObject = dynamic_cast(aServant.in()); if (!aPrsObject) return; - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (!vw) return; VISU_Actor* anActor = GetActor(aPrsObject, vw); @@ -1437,7 +1412,8 @@ OnRestoreViewParams() //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName()); _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp - VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp + if ( aSObj ) + VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp } void @@ -1553,7 +1529,7 @@ OnSweep() VISU::ScalarMap_i* aPrsObject = dynamic_cast(aServant.in()); if (!aPrsObject) return; - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (!vw) return; VISU_Actor* aActor = GetActor(aPrsObject, vw); @@ -1596,7 +1572,7 @@ void VisuGUI:: OnTimeAnimation() { - if(!VISU::GetViewWindow(this)) + if (!VISU::GetActiveViewWindow(this)) return; _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); @@ -1635,7 +1611,7 @@ void VisuGUI:: OnShowAnimation() { - if(!VISU::GetViewWindow(this)) + if (!VISU::GetActiveViewWindow(this)) return; LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); @@ -1693,7 +1669,6 @@ OnCopyPresentation() VISU::Mesh_i* aMeshPrs = dynamic_cast(aPrsObject); VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult()); aSameMesh->SameAs(aMeshPrs); - UpdateViewer(this, aSameMesh); } break; case VISU::TSCALARMAP: @@ -1701,7 +1676,6 @@ OnCopyPresentation() VISU::ScalarMap_i* aScalarPrs = dynamic_cast(aPrsObject); VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true); aSameScalar->SameAs(aScalarPrs); - UpdateViewer(this, aSameScalar); } break; case VISU::TDEFORMEDSHAPE: @@ -1709,15 +1683,15 @@ OnCopyPresentation() VISU::DeformedShape_i* aDefPrs = dynamic_cast(aPrsObject); VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true); aSameDeformed->SameAs(aDefPrs); - UpdateViewer(this, aSameDeformed); } break; case VISU::TSCALARMAPONDEFORMEDSHAPE: { - VISU::ScalarMapOnDeformedShape_i* aDefPrs = dynamic_cast(aPrsObject); - VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true); + VISU::ScalarMapOnDeformedShape_i* aDefPrs = + dynamic_cast(aPrsObject); + VISU::ScalarMapOnDeformedShape_i* aSameScalarMapOnDeformed = + new VISU::ScalarMapOnDeformedShape_i(aDefPrs->GetResult(),true); aSameScalarMapOnDeformed->SameAs(aDefPrs); - UpdateViewer(this, aSameScalarMapOnDeformed); } break; case VISU::TCUTPLANES: @@ -1725,7 +1699,6 @@ OnCopyPresentation() VISU::CutPlanes_i* aCutPrs = dynamic_cast(aPrsObject); VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true); aSameCut->SameAs(aCutPrs); - UpdateViewer(this, aSameCut); } break; case VISU::TCUTLINES: @@ -1733,7 +1706,6 @@ OnCopyPresentation() VISU::CutLines_i* aCutPrs = dynamic_cast(aPrsObject); VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true); aSameCut->SameAs(aCutPrs); - UpdateViewer(this, aSameCut); } break; case VISU::TISOSURFACE: @@ -1741,7 +1713,6 @@ OnCopyPresentation() VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast(aPrsObject); VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true); aSameIso->SameAs(aIsoPrs); - UpdateViewer(this, aSameIso); } break; case VISU::TSTREAMLINES: @@ -1749,7 +1720,6 @@ OnCopyPresentation() VISU::StreamLines_i* aLinesPrs = dynamic_cast(aPrsObject); VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true); aSameLines->SameAs(aLinesPrs); - UpdateViewer(this, aSameLines); } break; case VISU::TVECTORS: @@ -1757,7 +1727,6 @@ OnCopyPresentation() VISU::Vectors_i* aVectorsPrs = dynamic_cast(aPrsObject); VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true); aSameVectors->SameAs(aVectorsPrs); - UpdateViewer(this, aSameVectors); } break; case VISU::TPLOT3D: @@ -1765,7 +1734,6 @@ OnCopyPresentation() VISU::Plot3D_i* aPlot3DPrs = dynamic_cast(aPrsObject); VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult()); aSamePlot3D->SameAs(aPlot3DPrs); - UpdateViewer(this, aSamePlot3D); } break; } @@ -1776,7 +1744,7 @@ void VisuGUI:: OnSelectionInfo() { - if (GetViewWindow(this)) + if (GetActiveViewWindow(this)) (new VisuGUI_SelectionDlg(this))->show(); else SUIT_MessageBox::warn1(GetDesktop(this), @@ -1839,11 +1807,9 @@ OnMergeScalarBars() } } if (update) { - if (SVTK_ViewWindow* vw = GetViewWindow(this)) { -//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) { - vw->getRenderer()->ResetCameraClippingRange(); - vw->Repaint(); -//} + if (SVTK_ViewWindow* vw = GetActiveViewWindow(this)) { + vw->getRenderer()->ResetCameraClippingRange(); + vw->Repaint(); } } } @@ -1878,11 +1844,9 @@ OnFreeScalarBars() } } if (update) { - if (SVTK_ViewWindow* vw = GetViewWindow(this)) { -//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) { - vw->getRenderer()->ResetCameraClippingRange(); - vw->Repaint(); -//} + if (SVTK_ViewWindow* vw = GetActiveViewWindow(this)) { + vw->getRenderer()->ResetCameraClippingRange(); + vw->Repaint(); } } } @@ -1926,7 +1890,7 @@ void VisuGUI:: OnArrangeActors() { - SVTK_ViewWindow* vw = GetViewWindow(this); + SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (vw) { ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw); aDlg->exec(); @@ -1960,10 +1924,6 @@ createActions() tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false, this, SLOT(OnImportFromFile())); - createAction( VISU_EXPLORE_MED, "", QIconSet(), - tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false, - this, SLOT(OnExploreMEDFile())); - createAction( VISU_IMPORT_TABLE, "", QIconSet(), tr("MEN_IMPORT_TABLE"), "", 0, aParent, false, this, SLOT(OnImportTableFromFile())); @@ -2243,13 +2203,11 @@ createActions() aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION")); createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap), tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false, - //this, SLOT(OnEraseAll())); this); aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION")); createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap), tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false, - //this, SLOT(OnEraseAll())); this); createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(), @@ -2265,9 +2223,10 @@ createMenus() int aMenuId; aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 ); createMenu( separator(), aMenuId, -1, 10 ); - createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file - createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file - createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table + + int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 ); + createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file + createMenu( VISU_IMPORT_TABLE, anImportId ); // import table aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 ); createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map @@ -2616,6 +2575,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q if (!anIO.IsNull() && anIO->hasEntry()) { _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); + if ( !aSObject ) + continue; CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject); if (CORBA::is_nil(aCORBAObject)) { _PTR(GenericAttribute) anAttr; @@ -2663,6 +2624,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q if (!anIO.IsNull() && anIO->hasEntry()) { _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); + if ( !aSObject ) + continue; _PTR(GenericAttribute) anAttr; if (aSObject->FindAttribute(anAttr, "AttributeComment")) { _PTR(AttributeComment) aComment (anAttr); @@ -2693,6 +2656,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap); _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry()); + if ( !SO ) + return; bool isExist; VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); @@ -2751,7 +2716,15 @@ VisuGUI:: viewManagers( QStringList& theList ) const { theList.clear(); - theList.append( SVTK_Viewer::Type() ); + // append SVTK viewer only if there is neither SVTK nor VVTK is open + QPtrList lst; + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + if ( !lst.count() ) { + lst.clear(); + getApp()->viewManagers( VVTK_Viewer::Type(), lst ); + if ( !lst.count() ) + theList.append( SVTK_Viewer::Type() ); + } } @@ -2974,6 +2947,7 @@ void VisuGUI::createPreferences() // group: "MED files import" int importGr = addPreference( tr( "MED files import" ), srangeTab ); setPreferenceProperty( importGr, "columns", 1 ); + addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" ); addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" ); addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" ); addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" ); @@ -2993,11 +2967,12 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) if (b == QString("scalar_bar_orientation")) return; SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); float sbX1,sbY1,sbW,sbH; + float aTol = 1.00000009999999; std::string aWarning; if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1); sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Vertical: X+Width > 1\n"; sbX1=0.01; sbW=0.05; @@ -3008,7 +2983,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1); sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Vertical: Y+Height > 1\n"; sbY1=0.01; sbH=0.5; @@ -3019,7 +2994,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1); sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW); - if(sbX1+sbW > 1.0){ + if(sbX1+sbW > aTol){ aWarning = "Origin and Size Horizontal: X+Width > 1\n"; sbX1=0.2; sbW=0.6; @@ -3030,7 +3005,7 @@ void VisuGUI::preferencesChanged( const QString& a, const QString& b) else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1); sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH); - if(sbY1+sbH > 1.0){ + if(sbY1+sbH > aTol){ aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; sbY1=0.01; sbH=0.12; diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 22224d72..cec1e4c2 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -81,7 +81,6 @@ public slots: protected slots: void OnImportFromFile(); - void OnExploreMEDFile(); void OnImportTableFromFile(); void OnExportTableToFile(); void OnImportMedField(); diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h index 1fe7a7b2..681a9d13 100644 --- a/src/VISUGUI/VisuGUI_ActionsDef.h +++ b/src/VISUGUI/VisuGUI_ActionsDef.h @@ -21,15 +21,13 @@ #define VISUGUI_ACTIONSDEF //#define VISU_IMPORT_FROM_FILE 112 -//#define VISU_EXPLORE_MED 113 //#define VISU_IMPORT_MED 114 //#define VISU_IMPORT_TABLE 199 #define VISU_IMPORT_FROM_FILE 4002 -#define VISU_EXPLORE_MED 4003 -#define VISU_IMPORT_TABLE 4004 -#define VISU_IMPORT_MED_STRUCTURE 4005 -#define VISU_IMPORT_MED_TIMESTAMP 4006 -#define VISU_IMPORT_MED_FIELD 4007 +#define VISU_IMPORT_TABLE 4003 +#define VISU_IMPORT_MED_STRUCTURE 4004 +#define VISU_IMPORT_MED_TIMESTAMP 4005 +#define VISU_IMPORT_MED_FIELD 4006 #define VISU_SCALAR_MAP 4011 #define VISU_DEFORMED_SHAPE 4012 diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index 7705f32d..0d8cf8c3 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -48,7 +48,10 @@ * Constructor */ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): - QDialog( theParent, "VisuGUI_BuildProgressBar", false ), + QDialog( theParent, + "VisuGUI_BuildProgressBar", + false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), myIsRaiseColor( false ) { setCaption( tr( "DLG_BUILD_PROGRESS_TITLE" ) ); @@ -205,7 +208,7 @@ VisuGUI_BuildProgressDlg::~VisuGUI_BuildProgressDlg() void VisuGUI_BuildProgressDlg::show() { - if( onBrowseFile() ) + if( !myFileName.isNull() || onBrowseFile() ) QWidget::show(); } @@ -214,37 +217,44 @@ void VisuGUI_BuildProgressDlg::onStart() if( myFileName.isNull() ) return; - bool aBuildAll = myBuildAllCheckBox->isChecked(); - bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked(); - myResult = myGenerator->CreateResult( myFileName ); - myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() ); - myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() ); - - //setModal( false ); - myFileNameLineEdit->setReadOnly( true ); - /* - myBuildAllCheckBox->setNoChange(); - myBuildAtOnceCheckBox->setNoChange(); - myBuildEntitiesCheckBox->setNoChange(); - myBuildFieldsCheckBox->setNoChange(); - myBuildMinMaxCheckBox->setNoChange(); - myBuildGroupsCheckBox->setNoChange(); - */ - - myStartButton->setEnabled( false ); + if (CORBA::is_nil(myResult.in())) { + SUIT_MessageBox::warn1(this, + tr("WRN_VISU"), + tr("ERR_ERROR_IN_THE_FILE"), + tr("BUT_OK")); + onClose(); + }else{ + myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() ); + myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() ); + + //setModal( false ); + myFileNameLineEdit->setReadOnly( true ); + /* + myBuildAllCheckBox->setNoChange(); + myBuildAtOnceCheckBox->setNoChange(); + myBuildEntitiesCheckBox->setNoChange(); + myBuildFieldsCheckBox->setNoChange(); + myBuildMinMaxCheckBox->setNoChange(); + myBuildGroupsCheckBox->setNoChange(); + */ + + myStartButton->setEnabled( false ); + + bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked(); + if( aBuildAtOnce ) + { + QApplication::setOverrideCursor( Qt::waitCursor ); + myCurrentTime = vtkTimerLog::GetCurrentTime(); + } - if( aBuildAtOnce ) - { - QApplication::setOverrideCursor( Qt::waitCursor ); - myCurrentTime = vtkTimerLog::GetCurrentTime(); + myTime.setHMS( 0, 0, 0 ); + myTimer->start( 100 ); + + bool aBuildAll = myBuildAllCheckBox->isChecked(); + myResult->Build( aBuildAll, aBuildAtOnce ); } - - myTime.setHMS( 0, 0, 0 ); - myTimer->start( 100 ); - - myResult->Build( aBuildAll, aBuildAtOnce ); } void VisuGUI_BuildProgressDlg::onClose() @@ -390,3 +400,12 @@ void VisuGUI_BuildProgressDlg::onBuildCheckBoxClicked() myBuildGroupsButton->setPaletteBackgroundColor( aColor ); } + +void VisuGUI_BuildProgressDlg::setFileName( const QString& theFileName ) +{ + if ( !theFileName.isNull() ) + { + myFileName = theFileName; + myFileNameLineEdit->setText( myFileName.section( '/', -1 ) ); + } +} diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.h b/src/VISUGUI/VisuGUI_BuildProgressDlg.h index 4d880596..d0db5912 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -54,6 +54,7 @@ public: virtual void show(); QString fileName() const { return myFileName; } + void setFileName( const QString& theFileName ); protected slots: void done( int ); diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index 2c9f7f1b..d0ff6847 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -22,6 +22,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VISU_Prs3d_i.hh" #include "VISU_Result_i.hh" @@ -389,7 +390,7 @@ VisuGUI_ClippingDlg::~VisuGUI_ClippingDlg() { // no need to delete child widgets, Qt does it all for us std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); - VISU::RenderViewWindow(VISU::GetViewWindow(myVisuGUI)); + VISU::RenderViewWindow(VISU::GetActiveViewWindow(myVisuGUI)); } //================================================================================= @@ -481,9 +482,13 @@ void VisuGUI_ClippingDlg::ClickOnApply() if (!myPrs3d) return; - if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) { + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myVisuGUI)) { SUIT_OverrideCursor wc; + QWidget *aCurrWid = this->focusWidget(); + aCurrWid->clearFocus(); + aCurrWid->setFocus(); + // Save clipping planes, currently applied to the presentation // to enable restoring this state in case of failure. // Refer to bugs IPAL8849, IPAL8850 for more information. @@ -565,7 +570,7 @@ void VisuGUI_ClippingDlg::ClickOnCancel() //================================================================================= void VisuGUI_ClippingDlg::onSelectionChanged() { - if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) { + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myVisuGUI)) { Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO); myIO = anIO; @@ -653,7 +658,7 @@ void VisuGUI_ClippingDlg::ClickOnNew() if (!myPrs3d) return; - if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) { + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myVisuGUI)) { OrientedPlane* aPlane = OrientedPlane::New(aViewWindow); VISU::TVTKPlane aTVTKPlane(aPlane); myPlanes.push_back(aTVTKPlane); @@ -689,7 +694,7 @@ void VisuGUI_ClippingDlg::ClickOnDelete() ClickOnApply(); Sinchronize(); - if (SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myVisuGUI)) + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myVisuGUI)) VISU::RenderViewWindow(aViewWindow); } @@ -886,7 +891,7 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() if (AutoApplyCheckBox->isChecked()) ClickOnApply(); - if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI)) + if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow(myVisuGUI)) VISU::RenderViewWindow(vw); } @@ -1094,6 +1099,6 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId) void VisuGUI_ClippingDlg::OnPreviewToggle (bool theIsToggled) { std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(theIsToggled)); - if (SVTK_ViewWindow* vw = VISU::GetViewWindow(myVisuGUI)) + if (SVTK_ViewWindow* vw = VISU::GetActiveViewWindow(myVisuGUI)) VISU::RenderViewWindow(vw); } diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index a9983bf3..545e8c81 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -12,6 +12,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VISU_Gen_i.hh" #include "VISU_CutLines_i.hh" @@ -105,7 +106,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) QHBox* aPosBox = new QHBox (aPlanePane); aPosBox->setSpacing(5); - QLabel* aPosLbl = new QLabel (tr("LBL_POS"), aPosBox); + new QLabel (tr("LBL_POS"), aPosBox); myPosSpn = new QtxDblSpinBox (0, 1, 0.1, aPosBox); myPosSpn->setValue(0.5); aPlaneLayout->addWidget(aPosBox); @@ -166,7 +167,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) QHBox* aNbBox = new QHBox(aLinesPane); aNbBox->setSpacing(5); - QLabel* aNbLbl = new QLabel( tr( "LBL_NB_PLANS" ), aNbBox ); + new QLabel( tr( "LBL_NB_PLANS" ), aNbBox ); myNbSpn = new QtxDblSpinBox( 1, 100, 1, aNbBox ); myNbSpn->setValue( 10 ); @@ -186,7 +187,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) QHBox* aPosBox2 = new QHBox(aLinesPane); aPosBox2->setSpacing(5); - QLabel* aPosLbl2 = new QLabel( tr( "LBL_POS" ), aPosBox2 ); + new QLabel( tr( "LBL_POS" ), aPosBox2 ); myPosSpn2 = new QtxDblSpinBox( 0, 1, 0.1, aPosBox2 ); myPosSpn2->setValue( 0.5 ); aLinesLayout->addWidget( aPosBox2 ); @@ -258,7 +259,7 @@ VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg() deletePlanes(); if (myCutLines) //delete myCutLines; myCutLines->Destroy(); - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) vf->Repaint(); } @@ -327,7 +328,7 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::CutLines_i* thePrs) //------------------------------------------------------------------------------ void VisuGUI_CutLinesDlg::createPlanes() { - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView == NULL) return; if (myCutLines == NULL) return; if (myPreviewActor != 0) return; @@ -357,7 +358,7 @@ void VisuGUI_CutLinesDlg::createPlanes() void VisuGUI_CutLinesDlg::deletePlanes() { if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* aView = VISU::GetViewWindow()){ + if (SVTK_ViewWindow* aView = VISU::GetActiveViewWindow()){ aView->RemoveActor(myPreviewActor); aView->RemoveActor(myPreviewActorGlyphs); } @@ -414,7 +415,7 @@ void VisuGUI_CutLinesDlg::onCutSelect (int theId, bool theUpdate) myRotXLbl2->setText( tr("LBL_ROT_Z")); myRotYLbl2->setText( tr("LBL_ROT_X")); } - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) { /*myCutLines->SetOrientation2(getOrientaion(false), @@ -443,7 +444,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate) /* float aPos = myCutLines->GetBasePlanePosition(); myBasePlanePos->setText( QString::number(aPos) ); myBasePlanePos->setEnabled(false);*/ - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) { //myCutLines->SetBasePlanePosition(aPos); @@ -515,7 +516,7 @@ void VisuGUI_CutLinesDlg::DrawTable() vh->setLabel( i, str.arg(i+1) ); } // Update preview - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (myPreviewCheck->isChecked()) { // myCutLines->GetPL()->Update(); @@ -593,7 +594,7 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ source->Delete(); aPlaneMapper->Delete(); - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) if (update) vf->Repaint(); } @@ -684,7 +685,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol) QString aTxt = myPosTable->text(theRow, 0); bool isChanged = !aTxt.isEmpty(); ((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged); - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (myPreviewCheck->isChecked()) { //Update Preview @@ -700,7 +701,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol) if (isDefault) { //myCutLines->SetDefaultPosition(theRow); // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow))); - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (myPreviewCheck->isChecked()) { //Update Preview @@ -820,7 +821,7 @@ void VisuGUI_CutLinesDlg::reject() void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { if (thePreview) { //storeToPrsObject(myCutLines); // myCutLines->GetPL()->Update(); @@ -851,7 +852,7 @@ void VisuGUI_CutLinesDlg::onAllCurvesInvertedCheck(bool theInvert) void VisuGUI_CutLinesDlg::onRotation (double theValue) { if (myCutLines == NULL) return; - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (myPreviewCheck->isChecked()) { @@ -872,7 +873,7 @@ void VisuGUI_CutLinesDlg::onRotation (double theValue) void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue) { if (myCutLines == NULL) return; - SVTK_ViewWindow* aView = VISU::GetViewWindow(); + SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { if (myPreviewCheck->isChecked()) { //myCutLines->SetBasePlanePosition(theValue.toDouble()); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index c4072907..486a475d 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -30,6 +30,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VISU_CutPlanes_i.hh" #include "VISU_CutPlanesPL.hxx" @@ -166,11 +167,10 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane() { - cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<Destroy(); - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) vf->Repaint(); } @@ -194,7 +194,7 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs) void VisuGUI_CutPlanesPane::createPlanes() { - if (VISU::GetViewWindow() == NULL) return; + if (VISU::GetActiveViewWindow() == NULL) return; if (myCutPlanes == NULL) return; if (myPreviewActor != 0) return; @@ -211,7 +211,7 @@ void VisuGUI_CutPlanesPane::createPlanes() myPreviewActor->PickableOff(); myPreviewActor->SetMapper(aPlaneMapper); aPlaneMapper->Delete(); - VISU::GetViewWindow()->AddActor(myPreviewActor); + VISU::GetActiveViewWindow()->AddActor(myPreviewActor); } int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs) @@ -349,7 +349,7 @@ void VisuGUI_CutPlanesPane::DrawTable() // Update preview if (myPreviewCheck->isChecked()) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { myCutPlanes->GetPL()->Update(); deletePlanes(); createPlanes(); @@ -386,7 +386,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) if (myPreviewCheck->isChecked()) { //Update Preview - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble()); myCutPlanes->GetPL()->Update(); deletePlanes(); @@ -401,7 +401,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow))); if (myPreviewCheck->isChecked()) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { //Update Preview myCutPlanes->GetPL()->Update(); deletePlanes(); @@ -417,7 +417,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) void VisuGUI_CutPlanesPane::deletePlanes() { if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) vf->RemoveActor(myPreviewActor); myPreviewActor->Delete(); myPreviewActor = 0; @@ -427,7 +427,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue) { if (myCutPlanes == NULL) return; if (myPreviewCheck->isChecked()) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.); myCutPlanes->GetPL()->Update(); deletePlanes(); @@ -439,7 +439,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue) void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { if (thePreview) { storeToPrsObject(myCutPlanes); myCutPlanes->GetPL()->Update(); diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index 1fa6f098..2939ca90 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -27,10 +27,13 @@ // $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_Displayer.cxx #include "VisuGUI_Displayer.h" -#include "VVTK_ViewModel.h" + #include "VisuGUI_Tools.h" +#include "VISU_ViewManager_i.hh" #include "VISU_Actor.h" +#include "VVTK_ViewModel.h" + #include #include @@ -41,7 +44,7 @@ #include #include -#include "VISU_ViewManager_i.hh" +#include VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app ) : LightApp_Displayer(), @@ -67,7 +70,9 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V if( CORBA::is_nil( anObj ) ) return 0; - SVTK_Viewer* vtk_viewer = dynamic_cast( aViewFrame ); + SVTK_Viewer* vtk_viewer = dynamic_cast( aViewFrame ); + if (!vtk_viewer) + vtk_viewer = dynamic_cast( aViewFrame ); if( vtk_viewer ) { SVTK_ViewWindow* wnd = @@ -116,14 +121,22 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V void VisuGUI_Displayer::buildPrs3d( SVTK_ViewWindow* wnd, VISU::Prs3d_i* thePrs ) const { - VISU_Actor* newAct = VISU::FindActor( wnd, thePrs ); - if( !newAct ) - { - newAct = thePrs->CreateActor(); + VISU_Actor* newAct = VISU::FindActor(wnd, thePrs); + if (!newAct) { + try { + newAct = thePrs->CreateActor(); + } catch (std::runtime_error& exc) { + thePrs->RemoveActors(); + + INFOS(exc.what()); + SUIT_MessageBox::warn1 + (myApp->desktop(), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), + QObject::tr("BUT_OK")); + } } - if( newAct ) - { - wnd->AddActor( newAct ); + if (newAct) { + wnd->AddActor(newAct); wnd->Repaint(); } } diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index f496c5dc..4a441242 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1,4 +1,4 @@ - +// VISU VISUGUI : GUI of VISU component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -43,6 +43,9 @@ #include "LightApp_SelectionMgr.h" #include "LightApp_VTKSelector.h" #include "LightApp_Preferences.h" +#include "LightApp_Displayer.h" + +#include "SALOMEDS_IParameters.hxx" #include "VVTK_ViewManager.h" #include "VVTK_ViewWindow.h" @@ -65,6 +68,7 @@ #include "VISU_CutLines_i.hh" #include "VISU_Actor.h" +#include "VISU_ScalarMapAct.h" #include "VisuGUI_Tools.h" #include "VisuGUI_ActionsDef.h" @@ -81,6 +85,7 @@ #include #include #include +#include #include @@ -172,24 +177,24 @@ namespace VISU } //--------------------------------------------------------------- -VisuGUI_Module -::VisuGUI_Module() : +VisuGUI_Module:: +VisuGUI_Module() : VisuGUI() { } //--------------------------------------------------------------- -VisuGUI_Module -::~VisuGUI_Module() +VisuGUI_Module:: +~VisuGUI_Module() { } //--------------------------------------------------------------- void -VisuGUI_Module -::initialize( CAM_Application* theApp ) +VisuGUI_Module:: +initialize( CAM_Application* theApp ) { VisuGUI::initialize( theApp ); @@ -230,7 +235,8 @@ VisuGUI_Module accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType ); accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType ); - connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) ); + connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), + this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) ); // Prepare popup menus QtxPopupMgr* mgr = popupMgr(); @@ -283,21 +289,21 @@ VisuGUI_Module this, SLOT(OnErasePrs())); mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase mgr->setRule( action( GAUSS_ERASE_PRS ), - aRule + " and (isVisible=true)", true ); + aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)", true ); createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(), VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false, this, SLOT(OnDisplayPrs())); mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display mgr->setRule( action( GAUSS_DISPLAY_PRS ), - aRule + " and (isVisible=false)", true ); + aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)", true ); createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(), VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false, this, SLOT(OnDisplayOnlyPrs())); mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ), - aRule, true ); + aRule + " and ({true} in $canBeDisplayed)", true ); createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIconSet(), VisuGUI::tr("MEN_RENAME"), "", 0, this, false, @@ -309,7 +315,8 @@ VisuGUI_Module tr("MEN_SAVE_CONFIGURATION"), "", 0, this, false, this, SLOT(OnSaveConfiguration())); mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 ); - mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), "selcount>=0 and client='VVTK' and activeView='VVTK'", true ); + mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), + "selcount>=0 and client='VVTK' and activeView='VVTK'", true ); createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIconSet(), tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false, @@ -328,8 +335,8 @@ VisuGUI_Module //--------------------------------------------------------------- bool -VisuGUI_Module -::activateModule( SUIT_Study* theStudy ) +VisuGUI_Module:: +activateModule( SUIT_Study* theStudy ) { VisuGUI::activateModule( theStudy ); @@ -341,8 +348,8 @@ VisuGUI_Module //--------------------------------------------------------------- bool -VisuGUI_Module -::deactivateModule( SUIT_Study* theStudy ) +VisuGUI_Module:: +deactivateModule( SUIT_Study* theStudy ) { VisuGUI::deactivateModule( theStudy ); @@ -354,8 +361,8 @@ VisuGUI_Module //--------------------------------------------------------------- SUIT_ViewManager* -VisuGUI_Module -::onCreateViewManager() +VisuGUI_Module:: +onCreateViewManager() { Viewer* aViewer = new Viewer( this, myViewerMap ); return aViewer->getViewManager(); @@ -364,8 +371,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::onLastViewClosed(SUIT_ViewManager* theViewManager) +VisuGUI_Module:: +onLastViewClosed(SUIT_ViewManager* theViewManager) { myViewerMap.erase(theViewManager); } @@ -373,8 +380,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createPreferences() +VisuGUI_Module:: +createPreferences() { VisuGUI::createPreferences(); @@ -389,15 +396,16 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createGaussPointsPreferences() +VisuGUI_Module:: +createGaussPointsPreferences() { int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) ); int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab ); setPreferenceProperty( primitiveGr, "columns", 1 ); int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr, - LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" ); + LightApp_Preferences::Selector, "VISU", + "point_sprite_primitive_type" ); QStringList values; values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) ); @@ -422,7 +430,8 @@ VisuGUI_Module LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" ); + LightApp_Preferences::DblSpin, "VISU", + "point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); @@ -451,7 +460,8 @@ VisuGUI_Module setPreferenceProperty( maxSizePref, "max", 100 ); int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" ); + LightApp_Preferences::IntSpin, "VISU", + "point_sprite_magnification" ); setPreferenceProperty( magnificationPref, "min", 10 ); setPreferenceProperty( magnificationPref, "max", 1000 ); @@ -513,8 +523,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createInsideCursorPreferences() +VisuGUI_Module:: +createInsideCursorPreferences() { int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) ); @@ -522,7 +532,8 @@ VisuGUI_Module setPreferenceProperty( primitiveGr, "columns", 1 ); int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr, - LightApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" ); + LightApp_Preferences::Selector, "VISU", + "inside_point_sprite_primitive_type" ); QStringList values; values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) ); @@ -547,18 +558,21 @@ VisuGUI_Module LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" ); + LightApp_Preferences::DblSpin, "VISU", + "inside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" ); + LightApp_Preferences::IntSpin, "VISU", + "inside_geom_sphere_resolution" ); setPreferenceProperty( resolutionPref, "min", 3 ); setPreferenceProperty( resolutionPref, "max", 100 ); int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" ); + LightApp_Preferences::IntSpin, "VISU", + "inside_geom_sphere_face_limit" ); setPreferenceProperty( faceLimitPref, "min", 10 ); setPreferenceProperty( faceLimitPref, "max", 1000000 ); @@ -566,12 +580,14 @@ VisuGUI_Module setPreferenceProperty( sizeGr, "columns", 2 ); int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" ); + LightApp_Preferences::IntSpin, "VISU", + "inside_point_sprite_min_size" ); setPreferenceProperty( minSizePref, "min", 1 ); setPreferenceProperty( minSizePref, "max", 100 ); int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" ); + LightApp_Preferences::IntSpin, "VISU", + "inside_point_sprite_max_size" ); setPreferenceProperty( maxSizePref, "min", 1 ); setPreferenceProperty( maxSizePref, "max", 100 ); @@ -579,23 +595,24 @@ VisuGUI_Module setPreferenceProperty( magnificationGr, "columns", 2 ); int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr, - LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" ); + LightApp_Preferences::IntSpin, "VISU", + "inside_point_sprite_magnification" ); setPreferenceProperty( magnificationPref, "min", 10 ); setPreferenceProperty( magnificationPref, "max", 1000 ); int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr, - LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" ); + LightApp_Preferences::DblSpin, "VISU", + "inside_point_sprite_increment" ); setPreferenceProperty( incrementPref, "min", 0.01 ); setPreferenceProperty( incrementPref, "max", 10 ); setPreferenceProperty( incrementPref, "step", 0.1 ); - } //--------------------------------------------------------------- void -VisuGUI_Module -::createOutsideCursorPreferences() +VisuGUI_Module:: +createOutsideCursorPreferences() { int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) ); @@ -603,7 +620,8 @@ VisuGUI_Module setPreferenceProperty( primitiveGr, "columns", 1 ); int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr, - LightApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" ); + LightApp_Preferences::Selector, "VISU", + "outside_point_sprite_primitive_type" ); QStringList values; values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) ); @@ -628,18 +646,21 @@ VisuGUI_Module LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" ); + LightApp_Preferences::DblSpin, "VISU", + "outside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" ); + LightApp_Preferences::IntSpin, "VISU", + "outside_geom_sphere_resolution" ); setPreferenceProperty( resolutionPref, "min", 3 ); setPreferenceProperty( resolutionPref, "max", 100 ); int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" ); + LightApp_Preferences::IntSpin, "VISU", + "outside_geom_sphere_face_limit" ); setPreferenceProperty( faceLimitPref, "min", 10 ); setPreferenceProperty( faceLimitPref, "max", 1000000 ); @@ -663,8 +684,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createPickingPreferences() +VisuGUI_Module:: +createPickingPreferences() { int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) ); @@ -673,7 +694,7 @@ VisuGUI_Module setPreferenceProperty( cursorGr, "columns", 1 ); int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr, - LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" ); + LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" ); setPreferenceProperty( cursorSizePref, "min", 0 ); setPreferenceProperty( cursorSizePref, "max", 1.0 ); setPreferenceProperty( cursorSizePref, "step", 0.1 ); @@ -683,14 +704,15 @@ VisuGUI_Module setPreferenceProperty( pyramidHeightPref, "min", 1 ); setPreferenceProperty( pyramidHeightPref, "max", 100 ); - int selectionColorPref = addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr, - LightApp_Preferences::Color, "VISU", "picking_selection_color" ); + /*int selectionColorPref = */ + addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr, + LightApp_Preferences::Color, "VISU", "picking_selection_color" ); // Tolerance int toleranceGr = addPreference( tr( "VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" ), pickingTab ); int pointTolerancePref = addPreference( tr( "VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" ), toleranceGr, - LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" ); + LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" ); setPreferenceProperty( pointTolerancePref, "min", 0.001 ); setPreferenceProperty( pointTolerancePref, "max", 10 ); setPreferenceProperty( pointTolerancePref, "step", 0.01 ); @@ -742,13 +764,14 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createSpaceMousePreferences() +VisuGUI_Module:: +createSpaceMousePreferences() { int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) ); int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), mouseTab ); - int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, LightApp_Preferences::Selector, "VISU", "mouse_behaviour" ); + int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, + LightApp_Preferences::Selector, "VISU", "mouse_behaviour" ); QStringList values; values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) ); values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) ); @@ -759,16 +782,27 @@ VisuGUI_Module setPreferenceProperty( mousePref, "indexes", indices ); int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), mouseTab ); - int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, LightApp_Preferences::IntSpin, "VISU", "speed_increment" ); + int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, + LightApp_Preferences::IntSpin, "VISU", "speed_increment" ); setPreferenceProperty( keybrdPref, "max", 1000 ); int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), mouseTab ); setPreferenceProperty( spacemouseGr, "columns", 1 ); - int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment - int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment - int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification - int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification - int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch + int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, + LightApp_Preferences::Selector, "VISU", + "spacemouse_func1_btn" ); //decrease_speed_increment + int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, + LightApp_Preferences::Selector, "VISU", + "spacemouse_func2_btn" ); //increase_speed_increment + int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, + LightApp_Preferences::Selector, "VISU", + "spacemouse_func3_btn" ); //decrease_gauss_point_magnification + int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, + LightApp_Preferences::Selector, "VISU", + "spacemouse_func4_btn" ); //increase_gauss_point_magnification + int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, + LightApp_Preferences::Selector, "VISU", + "spacemouse_func5_btn" ); //dominant_combined_switch values.clear(); values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) ); values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) ); @@ -808,8 +842,8 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::createRecorderPreferences() +VisuGUI_Module:: +createRecorderPreferences() { int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) ); @@ -844,27 +878,28 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::OnCreateGaussPoints() +VisuGUI_Module:: +OnCreateGaussPoints() { double initialTime = vtkTimerLog::GetCPUTime(); - CreatePrs3d(this,true); + CreatePrs3d(this); INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " << vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); } void -VisuGUI_Module -::OnViewManagerAdded(SUIT_ViewManager* viewMgr) +VisuGUI_Module:: +OnViewManagerAdded(SUIT_ViewManager* viewMgr) { QString type = viewMgr->getViewModel()->getType(); if ( type == VVTK_Viewer::Type() ) - connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) ); + connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), + this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) ); } void -VisuGUI_Module -::OnViewCreated(SUIT_ViewWindow* view) +VisuGUI_Module:: +OnViewCreated(SUIT_ViewWindow* view) { SVTK_ViewWindow* viewWindow = dynamic_cast( view ); if ( viewWindow ) { @@ -878,8 +913,8 @@ VisuGUI_Module } void -VisuGUI_Module -::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref ) +VisuGUI_Module:: +setProperty( SVTK_ViewWindow* viewWindow, const QString& pref ) { if ( !viewWindow ) return; @@ -914,8 +949,8 @@ VisuGUI_Module } void -VisuGUI_Module -::setProperty( SVTK_ViewManager* vm, const QString& prop ) +VisuGUI_Module:: +setProperty( SVTK_ViewManager* vm, const QString& prop ) { if ( !vm ) return; @@ -926,8 +961,8 @@ VisuGUI_Module } void -VisuGUI_Module -::preferencesChanged( const QString& group, const QString& pref ) +VisuGUI_Module:: +preferencesChanged( const QString& group, const QString& pref ) { VisuGUI::preferencesChanged(group,pref); @@ -945,14 +980,14 @@ VisuGUI_Module //--------------------------------------------------------------- SUIT_ViewManager* -VisuGUI_Module -::getViewManager(const QString& theType, - const bool theIsCreate) +VisuGUI_Module:: +getViewManager(const QString& theType, + const bool theIsCreate) { - if(SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate)) + if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate)) return aViewManager; - if(theIsCreate && VVTK_Viewer::Type() == theType) + if (theIsCreate && theType == VVTK_Viewer::Type()) return onCreateViewManager(); return NULL; @@ -960,134 +995,19 @@ VisuGUI_Module //--------------------------------------------------------------- void -VisuGUI_Module -::OnEditGaussPoints() +VisuGUI_Module:: +OnEditGaussPoints() { Handle(SALOME_InteractiveObject) anIO; - if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){ - EditPrs3d(this, aPrs3d); - if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this,true)){ - aViewWindow->highlight(anIO,1); + if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) { + // Create VVTK_ViewWindow, if it does not exist + if (VVTK_ViewWindow* aViewWindow = GetViewWindow(this)) { + EditPrs3d(this, anIO, aPrs3d, aViewWindow); } } } -//--------------------------------------------------------------- -void -VisuGUI_Module -::OnDisplayPrs() -{ - if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs"); - - QApplication::setOverrideCursor(Qt::waitCursor); - - if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){ - SALOME_ListIO aSel, aList; - aSelectionMgr->selectedObjects(aSel); - extractContainers(aSel, aList); - - for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){ - Handle(SALOME_InteractiveObject) anIO = it.Value(); - CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); - - // is it a Prs3d object ? - if(!CORBA::is_nil(anObject)){ - if(VISU::Prs3d_i* aPrs3d = dynamic_cast(VISU::GetServant(anObject).in())){ - if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object"); - if(aPrs3d->GetType() == VISU::TGAUSSPOINTS) - VISU::UpdateViewer(this,aPrs3d,false,true,true); - else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){ - QString aType = aViewManager->getType(); - if(aType == SVTK_Viewer::Type()) - VISU::UpdateViewer(this,aPrs3d,false,true,true); - else if(aType == VVTK_Viewer::Type()) - VISU::UpdateViewer(this,aPrs3d,false,true,true); - } - continue; - } - } - - // is it Curve ? - if(VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(anObject).in())){ - if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Curve object"); - PlotCurve( this, aCurve, VISU::eDisplay ); - continue; - } - - // is it Container ? - if(VISU::Container_i* aContainer = dynamic_cast(VISU::GetServant(anObject).in())){ - if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Container object"); - PlotContainer( this, aContainer, VISU::eDisplay ); - continue; - } - - // is it Table ? - if(VISU::Table_i* aTable = dynamic_cast(VISU::GetServant(anObject).in())){ - if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Table object"); - PlotTable( this, aTable, VISU::eDisplay ); - continue; - } - } - } - - QApplication::restoreOverrideCursor(); -} - - -//--------------------------------------------------------------- -void -VisuGUI_Module -::OnEraseAll() -{ - if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){ - QString aType = aViewManager->getType(); - if(aType == SVTK_Viewer::Type()) - VISU::OnEraseAll(this); - else if(aType == VVTK_Viewer::Type()) - VISU::OnEraseAll(this); - else if(aType == SPlot2d_Viewer::Type()) - VISU::OnEraseAll(this); - } -} - - -//--------------------------------------------------------------- -void -VisuGUI_Module -::OnDisplayOnlyPrs() -{ - OnEraseAll(); - OnDisplayPrs(); -} - - -//--------------------------------------------------------------- -void -VisuGUI_Module -::OnErasePrs() -{ - QApplication::setOverrideCursor(Qt::waitCursor); - - LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); - SALOME_ListIO aSel, aList; - aSelectionMgr->selectedObjects(aSel); - extractContainers(aSel, aList); - - for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){ - Handle(SALOME_InteractiveObject) anIO = it.Value(); - CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this),anIO->getEntry()); - if(!CORBA::is_nil(anObject)){ - VISU::Base_var aBase = VISU::Base::_narrow(anObject); - if(!CORBA::is_nil(aBase)) - VISU::ErasePrs(this,aBase,true); - } - } - - QApplication::restoreOverrideCursor(); -} - - //--------------------------------------------------------------- namespace { @@ -1375,7 +1295,7 @@ namespace PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); if(VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in())){ // To set visiblity - VISU::UpdateViewer(theModule,aPrs3d,anIsFirst,false,false); + VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false); anIsFirst = false; // To update selection @@ -1661,3 +1581,433 @@ eventFilter( QObject * theWatched, QEvent * theEvent ) } return aRet; } + + +const char gSeparator = '_'; // character used to separate parameter names +const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b) +/*! + * \brief Virtual public + * + * This method is called just before the study document is saved, so the module has a possibility + * to store visual parameters in AttributeParameter attribue(s) + */ +void VisuGUI_Module::storeVisualParameters(int savePoint) +{ + SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + if( !study || !study->studyDS() ) + return; + _PTR(Study) studyDS = study->studyDS(); + _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint); + SALOMEDS_IParameters ip(ap); + + // viewers counters are used for storing view_numbers in IParameters + int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 ); + + // componentName is used for encoding of entries when storing them in IParameters + _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS ); + std::string componentName = visuEng->ComponentDataType(); + + QPtrList lst; + + // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since + // VVTK is declared in VISU, so here we store VVTK view window parameters. + // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters. + ip.setProperty( "ActiveGaussViewer", "-1" ); + getApp()->viewManagers( VVTK_Viewer::Type(), lst ); + for ( QPtrListIterator it( lst ); it.current(); ++it ) { + SUIT_ViewManager* vman = it.current(); + if ( SUIT_ViewWindow* vwin = vman->getActiveView() ) { + // using predefined string "GaussViewer" as "entry".. it's a hardcoded "workaround". + // gauss viewer parameters are retrieved using this "entry" string. + // name of parameter = caption of gauss ViewWindow + // value of parameter = ViewWindow's visual parameters + ip.setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() ); + + if ( application()->desktop()->activeWindow() == vwin ) + ip.setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() ); + vvtkViewers++; + } + } + + // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual + // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open.. + /* + lst.clear(); + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + ip.setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() ); + */ + + // main cycle to store parameters of displayed objects + lst.clear(); + getApp()->viewManagers( lst ); + vvtkViewers = svtkViewers = plotViewers = 0; + for ( QPtrListIterator it( lst ); it.current(); ++it ) { + SUIT_ViewManager* vman = it.current(); + QString vType = vman->getType(); + int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers : + vType == VVTK_Viewer::Type() ? &vvtkViewers : + vType == SPlot2d_Viewer::Type() ? &plotViewers : 0; + + // saving VTK actors' properties + if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same + vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow) + + QPtrVector views = vman->getViews(); + for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) { + if ( SVTK_ViewWindow* vtkView = dynamic_cast( views[i] ) ) { + vtkActorCollection* allActors = vtkView->getRenderer()->GetActors(); + allActors->InitTraversal(); + while ( vtkActor* actor = allActors->GetNextActor() ) { + if ( actor->GetVisibility() ) { // store only visible actors + if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) { + if ( vActor->hasIO() ) { // actor corresponds to existing obj + + Handle(SALOME_InteractiveObject) io = vActor->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip.encodeEntry( io->getEntry(), componentName ); + + std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator; + vtkParam += QString::number( *viewsCounter ).latin1(); vtkParam += gSeparator; + + param = vtkParam + "Visibility"; + ip.setParameter( entry, param, "On" ); + param = vtkParam + "Name"; + ip.setParameter( entry, param, vActor->getName() ); + param = vtkParam + "RepresentationMode"; + ip.setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() ); + param = vtkParam + "Opacity"; + ip.setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() ); + float r, g, b; + vActor->GetColor(r, g, b); + QString colorStr = QString::number( r ); colorStr += gDigitsSep; + colorStr += QString::number( g ); colorStr += gDigitsSep; + colorStr += QString::number( b ); + param = vtkParam + "Color"; + ip.setParameter( entry, param, colorStr.latin1() ); + param = vtkParam + "LineWidth"; + ip.setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() ); + if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { + param = vtkParam + "ShrinkMode"; + ip.setParameter( entry, param, "On" ); + param = vtkParam + "ShrinkFactor"; + ip.setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() ); + } + VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ); + if ( scalarMapActor && scalarMapActor->IsShading() ) { + param = vtkParam + "Shading"; + ip.setParameter( entry, param, "On" ); + } + if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) { + param = vtkParam + "ClippingPlane_"; + for ( int p = 0, nPlanes = vPrs->GetNumberOfClippingPlanes(); p < nPlanes; p++ ) { + vtkPlane* plane = vPrs->GetClippingPlane( p ); + float normal[3], origin[3]; + plane->GetNormal( normal ); + plane->GetOrigin( origin ); + std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep; + planeValue += QString::number( normal[1] ).latin1(); planeValue += gDigitsSep; + planeValue += QString::number( normal[2] ).latin1(); planeValue += gDigitsSep; + planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep; + planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep; + planeValue += QString::number( origin[2] ).latin1(); + param += QString::number( p+1 ).latin1(); + ip.setParameter( entry, param, planeValue ); + } + } + + } // hasIO + } // salome_actor successfull downcast + } // isVisible + } // end of ..while.. actors traversal + } // if ( vtkView ) + } // for ( views ) + (*viewsCounter)++; + } // if ( SVTK view model ) + else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers + QPtrVector views = vman->getViews(); + for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) { + if ( Plot2d_ViewWindow* plotView = dynamic_cast( views[i] ) ) { + Plot2d_ViewFrame* plotVF = plotView->getViewFrame(); + QPtrList curves; + plotVF->getCurves( curves ); + + Plot2d_Curve* curve; + for ( curve = curves.first(); curve; curve = curves.next() ) { + if ( SPlot2d_Curve* sCurve = dynamic_cast( curve ) ) { + if ( sCurve->hasIO() ) { + + Handle(SALOME_InteractiveObject) io = sCurve->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip.encodeEntry( io->getEntry(), componentName ); + + std::string param, plotParam = vType.latin1(); plotParam += gSeparator; + plotParam += QString::number( *viewsCounter ).latin1(); plotParam += gSeparator; + + param = plotParam + "Visibility"; + ip.setParameter( entry, param, "On" ); + } + } + } // for curves + } // if ( plotView ) + } // for ( views ) + (*viewsCounter)++; + } // if ( SPlot2d view model ) + } +} + +// returns VISU_Actor with IO with given entry +VISU_Actor* getActor( const QString& entry, SVTK_ViewWindow* vtkView ) +{ + if ( vtkView && !entry.isEmpty() ) { + vtkActorCollection* allActors = vtkView->getRenderer()->GetActors(); + allActors->InitTraversal(); + while ( vtkActor* actor = allActors->GetNextActor() ) { + if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) { + if ( vActor->hasIO() ) { // actor corresponds to existing obj + Handle(SALOME_InteractiveObject) io = vActor->getIO(); + if ( entry == io->getEntry() ) + return vActor; + } + } + } + } + return 0; +} + +const int ViewerType = 0; +const int ViewIndex = 1; +const int ParamName = 2; +// visual parameters are stored in strings as follows: +// ViewerType_ViewNumber_ParamName. '_' is used as separator and should not be used in +// viewer type or parameter names + +// return viewer type substring from parameter name +std::string getParam( const std::string& paramName, const int index ) +{ + QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) ); + if ( !lst.isEmpty() && index < lst.size() ) + return lst[index]; + return ""; +} + + +/*! + * \brief Virtual public + * + * This method is called after the study document is opened, so the module has a possibility to restore + * visual parameters + */ +void VisuGUI_Module::restoreVisualParameters(int savePoint) +{ + SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + if( !study || !study->studyDS() ) + return; + _PTR(Study) studyDS = study->studyDS(); + _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint); + SALOMEDS_IParameters ip(ap); + + // actors are stored in a map after displaying of them for quicker access in future + QMap > vtkActors; // map: entry to map: ViewType_ to actor (SVTK/VVTK) + + std::vector entries = ip.getEntries(); + + for ( std::vector::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) { + + std::vector paramNames = ip.getAllParameterNames( *entIt ); + std::vector paramValues = ip.getAllParameterValues( *entIt ); + std::vector::iterator namesIt = paramNames.begin(); + std::vector::iterator valuesIt = paramValues.begin(); + + if ( *entIt == "GaussViewer" ) { + // parameter names are view window's captions, values - visual parameters. + for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { + SUIT_ViewManager* vman = onCreateViewManager(); + SUIT_ViewWindow* vwin = vman->getActiveView(); + vwin->setCaption( (*namesIt).c_str() ); + + // wait untill the window is really shown. This step fixes MANY bugs.. + while ( !vwin->isVisible() ) + qApp->processEvents(); + + vwin->setVisualParameters( (*valuesIt).c_str() ); + } + continue; // skip to next entry + } + + // entry is a normal entry - it should be "decoded" (setting base adress of component) + QString entry( ip.decodeEntry( *entIt ).c_str() ); + + for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { + std::string viewerType = ::getParam( *namesIt, ViewerType ); + + std::string paramName = ::getParam( *namesIt, ParamName ); + bool ok; + std::string viewIndexStr = ::getParam( *namesIt, ViewIndex ); + int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok ); + if ( !ok ) // bad conversion of view index to integer + continue; + + // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl; + + if ( viewerType == SVTK_Viewer::Type().latin1() || + viewerType == VVTK_Viewer::Type().latin1() ) { + + // used as inner map key for locating the actor. + QString viewerTypeIndex = viewerType + QString::number( viewIndex ); + + if ( paramName == "Visibility" && displayer() ) { + // if VVTK, then we must create viewer first, because + + QPtrList lst; + getApp()->viewManagers( viewerType, lst ); + + // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager + if ( viewIndex >= 0 && viewIndex < lst.count() ) { + SUIT_ViewManager* vman = lst.at( viewIndex ); + SUIT_ViewModel* vmodel = vman->getViewModel(); + // SVTK and VVTK view models can be casted to SALOME_View + displayer()->Display( entry, true, dynamic_cast( vmodel ) ); + SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); + // vtkView->getRenderer()->ResetCameraClippingRange(); + // vtkView->Repaint(); + + // store displayed actor so setting of color, opacity, etc. will be much faster + QMap viewActorMap; + if ( vtkActors.contains( entry ) ) + viewActorMap = vtkActors[ entry ]; + viewActorMap[ viewerTypeIndex ] = getActor( entry, vtkView ); + vtkActors[ entry ] = viewActorMap; + } + } + else { // the rest properties "work" with VISU_Actor, so we initialize it at first + VISU_Actor* vActor = 0; + if ( vtkActors.contains( entry ) ) { + QMap viewActorMap = vtkActors[ entry ]; + if ( viewActorMap.contains( viewerTypeIndex ) ) + vActor = viewActorMap[ viewerTypeIndex ]; + } + if ( !vActor ) + continue; + + QString val( (*valuesIt).c_str() ); + + if ( paramName == "Name" ) + vActor->setName( val.latin1() ); + + else if ( paramName == "RepresentationMode" ) + vActor->SetRepresentation( val.toInt() ); + + else if ( paramName == "Opacity" ) + vActor->SetOpacity( val.toFloat() ); + + else if ( paramName == "Color" ) { + QStringList colors = QStringList::split( gDigitsSep, val ); + if ( colors.count() == 3 ) + vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() ); + } + + else if ( paramName == "LineWidth" ) + vActor->SetLineWidth( val.toFloat() ); + + else if ( paramName == "ShrinkMode" ) { + vActor->SetShrinkable( true ); + vActor->SetShrink(); + } + + else if ( paramName == "ShrunkFactor" ) + vActor->SetShrinkFactor( val.toFloat() ); + + else if ( paramName == "Shading" ) { + if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ) ) + scalarMapActor->SetShading(); + } + + else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) { + QStringList vals = QStringList::split( gDigitsSep, val ); + if ( vals.count() == 6 && vActor->GetPrs3d() ) { + float normal[3], origin[3]; + for (int x = 0; x < 3; x++ ) { + normal[x] = vals[x].toFloat(); + origin[x] = vals[x+3].toFloat(); + } + vtkPlane* plane = vtkPlane::New(); + plane->SetNormal( normal ); + plane->SetOrigin( origin ); + vActor->GetPrs3d()->AddClippingPlane( plane ); + } + } + } // else .. + } // if SVTK + + else if ( viewerType == SPlot2d_Viewer::Type().latin1() ) { + + if ( paramName == "Visibility" && displayer() ) { + QPtrList lst; + getApp()->viewManagers( viewerType, lst ); + + if ( viewIndex >= 0 && viewIndex < lst.count() ) { + SUIT_ViewManager* vman = lst.at( viewIndex ); + SUIT_ViewModel* vmodel = vman->getViewModel(); + // SVTK and VVTK view models can be casted to SALOME_View + displayer()->Display( entry, true, dynamic_cast( vmodel ) ); + } + } + + } // if SPlot2d + + } // for names/parameters iterator + } // for entries iterator + + // [ update all SVTK/VVTK views + QPtrList lst; + getApp()->viewManagers( lst ); + for ( QPtrListIterator it( lst ); it.current(); ++it ) { + SUIT_ViewManager* vman = it.current(); + SUIT_ViewModel* vmodel = vman->getViewModel(); + if ( !vmodel ) + continue; + if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers + vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way + SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); + vtkView->getRenderer()->ResetCameraClippingRange(); + vtkView->Repaint(); + } + else if ( vmodel->getType() == SPlot2d_Viewer::Type().latin1() ) { + Plot2d_ViewWindow* plotView = (Plot2d_ViewWindow*) vman->getActiveView(); + plotView->getViewFrame()->Repaint(); + } + } // ] end of update views + + // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual + // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one + // default SVTK if needed. + /* + QString openedSvtkViewerStr = ip.getProperty( "VtkViewersCount" ).c_str(); + int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok ); + if ( ok && openedSvtkViewer == 0 ) { + lst.clear(); + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + if ( lst.count() ) + lst.at( 0 )->closeAllViews(); + } + */ + + // if active Gauss Viewer is set ( != -1) then raise the gauss view window. + bool ok; + QString activeGaussViewerStr = ip.getProperty( "ActiveGaussViewer" ).c_str(); + int activeGaussViewer = activeGaussViewerStr.toInt( &ok ); + if ( ok && activeGaussViewer != -1 ) { + lst.clear(); + getApp()->viewManagers( VVTK_Viewer::Type(), lst ); + if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) { + SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView(); + if ( activeView ) { + activeView->setActiveWindow(); + activeView->setFocus(); + } + } + } +} + diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index c13c8235..d0c371b4 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -24,7 +24,6 @@ // File : VisuGUI_Module.h // Author : // Module : VISU -// $Header$ #ifndef VisuGUI_Module_HeaderFile #define VisuGUI_Module_HeaderFile @@ -84,6 +83,14 @@ public: getViewManager(const QString& theType, const bool theIsCreate); + virtual + void + storeVisualParameters(int savePoint); + + virtual + void + restoreVisualParameters(int savePoint); + public slots: //! Reimplemented method of the module deactivation. virtual @@ -146,26 +153,6 @@ protected slots: void OnEditGaussPoints(); - //! Reimplemented method of the Gauss Points displaying. - virtual - void - OnDisplayPrs(); - - //! Reimplemented method of the Gauss Points displaying only. - virtual - void - OnDisplayOnlyPrs(); - - //! Reimplemented method of the Gauss Points full erasing. - virtual - void - OnEraseAll(); - - //! Reimplemented method of the Gauss Points erasing. - virtual - void - OnErasePrs(); - //! Virtual method of saving configuration. virtual void diff --git a/src/VISUGUI/VisuGUI_NonIsometricDlg.cxx b/src/VISUGUI/VisuGUI_NonIsometricDlg.cxx deleted file mode 100644 index 323c384f..00000000 --- a/src/VISUGUI/VisuGUI_NonIsometricDlg.cxx +++ /dev/null @@ -1,186 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 CEA/DEN, EDF R&D -// -// -// -// File : SALOMEGUI_NonIsometricDlg.cxx -// Author : Vasily Rusyaev -// Module : VISU -// $Header$ - -#include "VisuGUI_NonIsometricDlg.h" - -#include "VisuGUI_Tools.h" - -#include "VISU_Actor.h" -#include "VISU_PipeLine.hxx" - -#include "SalomeApp_Application.h" -#include "LightApp_SelectionMgr.h" - -#include "SVTK_ViewWindow.h" -#include "SVTK_RenderWindowInteractor.h" - -#include "SUIT_Desktop.h" -#include "SUIT_Session.h" -#include "SUIT_ViewWindow.h" - -#include "SALOME_ListIteratorOfListIO.hxx" -#include "SALOME_ListIO.hxx" - -#include "QtxDblSpinBox.h" - -#include "utilities.h" - -#include -#include -#include -#include - -using namespace std; - -/*! - Constructor -*/ -VisuGUI_NonIsometricDlg::VisuGUI_NonIsometricDlg (QWidget* parent, const char* name, bool modal, WFlags fl) - : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) -{ - if (!name) - setName("NonIsometricDlg"); - setCaption(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); - - SVTK_ViewWindow* aViewWnd = VISU::GetViewWindow(); - - // Create layout for this dialog - QGridLayout* layoutDlg = new QGridLayout (this); - layoutDlg->setSpacing(6); - layoutDlg->setMargin(11); - - // Create croup box with grid layout - QGroupBox* GroupBox = new QGroupBox(this, "GroupBox"); - QGridLayout* glGroupBox = new QGridLayout(GroupBox); - glGroupBox->setMargin(11); - glGroupBox->setSpacing(6); - - // "X" scaling - QLabel* TextLabelX = new QLabel (tr("LBL_X"), GroupBox, "TextLabelX"); - m_sbXcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox); - m_sbXcoeff->setMinimumWidth(80); - m_sbXcoeff->setValue(1.0); - - // "Y" scaling - QLabel* TextLabelY = new QLabel (tr("LBL_Y"), GroupBox, "TextLabelY"); - m_sbYcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox); - m_sbYcoeff->setMinimumWidth(80); - m_sbYcoeff->setValue(1.0); - - // "Z" scaling - QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), GroupBox, "TextLabelZ"); - m_sbZcoeff = new QtxDblSpinBox(-DBL_MAX, DBL_MAX, 0.1, GroupBox); - m_sbZcoeff->setMinimumWidth(80); - m_sbZcoeff->setValue(1.0); - - // Get initial values from the current VTK viewer - if (aViewWnd) { - double aScaleFactor[3]; - aViewWnd->GetScale(aScaleFactor); - m_sbXcoeff -> setValue(aScaleFactor[0]); - m_sbYcoeff -> setValue(aScaleFactor[1]); - m_sbZcoeff -> setValue(aScaleFactor[2]); - } - - // Create button - m_bReset = new QPushButton(tr("&Reset"), GroupBox, "m_bReset"); - - // Layout widgets in the group box - glGroupBox->addWidget(TextLabelX, 0, 0); - glGroupBox->addWidget(m_sbXcoeff, 0, 1); - glGroupBox->addWidget(TextLabelY, 0, 2); - glGroupBox->addWidget(m_sbYcoeff, 0, 3); - glGroupBox->addWidget(TextLabelZ, 0, 4); - glGroupBox->addWidget(m_sbZcoeff, 0, 5); - glGroupBox->addWidget(m_bReset, 0, 6); - - // OK, CANCEL, Apply button - QGroupBox* aWgt = new QGroupBox(this); - QHBoxLayout* aHBoxLayout = new QHBoxLayout(aWgt); - aHBoxLayout->setMargin(11); - aHBoxLayout->setSpacing(6); - // Create button - QPushButton* m_bOk = new QPushButton(tr("O&K"), aWgt, "m_bOk"); - m_bOk->setDefault(TRUE); - m_bOk->setAutoDefault(TRUE); - // Create button - QPushButton* m_bApply = new QPushButton(tr("&Apply"), aWgt, "m_bApply"); - m_bApply->setAutoDefault(TRUE); - // Create button - QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aWgt, "m_bCancel"); - m_bCancel->setAutoDefault(TRUE); - - // Layout buttons - aHBoxLayout->addWidget(m_bOk); - aHBoxLayout->addWidget(m_bApply); - aHBoxLayout->addStretch(); - aHBoxLayout->addWidget(m_bCancel); - - // Layout top level widgets - layoutDlg->addWidget(GroupBox,0,0); - layoutDlg->addWidget(aWgt,1,0); - - // signals and slots connections - connect(m_bCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_bOk, SIGNAL(clicked()), this, SLOT(onClickOk())); - connect(m_bApply, SIGNAL(clicked()), this, SLOT(onClickApply())); - connect(m_bReset, SIGNAL(clicked()), this, SLOT(onClickReset())); - - this->resize(100, this->sizeHint().height()); -} - -/* - * Destroys the object and frees any allocated resources - */ -VisuGUI_NonIsometricDlg::~VisuGUI_NonIsometricDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -void VisuGUI_NonIsometricDlg::onClickOk() -{ - //apply changes - onClickApply(); - //Close dialog - accept(); -} - -void VisuGUI_NonIsometricDlg::onClickApply() -{ - SalomeApp_Application* anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); - LightApp_SelectionMgr* mgr = anApp->selectionMgr(); - - SVTK_ViewWindow* vf = VISU::GetViewWindow(); - if (!vf) - return; - - double aScale[3] = {m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value()}; - vf->SetScale(aScale); - - SALOME_ListIO selected; - mgr->selectedObjects(selected); - SALOME_ListIteratorOfListIO Itinit(selected); - - if (vf) - for (; Itinit.More(); Itinit.Next()) { - vf->highlight(Itinit.Value(), true); - } -} - -void VisuGUI_NonIsometricDlg::onClickReset() -{ - m_bReset->setFocus(); - m_sbXcoeff->setValue(1.0); - m_sbYcoeff->setValue(1.0); - m_sbZcoeff->setValue(1.0); -} diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index a7935632..04ba4334 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -30,12 +30,14 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VISU_ViewManager_i.hh" #include "VISU_Plot3DPL.hxx" -#include "SALOME_Actor.h" #include "SVTK_ViewWindow.h" + +#include "SALOME_Actor.h" #include "SUIT_Desktop.h" #include @@ -127,7 +129,7 @@ class TPlane : public SALOME_Actor //======================================================================= VisuGUI_Plot3DPane::VisuGUI_Plot3DPane (QWidget* parent) : QVBox(parent), myInitFromPrs(false), myPreviewActor(NULL), - myViewWindow(VISU::GetViewWindow()), myPrs(NULL), myPipeCopy(NULL) + myViewWindow(VISU::GetActiveViewWindow()), myPrs(NULL), myPipeCopy(NULL) { layout()->setAlignment(Qt::AlignTop); setSpacing(6); diff --git a/src/VISUGUI/VisuGUI_PopupTools.cxx b/src/VISUGUI/VisuGUI_PopupTools.cxx index b4ca7c20..68299777 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.cxx +++ b/src/VISUGUI/VisuGUI_PopupTools.cxx @@ -26,15 +26,17 @@ // Module : VISU #include "VisuGUI_PopupTools.h" + #include "VisuGUI_ViewTools.h" #include "VisuGUI_Tools.h" -#include "SalomeApp_Study.h" -#include "LightApp_Study.h" + +#include "VISU_Result_i.hh" #include "VISU_Actor.h" #include "VISU_ScalarMapAct.h" -#include "VISU_Result_i.hh" + #include "SalomeApp_Study.h" +#include "LightApp_Study.h" using namespace VISU; @@ -211,10 +213,10 @@ QString VisuGUI_Selection::representation( const int ind ) const { QString aResStr; - if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ){ - if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ){ + if (SVTK_ViewWindow* aView = GetActiveViewWindow(myModule)) { + if (VISU_Actor* anVISUActor = FindActor(aView, entry(ind).latin1())) { int aRepresent = anVISUActor->GetRepresentation(); - switch ( aRepresent ){ + switch (aRepresent) { ENUM2STRING( aResStr, VISU::POINT ); ENUM2STRING( aResStr, VISU::WIREFRAME ); ENUM2STRING( aResStr, VISU::SHADED ); @@ -278,8 +280,8 @@ namespace const QString& theEntry) { typedef typename TViewer::TViewWindow TViewWindow; - if(TViewWindow* aViewWindow = GetViewWindow(theModule)) - if(VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1())) + if (TViewWindow* aViewWindow = GetActiveViewWindow(theModule)) + if (VISU_Actor* anActor = FindActor(aViewWindow,theEntry.latin1())) return anActor->GetVisibility() ? "true" : "false"; return QString(); @@ -315,7 +317,7 @@ QString VisuGUI_Selection::isShrunk( const int ind ) const { QString aResStr; - if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ) + if ( SVTK_ViewWindow* aView = GetActiveViewWindow(myModule) ) if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ) if ( anVISUActor->IsShrunkable() ) aResStr = anVISUActor->IsShrunk() ? "1" : "0"; @@ -332,7 +334,7 @@ QString VisuGUI_Selection::isShading( const int ind ) const { QString aResStr; - if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ) + if ( SVTK_ViewWindow* aView = GetActiveViewWindow(myModule) ) if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ) if ( VISU_ScalarMapAct* anActor = dynamic_cast(anVISUActor) ) aResStr = anActor->IsShading() ? "1" : "0"; @@ -344,12 +346,12 @@ QString VisuGUI_Selection::isScalarMapAct( const int ind ) const { QString aResStr; - if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) ) + if ( SVTK_ViewWindow* aView = GetActiveViewWindow(myModule) ) if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ) - { - VISU_ScalarMapAct* anActor = dynamic_cast(anVISUActor); - aResStr = anActor ? "1" : "0"; - } - + { + VISU_ScalarMapAct* anActor = dynamic_cast(anVISUActor); + aResStr = anActor ? "1" : "0"; + } + return aResStr; } diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 7984a698..3fc626bb 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -24,7 +24,6 @@ // File : VisuGUI_Module.h // Author : // Module : VISU -// $Header$ #ifndef VisuGUI_Prs3dTools_HeaderFile #define VisuGUI_Prs3dTools_HeaderFile @@ -52,9 +51,10 @@ namespace VISU template void EditPrs3d(VisuGUI* theModule, - VISU::Prs3d_i* thePrs3d) + VISU::Prs3d_i* thePrs3d, + SVTK_ViewWindow* theViewWindow) { - if(TPrs3d_i* aPrs3d = dynamic_cast(thePrs3d)){ + if (TPrs3d_i* aPrs3d = dynamic_cast(thePrs3d)) { TDlg* aDlg = new TDlg (theModule); aDlg->initFromPrsObject(aPrs3d); if (runAndWait(aDlg,TIsDlgModal)) { @@ -65,18 +65,17 @@ namespace VISU try { aPrs3d->UpdateActors(); } catch (std::runtime_error& exc) { + aPrs3d->RemoveActors(); + INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); - - aPrs3d->RemoveActors(); } - typedef typename TViewer::TViewWindow TViewWindow; - if(TViewWindow* aViewWindow = GetViewWindow(theModule)){ - aViewWindow->getRenderer()->ResetCameraClippingRange(); - aViewWindow->Repaint(); + if (theViewWindow) { + theViewWindow->getRenderer()->ResetCameraClippingRange(); + theViewWindow->Repaint(); } // Optionally, create table and curves for cut lines QApplication::setOverrideCursor(Qt::waitCursor); @@ -93,10 +92,19 @@ namespace VISU template inline void - EditPrs3d(VisuGUI* theModule, - VISU::Prs3d_i* thePrs3d) + EditPrs3d(VisuGUI* theModule, + Handle(SALOME_InteractiveObject)& theIO, + VISU::Prs3d_i* thePrs3d, + SVTK_ViewWindow* theViewWindow = NULL) { - EditPrs3d(theModule,thePrs3d); + SVTK_ViewWindow* aViewWindow = theViewWindow; + if (!aViewWindow) + // Create SVTK_ViewWindow, if it does not exist + aViewWindow = GetViewWindow(theModule); + if (aViewWindow) { + EditPrs3d(theModule, thePrs3d, aViewWindow); + aViewWindow->highlight(theIO, 1); + } } //--------------------------------------------------------------- @@ -134,26 +142,30 @@ namespace VISU bool CreatePrs3d(VisuGUI* theModule, _PTR(SObject) theTimeStamp, - const Handle(SALOME_InteractiveObject)& theIO, - const bool theIsCreateView = false) + const Handle(SALOME_InteractiveObject)& theIO) { Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp); bool isExist; QString aType = Storable::FindValue(aMap,"myType",&isExist); - if(!isExist || aType.toInt() != TTIMESTAMP ) + if (!isExist || aType.toInt() != TTIMESTAMP ) return false; QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1(); QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1(); QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1(); QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1(); - // - int aPos = GetFreePositionOfDefaultScalarBar(theModule); - GetResourceMgr()->setValue("VISU","scalar_bar_position_num",aPos); - // + + // Create new TViewWindow instance, if it does not exist. + typedef typename TViewer::TViewWindow TViewWindow; + TViewWindow* aViewWindow = GetViewWindow(theModule); + + // Define free position for scalar bar. + int aPos = GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); + GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos); + QApplication::setOverrideCursor(Qt::waitCursor); - + TPrs3d_i* aPrs3d = CreatePrs3d(theModule, theTimeStamp, @@ -161,16 +173,16 @@ namespace VISU (Entity)anEntity.toInt(), aFieldName.latin1(), aTimeStampId.toInt()); - + QApplication::restoreOverrideCursor(); - if(aPrs3d){ + if (aPrs3d) { SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0); - if(!aValue){ - if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode + if (!aValue) { + if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode aDlg->initFromPrsObject(aPrs3d); - if(runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) { + if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) { // Optionally, create table and curves for cut lines QApplication::setOverrideCursor(Qt::waitCursor); CreateCurves( theModule, @@ -187,57 +199,60 @@ namespace VISU } } } - PublishInView(theModule,aPrs3d,true,theIsCreateView); - AddScalarBarPosition(theModule,aPrs3d,aPos); + // Display created presentation. + if (aViewWindow) { + PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true); + aViewWindow->onFitAll(); + + AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); + } return true; } return false; } - + //--------------------------------------------------------------- template inline void - CreatePrs3d(VisuGUI* theModule, - const bool theIsCreateView = true) + CreatePrs3d(VisuGUI* theModule) { if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule))) return; - + _PTR(SObject) aTimeStampSObj; Handle(SALOME_InteractiveObject) anIO; - if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO)) + if (!CheckTimeStamp(theModule,aTimeStampSObj,&anIO)) return; - - if(!CreatePrs3d(theModule,aTimeStampSObj,anIO,theIsCreateView)) + + // Create new TViewWindow instance, if it does not exist. + typedef typename TViewer::TViewWindow TViewWindow; + if (!GetViewWindow(theModule)) return; - + + if (!CreatePrs3d(theModule,aTimeStampSObj,anIO)) + return; + theModule->application()->putInfo(QObject::tr("INF_DONE")); - - typedef typename TViewer::TViewWindow TView; - if(TView* aView = GetViewWindow(theModule,theIsCreateView)) - aView->onFitAll(); } template inline void - CreatePrs3d(VisuGUI* theModule, - const bool theIsCreateView = true) + CreatePrs3d(VisuGUI* theModule) { - if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){ + if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) { QString aType = aViewManager->getType(); - if(aType == SVTK_Viewer::Type()) - CreatePrs3d(theModule,theIsCreateView); - else if(aType == VVTK_Viewer::Type()) - CreatePrs3d(theModule,theIsCreateView); + if (aType == VVTK_Viewer::Type()) + CreatePrs3d(theModule); + else + CreatePrs3d(theModule); } } - } #endif diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index ddc63e88..54c96b88 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -30,12 +30,10 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" - -#include "SVTK_FontWidget.h" - -#include "SVTK_ViewWindow.h" +#include "VisuGUI_ViewTools.h" #include "SVTK_ViewWindow.h" +#include "SVTK_FontWidget.h" #include "VISUConfig.hh" #include "VISU_Convertor.hxx" @@ -62,8 +60,20 @@ using namespace std; VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref): QVBox(parent), myPreviewActor(0) { - myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80; - myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12; + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + QString propertyName; + propertyName = QString("scalar_bar_vertical_"); + myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", myVerX); + myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", myVerY); + myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", myVerW); + myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",myVerH); + + propertyName = QString("scalar_bar_horizontal_"); + myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", myHorX); + myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", myHorY); + myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", myHorW); + myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",myHorH); + Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0; myRangeMode = -1; @@ -622,7 +632,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { void VisuGUI_ScalarBarPane::updatePreview() { if (myPreviewCheck->isChecked()) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { deleteScalarBar(); createScalarBar(); vf->Repaint(); @@ -634,11 +644,11 @@ void VisuGUI_ScalarBarPane::updatePreview() */ void VisuGUI_ScalarBarPane::createScalarBar() { - if (VISU::GetViewWindow() == NULL) return; + if (VISU::GetActiveViewWindow() == NULL) return; if (myPreviewActor != 0) return; if (myScalarMap == NULL) return; - if(!check()) return; + if (!check()) return; if ( myBusy ) return; @@ -725,7 +735,7 @@ void VisuGUI_ScalarBarPane::createScalarBar() aScalarBarActor->Modified(); - VISU::GetViewWindow()->AddActor(myPreviewActor); + VISU::GetActiveViewWindow()->AddActor(myPreviewActor); myBusy = false; } @@ -736,7 +746,7 @@ void VisuGUI_ScalarBarPane::deleteScalarBar() if ( myBusy ) return; if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()){ + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()){ vf->RemoveActor(myPreviewActor); myPreviewActor->GetScalarBar()->VisibilityOff(); } @@ -1033,7 +1043,7 @@ void VisuGUI_ScalarBarPane::onTextPref() void VisuGUI_ScalarBarPane::onPreviewCheck (bool thePreview) { - if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) { + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { if (thePreview) { createScalarBar(); } else { diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index ccb1c573..54f79c9c 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -26,19 +26,23 @@ // Module : VISU #include "VisuGUI_ScalarMapOnDeformedShapeDlg.h" + #include "VisuGUI_Tools.h" + #include "VISU_Result_i.hh" #include "VISU_ScalarMapOnDeformedShape_i.hh" + +#include "VISU_ScalarMapPL.hxx" #include "VISU_ScalarMapOnDeformedShapePL.hxx" + +#include "VISU_Convertor.hxx" + #include "SalomeApp_Module.h" #include "LightApp_SelectionMgr.h" #include "SUIT_Desktop.h" -#include "VISU_ScalarMapPL.hxx" #include "SALOME_ListIO.hxx" -#include "VISU_Convertor.hxx" - #include "SALOMEDSClient_AttributeComment.hxx" #include "SALOMEDSClient_AttributeName.hxx" @@ -55,6 +59,7 @@ using namespace std; VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule) : QDialog(VISU::GetDesktop(theModule), "VisuGUI_ScalarMapOnDeformedShapeDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + myIsAnimation(false), myVisuGUI(theModule) { myPrs = NULL; @@ -94,14 +99,14 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome TopGroupLayout->addWidget(FieldLabel, 1, 0); TopGroupLayout->addWidget(myFieldsCombo,1,1); - + // TimeStamps combo box QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel"); myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp"); TopGroupLayout->addWidget(TimeStampLabel, 2, 0); TopGroupLayout->addWidget(myTimeStampsCombo,2,1); - + // aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB")); @@ -143,23 +148,24 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int))); connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int))); - } -void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim) +void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject + (VISU::ScalarMapOnDeformedShape_i* thePrs, bool isAnim) { + myIsAnimation = isAnim; myPrs = thePrs; - setFactor(thePrs->GetScale()); + setFactor(myPrs->GetScale()); myTimeStampsCombo->setDisabled(isAnim); - - QString aFieldName(thePrs->GetScalarFieldName()); - float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(), - thePrs->GetScalarFieldName().c_str(), - thePrs->GetScalarIteration(), - thePrs->GetScalarEntity()); + + QString aFieldName(myPrs->GetScalarFieldName()); + float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), + myPrs->GetScalarFieldName().c_str(), + myPrs->GetScalarIteration(), + myPrs->GetScalarEntity()); QString aIteration(QString("%1").arg(aIterFloat)); - + if (myMeshFieldsTimes.size() == 0) { // find all fields and time stamps on it @@ -171,67 +177,109 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe Handle(SALOME_InteractiveObject) aIO = selected.First(); if (aIO->hasEntry()) { _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); + + _PTR(GenericAttribute) anTmpAttr; + if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) { + _PTR(AttributeComment) aTmpComment (anTmpAttr); + string aTmpComm = aTmpComment->Value(); + QString aTmpstrIn (aTmpComm.c_str()); + VISU::Storable::TRestoringMap aTmpaMap; + VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap); + bool aTmpisExist; + VISU::VISUType aTmpType = + (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt(); + switch(aTmpType){ + case VISU::TTIMESTAMP: + { + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + break; + } + case VISU::TFIELD: + { + _PTR(SObject) newSObject; + if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject; + aSObject = aSObject->GetFather(); + break; + } + case VISU::TANIMATION: + { + _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject); + for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) { + _PTR(SObject) aTmpChildSObj = aTmpIter->Value(); + _PTR(SObject) newSObject; + if(aTmpChildSObj->ReferencedObject(newSObject)){ + aSObject = newSObject; + aSObject->GetFather(); + break; + } + } + break; + } + } + } + aSObject = aSObject->GetFather(); aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); + mySelectionObj = aSObject; CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); - VISU::Result_var aResult; if (CORBA::is_nil(anObject)) { mySelectionObj = mySelectionObj->GetFather(); } - _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); - - for (aIter->InitEx(true); aIter->More(); aIter->Next()) { - _PTR(SObject) aChildSObj = aIter->Value(); - CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); - - _PTR(GenericAttribute) anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); - string aComm = aComment->Value(); - QString strIn (aComm.c_str()); - VISU::Storable::TRestoringMap aMap; - VISU::Storable::StrToMap(strIn,aMap); - bool isExist; - VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); - if (isExist) { - if ((aType == VISU::TTIMESTAMP)) { - _PTR(GenericAttribute) aNameAttr; - if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) { - _PTR(AttributeName) aName (aNameAttr); - VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); - QString aMeshName = VISU::getValue(aChildSObj,"myMeshName"); - if(QString(thePrs->GetMeshName().c_str()) != aMeshName) continue; - myCurrMeshName = aMeshName; - QString aFieldName = VISU::getValue(aChildSObj,"myFieldName"); - QString aTimeIter = VISU::getValue(aChildSObj,"myTimeStampId"); - QString aEntity = VISU::getValue(aChildSObj,"myEntityId"); - VISU::TEntity anEntity; - switch(aEntity.toInt()){ - case 0: anEntity = VISU::NODE_ENTITY; break; - case 1: anEntity = VISU::EDGE_ENTITY; break; - case 2: anEntity = VISU::FACE_ENTITY; break; - case 3: anEntity = VISU::CELL_ENTITY; break; - } - TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()]; - TFE aKey(aFieldName.latin1(),anEntity); - aFieldsMap[aKey][aTimeIter.toInt()] = - GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), - aFieldName.latin1(), - aTimeIter.toInt(), - anEntity); - } - } - } - } - } } } - - AddAllFieldNames(); + if (mySelectionObj) { + _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); + + for (aIter->InitEx(true); aIter->More(); aIter->Next()) { + _PTR(SObject) aChildSObj = aIter->Value(); + CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); + + _PTR(GenericAttribute) anAttr; + if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { + _PTR(AttributeComment) aComment (anAttr); + string aComm = aComment->Value(); + QString strIn (aComm.c_str()); + VISU::Storable::TRestoringMap aMap; + VISU::Storable::StrToMap(strIn,aMap); + bool isExist; + VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); + if (isExist) { + if ((aType == VISU::TTIMESTAMP)) { + _PTR(GenericAttribute) aNameAttr; + if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) { + _PTR(AttributeName) aName (aNameAttr); + VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); + QString aMeshName = VISU::getValue(aChildSObj, "myMeshName"); + if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue; + myCurrMeshName = aMeshName; + QString aFieldName = VISU::getValue(aChildSObj, "myFieldName"); + QString aTimeIter = VISU::getValue(aChildSObj, "myTimeStampId"); + QString aEntity = VISU::getValue(aChildSObj, "myEntityId"); + VISU::TEntity anEntity; + switch (aEntity.toInt()) { + case 0: anEntity = VISU::NODE_ENTITY; break; + case 1: anEntity = VISU::EDGE_ENTITY; break; + case 2: anEntity = VISU::FACE_ENTITY; break; + case 3: anEntity = VISU::CELL_ENTITY; break; + } + TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()]; + TFE aKey (aFieldName.latin1(), anEntity); + aFieldsMap[aKey][aTimeIter.toInt()] = + GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), + aFieldName.latin1(), + aTimeIter.toInt(), + anEntity); + } + } + } + } + } + } + + AddAllFieldNames(); } myFieldsCombo->setCurrentText(aFieldName); AddAllTimes(myFieldsCombo->currentText()); @@ -241,21 +289,28 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe myScalarPane->initFromPrsObject(myPrs); } -int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalar) { - +int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject + (VISU::ScalarMapOnDeformedShape_i* thePrs, bool theUpdateScalars, int theIter) +{ thePrs->SetScale(getFactor()); - - thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(), - myPrs->GetScalarFieldName().c_str(), - myPrs->GetScalarIteration(), - myPrs->GetScalarEntity()); - if (theUpdateScalar) SetScalarField(); + if (myIsAnimation) + thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(), + getCurrentScalarFieldName().latin1(), + theIter, + myPrs->GetScalarEntity()); + else + thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(), + getCurrentScalarFieldName().latin1(), + myTimeStampsCombo->currentItem() + 1, + myPrs->GetScalarEntity()); + + if (theUpdateScalars) SetScalarField(); thePrs->ShowColored(true); myScalarPane->storeToPrsObject(thePrs); - + myPrs = thePrs; return 1; @@ -304,7 +359,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString the aFieldName.latin1(), theIter, anEntity); - + myScalarPane->storeToPrsObject(myPrs); UpdateScalarField(); diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index bf588c9e..6bc817c6 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -63,7 +63,7 @@ public: void initFromPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool isAnim=false); - int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalar=true); + int storeToPrsObject(VISU::ScalarMapOnDeformedShape_i* thePrs,bool theUpdateScalars=true,int theIter=1); int getCurrentScalarFieldNamePos(); QString getCurrentScalarFieldName(); @@ -92,6 +92,8 @@ private: TMF myMeshFieldsTimes; QString myCurrMeshName; + int myCurrScalarIter; + bool myIsAnimation; _PTR(SObject) mySelectionObj; VISU::ScalarMapOnDeformedShape_i* myPrs; diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 5bcf465f..371d50a5 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -30,6 +30,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VISU_Actor.h" #include "VISU_PrsObject_i.hh" @@ -49,7 +50,6 @@ #include "SALOME_ListIteratorOfListIO.hxx" #include "SVTK_ViewWindow.h" -#include "SVTK_ViewModel.h" #include "SVTK_Selector.h" #include "utilities.h" @@ -263,7 +263,7 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule): // Activate Points pane myWidgetStack->raiseWidget(myPointsPane); - if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)) + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myModule)) aViewWindow->SetSelectionMode(NodeSelection); onSelectionEvent(); @@ -276,7 +276,7 @@ VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg() void VisuGUI_SelectionDlg::onSelectionChange (int theId) { - SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule); + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myModule); if (!aViewWindow) return; switch (theId) { @@ -300,11 +300,10 @@ void VisuGUI_SelectionDlg::onSelectionChange (int theId) void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent) { - if( mySelectionDlg ) - { + if (mySelectionDlg) { mySelectionDlg = NULL; disconnect(mySelectionMgr,0,0,0); - if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)){ + if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myModule)) { switch(aViewWindow->SelectionMode()){ case NodeSelection: case CellSelection: @@ -337,10 +336,10 @@ template QString getVector(TData* theData, int theId){ #define ABS(a) (a>=0)?a:-a void VisuGUI_SelectionDlg::onSelectionEvent() { - SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule); + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myModule); if (!aViewWindow) return; - switch(aViewWindow->SelectionMode()){ + switch (aViewWindow->SelectionMode()) { case NodeSelection: case CellSelection: case ActorSelection: @@ -538,7 +537,7 @@ bool onIdEdit (const QString& theText, QLabel* theFieldName) { SalomeApp_Application* anApp = theModule->getApp(); - SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theModule); + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(theModule); if (!aViewWindow) return false; SVTK_Selector* aSelector = aViewWindow->GetSelector(); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index aba09d66..e6fa3cc2 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -82,8 +82,7 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int))); - // Find All prs obj - //SUIT_Study* aActiveStudy = VISU::(myVisuGUI); + // Find all fields and time stamps on it _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI)); LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI); SALOME_ListIO selected; @@ -92,71 +91,114 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) Handle(SALOME_InteractiveObject) aIO = selected.First(); if (aIO->hasEntry()) { _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); + + _PTR(GenericAttribute) anTmpAttr; + if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) { + _PTR(AttributeComment) aTmpComment (anTmpAttr); + string aTmpComm = aTmpComment->Value(); + QString aTmpstrIn (aTmpComm.c_str()); + VISU::Storable::TRestoringMap aTmpaMap; + VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap); + bool aTmpisExist; + VISU::VISUType aTmpType = + (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt(); + switch (aTmpType) { + case VISU::TTIMESTAMP: + { + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + break; + } + case VISU::TFIELD: + { + _PTR(SObject) newSObject; + if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject; + aSObject = aSObject->GetFather(); + break; + } + case VISU::TANIMATION: + { + _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject); + for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) { + _PTR(SObject) aTmpChildSObj = aTmpIter->Value(); + _PTR(SObject) newSObject; + if(aTmpChildSObj->ReferencedObject(newSObject)){ + aSObject = newSObject; + aSObject->GetFather(); + break; + } + } + break; + } + } + } + aSObject = aSObject->GetFather(); aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); + mySelectionObj = aSObject; CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); - VISU::Result_var aResult; if (CORBA::is_nil(anObject)) { mySelectionObj = mySelectionObj->GetFather(); } - _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); - - for (aIter->InitEx(true); aIter->More(); aIter->Next()) { - _PTR(SObject) aChildSObj = aIter->Value(); - CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); - - if (!CORBA::is_nil(aChildObject)) { - VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); - if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object - if ((aPrsObj->GetType() != VISU::TSTREAMLINES) && - (aPrsObj->GetType() != VISU::TMESH)) { - _PTR(GenericAttribute) anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeName")) { - _PTR(AttributeName) aName (anAttr); - myPrsLst += QString(aName->Value().c_str()); - myPrsList.append(aPrsObj); - continue; - } - } - } - } - // else { // This is not a Prs object - _PTR(GenericAttribute) anAttr; - if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - _PTR(AttributeComment) aComment (anAttr); - string aComm = aComment->Value(); - QString strIn (aComm.c_str()); - VISU::Storable::TRestoringMap aMap; - VISU::Storable::StrToMap(strIn,aMap); - bool isExist; - VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); - if (isExist) { - if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) { - _PTR(GenericAttribute) aNameAttr; - if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) { - _PTR(AttributeName) aName (aNameAttr); - VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); - switch (aType) { - case VISU::TFAMILY: - myFamilisLst += QString(aName->Value().c_str()); - myFamilyList.append(aPrsObj); - break; - case VISU::TGROUP: - myGroupsLst += QString(aName->Value().c_str()); - myGroupList.append(aPrsObj); - break; - case VISU::TENTITY: - myEntitiesLst += QString(aName->Value().c_str()); - myEntityList.append(aPrsObj); - break; - } - } - } - } - } + } + } + + if (mySelectionObj) { + _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); + + for (aIter->InitEx(true); aIter->More(); aIter->Next()) { + _PTR(SObject) aChildSObj = aIter->Value(); + CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); + + if (!CORBA::is_nil(aChildObject)) { + VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); + if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object + if ((aPrsObj->GetType() != VISU::TSTREAMLINES) && + (aPrsObj->GetType() != VISU::TMESH)) { + _PTR(GenericAttribute) anAttr; + if (aChildSObj->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName (anAttr); + myPrsLst += QString(aName->Value().c_str()); + myPrsList.append(aPrsObj); + continue; + } + } + } + } + + _PTR(GenericAttribute) anAttr; + if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { + _PTR(AttributeComment) aComment (anAttr); + string aComm = aComment->Value(); + QString strIn (aComm.c_str()); + VISU::Storable::TRestoringMap aMap; + VISU::Storable::StrToMap(strIn,aMap); + bool isExist; + VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); + if (isExist) { + if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) { + _PTR(GenericAttribute) aNameAttr; + if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) { + _PTR(AttributeName) aName (aNameAttr); + VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); + switch (aType) { + case VISU::TFAMILY: + myFamilisLst += QString(aName->Value().c_str()); + myFamilyList.append(aPrsObj); + break; + case VISU::TGROUP: + myGroupsLst += QString(aName->Value().c_str()); + myGroupList.append(aPrsObj); + break; + case VISU::TENTITY: + myEntitiesLst += QString(aName->Value().c_str()); + myEntityList.append(aPrsObj); + break; + } + } + } + } } } } @@ -244,7 +286,6 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) } - void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs) { myScalarPane->initFromPrsObject(thePrs); diff --git a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx b/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx deleted file mode 100644 index 48ec2dcf..00000000 --- a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx +++ /dev/null @@ -1,161 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_SweepPrefDlg.cxx -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -using namespace std; -#include "VisuGUI_SweepPrefDlg.h" -#include - -/*! - Constructor -*/ -VisuGUI_SweepPrefDlg::VisuGUI_SweepPrefDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) -{ - if (!name) - setName("VisuGUI_SweepPrefDlg"); - setCaption(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout( this ); - TopLayout->setSpacing( 6 ); - TopLayout->setMargin( 11 ); - - TopGroup = new QGroupBox( this, "TopGroup" ); - TopGroup->setColumnLayout(0, Qt::Vertical ); - TopGroup->layout()->setSpacing( 0 ); - TopGroup->layout()->setMargin( 0 ); - QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() ); - TopGroupLayout->setAlignment( Qt::AlignTop ); - TopGroupLayout->setSpacing( 6 ); - TopGroupLayout->setMargin( 11 ); - - TimeLabel = new QLabel (tr("LBL_TIME_STEP"), TopGroup, "TimeLabel"); - TimeSpin = new QtxDblSpinBox( 0.1, 1000.0, 0.1, TopGroup ); - TimeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - TimeSpin->setMinimumSize( 70, 0 ); - TimeSpin->setValue( 0.2 ); - - CyclesLabel = new QLabel (tr("LBL_NB_CYCLES"), TopGroup, "CyclesLabel"); - CyclesSpin = new QSpinBox( 1, 100, 1, TopGroup, "CyclesSpin" ); - CyclesSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - CyclesSpin->setMinimumSize( 70, 0 ); - CyclesSpin->setValue( 1 ); - - StepsLabel = new QLabel (tr("LBL_NB_STEPS"), TopGroup, "StepsLabel"); - StepsSpin = new QSpinBox( 1, 200, 1, TopGroup, "StepsSpin" ); - StepsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - StepsSpin->setMinimumSize( 70, 0 ); - StepsSpin->setValue( 20 ); - - TopGroupLayout->addWidget( TimeLabel, 0, 0 ); - TopGroupLayout->addWidget( TimeSpin, 0, 1 ); - TopGroupLayout->addWidget( CyclesLabel, 1, 0 ); - TopGroupLayout->addWidget( CyclesSpin, 1, 1 ); - TopGroupLayout->addWidget( StepsLabel, 2, 0 ); - TopGroupLayout->addWidget( StepsSpin, 2, 1 ); - - GroupButtons = new QGroupBox( this, "GroupButtons" ); - GroupButtons->setColumnLayout(0, Qt::Vertical ); - GroupButtons->layout()->setSpacing( 0 ); - GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonOk, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); - buttonCancel->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); - - TopLayout->addWidget( TopGroup, 0, 0); - TopLayout->addWidget( GroupButtons, 1, 0 ); - - // signals and slots connections =========================================== - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); -} - -/*! - Destructor -*/ -VisuGUI_SweepPrefDlg::~VisuGUI_SweepPrefDlg() -{ -} - -/*! - Sets Time step -*/ -void VisuGUI_SweepPrefDlg::setTimeStep( double step ) -{ - TimeSpin->setValue( step ); -} - -/*! - Gets Time step -*/ -double VisuGUI_SweepPrefDlg::getTimeStep() -{ - return TimeSpin->value(); -} - -/*! - Sets Nb of cycles -*/ -void VisuGUI_SweepPrefDlg::setNbCycles( int nbc ) -{ - CyclesSpin->setValue( nbc ); -} - -/*! - Gets Nb of cycles -*/ -int VisuGUI_SweepPrefDlg::getNbCycles() -{ - return CyclesSpin->value(); -} - -/*! - Sets Nb of Steps -*/ -void VisuGUI_SweepPrefDlg::setNbSteps( int nbs ) -{ - StepsSpin->setValue( nbs ); -} - -/*! - Gets Nb of Steps -*/ -int VisuGUI_SweepPrefDlg::getNbSteps() -{ - return StepsSpin->value(); -} diff --git a/src/VISUGUI/VisuGUI_SweepPrefDlg.h b/src/VISUGUI/VisuGUI_SweepPrefDlg.h deleted file mode 100644 index 6179c111..00000000 --- a/src/VISUGUI/VisuGUI_SweepPrefDlg.h +++ /dev/null @@ -1,67 +0,0 @@ -// VISU VISUGUI : GUI of VISU component -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : VisuGUI_SweepPrefDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND -// Module : VISU -// $Header$ - -#ifndef VISUGUI_SWEEPPREFDLG_H -#define VISUGUI_SWEEPPREFDLG_H - -#include -#include -#include -#include -#include -#include "QtxDblSpinBox.h" - -class VisuGUI_SweepPrefDlg : public QDialog -{ - Q_OBJECT - -public: - VisuGUI_SweepPrefDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - ~VisuGUI_SweepPrefDlg(); - - void setTimeStep( double step ); - double getTimeStep(); - void setNbCycles( int nbc ); - int getNbCycles(); - void setNbSteps ( int nbs ); - int getNbSteps (); - -private: - QGroupBox* TopGroup; - QLabel* TimeLabel; - QtxDblSpinBox* TimeSpin; - QLabel* CyclesLabel; - QSpinBox* CyclesSpin; - QLabel* StepsLabel; - QSpinBox* StepsSpin; - QGroupBox* GroupButtons; - QPushButton* buttonOk; - QPushButton* buttonCancel; -}; - -#endif // VISUGUI_SWEEPPREFDLG_H diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 476721a5..de4de17e 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -12,6 +12,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" #include "VisuGUI_DeformedShapeDlg.h" #include "VisuGUI_CutPlanesDlg.h" #include "VisuGUI_CutLinesDlg.h" @@ -68,15 +69,17 @@ #define MAXVAL 1e10 ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator) - : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myAnimator(theAnimator), myViewWindow(theAnimator->getViewer()) + : QDialog(theParent, "ArrangeDlg", true, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + myAnimator(theAnimator), + myViewWindow(theAnimator->getViewer()) { myCurrent = 0; init(); QStringList aFieldNames; // Find names of fields - for (int i = 0; i < theAnimator->getNbFields(); i++) { - aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName")); + for (int i = 0; i < myAnimator->getNbFields(); i++) { + aFieldNames.append(VISU::getValue(myAnimator->getFieldData(i).myField, "myName")); Offset aOffs; aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0]; aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1]; @@ -90,7 +93,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator) ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow) : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myAnimator(0), myViewWindow(theViewWindow) + myAnimator(NULL), myViewWindow(theViewWindow) { myCurrent = 0; init(); @@ -242,7 +245,7 @@ void ArrangeDlg::init() void ArrangeDlg::accept() { - if (myAnimator) { + if (myAnimator != NULL) { acceptAnimation(); } else { acceptViewWindow(); @@ -456,6 +459,7 @@ SetupDlg::SetupDlg (QWidget* theParent, QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6); aMainLayout->setSpacing(5); + // Range of time stamps QFrame* aRangeGrp = new QFrame(this); QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp ); aRangeLayout->setSpacing( 6 ); @@ -466,16 +470,19 @@ SetupDlg::SetupDlg (QWidget* theParent, aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3); myUseRangeChk->setChecked(myAnimator->isRangeDefined()); + double aMaxTime = myAnimator->getMaxTime(); + double aMinTime = myAnimator->getMinTime(); + double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1); + QLabel* aMinLbl = new QLabel("From", aRangeGrp); aMinLbl->setEnabled(myUseRangeChk->isChecked()); aRangeLayout->addWidget(aMinLbl, 1, 0); - double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1); - myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp ); + myMinVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp ); myMinVal->setEnabled(myUseRangeChk->isChecked()); if (myUseRangeChk->isChecked()) myMinVal->setValue( myAnimator->getMinRange() ); else - myMinVal->setValue( myAnimator->getMinTime() ); + myMinVal->setValue( aMinTime ); connect(myMinVal, SIGNAL( valueChanged(double)), this, SLOT( onMinValue(double) )); @@ -484,12 +491,12 @@ SetupDlg::SetupDlg (QWidget* theParent, QLabel* aMaxLbl = new QLabel("To", aRangeGrp); aMaxLbl->setEnabled(myUseRangeChk->isChecked()); aRangeLayout->addWidget(aMaxLbl, 1, 2); - myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp ); + myMaxVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp ); myMaxVal->setEnabled(myUseRangeChk->isChecked()); if (myUseRangeChk->isChecked()) myMaxVal->setValue( myAnimator->getMaxRange() ); else - myMaxVal->setValue( myAnimator->getMaxTime() ); + myMaxVal->setValue( aMaxTime ); connect(myMaxVal, SIGNAL( valueChanged(double)), this, SLOT( onMaxValue(double) )); @@ -505,6 +512,7 @@ SetupDlg::SetupDlg (QWidget* theParent, aMainLayout->addWidget(aRangeGrp); + // Fields and Properties QHBox* aPropFrame = new QHBox(this); aPropFrame->setSpacing(5); @@ -512,8 +520,8 @@ SetupDlg::SetupDlg (QWidget* theParent, myFieldLst = new QListBox(aNamesBox); QStringList aFieldNames; // Find names of fields - for (int i = 0; i < theAnimator->getNbFields(); i++) { - _PTR(SObject) aSO = theAnimator->getFieldData(i).myField; + for (int i = 0; i < myAnimator->getNbFields(); i++) { + _PTR(SObject) aSO = myAnimator->getFieldData(i).myField; aFieldNames.append(VISU::getValue(aSO, "myName")); } myFieldLst->insertStringList(aFieldNames); @@ -536,7 +544,7 @@ SetupDlg::SetupDlg (QWidget* theParent, // this, SLOT( onScalarBarDlg() ) ); myPropBtn = new QPushButton("Properties...", aPropBox); - // myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP); + // myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP); connect( myPropBtn, SIGNAL( clicked() ), this, SLOT( onPreferencesDlg() ) ); @@ -647,7 +655,7 @@ void SetupDlg::onFieldChange (int theIndex) myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]); break; case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape - myTypeCombo->setCurrentItem(TSCALARMAPONDEFORMEDSHAPE_ITEM); + myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]); break; case VISU::TVECTORS: //Vectors myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]); @@ -766,13 +774,13 @@ void SetupDlg::onPreferencesDlg() if (aDlg->exec()) { int anbFrames=aDlg->getCurrentScalarNbIterations(); + int aIter = 0; for (int i = 0; i < aData.myNbFrames; i++){ TYPE* aCurrPrs_i = dynamic_cast(aData.myPrs[i]); + aIter = i+1; if(i+1 > anbFrames) - aDlg->SetScalarField(anbFrames); - else - aDlg->SetScalarField(i+1); - aDlg->storeToPrsObject(aCurrPrs_i,false); + aIter=anbFrames; + aDlg->storeToPrsObject(aCurrPrs_i,false,aIter); } } delete aDlg; @@ -970,7 +978,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu myAnimator = new VISU_TimeAnimation (theStudy); myAnimator->setSpeed(1); - myAnimator->setViewer(VISU::GetViewWindow(theModule)); + myAnimator->setViewer(VISU::GetActiveViewWindow(theModule)); connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double))); connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop())); @@ -1148,6 +1156,9 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu SUIT_Study* aStudy = VISU::GetAppStudy(myModule); connect(aStudy, SIGNAL(destroyed()), this, SLOT(close())); + connect(myAnimator->getViewer(), SIGNAL(destroyed()), this, SLOT(close())); + connect(myAnimator->getViewer(), SIGNAL(closing(SUIT_ViewWindow*)), this, SLOT(close())); + aMainLayout->addWidget(aBtnBox); myPlayFrame->setEnabled(false); @@ -1156,7 +1167,10 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu //------------------------------------------------------------------------ VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg() { - delete myAnimator; + if(myAnimator != NULL){ + delete myAnimator; + myAnimator = NULL; + } } //------------------------------------------------------------------------ @@ -1272,11 +1286,23 @@ void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent) //------------------------------------------------------------------------ void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent) { - myAnimator->stopAnimation(); - myAnimator->wait(500); - if (myAnimator->running() && (! myAnimator->finished())) { - isClosing = true; - myEvent = theEvent; + if(myAnimator != NULL){ + myAnimator->stopAnimation(); + myAnimator->wait(500); + if (myAnimator->running() && (! myAnimator->finished())) { + isClosing = true; + myEvent = theEvent; + // * Destroing data in myAnimator before study closed. + // * It needed for correcting destroing of myAnimator, which + // * depend from SVTK_RenderWindowInteractor() e.t.c. + if(theEvent->type() == QEvent::Close){ + for (int i = 0; i < myAnimator->getNbFields(); i++) + myAnimator->clearData(myAnimator->getFieldData(i)); + myAnimator->clearFieldData(); + } + } else { + QDialog::closeEvent(theEvent); + } } else { QDialog::closeEvent(theEvent); } diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 978a4c24..757b1749 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -28,6 +28,9 @@ #include "VisuGUI_Tools.h" +#include "VisuGUI.h" +#include "VisuGUI_ViewTools.h" + #include "VISU_Gen_i.hh" #include "VISU_Prs3d_i.hh" #include "VISU_Result_i.hh" @@ -42,15 +45,15 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" -#include "OB_Browser.h" #include "LightApp_DataObject.h" #include "LightApp_SelectionMgr.h" +#include "OB_Browser.h" + #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" #include "SVTK_ViewWindow.h" -#include "SVTK_ViewModel.h" #include "SVTK_Functor.h" #include "VTKViewer_Algorithm.h" @@ -61,8 +64,6 @@ #include "SUIT_Session.h" #include "SUIT_MessageBox.h" -#include "VisuGUI.h" - #include #include @@ -366,6 +367,11 @@ namespace VISU for (; anIter.More(); anIter.Next()) { Handle(SALOME_InteractiveObject) anIO = anIter.Value(); if (anIO->hasEntry()) { + + // asv : if selected object is a Save Point object selected in object browser - return false + if ( QString( anIO->getEntry() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) ) + return false; + _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry()); VISU::Storable::TRestoringMap pMap; if (aSObject) { @@ -421,49 +427,6 @@ namespace VISU return true; } - // Display/Erase - - void - ErasePrs (const SalomeApp_Module* theModule, - CORBA::Object_ptr theObject, bool theUpdate) - { - if (!CORBA::is_nil(theObject)) { - VISU::Base_var aBase = VISU::Base::_narrow(theObject); - if (CORBA::is_nil(aBase)) return; - VISU::VISUType aType = aBase->GetType(); - switch (aType) { - case VISU::TCURVE: - { - if (VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(aBase).in())) - PlotCurve(theModule, aCurve, VISU::eErase ); - break; - } - case VISU::TCONTAINER: - { - if (VISU::Container_i* aContainer = dynamic_cast(VISU::GetServant(aBase).in())) - PlotContainer(theModule, aContainer, VISU::eErase ); - break; - } - case VISU::TTABLE: - { - if (VISU::Table_i* aTable = dynamic_cast(VISU::GetServant(aBase).in())) - PlotTable(theModule, aTable, VISU::eErase ); - break; - } - default: - { - if (VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(aBase).in())) { - ErasePrs3d(theModule, aPrsObject); - if (theUpdate) { - if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) - vw->Repaint(); - } - } - } - } // switch (aType) - } - } - void DeleteSObject(VisuGUI* theModule, _PTR(Study) theStudy, @@ -472,16 +435,13 @@ namespace VISU _PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject); for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { _PTR(SObject) aChildSObject = aChildIter->Value(); - CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject); - RemoveScalarBarPosition(theModule,aChildObj); - ErasePrs(theModule, aChildObj); + ErasePrs(theModule, aChildObj, /*repaint_view_window = */false); } CORBA::Object_var anObj = VISU::ClientSObjectToObject(theSObject); if (!CORBA::is_nil(anObj)) { - RemoveScalarBarPosition(theModule,anObj); - ErasePrs(theModule, anObj); + ErasePrs(theModule, anObj, /*repaint_view_window = */true); VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj); if (!CORBA::is_nil(aRemovableObject)) { @@ -506,19 +466,10 @@ namespace VISU if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule))) return; - RemoveScalarBarPosition(theModule,thePrs); - thePrs->RemoveFromStudy(); - } + SVTK_ViewWindow* vw = GetActiveViewWindow(theModule); + RemoveScalarBarPosition(theModule, vw, thePrs); - void - ErasePrs3d(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs) - { - if ( SVTK_ViewWindow* vw = GetViewWindow( theModule ) ){ - if (VISU_Actor* anVISUActor = FindActor( vw, thePrs )) { - anVISUActor->VisibilityOff(); - } - } + thePrs->RemoveFromStudy(); } // Presentation management @@ -527,8 +478,8 @@ namespace VISU ChangeRepresentation (const SalomeApp_Module* theModule, VISU::PresentationType theType) { - SVTK_ViewWindow* vw = GetViewWindow( theModule, false ); - if( !vw ) + SVTK_ViewWindow* vw = GetActiveViewWindow(theModule); + if (!vw) return; Handle(SALOME_InteractiveObject) anIO; @@ -563,17 +514,15 @@ namespace VISU } } } - + void SetShading ( const SalomeApp_Module* theModule, bool theOn ) { - SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type()); - if (!aView) return; - SVTK_ViewWindow* vw = dynamic_cast( aView ); - if( !vw ) + SVTK_ViewWindow* vw = GetActiveViewWindow(theModule); + if (!vw) return; - + Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO); if (CORBA::is_nil(anObject)) return; @@ -654,167 +603,30 @@ namespace VISU return dynamic_cast(VISU::GetServant(anObject).in()); } - // Views - - SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType) - { - if(SalomeApp_Application* anApp = theModule->getApp()){ - if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){ - if (!theType.isNull()) { - if (aViewManager->getType() != theType) - return 0; - } - return aViewManager->getActiveView(); - } - } - return 0; - } - // VTK View - TViewWindows - GetViews(const SalomeApp_Module* theModule) - { - TViewWindows aViewWindows; - if(SalomeApp_Application* anApp = theModule->getApp()){ - ViewManagerList aViewManagerList; - anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList); - QPtrListIterator anIter(aViewManagerList); - while(SUIT_ViewManager* aViewManager = anIter.current()){ - QPtrVector aViews = aViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) - if(SVTK_ViewWindow* aView = dynamic_cast(aViewWindow)) - aViewWindows.push_back(aView); - } - ++anIter; - } - } - return aViewWindows; - } - - SVTK_ViewWindow* - GetViewWindow( const SalomeApp_Module* theModule, const bool theCreate ) - { - if (SalomeApp_Application* anApp = theModule->getApp()) - { - SVTK_ViewWindow* wnd = dynamic_cast(anApp->desktop()->activeWindow()); - if( wnd ) - return wnd; - else - { - SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate ); - return aViewManager ? dynamic_cast( aViewManager->getActiveView() ) : 0; - } - } - return NULL; - } - - /*SVTK_ViewWindow* - GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate ) - { - if (SalomeApp_Application* anApp = theModule->getApp()) - { - SVTK_ViewWindow* wnd = dynamic_cast(anApp->desktop()->activeWindow()); - if( wnd ) - return wnd; - else - { - if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate )) - return dynamic_cast( aViewManager->getActiveView() ); - } - } - return NULL; - }*/ - - - SVTK_ViewWindow* - GetViewWindow() - { - SalomeApp_Application* anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); - if (anApp) { - if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) { - if (aViewManager->getType() == SVTK_Viewer::Type()) { - if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) { - return dynamic_cast(aViewWindow); - } - } - } - } - return NULL; - } - VISU_Actor* - PublishInView(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs) + PublishMeshInView(const SalomeApp_Module* theModule, + VISU::Prs3d_i* thePrs, + SVTK_ViewWindow* theViewWindow) { VISU_Actor* aActor = NULL; - if(!thePrs) + if (!thePrs || !theViewWindow) return aActor; - if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){ - QApplication::setOverrideCursor( Qt::waitCursor ); - try{ - if(aActor = thePrs->CreateActor()) - aView->AddActor(aActor); - }catch(std::exception& exc){ - SUIT_MessageBox::warn1 - (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), - QObject::tr("BUT_OK")); - } - QApplication::restoreOverrideCursor(); - } - return aActor; - } - VISU_Actor* - UpdateViewer(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs, - bool theDispOnly) - { - SVTK_ViewWindow* vw = GetViewWindow( theModule ); - if (!vw) return NULL; - - vtkRenderer *aRen = vw->getRenderer(); - vtkActorCollection *anActColl = aRen->GetActors(); - anActColl->InitTraversal(); - - vtkActor *anActor; - VISU_Actor* anVISUActor = NULL; - VISU_Actor* aResActor = NULL; - while(vtkActor *anActor = anActColl->GetNextActor()){ - anVISUActor = VISU_Actor::SafeDownCast(anActor); - if(anVISUActor){ - VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d(); - if(aPrs == NULL) continue; - if (thePrs == aPrs) { - try { - aResActor = anVISUActor; - thePrs->UpdateActor(aResActor); - aResActor->VisibilityOn(); - } catch (std::runtime_error& exc) { - aResActor->VisibilityOff(); - INFOS(exc.what()); - SUIT_MessageBox::warn1 - (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), - QObject::tr("BUT_OK")); - } - } else if (theDispOnly) { - anVISUActor->VisibilityOff(); - } else { - } - } else if (theDispOnly && anActor->GetVisibility()) { - anActor->VisibilityOff(); - } else { - } + QApplication::setOverrideCursor( Qt::waitCursor ); + try { + if (aActor = thePrs->CreateActor()) + theViewWindow->AddActor(aActor); + } catch(std::exception& exc) { + SUIT_MessageBox::warn1 + (GetDesktop(theModule), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), + QObject::tr("BUT_OK")); } - if (aResActor) - return aResActor; + QApplication::restoreOverrideCursor(); - //anVISUActor = PublishInView( theModule, thePrs ); - return anVISUActor; + return aActor; } void @@ -1196,7 +1008,8 @@ namespace VISU // Others void CreateMesh (const SalomeApp_Module* theModule, - const Handle(SALOME_InteractiveObject)& theIO) + const Handle(SALOME_InteractiveObject)& theIO, + SVTK_ViewWindow* theViewWindow) { _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); //if (CheckLock(aStudy)) @@ -1243,7 +1056,7 @@ namespace VISU timer.Show(); #endif - QApplication::restoreOverrideCursor(); + //QApplication::restoreOverrideCursor(); VISU::Mesh_i* pPresent = NULL; if (!CORBA::is_nil(aMesh)) pPresent = dynamic_cast(VISU::GetServant(aMesh).in()); @@ -1255,23 +1068,19 @@ namespace VISU return; } - if (SVTK_ViewWindow* aView = GetViewWindow(theModule)) { + if (theViewWindow) { try { #ifdef CHECKTIME Utils_Timer timer; timer.Start(); #endif - PublishInView(theModule, pPresent); - //aView->onFitAll(); - SetFitAll(aView); + PublishMeshInView(theModule, pPresent, theViewWindow); + SetFitAll(theViewWindow); #ifdef CHECKTIME timer.Stop(); MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH"); timer.Show(); #endif - theModule->application()->putInfo(QObject::tr("INF_DONE")); - // Make "Save" button active - theModule->getApp()->updateActions(); } catch (std::runtime_error& exc) { INFOS(exc.what()); SUIT_MessageBox::warn1 @@ -1280,6 +1089,10 @@ namespace VISU QObject::tr("BUT_OK")); } } + + theModule->application()->putInfo(QObject::tr("INF_DONE")); + // Make "Save" button active + theModule->getApp()->updateActions(); } // ======================================================================================== @@ -1411,58 +1224,45 @@ namespace VISU } return aList; } - - int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule){ + + int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow) + { int minIndx = 1; std::set aIndexes; - SVTK_ViewWindow* vw = GetViewWindow(theModule); TViewToPrs3d aMap = theModule->getScalarBarsMap(); - TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(vw); - if (aViewToPrsIter != aMap.end()){ + TViewToPrs3d::const_iterator aViewToPrsIter = aMap.find(theViewWindow); + if (aViewToPrsIter != aMap.end()) { TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin(); - for(;aPrsIter!=(aViewToPrsIter->second).end();aPrsIter++){ + for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) { aIndexes.insert((*aPrsIter).second); } } std::set::const_iterator aIter = aIndexes.begin(); - for (int i=1,length=aIndexes.size(); i <= length; i++){ + for (int i = 1,length = aIndexes.size(); i <= length; i++) { std::set::const_iterator aIter = aIndexes.find(i); - if(aIter==aIndexes.end()){minIndx = i;break;} + if (aIter == aIndexes.end()) { minIndx = i; break; } else minIndx = i + 1; - } return minIndx; } - - void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos){ - SVTK_ViewWindow* vw = GetViewWindow(theModule); + + void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, + VISU::Prs3d_i* thePrs3d, int pos) + { TViewToPrs3d& aMap = theModule->myScalarBarsMap; - TPrs3dToInd aPair; aPair.first=thePrs3d; aPair.second=pos; - aMap[vw].insert(aPair); + TPrs3dToInd aPair; aPair.first = thePrs3d; aPair.second = pos; + aMap[theViewWindow].insert(aPair); } - - void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d){ + + void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, + VISU::Prs3d_i* thePrs3d) + { TViewToPrs3d& aMap = theModule->myScalarBarsMap; - TSetPrs3d::iterator aIter = aMap[vw].begin(); - for(;aIter!=aMap[vw].end();aIter++) - if((*aIter).first == thePrs3d){ - aMap[vw].erase(*aIter); + TSetPrs3d::iterator aIter = aMap[theViewWindow].begin(); + for (; aIter != aMap[theViewWindow].end(); aIter++) + if ((*aIter).first == thePrs3d) { + aMap[theViewWindow].erase(*aIter); return; } } - - void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d){ - SVTK_ViewWindow* vw = GetViewWindow(theModule); - RemoveScalarBarPosition(theModule,vw,thePrs3d); - } - - void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject){ - if (!CORBA::is_nil(theObject)) { - Base_var aBase = Base::_narrow(theObject); - if (CORBA::is_nil(aBase)) return; - if (VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(aBase).in())){ - RemoveScalarBarPosition(theModule,aPrsObject); - } - } - } } diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index d514b4b3..af166ad6 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -98,18 +98,12 @@ namespace VISU { bool IsRemovableSelected(const SalomeApp_Module* theModule); - // Display/Erase - void ErasePrs(const SalomeApp_Module* theModule, - CORBA::Object_ptr theObject, - bool theUpdate = true); void DeleteSObject(VisuGUI* theModule, _PTR(Study) theStudy, _PTR(SObject) theSObject); void DeletePrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs, const Handle(SALOME_InteractiveObject)& theIO); - void ErasePrs3d(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs); // Presentation management void ChangeRepresentation (const SalomeApp_Module* theModule, @@ -126,21 +120,11 @@ namespace VISU { VISU::Result_var& theResult); bool IsSObjectTable(_PTR(SObject) theSObject); - // Views - SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, - QString theType = QString::null); - - // VTK View - TViewWindows GetViews(const SalomeApp_Module* theModule); - SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule, - const bool theCreate = false ); - SVTK_ViewWindow* GetViewWindow(); - - VISU_Actor* PublishInView(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs); - VISU_Actor* UpdateViewer(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs, - bool theDispOnly = false); + /*! Display mesh presentation in given VTK view window + */ + VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule, + VISU::Prs3d_i* thePrs, + SVTK_ViewWindow* theViewWindow); /*! * \brief Repaint all SVTK view windows, where the given object is displayed. @@ -183,26 +167,32 @@ namespace VISU { void CreatePlot( SalomeApp_Module* theModule, _PTR(SObject) theSobj ); + /*! Display/Erase/Update a curve presentation. + * Parameter \a frame may be NULL, in this case there is only update without display/erase + */ void UpdateCurve( VISU::Curve_i*, Plot2d_ViewFrame* frame, SPlot2d_Curve*, int theDisplaying ); - //parameter frame may be 0, in this case there is only update without display/erase - // Others + /*! Create mesh presentation and display it in \a theViewWindow. + * If \a theViewWindow is NULL, no displaying will be done. + */ void CreateMesh (const SalomeApp_Module* theModule, - const Handle(SALOME_InteractiveObject)& theIO); + const Handle(SALOME_InteractiveObject)& theIO, + SVTK_ViewWindow* theViewWindow = NULL); + // Others std::vector GetPrs3dList (const SalomeApp_Module* theModule, const Handle(SALOME_InteractiveObject)& theIO); std::vector GetPrs3dList (const SalomeApp_Module* theModule, _PTR(SObject) theObject); - int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule); - void AddScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d, int pos); - void RemoveScalarBarPosition(VisuGUI* theModule,VISU::Prs3d_i* thePrs3d); - void RemoveScalarBarPosition(VisuGUI* theModule,SVTK_ViewWindow* vw,VISU::Prs3d_i* thePrs3d); - void RemoveScalarBarPosition(VisuGUI* theModule,CORBA::Object_ptr theObject); + int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow); + void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, + VISU::Prs3d_i* thePrs3d, int pos); + void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, + VISU::Prs3d_i* thePrs3d); } #endif diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx index bf893f50..b9556c4c 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx @@ -66,7 +66,7 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule, : QDialog( VISU::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), mySelectionMgr( VISU::GetSelectionMgr( theModule ) ), - myViewWindow( VISU::GetViewWindow( theModule ) ) + myViewWindow( VISU::GetActiveViewWindow(theModule) ) { if (!name) setName("VisuGUI_TransparencyDlg"); diff --git a/src/VISUGUI/VisuGUI_ViewTools.cxx b/src/VISUGUI/VisuGUI_ViewTools.cxx index 868ab606..601e2a17 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.cxx +++ b/src/VISUGUI/VisuGUI_ViewTools.cxx @@ -37,37 +37,35 @@ namespace VISU { void ErasePrs(VisuGUI* theModule, - VISU::Base_ptr theBase, - bool thIsUpdate) + CORBA::Object_ptr theObject, + bool theDoRepaintVW) { - VISU::VISUType aType = theBase->GetType(); + if (CORBA::is_nil(theObject)) return; + VISU::Base_var aBase = VISU::Base::_narrow(theObject); + if (CORBA::is_nil(aBase)) return; + + VISU::VISUType aType = aBase->GetType(); switch (aType) { case VISU::TCURVE: { - if (VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(theBase).in())) + if (VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(aBase).in())) PlotCurve(theModule, aCurve, VISU::eErase ); break; } case VISU::TCONTAINER: { - if (VISU::Container_i* aContainer = dynamic_cast(VISU::GetServant(theBase).in())) + if (VISU::Container_i* aContainer = dynamic_cast(VISU::GetServant(aBase).in())) PlotContainer(theModule, aContainer, VISU::eErase ); break; } case VISU::TTABLE: { - if (VISU::Table_i* aTable = dynamic_cast(VISU::GetServant(theBase).in())) + if (VISU::Table_i* aTable = dynamic_cast(VISU::GetServant(aBase).in())) PlotTable(theModule, aTable, VISU::eErase ); break; } default: { - if(VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(theBase).in())){ - if(aType == VISU::TGAUSSPOINTS) - ErasePrs3d(theModule,aPrsObject,thIsUpdate); - else if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){ - QString aType = aViewManager->getType(); - if(aType == SVTK_Viewer::Type()) - ErasePrs3d(theModule,aPrsObject,thIsUpdate); - else if(aType == VVTK_Viewer::Type()) - ErasePrs3d(theModule,aPrsObject,thIsUpdate); - } + if (VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(aBase).in())) { + SVTK_ViewWindow* vw = GetActiveViewWindow(theModule); + RemoveScalarBarPosition(theModule, vw, aPrsObject); + ErasePrs3d(theModule, aPrsObject, theDoRepaintVW); } }} // switch (aType) } diff --git a/src/VISUGUI/VisuGUI_ViewTools.h b/src/VISUGUI/VisuGUI_ViewTools.h index f10bf63e..bb28861a 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.h +++ b/src/VISUGUI/VisuGUI_ViewTools.h @@ -30,34 +30,36 @@ #include "VisuGUI.h" -#include "SUIT_MessageBox.h" -#include "SUIT_ViewManager.h" -#include "SUIT_ViewWindow.h" +#include "VisuGUI_Tools.h" + +#include "VISU_Prs3d_i.hh" +#include "VISU_Table_i.hh" +#include "VISU_ViewManager_i.hh" + +#include "VISU_Actor.h" #include "SalomeApp_Module.h" #include "SalomeApp_Application.h" -#include "VISU_Prs3d_i.hh" - #include "VVTK_ViewModel.h" #include "VVTK_ViewWindow.h" +#include "SVTK_Functor.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" -#include "VisuGUI_Tools.h" +#include "SPlot2d_ViewModel.h" + #include "VTKViewer_Algorithm.h" -#include "SVTK_Functor.h" -#include "VISU_Table_i.hh" -#include "VISU_ViewManager_i.hh" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ViewManager.h" +#include "SUIT_ViewWindow.h" + #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" -#include "SPlot2d_ViewModel.h" - -#include "VISU_Actor.h" - #include #include @@ -65,17 +67,26 @@ class VVTK_Viewer; namespace VISU { - //--------------------------------------------------------------- + /*! Return active view window, if it instantiates TViewer::TViewWindow class, + * overwise find or create corresponding view window, make it active and return it. + * \note Active VVTK_ViewWindow can be returned by request GetViewWindow(), + * because VVTK_ViewWindow inherits SVTK_ViewWindow. + */ template inline typename TViewer::TViewWindow* - GetViewWindow(VisuGUI* theModule, - const bool theIsViewCreate = false) + GetViewWindow(VisuGUI* theModule) { - typedef typename TViewer::TViewWindow TView; - if(SUIT_ViewManager* aViewManager = theModule->getViewManager(TViewer::Type(),theIsViewCreate)){ - if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){ - if(TView* aView = dynamic_cast(aViewWindow)){ + typedef typename TViewer::TViewWindow TViewWindow; + if (SalomeApp_Application* anApp = theModule->getApp()) { + if (TViewWindow* aView = dynamic_cast(anApp->desktop()->activeWindow())) + return aView; + } + SUIT_ViewManager* aViewManager = + theModule->getViewManager(TViewer::Type(), /*create = */true); + if (aViewManager) { + if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) { + if (TViewWindow* aView = dynamic_cast(aViewWindow)) { aViewWindow->raise(); aViewWindow->setFocus(); return aView; @@ -85,30 +96,54 @@ namespace VISU return NULL; } + /*! Return active view window, if it instantiates TViewWindow class, overwise return NULL. + * \note Active VVTK_ViewWindow can be returned by request GetActiveViewWindow(), + * because VVTK_ViewWindow inherits SVTK_ViewWindow. + */ + template + inline + TViewWindow* + GetActiveViewWindow(const SalomeApp_Module* theModule = NULL) + { + SalomeApp_Application* anApp = NULL; + if (theModule) + anApp = theModule->getApp(); + else + anApp = dynamic_cast + (SUIT_Session::session()->activeApplication()); + + if (anApp) + if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) + if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) + return dynamic_cast(aViewWindow); + + return NULL; + } + //--------------------------------------------------------------- - template inline VISU_Actor* PublishInView(VisuGUI* theModule, Prs3d_i* thePrs, - const bool theIsHighlight = false, - const bool theIsCreateView = false) + SVTK_ViewWindow* theViewWindow, + const bool theIsHighlight = false) { - typedef typename TViewer::TViewWindow TView; - if(TView* aView = GetViewWindow(theModule,theIsCreateView)){ + if (theViewWindow) { QApplication::setOverrideCursor( Qt::waitCursor ); try { - if(VISU_Actor* anActor = thePrs->CreateActor()){ - aView->AddActor(anActor); - if(theIsHighlight) - aView->highlight(anActor->getIO(),true); - aView->getRenderer()->ResetCameraClippingRange(); - aView->Repaint(); + if (VISU_Actor* anActor = thePrs->CreateActor()) { + theViewWindow->AddActor(anActor); + if (theIsHighlight) + theViewWindow->highlight(anActor->getIO(),true); + theViewWindow->getRenderer()->ResetCameraClippingRange(); + theViewWindow->Repaint(); QApplication::restoreOverrideCursor(); return anActor; } } catch(std::exception& exc) { + thePrs->RemoveActors(); + QApplication::restoreOverrideCursor(); INFOS(exc.what()); SUIT_MessageBox::warn1 @@ -122,56 +157,53 @@ namespace VISU //--------------------------------------------------------------- - template inline VISU_Actor* UpdateViewer(VisuGUI* theModule, VISU::Prs3d_i* thePrs, bool theDispOnly = false, - const bool theIsHighlight = false, - const bool theIsViewCreate = false) + const bool theIsHighlight = false) { - typedef typename TViewer::TViewWindow TView; - if(TView* aView = GetViewWindow(theModule,theIsViewCreate)){ - vtkRenderer *aRen = aView->getRenderer(); + if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { + vtkRenderer *aRen = aViewWindow->getRenderer(); vtkActorCollection *anActColl = aRen->GetActors(); anActColl->InitTraversal(); VISU_Actor* aResActor = NULL; - while(vtkActor *anAct = anActColl->GetNextActor()){ - if(VISU_Actor* anActor = dynamic_cast(anAct)){ - if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){ - if(thePrs == aPrs3d){ + bool isOk = true; + while (vtkActor *anAct = anActColl->GetNextActor()) { + if (VISU_Actor* anActor = dynamic_cast(anAct)) { + if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) { + if (thePrs == aPrs3d) { try { + aResActor = anActor; thePrs->UpdateActors(); + aResActor->VisibilityOn(); } catch (std::runtime_error& exc) { + thePrs->RemoveActors(); + isOk = false; + INFOS(exc.what()); - QApplication::restoreOverrideCursor(); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); - - thePrs->RemoveActors(); - return NULL; } - aResActor = anActor; - aResActor->VisibilityOn(); - }else if(theDispOnly){ + } else if (theDispOnly) { anActor->VisibilityOff(); } - }else if(theDispOnly && anActor->GetVisibility()){ + } else if (theDispOnly && anActor->GetVisibility()) { anActor->VisibilityOff(); } } } - if(aResActor){ - if(theIsHighlight) - aView->highlight(aResActor->getIO(),true); - aView->getRenderer()->ResetCameraClippingRange(); - aView->Repaint(); + if (aResActor) { + if (theIsHighlight && isOk) + aViewWindow->highlight(aResActor->getIO(), true); + aViewWindow->getRenderer()->ResetCameraClippingRange(); + aViewWindow->Repaint(); return aResActor; } - return PublishInView(theModule,thePrs,theIsHighlight,theIsViewCreate); + return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight); } return NULL; } @@ -184,14 +216,14 @@ namespace VISU OnEraseAll(VisuGUI* theModule) { typedef typename TViewer::TViewWindow TViewWindow; - if(TViewWindow* aViewWindow = GetViewWindow(theModule)){ + if (TViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { aViewWindow->unHighlightAll(); - if(vtkRenderer *aRen = aViewWindow->getRenderer()){ + if (vtkRenderer *aRen = aViewWindow->getRenderer()) { vtkActorCollection *aCollection = aRen->GetActors(); aCollection->InitTraversal(); - while(vtkActor *anAct = aCollection->GetNextActor()){ - if(anAct->GetVisibility() > 0) - if(SALOME_Actor* anActor = dynamic_cast(anAct)){ + while (vtkActor *anAct = aCollection->GetNextActor()) { + if (anAct->GetVisibility() > 0) + if (SALOME_Actor* anActor = dynamic_cast(anAct)) { anActor->VisibilityOff(); } } @@ -199,57 +231,37 @@ namespace VISU } } } - + template<> inline void OnEraseAll(VisuGUI* theModule) { - if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule,false)) + if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll(); } //--------------------------------------------------------------- - template - inline - VISU_Actor* - FindActor(TVieweWindow* theViewWindow, - const char* theEntry) - { - using namespace SVTK; - if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){ - if(vtkActorCollection* aCollection = aRenderer->GetActors()){ - if(VISU_Actor* anActor = Find(aCollection,TIsSameEntry(theEntry))){ - return anActor; - } - } - } - return NULL; - } - - template inline void ErasePrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs, - const bool thIsUpdate = true) + const bool theDoRepaintVW = true) { - typedef typename TViewer::TViewWindow TViewWindow; - if(TViewWindow* aViewWindow = GetViewWindow(theModule)){ - if(VISU_Actor* anActor = FindActor(aViewWindow,thePrs)){ + if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { + if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs)) { anActor->VisibilityOff(); - if(thIsUpdate) + if (theDoRepaintVW) aViewWindow->Repaint(); } } } - void ErasePrs(VisuGUI* theModule, - VISU::Base_ptr theBase, - bool thIsUpdate); + CORBA::Object_ptr theObject, + bool theDoRepaintVW); } #endif diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index 20168853..0879dd8c 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -112,7 +112,7 @@ LDFLAGS += \ -L${GUI_ROOT_DIR}/lib/salome \ -L${MED_ROOT_DIR}/lib/salome -LIBS+= -lboost_signals-mt \ +LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \ -lSalomeHDFPersist \ -lSalomeGenericObj \ -lSalomeContainer \ @@ -120,7 +120,6 @@ LIBS+= -lboost_signals-mt \ -lTOOLSDS \ -lOpUtil \ -lEvent \ - -lCASCatch \ -lSalomeApp \ -lSalomeSession \ -lVTKViewer \ @@ -129,6 +128,7 @@ LIBS+= -lboost_signals-mt \ -lVisuConvertor \ -lVisuPipeLine \ -lVisuObject \ + -lVVTK \ -lVISUGUITOOLS LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \ @@ -141,8 +141,9 @@ LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \ -lSalomeNotification \ -lSALOMELocalTrace \ -lSalomeResourcesManager \ - -lSalomeDS \ + -lSalomeDSClient \ -lSalomeDSImpl \ + -lSalomeDS \ -lSalomeObject \ -lqtx \ -lsuit \ diff --git a/src/VISU_I/VISUConfig.cc b/src/VISU_I/VISUConfig.cc index ee879b6a..d1e4c58e 100644 --- a/src/VISU_I/VISUConfig.cc +++ b/src/VISU_I/VISUConfig.cc @@ -194,6 +194,16 @@ namespace VISU{ } + QString Storable::FindValue(const TRestoringMap& theMap, const string& theArg, const QString& theDefaultValue) + { + bool anIsFound = false; + QString aValue = FindValue(theMap,theArg,&anIsFound); + if(anIsFound) + return aValue; + return theDefaultValue; + } + + //=========================================================================== PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject){ if(CORBA::is_nil(theObject)) return NULL; diff --git a/src/VISU_I/VISUConfig.hh b/src/VISU_I/VISUConfig.hh index 6ec9a2d0..3e835d71 100644 --- a/src/VISU_I/VISUConfig.hh +++ b/src/VISU_I/VISUConfig.hh @@ -124,6 +124,7 @@ namespace VISU static void Registry(const char* theComment, TStorableEngine theEngine); static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString); static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL); + static QString FindValue(const TRestoringMap& theMap, const std::string& theArg, const QString& theDefaultValue); static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap); static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject); static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 8a691fd4..5501a17a 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -107,7 +107,7 @@ VISU::ColoredPrs3d_i myField = anOrigin->GetField(); myMeshName = myField->myMeshName; - myEntity = myField->myEntity; + myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity; myIteration = anOrigin->GetIteration(); myFieldName = anOrigin->GetFieldName(); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index e03d772e..9e277a47 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -166,7 +166,7 @@ namespace VISU void SameAsParams(const ColoredPrs3d_i* theOrigin); - const VISU::PField& + virtual const VISU::PField& GetField() const; const std::string& diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 91b8ef80..f3d809ed 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -175,8 +175,14 @@ namespace VISU{ theStr<Object map theStr<GetName(); + theStr<GetScalarMode()<<")"<GetScaling()){ @@ -359,6 +365,10 @@ namespace VISU{ theStr<GetName(); + theStr<Object map theStr<GetName(); + theStr<GetCellColor(); theStr<(GetServant(anObj).in())){ - SALOMEDS::SObject_var aSObject = aServant->GetSObject(); SALOMEDS::GenericAttribute_var anAttr; if(theSObject->FindAttribute(anAttr,"AttributeComment")){ using namespace SALOMEDS; @@ -921,6 +936,11 @@ namespace VISU{ theStr<GetName(); + theStr<GetName(); + theStr<FindAttribute(anAttr,"AttributeComment")){ SALOMEDS::AttributeComment_var aComment = @@ -1117,6 +1142,10 @@ namespace VISU{ std::string aPrefix = thePrefix + PREFIX; theArgumentName = aName; + // Set name (as this object could be renamed by user) + CORBA::String_var aNameInStudy = aSObject->GetName(); + theStr<NewChildIterator(aSObject); for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){ SALOMEDS::SObject_var aRefSObj = aCurveIter->Value(); diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index ff03f9f2..c5a950cc 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -85,6 +85,7 @@ #include #include "Utils_ExceptHandlers.hxx" +#include "CASCatch.hxx" using namespace std; @@ -238,18 +239,23 @@ namespace VISU const char* theFieldName, CORBA::Double theIteration) { + CASCatch_TRY{ #ifndef _DEXCEPT_ - try{ + try{ #endif - if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) - return true; + if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) + return true; #ifndef _DEXCEPT_ - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<GetMessageString()); + } return false; } @@ -299,58 +305,69 @@ namespace VISU //=========================================================================== SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, const char* theURL, - bool isMultiFile) + bool theIsMultiFile) { Mutex mt(myMutex); - string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); - TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); + string aTmpDir = theURL; if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<GetStudy(); - - //CORBA::Boolean anIsValidScript; - //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript); + + typedef std::vector TFileNames; + TFileNames aFileNames; + TFileNames aFiles; - SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent); - for (; itBig->More(); itBig->Next()) { - SALOMEDS::SObject_var gotBranch = itBig->Value(); + SALOMEDS::Study_var aStudy = theComponent->GetStudy(); + SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); + for (; anIter->More(); anIter->Next()) { + SALOMEDS::SObject_var gotBranch = anIter->Value(); CORBA::Object_var anObj = SObjectToObject(gotBranch); if(CORBA::is_nil(anObj)) continue; - if(Result_i* pResult = dynamic_cast(GetServant(anObj).in())){ - switch(pResult->GetCreationId()){ + if(Result_i* aResult = dynamic_cast(GetServant(anObj).in())){ + switch(aResult->GetCreationId()){ case Result_i::eImportFile: case Result_i::eCopyAndImportFile: { - const QFileInfo& aFileInfo = pResult->GetFileInfo(); - QString aPrefix(""); - if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str(); - QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str(); - static QString aCommand; - aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); - - int aRes = system(aCommand); - if(aRes){ - if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<URL()) + aFileName; + + std::ostringstream aStream; + aStream<<"cp "< 0){ - SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; - aSeq->length(aFileNames.Length()); - for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--) - aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString()); - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile); - if(!isMultiFile) - SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true); + + if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<length(aFileNames.size()); + for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--) + aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str(); } + + SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames; + aListOfFiles->length(aFiles.size()); + if(!aFiles.empty()){ + for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--) + aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str(); + } + + SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); + if(theIsMultiFile) + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile); + else + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in()); + return aStreamFile._retn(); } diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 2a65400b..a38ea37b 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -228,6 +228,8 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring) throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!"); if (!theRestoring) { myPresentType = VISU::SHADED; + if(myEntity == VISU::NODE_ENTITY) + myPresentType = VISU::POINT; myName = GenerateName().latin1(); myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0; myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0; @@ -273,7 +275,8 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring) myMeshPL->Init(); string aResultEntry = myResult->GetEntry(); string anEntry = myResult->GetEntry(aComment.latin1()); - if(anEntry == "") throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!"); + if(anEntry == "") + throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!"); mySObject = myStudy->FindObjectID(anEntry.c_str()); SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder(); SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR"); diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 64bb0bb9..1bdd88b8 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -265,8 +265,8 @@ VISU::Prs3d_i }catch(std::bad_alloc& ex){ throw std::runtime_error("CreateActor >> No enough memory"); throw ex; - } catch(std::exception& ex){ - throw ex; + } catch(std::exception&){ + throw; }catch(...) { throw std::runtime_error("CreateActor >> unexpected exception was caught!!!"); } diff --git a/src/VISU_I/VISU_Prs3d_i.hh b/src/VISU_I/VISU_Prs3d_i.hh index efdd5556..c83955f5 100644 --- a/src/VISU_I/VISU_Prs3d_i.hh +++ b/src/VISU_I/VISU_Prs3d_i.hh @@ -35,7 +35,6 @@ #include "SALOME_GenericObj_i.hh" #include "SALOME_InteractiveObject.hxx" -#include #include class VISU_PipeLine; diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 2a85df81..9745df01 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -787,20 +787,23 @@ VISU::Result_i ::Result_i (SALOMEDS::Study_ptr theStudy, const ESourceId& theSourceId, const ECreationId& theCreationId, - CORBA::Boolean theIsBuildImmediately): + CORBA::Boolean theIsBuildImmediately, + CORBA::Boolean theIsBuildFields, + CORBA::Boolean theIsBuildMinMax, + CORBA::Boolean theIsBuildGroups): myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)), myCreationId(theCreationId), mySourceId(theSourceId), myIsBuildImmediately(theIsBuildImmediately), - myInput(NULL), + myIsBuildFields(theIsBuildFields), + myIsBuildMinMax(theIsBuildMinMax), + myIsBuildGroups(theIsBuildGroups), myIsEntitiesDone(false), myIsFieldsDone(false), myIsGroupsDone(false), myIsMinMaxDone(false), - myIsBuildFields(true), - myIsBuildGroups(true), - myIsBuildMinMax(true), - myIsAllDone(false) + myIsAllDone(false), + myInput(NULL) { myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId())); } @@ -1181,7 +1184,8 @@ Restore(SALOMEDS::SObject_ptr theSObject, SALOMEDS::SObject_var aRefSObj, aTargetRefSObj; if (mySObject->FindSubObject(1, aRefSObj) && - aRefSObj->ReferencedObject(aTargetRefSObj)) { + aRefSObj->ReferencedObject(aTargetRefSObj)) + { if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference."); SALOMEDS::SComponent_var aCompRefSObj = aTargetRefSObj->GetFatherComponent(); CORBA::String_var aDataType = aCompRefSObj->ComponentDataType(); @@ -1258,7 +1262,21 @@ Restore(SALOMEDS::SObject_ptr theSObject, } if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId); myInput = CreateConvertor(myFileInfo.filePath().latin1()); - myInput->Build(); + + myInput->BuildEntities(); + if(myIsBuildFields){ + myInput->BuildFields(); + myIsFieldsDone = true; + if(myIsBuildMinMax){ + myInput->BuildMinMax(); + myIsMinMaxDone = true; + } + } + if(myIsBuildGroups){ + myInput->BuildGroups(); + myIsGroupsDone = true; + } + QString aComment; aComment.sprintf("myComment=%s;myType=%d;myFileName=%s;myInitFileName=%s", GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(), @@ -1269,8 +1287,8 @@ Restore(SALOMEDS::SObject_ptr theSObject, SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr); aCmnt->SetValue(aComment.latin1()); } - bool isBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false); - if (isBuildAll) + bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false); + if(anIsBuildAll) BuildAll(); return this; } catch(std::exception& exc) { @@ -1357,6 +1375,9 @@ VISU::Result_i Storable::DataToStream(theStr,"myName",myName.c_str()); Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str()); Storable::DataToStream(theStr,"myCreationId",myCreationId); + Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone); + Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone); + Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone); } @@ -1374,11 +1395,20 @@ VISU::Result_i if(aCreationId == eImportMed || aCreationId == eImportMedField) aSourceId = eRestoredComponent; - VISU::Result_i* pResult = new VISU::Result_i(aStudy,aSourceId,aCreationId); - if (pResult == NULL) + CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","0").toInt(); + CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","0").toInt(); + CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","0").toInt(); + + VISU::Result_i* aResult = new VISU::Result_i(aStudy, + aSourceId, + aCreationId, + anIsBuildFields, + anIsBuildMinMax, + anIsBuildGroups); + if (aResult == NULL) return NULL; - return pResult->Restore(theSObject,theMap,thePrefix); + return aResult->Restore(theSObject,theMap,thePrefix); } diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index ee903de6..27ec5e08 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -28,11 +28,9 @@ #define __VISU_RESULT_I_H__ #include "VISUConfig.hh" +#include "VISU_BoostSignals.h" #include "SALOME_GenericObj_i.hh" -#include -#include - #include #include @@ -41,7 +39,7 @@ class VISU_Convertor; namespace VISU { //---------------------------------------------------------------------------- - class MinMaxCunsomer: public virtual boost::bsignals::trackable + class MinMaxCunsomer: public virtual boost::signalslib::trackable { protected: bool myMinMaxIsInitilized; @@ -73,7 +71,10 @@ namespace VISU Result_i(SALOMEDS::Study_ptr theStudy, const ESourceId& theSourceId, const ECreationId& theCreationId, - CORBA::Boolean theIsBuildImmediately = true); + CORBA::Boolean theIsBuildImmediately = true, + CORBA::Boolean theIsBuildFields = true, + CORBA::Boolean theIsBuildMinMax = true, + CORBA::Boolean theIsBuildGroups = true); virtual ~Result_i(); virtual void RemoveFromStudy(); diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 9b8868e3..c9ee0e66 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -102,6 +102,7 @@ ScalarMapOnDeformedShape_i(Result_i* theResult, VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<GetScalarIteration(); + string theScalarMeshName = this->GetScalarMeshName(); + string theScalarFieldName = this->GetScalarFieldName(); + if(MYDEBUG) cout << "SameAs:"<(theOrigin)){ ScalarMapOnDeformedShape_i* anOrigin = const_cast(aPrs3d); - // increment the scalar iteration for using in VISU_TimeAnimation class implementation. this->SetScalarField(anOrigin->GetScalarMeshName().c_str(), anOrigin->GetScalarFieldName().c_str(), - anOrigin->GetScalarIteration() + 1, + theScalarIter, anOrigin->GetScalarEntity()); Update(); } @@ -204,6 +213,7 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){ void VISU::ScalarMapOnDeformedShape_i::DoHook() { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<SetRepresentation(2); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); @@ -224,6 +235,7 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<(theActor)){ if(IsColored()){ anActor->SetBarVisibility(true); @@ -242,12 +254,15 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName, const int theIteration, const VISU::TEntity theEntity) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<NewChildIterator(theData.myField); anIter->Next(); // First is reference on support @@ -202,8 +199,8 @@ namespace aFieldName.latin1(), aTimeStampId); theData.myPrs[aFrameId++] = aPresent; - theMinVal = std::min(aPresent->GetMin(),theMinVal); - theMaxVal = std::max(aPresent->GetMax(),theMaxVal); + aMin = std::min(aPresent->GetMin(), aMin); + aMax = std::max(aPresent->GetMax(), aMax); } theData.myNbFrames = aFrameId; @@ -212,7 +209,7 @@ namespace if( aRangeType != 1 ){ for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) { if (VISU::ScalarMap_i* aPrs = dynamic_cast(theData.myPrs[aFrameId])){ - aPrs->SetRange(theMinVal, theMaxVal); + aPrs->SetRange(aMin, aMax); aPrs->SetOffset(theData.myOffset); } } @@ -220,7 +217,7 @@ namespace if (theData.myPrsType == VISU::TISOSURFACE) for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) if (VISU::IsoSurfaces_i* aPrs = dynamic_cast(theData.myPrs[aFrameId])) - aPrs->SetSubRange(theMinVal, theMaxVal); + aPrs->SetSubRange(aMin, aMax); } } } @@ -246,100 +243,80 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) { aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TISOSURFACE: // Iso Surfaces GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TCUTPLANES: // Cut Planes GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TCUTLINES: // Cut Lines GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TPLOT3D: // Plot3d GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TDEFORMEDSHAPE: // Deformed Shape GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TVECTORS: // Vectors GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TSTREAMLINES: // Stream Lines GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TGAUSSPOINTS: // Gauss Points GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape GeneratePresentations(myStudy, aData, aResult, isRangeDefined(), - myMinVal, - myMaxVal, - myTimeMin, - myTimeMax); + myTimeMinVal, + myTimeMaxVal); break; default: MESSAGE("Not implemented for this presentation type: " << aData.myPrsType); @@ -618,8 +595,6 @@ void VISU_TimeAnimation::run() qApp->unlock(); msleep(100); qApp->lock(); - - QPixmap px = QPixmap::grabWindow(myView->winId()); QString aFile(myDumpPath); QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]); int aPos = -1; @@ -628,7 +603,7 @@ void VISU_TimeAnimation::run() aFile += aName; aFile += "."; aFile += myDumpFormat.lower(); - px.save(aFile, myDumpFormat); + myView->dumpViewToFormat(aFile,myDumpFormat); } if (!myIsActive) break; @@ -771,8 +746,8 @@ SALOMEDS::SObject_ptr VISU_TimeAnimation::publishInStudy() std::string aSComponentEntry = aSComponent->GetID(); QString aComment; - aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g", - VISU::TANIMATION,myMinVal,myMaxVal); + aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g", + VISU::TANIMATION,myTimeMinVal,myTimeMaxVal); string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","", GenerateName(),"",aComment,true); @@ -814,8 +789,8 @@ void VISU_TimeAnimation::saveAnimation() std::string aSComponentEntry = aSComponent->GetID(); QString aComment; - aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g", - VISU::TANIMATION,myMinVal,myMaxVal); + aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g", + VISU::TANIMATION,myTimeMinVal,myTimeMaxVal); _PTR(GenericAttribute) anAttr; anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment"); @@ -881,8 +856,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) VISU::Storable::StrToMap(strIn,aMap); bool isExist; - myMinVal = VISU::Storable::FindValue(aMap,"myMinVal",&isExist).toDouble(); - myMaxVal = VISU::Storable::FindValue(aMap,"myMaxVal",&isExist).toDouble(); + myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble(); + myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble(); _PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject); for (anIter->Init(); anIter->More(); anIter->Next()) { @@ -939,8 +914,7 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) aData.myPrs[0]->GetOffset(aData.myOffset); for (int i = 1; i < aData.myNbFrames; i++) { //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]); - //enk 06.02.2006:aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005 - aData.myPrs[i]->SameAsParams(aData.myPrs[i-1]);//enk 06.02.2006: initializing from previous presentation + aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005 } } string aStr = aAnimSObject->GetID(); diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index 315415c8..bb1925a8 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -66,6 +66,7 @@ class VISU_TimeAnimation: public QObject, public QThread SVTK_ViewWindow* getViewer() { return myView; } void clearView(); void clearData(FieldData& theData); + void clearFieldData() { myFieldsLst.clear();}; void stopAnimation(); void startAnimation(); @@ -93,11 +94,11 @@ class VISU_TimeAnimation: public QObject, public QThread CORBA::Boolean isProportional() { return myProportional; } void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax) - { myMaxVal = theMax; myMinVal = theMin; } + { myTimeMinVal = theMin; myTimeMaxVal = theMax; } - CORBA::Double getMinRange() { return myMinVal; } - CORBA::Double getMaxRange() { return myMaxVal; } - CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); } + CORBA::Double getMinRange() { return myTimeMinVal; } + CORBA::Double getMaxRange() { return myTimeMaxVal; } + CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); } void dumpTo(const char* thePath) { myDumpPath = thePath; } std::string setDumpFormat(const char* theFormat); @@ -132,7 +133,7 @@ class VISU_TimeAnimation: public QObject, public QThread private slots: void onViewDeleted(); - + private: QString myLastError; @@ -144,8 +145,8 @@ class VISU_TimeAnimation: public QObject, public QThread bool myCycling; _PTR(Study) myStudy; - double myMaxVal, myMinVal; - double myTimeMin, myTimeMax; + double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user + double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation QString myDumpPath; QString myDumpFormat; SVTK_ViewWindow* myView; diff --git a/src/VISU_I/VISU_ViewManager_i.cc b/src/VISU_I/VISU_ViewManager_i.cc index c86ac5d8..7168bb99 100644 --- a/src/VISU_I/VISU_ViewManager_i.cc +++ b/src/VISU_I/VISU_ViewManager_i.cc @@ -257,31 +257,29 @@ namespace VISU { //=========================================================================== // VISU namespace functions //=========================================================================== - SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame) + vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow) { - return dynamic_cast(theStudyFrame); - } - - vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame) - { - return GetViewWindow(theStudyFrame)->getRenderer(); + if (SVTK_ViewWindow* vw = dynamic_cast(theViewWindow)) + return vw->getRenderer(); + return NULL; } - vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame) + vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow) { - return GetRenderer(theStudyFrame)->GetActiveCamera(); + return GetRenderer(theViewWindow)->GetActiveCamera(); } void RepaintView (SUIT_ViewWindow* theViewWindow) { - SVTK_ViewWindow* vf = GetViewWindow(theViewWindow); - vf->getRenderer()->ResetCameraClippingRange(); - vf->getRenderWindow()->Render(); + if (SVTK_ViewWindow* vf = dynamic_cast(theViewWindow)) { + vf->getRenderer()->ResetCameraClippingRange(); + vf->getRenderWindow()->Render(); + } } - VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs) + VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs) { - SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame); + SVTK_ViewWindow* vf = dynamic_cast(theViewWindow); if (!vf) return NULL; if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<GetScale(aScaleFactor); + (dynamic_cast(theViewWindow))->GetScale(aScaleFactor); Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]); Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]); Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]); @@ -1841,7 +1841,7 @@ namespace VISU { aColor[1] = int(255.0*theColor.G); aColor[2] = int(255.0*theColor.B); QColor aNewColor (aColor[0],aColor[1],aColor[2]); - VISU::GetViewWindow(theViewWindow)->setBackgroundColor(aNewColor); + (dynamic_cast(theViewWindow))->setBackgroundColor(aNewColor); } SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow) @@ -1922,7 +1922,7 @@ namespace VISU { SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) { ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFitAll)); + (dynamic_cast(aVW), &SVTK_ViewWindow::onFitAll)); Update(); } } @@ -1936,27 +1936,27 @@ namespace VISU { switch (theType) { case VISU::View3D::FRONT : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFrontView)); + (dynamic_cast(aVW), &SVTK_ViewWindow::onFrontView)); break; case VISU::View3D::BACK : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onBackView)); + (dynamic_cast(aVW), &SVTK_ViewWindow::onBackView)); break; case VISU::View3D::LEFT : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onLeftView)); + (dynamic_cast(aVW),&SVTK_ViewWindow::onLeftView)); break; case VISU::View3D::RIGHT : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onRightView)); + (dynamic_cast(aVW),&SVTK_ViewWindow::onRightView)); break; case VISU::View3D::TOP : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onTopView)); + (dynamic_cast(aVW),&SVTK_ViewWindow::onTopView)); break; case VISU::View3D::BOTTOM : ProcessVoidEvent(new TVoidMemFunEvent - (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onBottomView)); + (dynamic_cast(aVW),&SVTK_ViewWindow::onBottomView)); break; } Update(); @@ -2126,7 +2126,7 @@ namespace VISU { void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow, VISU::View3D::Axis theAxis, CORBA::Double theParam) { - SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theViewWindow); + SVTK_ViewWindow* aViewWindow = dynamic_cast(theViewWindow); double aScaleFactor[3]; aViewWindow->GetScale(aScaleFactor); aScaleFactor[theAxis] = theParam; @@ -2136,7 +2136,7 @@ namespace VISU { void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3]) { double aScale[3] = {theScale[0], theScale[1], theScale[2]}; - VISU::GetViewWindow(theViewWindow)->SetScale(aScale); + (dynamic_cast(theViewWindow))->SetScale(aScale); } void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam) @@ -2145,7 +2145,7 @@ namespace VISU { SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) { double aScale[3]; - VISU::GetViewWindow(aVW)->GetScale(aScale); + (dynamic_cast(aVW))->GetScale(aScale); aScale[theAxis] = theParam; ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale)); } diff --git a/src/VISU_SWIG/VISU_Example_01.py b/src/VISU_SWIG/VISU_Example_01.py index d8c19b65..e9727b81 100644 --- a/src/VISU_SWIG/VISU_Example_01.py +++ b/src/VISU_SWIG/VISU_Example_01.py @@ -80,6 +80,13 @@ cutplanes.SetNbPlanes(30) cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0) myView.DisplayOnly(cutplanes) +print "Creating Scalar Map On Deformed Shape.......", +scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1); +if scalarmapondefshape is None : print "Error" +else : print "OK" +scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity); +myView.DisplayOnly(scalarmapondefshape) + #%====================Stage4: Opening a new study and Med file import====================% # Opening a new study tempoparily commented due to a problem @@ -131,6 +138,11 @@ else : print "OK" cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0) myView1.DisplayOnly(cutplanes1) +print "Creating Scalar Map On Deformed Shape.......", +scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1); +if scalarmapondefshape1 is None : print "Error" +else : print "OK" +myView1.DisplayOnly(scalarmapondefshape1) #%====================Stage6: Object browser popup====================% print "**** Stage6: Object browser popup" diff --git a/src/VISU_SWIG/visu.py b/src/VISU_SWIG/visu.py index daadf7aa..ea05e2bf 100644 --- a/src/VISU_SWIG/visu.py +++ b/src/VISU_SWIG/visu.py @@ -81,6 +81,12 @@ def PublishComponent(theStudyDocument): pass return aSComponent; + +def SetName(theObj, theName): + anIOR = myORB.object_to_string(theObj) + aSObj = myLocalStudy.FindObjectIOR(anIOR) + anAttr = aSObj.FindAttribute("AttributeName")[1] + anAttr.SetValue(theName) def StrToMap(theString) : aPairList = split(theString,";") @@ -602,6 +608,23 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi aPrsObj.RemoveFromStudy() else : aVISUObjList.append(aPrsObj) + + if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) : + print " Creating ScalarMapOnDeformedShapeOnField", + aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId) + if aPrsObj is None : print "Error" + else : + print ",OK" + theView.DisplayOnly(aPrsObj) + theView.FitAll() + aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt + aPictureName = re.sub("\s+","_", aPictureName) + theView.SavePicture(aPictureName) + if theIsAutoDelete : + aPrsObj.RemoveFromStudy() + else : + aVISUObjList.append(aPrsObj) + return aVISUObjList diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx index de0ebfd0..e292f1b6 100644 --- a/src/VVTK/VVTK_MainWindow.cxx +++ b/src/VVTK/VVTK_MainWindow.cxx @@ -79,7 +79,7 @@ VVTK_MainWindow // Recording myRecordingToolBar = new QToolBar(this); myRecordingToolBar->setCloseMode(QDockWindow::Undocked); - myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); + myRecordingToolBar->setLabel(tr("LBL_TOOLBAR_RECORD_LABEL")); moveDockWindow(myRecordingToolBar,Qt::DockLeft); myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"), @@ -265,7 +265,7 @@ VVTK_MainWindow1 { myPtsToolBar = new QToolBar(this); myPtsToolBar->setCloseMode(QDockWindow::Undocked); - myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); + myPtsToolBar->setLabel(tr("LBL_TOOLBAR_GAUSS_LABEL")); moveDockWindow(myPtsToolBar,Qt::DockLeft); QPixmap aPixmap; diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index 484eff95..8a171986 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -236,19 +236,17 @@ vtkStandardNewMacro(VVTK_Renderer1); //---------------------------------------------------------------------------- VVTK_Renderer1::VVTK_Renderer1(): - //myImplicitFunctionWidget(VISU_ImplicitFunctionWidget::New()), myWidgetCtrl(VISU_WidgetCtrl::New()), myOutsideCursorSettings(NULL) { if(MYDEBUG) INFOS("VVTK_Renderer1() - "<SetPlaceFactor(1.1); myWidgetCtrl->SetPlaceFactor(1.1); // - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - pPlanesWidget->SetOutlineTranslation(false); - vtkProperty* aSelectedPlaneProperty = pPlanesWidget->GetSelectedPlaneProperty(); - vtkProperty* aPlaneProperty = pPlanesWidget->GetPlaneProperty(); + VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); + aPlanesWidget->SetOutlineTranslation(false); + vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty(); + vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty(); aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5); // myWidgetCtrl->Delete(); @@ -274,6 +272,7 @@ VVTK_Renderer1 } } + //---------------------------------------------------------------------------- void VVTK_Renderer1 @@ -286,30 +285,32 @@ VVTK_Renderer1 AdjustWidgetCtrl(); } } + + //---------------------------------------------------------------------------- -void VVTK_Renderer1::AdjustWidgetCtrl() +void +VVTK_Renderer1 +::AdjustWidgetCtrl() { - if(SVTK_Renderer::OnAdjustActors()){ - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - pPlanesWidget->InitialPlaceWidget(myBndBox); - pPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - // - VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - pSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - float dX, dXmin=1.e20; - for (int i=0; i<3; ++i) { - dX=myBndBox[2*i+1]-myBndBox[2*i]; - if (dXSetRadius(dXmin); + VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); + aPlanesWidget->InitialPlaceWidget(myBndBox); + aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); + // + VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget(); + aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); + + float aMinLength = VTK_LARGE_FLOAT; + for (int i=0; i<3; ++i) { + float aLength = myBndBox[2*i+1]-myBndBox[2*i]; + aMinLength = std::min(aMinLength,aLength); } + aSphereWidget->SetRadius(aMinLength); } + //---------------------------------------------------------------------------- void VVTK_Renderer1 @@ -329,7 +330,9 @@ VVTK_Renderer1 } //---------------------------------------------------------------------------- -VISU_WidgetCtrl* VVTK_Renderer1::GetWidgetCtrl() +VISU_WidgetCtrl* +VVTK_Renderer1 +::GetWidgetCtrl() { return myWidgetCtrl.GetPointer(); } diff --git a/src/VVTK/VVTK_ViewModel.cxx b/src/VVTK/VVTK_ViewModel.cxx index e3778816..5fcc06f9 100644 --- a/src/VVTK/VVTK_ViewModel.cxx +++ b/src/VVTK/VVTK_ViewModel.cxx @@ -1,208 +1,27 @@ -#include -#include - #include "VVTK_ViewModel.h" -#include "VVTK_ViewWindow.h" - -#include "SVTK_View.h" -#include "SVTK_MainWindow.h" -#include "SVTK_RenderWindowInteractor.h" -#include "VTKViewer_ViewModel.h" +#include "VVTK_ViewWindow.h" -//========================================================== -VVTK_Viewer -::VVTK_Viewer() +VVTK_Viewer:: +VVTK_Viewer() { - myTrihedronSize = 105; } -VVTK_Viewer -::~VVTK_Viewer() -{} - - -//========================================================== -void -VVTK_Viewer -::setViewManager(SUIT_ViewManager* theViewManager) +VVTK_Viewer:: +~VVTK_Viewer() { - SUIT_ViewModel::setViewManager(theViewManager); - - if ( !theViewManager ) - return; - - connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), - this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*))); - - connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), - this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*))); - - connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)), - this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*))); } - //========================================================== -SUIT_ViewWindow* -VVTK_Viewer -::createView( SUIT_Desktop* theDesktop ) +SUIT_ViewWindow* +VVTK_Viewer:: +createView( SUIT_Desktop* theDesktop ) { - TViewWindow* aViewWindow = new TViewWindow(theDesktop); + TViewWindow* aViewWindow = new TViewWindow (theDesktop); aViewWindow->Initialize(this); - + aViewWindow->setBackgroundColor( backgroundColor() ); aViewWindow->SetTrihedronSize( trihedronSize() ); return aViewWindow; } - - -//========================================================== -void -VVTK_Viewer -::contextMenuPopup( QPopupMenu* thePopup ) -{ - thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) ); - thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) ); - - thePopup->insertSeparator(); - - if(TViewWindow* aView = dynamic_cast(myViewManager->getActiveView())){ - if ( !aView->getMainWindow()->getToolBar()->isVisible() ){ - thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) ); - } - } -} - - -//========================================================== -void -VVTK_Viewer -::Repaint() -{ - QPtrVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getMainWindow()->Repaint(); - } - } -} - - -//========================================================== -bool -VVTK_Viewer -::isVisible( const Handle(SALOME_InteractiveObject)& io ) -{ - QPtrVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) - if(TViewWindow* aView = dynamic_cast(aViewWindow)) - if(!aView->getView()->isVisible( io )) - return false; - - return true; -} - - -//========================================================== -void -VVTK_Viewer -::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event) -{} - -void -VVTK_Viewer -::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event) -{} - -void -VVTK_Viewer -::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event) -{} - - -//========================================================== -QColor -VVTK_Viewer -::backgroundColor() const -{ - return myBgColor; -} - -void -VVTK_Viewer -::setBackgroundColor( const QColor& theColor ) -{ - if ( !theColor.isValid() ) - return; - - QPtrVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){ - if(TViewWindow* aView = dynamic_cast(aViewWindow)){ - aView->setBackgroundColor(theColor); - } - } - } - - myBgColor = theColor; -} - -//========================================================== -int -VVTK_Viewer -::trihedronSize() const -{ - return myTrihedronSize; -} - -void -VVTK_Viewer -::setTrihedronSize( const int theSize ) -{ - myTrihedronSize = theSize; - if(SUIT_ViewManager* aViewManager = getViewManager()){ - QPtrVector aViews = aViewManager->getViews(); - for ( int i = 0; i < aViews.count(); i++ ){ - if(TViewWindow* aView = dynamic_cast(aViews.at( i ))){ - aView->getMainWindow()->SetTrihedronSize( theSize ); - } - } - } -} - -//========================================================== -void -VVTK_Viewer -::onDumpView() -{ - if(SUIT_ViewWindow* aView = myViewManager->getActiveView()) - aView->onDumpView(); -} - -//========================================================== -void -VVTK_Viewer -::onChangeBgColor() -{ - if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){ - QColor aColor = QColorDialog::getColor( backgroundColor(), aView); - setBackgroundColor(aColor); - } -} - -//========================================================== -void -VVTK_Viewer -::onShowToolbar() -{ - QPtrVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getMainWindow()->getToolBar()->show(); - } - } -} - diff --git a/src/VVTK/VVTK_ViewModel.h b/src/VVTK/VVTK_ViewModel.h index 0846edcd..5f343dc9 100644 --- a/src/VVTK/VVTK_ViewModel.h +++ b/src/VVTK/VVTK_ViewModel.h @@ -4,15 +4,12 @@ #include #include "VVTK.h" -#include "SVTK_ViewModelBase.h" - -#include "SALOME_Prs.h" -#include "SALOME_InteractiveObject.hxx" +#include "SVTK_ViewModel.h" class VVTK_ViewWindow; -//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View -class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View +//! VVTK View Model +class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer { Q_OBJECT; @@ -23,48 +20,11 @@ public: VVTK_Viewer(); virtual ~VVTK_Viewer(); - //! Redefine SUIT_ViewModel::createView + //! See #SUIT_ViewModel::createView virtual SUIT_ViewWindow* createView(SUIT_Desktop*); - //! Redefine SUIT_ViewModel::setViewManager - virtual void setViewManager(SUIT_ViewManager* theViewManager); - //! Redefine SUIT_ViewModel::contextMenuPopup - virtual void contextMenuPopup( QPopupMenu* ); //! See SUIT_ViewModel::getType virtual QString getType() const { return Type(); } - - //! Redefine SALOME_View::Repaint - virtual void Repaint(); - - //! Redefine SALOME_View::isVisible - virtual bool isVisible( const Handle(SALOME_InteractiveObject)& ); - - //! Get background color of the viewer - QColor backgroundColor() const; - - //! Set background color to the viewer - void setBackgroundColor( const QColor& ); - - //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize) - int trihedronSize() const; - - //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize) - void setTrihedronSize( const int ); - -protected slots: - void onMousePress(SUIT_ViewWindow*, QMouseEvent*); - void onMouseMove(SUIT_ViewWindow*, QMouseEvent*); - void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*); - - void onDumpView(); - void onShowToolbar(); - void onChangeBgColor(); - -private: - QColor myBgColor; - int myTrihedronSize; - bool mySelectionEnabled; - bool myMultiSelectionEnabled; }; #endif -- 2.30.2